:root {
  --navy: #07365f;
  --navy-deep: #052c4f;
  --blue: #0a5ea8;
  --red: #b3202b;
  --gold: #d89a24;
  --cream: #f3f7fa;
  --paper: #f7fafc;
  --mint: #e8f3fa;
  --teal: #0d7d70;
  --ink: #253544;
  --muted: #4d6071;
  --muted-strong: #3f5263;
  --on-dark: #f7fbff;
  --on-dark-muted: #cfdeea;
  --line: #cbd9e3;
  --white: #fff;
  --shadow: 0 16px 42px rgba(15,48,76,.11);
  --radius: 20px;
}

@font-face { font-family: "Cairo CN"; src: url("/fonts/cairo-arabic-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Cairo CN"; src: url("/fonts/cairo-latin-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0000-024F; }
@font-face { font-family: "Cairo CN"; src: url("/fonts/cairo-arabic-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Cairo CN"; src: url("/fonts/cairo-latin-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0000-024F; }
@font-face { font-family: "Tajawal CN"; src: url("/fonts/tajawal-arabic-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Tajawal CN"; src: url("/fonts/tajawal-latin-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-024F; }
@font-face { font-family: "Tajawal CN"; src: url("/fonts/tajawal-arabic-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Tajawal CN"; src: url("/fonts/tajawal-latin-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; unicode-range: U+0000-024F; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--cream); }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Tajawal CN", Tajawal, "Segoe UI", Arial, sans-serif; font-weight: 500; line-height: 1.7; text-rendering: optimizeLegibility; font-kerning: normal; }
h1, h2, h3, h4, h5, h6, button, .button, .main-nav, .brand strong { font-family: "Cairo CN", Cairo, "Segoe UI", Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.shell { width: min(1160px, calc(100% - 36px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 9px; color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .03em; }

.site-header { position: sticky; inset-block-start: 0; z-index: 40; color: var(--ink); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: max-content; }
.brand img { width: 52px; height: 52px; object-fit: contain; filter: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.3; }
.brand strong { font-size: 17px; }
.brand small { color: var(--muted-strong); font-size: 11px; font-weight: 500; }
.brand-dark { color: var(--navy); }
.brand-dark small { color: var(--muted); }
.login-eyebrow { margin-top: 34px; }
.text-center { text-align: center; }
.main-nav { display: flex; align-items: center; gap: 22px; color: var(--text-primary, #253544); font-size: 13px; font-weight: 700; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--blue); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-cta { padding: 10px 17px; color: white; background: var(--red); border-radius: 999px; font-size: 11px; font-weight: 700; }
.mobile-menu { display: none; width: 42px; height: 42px; color: var(--navy); background: white; border: 1px solid var(--line); border-radius: 50%; }

.language-switcher { display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: #edf3f7; border: 1px solid var(--line); border-radius: 999px; direction: ltr; }
.language-switcher button { min-width: 31px; min-height: 28px; padding: 3px 7px; color: var(--muted); background: transparent; border: 0; border-radius: 999px; font-size: 9px; font-weight: 700; }
.language-switcher button.active { color: white; background: var(--blue); }
.login-language { display: flex; justify-content: flex-end; margin-bottom: 20px; }

.button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 14px; padding: 11px 22px; border: 1px solid transparent; border-radius: 999px; font-weight: 800; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.button:hover { transform: translateY(-2px); }
.button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid rgba(30,98,173,.25); outline-offset: 2px; }
.button-gold { color: var(--navy-deep); background: var(--gold); }
.button-dark { color: white; background: var(--navy); }
.button-red { color: white; background: var(--red); }
.button-light { color: var(--navy); background: white; }
.button-outline { color: white; border-color: rgba(255,255,255,.42); }
.button:disabled { opacity: .6; cursor: wait; transform: none; }

/* unified functional portal */
.portal-hero { position: relative; overflow: hidden; color: white; background: radial-gradient(circle at 82% 18%, rgba(11,120,197,.34), transparent 31%), linear-gradient(135deg, #052c4f, #073f72); }
.portal-hero::after { content: ""; position: absolute; inset: auto -8vw -18vw auto; width: 42vw; height: 42vw; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.portal-hero-grid { position: relative; z-index: 1; min-height: 500px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); align-items: center; gap: 80px; padding-block: 72px; }
.portal-hero-copy { max-width: 740px; }
.portal-hero .eyebrow { color: #9cd3f3; }
.portal-hero h1 { max-width: 800px; margin: 0; font-size: clamp(42px, 5.6vw, 72px); line-height: 1.18; letter-spacing: -.035em; }
.portal-hero-copy > p:not(.eyebrow) { max-width: 650px; margin: 22px 0 0; color: rgba(255,255,255,.78); font-size: 17px; }
.portal-identity { display: grid; justify-items: center; padding: 34px 26px; color: var(--ink); background: rgba(255,255,255,.96); border: 1px solid rgba(255,255,255,.5); border-radius: 28px; box-shadow: 0 24px 70px rgba(2,23,40,.26); text-align: center; }
.portal-identity img { width: 142px; height: 142px; object-fit: contain; }
.portal-identity strong { margin-top: 12px; color: var(--navy); font-family: "Cairo CN", Cairo, sans-serif; font-size: 24px; }
.portal-identity span { color: var(--muted); font-size: 12px; }
.portal-identity em { margin-top: 18px; padding: 7px 12px; color: var(--blue); background: var(--mint); border-radius: 999px; font-size: 11px; font-style: normal; font-weight: 700; direction: ltr; }
.functional-access-grid .access-card { min-height: 285px; }
.functional-access-grid .booking { background: var(--blue); }
.functional-access-grid .access-card > a b { font-size: 18px; }
.portal-info-section { padding-block: 88px; background: white; }
.portal-info-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 22px; }
.security-card, .official-card, .contact-card { padding: 32px; border: 1px solid var(--line); border-radius: 22px; }
.security-card { background: #f7fafc; }
.security-card h2 { max-width: 690px; margin: 0; font-size: clamp(28px, 3.6vw, 44px); line-height: 1.3; }
.security-card > p:not(.eyebrow), .official-card p, .contact-card p { color: var(--muted); }
.portal-contact-stack { display: grid; gap: 18px; }
.official-card { color: white; background: var(--navy); }
.official-card h2, .contact-card h2 { margin: 0; font-size: 23px; }
.official-card p { color: rgba(255,255,255,.72); }
.contact-card { background: #fff; }
.contact-card div { display: grid; gap: 6px; margin-top: 18px; }
.contact-card a { color: var(--blue); font-weight: 700; }
.compact-footer { background: var(--navy-deep); }

[dir="rtl"] .portal-hero h1, [dir="rtl"] .section-head h2 { letter-spacing: 0; }
[dir="rtl"] .functional-access-grid .access-card > a b { transform: rotate(180deg); }

.hero { position: relative; min-height: 670px; overflow: hidden; color: white; background: var(--navy-deep); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6,38,48,.08), rgba(6,38,48,.88) 55%, #062630 100%); }
.hero-photo { position: absolute; inset: 0 0 0 auto; width: 57%; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-inner { position: relative; z-index: 2; min-height: 670px; display: flex; align-items: center; }
.hero-copy { width: min(660px, 62%); padding-block: 80px; }
.hero .eyebrow { color: var(--gold); }
.hero h1 { margin: 0; font-size: clamp(44px, 6vw, 74px); line-height: 1.23; letter-spacing: -.045em; }
.hero h1 em { color: #cfe9e6; font-style: normal; }
.hero-copy > p:not(.eyebrow) { max-width: 600px; margin: 23px 0 0; color: rgba(255,255,255,.75); font-size: 17px; line-height: 1.95; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 31px; }
.hero-facts { display: flex; gap: 25px; margin-top: 44px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.56); font-size: 10px; }
.hero-facts span { display: flex; flex-direction: column; }
.hero-facts strong { color: white; font-size: 13px; }

.ticker { overflow: hidden; color: var(--navy); background: var(--gold); direction: ltr; }
.ticker-track { width: max-content; display: flex; animation: ticker 38s linear infinite; }
.ticker span { padding: 12px 20px; white-space: nowrap; font-size: 11px; font-weight: 800; }
.ticker b { margin-inline: 25px 0; opacity: .5; }
@keyframes ticker { from { transform: translateX(-50%); } to { transform: translateX(0); } }

.entry-section, .story-section, .app-section { padding-block: 96px; }
.entry-section { background: var(--cream); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 48px; margin-bottom: 38px; }
.section-head h2, .story-copy h2, .app-copy h2 { margin: 0; font-size: clamp(31px, 4.5vw, 50px); line-height: 1.28; letter-spacing: -.035em; }
.section-head > p { max-width: 465px; margin: 0; color: var(--muted); font-size: 14px; }
.access-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.access-card { min-height: 320px; display: flex; flex-direction: column; justify-content: space-between; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 14px 40px rgba(6,38,48,.05); }
.access-card.booking { color: white; background: var(--teal); border-color: transparent; }
.access-card.team { color: white; background: var(--navy); border-color: transparent; }
.access-card small { color: var(--muted-strong); font-size: 12px; font-weight: 800; }
.access-card h3 { margin: 0 0 9px; font-size: 25px; }
.access-card p { margin: 0; color: var(--muted-strong); font-size: 14px; font-weight: 500; }
.access-card.booking small, .access-card.team small { color: var(--on-dark-muted); }
.access-card.booking p, .access-card.team p { color: var(--on-dark-muted); }
.access-card > a { display: flex; align-items: center; justify-content: space-between; padding-top: 17px; border-top: 1px solid currentColor; font-size: 12px; font-weight: 800; }

.story-section { background: white; }
.story-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 72px; }
.story-photo { min-height: 570px; overflow: hidden; border-radius: 28px; box-shadow: var(--shadow); }
.story-photo img { width: 100%; height: 570px; object-fit: cover; }
.story-copy > p:not(.eyebrow), .app-copy > p:not(.eyebrow) { color: var(--muted); }
.check-list { display: grid; gap: 11px; padding: 0; margin: 28px 0 0; list-style: none; }
.check-list li { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; }
.check-list span { width: 25px; height: 25px; display: grid; place-items: center; color: var(--teal); background: var(--mint); border-radius: 50%; }

.app-section { background: #e8f1ef; }
.app-grid { display: grid; grid-template-columns: .8fr 1.2fr; align-items: center; gap: 90px; }
.phone-frame { width: min(290px, 82vw); margin-inline: auto; padding: 12px; border: 7px solid var(--navy-deep); border-radius: 42px; background: #f6f2e9; box-shadow: 24px 28px 0 rgba(11,52,67,.08), var(--shadow); transform: rotate(-3deg); }
.phone-screen { min-height: 490px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; border-radius: 28px; background: radial-gradient(circle at 50% 0, rgba(30,98,173,.16), transparent 38%), white; text-align: center; }
.phone-screen img { width: 88px; margin-bottom: 22px; }
.phone-screen strong { font-size: 28px; }
.phone-screen p { max-width: 190px; color: var(--muted); font-size: 11px; }
.app-points { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.app-points span { padding: 8px 13px; color: var(--teal); background: rgba(21,124,120,.1); border-radius: 999px; font-size: 11px; font-weight: 800; }

.page-hero { padding-block: 65px; color: white; background: radial-gradient(circle at 12% 20%, rgba(30,98,173,.22), transparent 30%), var(--navy-deep); }
.page-hero-inner { display: flex; align-items: end; justify-content: space-between; gap: 45px; }
.page-hero h1 { margin: 0; font-size: clamp(36px, 5vw, 58px); line-height: 1.25; }
.page-hero p { max-width: 520px; margin: 16px 0 0; color: rgba(255,255,255,.72); }
.page-hero .eyebrow { color: var(--gold); }
.back-link { color: rgba(255,255,255,.7); font-size: 13px; }

.form-layout { display: grid; grid-template-columns: 1fr 330px; gap: 42px; align-items: start; padding-block: 64px 92px; }
.form-card, .tracking-card, .login-card { padding: 32px; border: 1px solid var(--line); border-radius: 26px; background: white; box-shadow: var(--shadow); }
.form-section-title { display: flex; align-items: center; gap: 13px; margin: 6px 0 22px; }
.form-section-title:not(:first-child) { margin-top: 36px; padding-top: 30px; border-top: 1px solid var(--line); }
.form-section-title > span { width: 34px; height: 34px; display: grid; place-items: center; color: white; background: var(--teal); border-radius: 50%; font-weight: 800; }
.form-section-title h2 { margin: 0; font-size: 19px; }
.form-section-title p { margin: 1px 0 0; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 50px; padding: 11px 13px; color: var(--ink); background: #fbfcfb; border: 1px solid rgba(11,52,67,.18); border-radius: 12px; }
input::placeholder, textarea::placeholder { color: #657686; opacity: 1; }
select:disabled, input:disabled { color: #657686; background: #f1f5f7; cursor: not-allowed; opacity: 1; }
.field-help { color: var(--muted-strong); font-size: 11px; font-weight: 500; line-height: 1.55; }
textarea { min-height: 112px; resize: vertical; }
.consent-row { grid-template-columns: auto 1fr; align-items: start; gap: 11px; margin-top: 17px; padding: 15px; background: #f3f8f6; border-radius: 14px; }
.consent-row input { width: 18px; min-height: 18px; margin-top: 4px; }
.consent-row span { display: grid; }
.consent-row small { color: var(--muted); font-weight: 400; }
.submit-button { width: 100%; margin-top: 24px; }
.privacy-copy { color: var(--muted); font-size: 11px; text-align: center; }
.honeypot { position: absolute; inset-inline-start: -9999px; }
.side-info { position: sticky; top: 100px; padding: 25px; color: white; background: var(--navy); border-radius: 22px; }
.side-info h2 { margin: 0 0 12px; font-size: 20px; }
.side-info p { color: rgba(255,255,255,.7); font-size: 13px; }
.side-info dl { margin: 24px 0 0; }
.side-info dt { color: var(--gold); font-size: 11px; font-weight: 800; }
.side-info dd { margin: 1px 0 14px; font-size: 13px; }
.alert { margin: 16px 0 0; padding: 12px 14px; color: #8f1d27; background: #fff0f1; border: 1px solid #f8c6ca; border-radius: 12px; font-size: 13px; }
.success-ticket { display: grid; gap: 13px; padding: 28px; color: var(--navy); background: var(--mint); border-radius: 20px; text-align: center; }
.success-ticket code { display: block; padding: 13px; color: white; background: var(--navy); border-radius: 12px; font-size: 25px; font-weight: 900; letter-spacing: .12em; direction: ltr; }

.tracking-wrap, .login-wrap { min-height: calc(100vh - 76px); display: grid; place-items: center; padding-block: 70px; background: radial-gradient(circle at 85% 8%, rgba(21,124,120,.12), transparent 28%), var(--cream); }
.tracking-card, .login-card { width: min(580px, calc(100% - 36px)); }
.tracking-card h1, .login-card h1 { margin: 0; font-size: 34px; }
.mfa-login-heading { padding: 14px 16px; background: #eef6f4; border: 1px solid #d4e9e3; border-radius: 13px; }
.mfa-login-heading strong { color: var(--navy); font-size: 17px; }
.mfa-login-heading p { margin: 5px 0 0; color: var(--muted-strong); font-size: 12px; line-height: 1.7; }
.tracking-card > p, .login-card > p { color: var(--muted); }
.tracking-result { margin-top: 22px; padding: 22px; color: white; background: var(--navy); border-radius: 18px; }
.tracking-result dl { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.tracking-result dt { color: var(--gold); font-size: 10px; }
.tracking-result dd { margin: 2px 0 0; font-weight: 800; }
.login-note { margin-top: 20px; padding: 13px; color: var(--muted); background: #f3f6f5; border-radius: 12px; font-size: 11px; }

/* فضاء المتابعة الشخصي */
.space-gateway { min-height: calc(100vh - 76px); padding-block: 58px 78px; background: radial-gradient(circle at 85% 8%, rgba(21,124,120,.13), transparent 30%), var(--cream); }
.space-gateway-head { max-width: 720px; margin-bottom: 28px; }
.space-gateway-head h1 { margin: 0; font-size: clamp(34px, 5vw, 52px); }
.space-gateway-head > p { max-width: 630px; color: var(--muted); }
.space-gateway-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 24px; align-items: start; }
.space-login-card, .space-track-card { width: 100%; min-height: 100%; }
.space-card-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 17px; color: white; background: var(--teal); border-radius: 15px; font-size: 22px; }
.space-track-card .space-card-icon { color: var(--navy); background: var(--mint); }
.space-login-card h2, .space-track-card h2 { margin: 0; font-size: 25px; }
.space-login-card > p, .space-track-card > p { min-height: 48px; color: var(--muted); }

.space-account-page { min-height: 100vh; padding-bottom: 70px; background: #f4f7f6; }
.space-account-page .site-header { position: static; }
.space-account-actions { display: flex; align-items: center; gap: 12px; }
.space-account-shell { padding-top: 38px; }
.space-account-loading { padding: 70px 22px; color: var(--muted); text-align: center; }
.password-change-card { width: min(620px, 100%); margin: 28px auto 0; padding: 32px; background: white; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.password-change-card h1 { margin: 0 0 8px; font-size: 31px; }
.password-change-card > p { color: var(--muted); }
.space-welcome { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 24px; }
.space-welcome h1 { margin: 0; font-size: clamp(31px, 4vw, 45px); }
.space-welcome p { margin: 6px 0 0; color: var(--muted); }
.space-secure-badge { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; color: #08624e; background: #def4e9; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.space-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 14px; margin-bottom: 22px; }
.space-metric { padding: 20px; background: white; border: 1px solid var(--line); border-radius: 18px; }
.space-metric span { display: block; color: var(--muted); font-size: 12px; }
.space-metric strong { display: block; margin-top: 5px; color: var(--navy); font-size: 28px; }
.space-dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.space-panel { min-width: 0; padding: 23px; background: white; border: 1px solid var(--line); border-radius: 20px; }
.space-panel-wide { grid-column: 1 / -1; }
.space-panel header { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }
.space-panel h2 { margin: 0; font-size: 20px; }
.space-panel header span { color: var(--muted); font-size: 11px; }
.space-list { display: grid; gap: 10px; }
.space-appointment, .space-advice, .space-document { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center; padding: 14px; background: #f7faf9; border-radius: 14px; }
.space-appointment time { min-width: 65px; padding: 8px; color: white; background: var(--navy); border-radius: 10px; text-align: center; font-weight: 800; }
.space-appointment time strong, .space-appointment time span { display: block; }
.space-appointment h3, .space-appointment p { margin: 0; }
.space-appointment p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.space-status { padding: 6px 9px; color: var(--teal); background: #dff4eb; border-radius: 999px; font-size: 11px; font-weight: 800; }
.space-appointment strong, .space-advice strong, .space-document strong { display: block; }
.space-appointment small, .space-advice small, .space-document small { display: block; margin-top: 3px; color: var(--muted); }
.space-appointment .status-badge { justify-self: end; }
.space-advice, .space-document { grid-template-columns: 1fr auto; }
.space-advice p { margin: 7px 0 0; white-space: pre-wrap; }
.space-document b { color: var(--teal); }
.space-history { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.space-history:last-child { border-bottom: 0; }
.space-history small { color: var(--muted); }
.space-empty { padding: 24px; color: var(--muted); background: #f7faf9; border-radius: 14px; text-align: center; }
.space-privacy-note { margin-top: 18px; padding: 17px 19px; color: #385460; background: #eaf2f0; border-radius: 15px; font-size: 12px; }
.space-privacy-note strong { color: var(--navy); }

/* unified follow-up messages, controlled documents and account devices */
.space-message-panel { border-top: 4px solid var(--teal); }
.space-message { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #f8fbfa; }
.space-message.is-important { border-inline-start: 5px solid #b82031; background: #fff7f7; }
.space-message.is-read { opacity: .84; }
.space-message > header { align-items: flex-start; margin: 0 0 9px; }
.space-message h3, .space-message p { margin: 0; }
.space-message h3 { margin-top: 3px; font-size: 17px; }
.space-message header span, .space-message time, .space-message > small { color: var(--muted-strong); font-size: 11px; }
.space-message > p { line-height: 1.8; white-space: pre-wrap; }
.space-message-read { margin-top: 12px; }
.space-document p { margin: 7px 0 0; color: var(--muted-strong); font-size: 12px; white-space: pre-wrap; }
.space-document a { display: inline-flex; margin-top: 8px; }
.space-account-security { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; padding: 21px; background: white; border: 1px solid var(--line); border-radius: 18px; }
.space-account-security h2, .space-account-security p { margin: 0; }
.space-account-security p { margin-top: 6px; color: var(--muted-strong); }
.space-security-actions { width: min(430px, 100%); display: grid; gap: 10px; }
.space-security-actions details { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.space-security-actions summary { cursor: pointer; color: var(--navy); font-weight: 800; }
.space-own-password-form { display: grid; gap: 10px; margin-top: 12px; }
.space-publishing-panel { margin: 0 0 22px; padding: 18px; border: 1px solid #cfe4df; border-radius: 16px; background: #f5fbf9; }
.space-publishing-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.space-publishing-columns h4 { margin: 8px 0; }
.space-publishing-columns .compact-list article { grid-template-columns: 1fr auto auto; }
.space-language-fieldset { margin: 14px 0; padding: 15px; border: 1px solid var(--line); border-radius: 13px; }
.space-language-fieldset legend { padding-inline: 8px; color: var(--navy); font-weight: 800; }

/* Personalized home exercise programs */
.space-exercise-program { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; }
.space-exercise-program > header { margin: 0; padding: 17px 18px; background: #eef7f4; }
.space-exercise-program > header h3, .space-exercise-program > header p { margin: 0; }
.space-exercise-program > header p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.space-exercise-program > header > span { padding: 6px 9px; color: var(--teal); background: white; border-radius: 999px; font-weight: 800; }
.space-program-goal { margin: 0; padding: 14px 18px; color: #385460; border-bottom: 1px solid var(--line); }
.space-exercise-program > ol { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: exercises; }
.space-exercise-program > ol > li { position: relative; padding: 17px 58px 17px 18px; border-bottom: 1px solid var(--line); counter-increment: exercises; }
.space-exercise-program > ol > li::before { content: counter(exercises); position: absolute; top: 17px; right: 17px; width: 28px; height: 28px; display: grid; place-items: center; color: white; background: var(--teal); border-radius: 50%; font-weight: 800; }
.space-exercise-program li strong, .space-exercise-program li small { display: block; }
.space-exercise-program li small { margin-top: 3px; color: var(--muted); }
.space-exercise-program li > p { margin: 11px 0 0; line-height: 1.8; white-space: pre-wrap; }
.space-program-note { padding: 9px 11px; color: #385460; background: #f4f8f7; border-radius: 9px; }
.space-program-precaution { margin-top: 9px !important; color: #8a5a16 !important; }
.space-exercise-program > aside { padding: 15px 18px; color: #6c4b16; background: #fff8e8; }
.space-exercise-program > aside p { margin: 4px 0 0; }

.dashboard { min-height: 100vh; display: grid; grid-template-columns: 245px 1fr; background: #f4f6f5; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 25px 18px; color: var(--on-dark); background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%); }
.sidebar .brand { margin-bottom: 40px; padding: 9px 8px; color: var(--on-dark); border: 1px solid rgba(255,255,255,.08); border-radius: 15px; background: rgba(255,255,255,.035); }
.sidebar .brand img { width: 54px; height: 54px; filter: drop-shadow(0 2px 5px rgba(1,20,38,.28)); }
.sidebar .brand strong { color: var(--on-dark); font-size: 16px; font-weight: 700; }
.sidebar .brand small { color: var(--on-dark-muted); font-size: 11px; font-weight: 500; }
.sidebar nav { display: grid; gap: 7px; }
.sidebar nav a { padding: 11px 13px; color: var(--on-dark-muted); border-radius: 11px; font-size: 13px; font-weight: 600; }
.sidebar nav .active { color: white; background: rgba(255,255,255,.13); box-shadow: inset 0 0 0 1px rgba(255,255,255,.035); }
.logout-button { margin-top: auto; padding: 11px; color: white; background: transparent; border: 1px solid rgba(255,255,255,.2); border-radius: 11px; }
.account-security-button { color: var(--on-dark); border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.07); }
.dashboard-main { min-width: 0; padding: 34px; }
.dashboard-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.dashboard-top h1 { margin: 0; font-size: 32px; }
.dashboard-top p { margin: 0; color: var(--muted); }
.online-pill { padding: 7px 11px; color: #0a654f; background: #dff4eb; border-radius: 999px; font-size: 11px; font-weight: 800; }

/* Desktop sidebar viewport fix */
@media (min-width: 901px) {
  .dashboard { display: block; min-height: 100dvh; padding-inline-start: 245px; }
  .sidebar {
    position: fixed;
    z-index: 60;
    inset-block: 0;
    inset-inline-start: 0;
    width: 245px;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.22) transparent;
  }
}

@media (min-width: 901px) and (max-height: 760px) {
  .sidebar { padding: 12px 14px; }
  .sidebar .brand { margin-bottom: 14px; }
  .sidebar nav { gap: 2px; }
  .sidebar nav a { padding: 7px 10px; }
  .sidebar-version { margin-top: 14px; margin-bottom: 8px; padding: 8px 10px; }
  .logout-button { padding: 8px 10px; }
}
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 26px 0; }
.metric { padding: 20px; background: white; border: 1px solid var(--line); border-radius: 17px; }
.metric span { color: var(--muted-strong); font-size: 12px; font-weight: 600; }
.metric strong { display: block; margin-top: 7px; font-size: 27px; }
.panel { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 20px; }
.panel-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 22px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 21px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 920px; }
th, td { padding: 13px 14px; text-align: start; border-bottom: 1px solid #e2e9ed; font-size: 13px; vertical-align: top; }
th { color: var(--muted-strong); background: #f5f8fa; font-size: 11px; font-weight: 700; }
td strong { display: block; }
td small { color: var(--muted-strong); font-size: 11px; font-weight: 500; }
.status-select { min-height: 38px; padding: 5px 8px; font-size: 11px; }
.save-status { min-height: 36px; padding: 5px 11px; color: white; background: var(--teal); border: 0; border-radius: 9px; font-size: 11px; }
.empty-state { padding: 50px 20px; color: var(--muted); text-align: center; }
.dashboard-error { margin-bottom: 18px; }
.space-account-admin { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 22px; padding: 16px; background: #edf6f3; border: 1px solid #d6e9e3; border-radius: 14px; }
.space-account-admin strong, .space-account-admin small { display: block; }
.space-account-admin small { margin-top: 4px; color: var(--muted); }

.site-footer { padding-block: 45px; color: rgba(255,255,255,.66); background: #041d25; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 50px; }
.footer-grid h2 { margin: 0 0 10px; color: white; font-size: 18px; }
.footer-grid p, .footer-grid a { display: block; margin: 5px 0; font-size: 12px; }
.footer-bottom { margin-top: 30px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); font-size: 10px; }

@media (max-width: 900px) {
  .main-nav { display: none; position: absolute; inset: 76px 0 auto; padding: 18px; color: var(--ink); background: white; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); flex-direction: column; align-items: stretch; }
  .main-nav.open { display: flex; }
  .header-cta { display: none; }
  .mobile-menu { display: grid; place-items: center; }
  .hero-photo { width: 100%; opacity: .45; }
  .hero::after { background: linear-gradient(0deg, rgba(6,38,48,.9), rgba(6,38,48,.62)); }
  .hero-copy { width: 100%; }
  .access-grid, .story-grid, .app-grid { grid-template-columns: 1fr; }
  .story-grid, .app-grid { gap: 45px; }
  .form-layout { grid-template-columns: 1fr; }
  .side-info { position: static; }
  .dashboard { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; gap: 20px; }
  .sidebar .brand { margin: 0; }
  .sidebar nav { display: none; }
  .logout-button { margin: 0 0 0 auto; }
  [dir="rtl"] .logout-button { margin: 0 auto 0 0; }
  .team-language-switcher { width: auto; margin: 0; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .space-gateway-grid, .space-dashboard-grid { grid-template-columns: 1fr; }
  .space-publishing-columns { grid-template-columns: 1fr; }
  .space-panel-wide { grid-column: auto; }
  .whatsapp-config-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 26px, 1160px); }
  .header-inner { min-height: 68px; }
  .brand img { width: 42px; height: 42px; }
  .brand strong { font-size: 14px; }
  .header-actions { gap: 6px; }
  .language-switcher button { min-width: 28px; padding-inline: 5px; }
  .portal-hero-grid { min-height: auto; grid-template-columns: 1fr; gap: 38px; padding-block: 55px; }
  .portal-hero h1 { font-size: 39px; }
  .portal-hero-copy > p:not(.eyebrow) { font-size: 15px; }
  .portal-identity { width: min(100%, 340px); margin-inline: auto; }
  .portal-info-grid { grid-template-columns: 1fr; }
  .portal-info-section { padding-block: 60px; }
  .hero, .hero-inner { min-height: 610px; }
  .hero h1 { font-size: 42px; }
  .hero-copy > p:not(.eyebrow) { font-size: 15px; }
  .hero-facts { gap: 12px; justify-content: space-between; }
  .entry-section, .story-section, .app-section { padding-block: 65px; }
  .section-head, .page-hero-inner { display: block; }
  .section-head > p { margin-top: 14px; }
  .access-grid { grid-template-columns: 1fr; }
  .access-card { min-height: 270px; }
  .story-photo, .story-photo img { min-height: 390px; height: 390px; }
  .page-hero { padding-block: 48px; }
  .back-link { display: inline-block; margin-top: 18px; }
  .form-layout { padding-block: 38px 65px; }
  .form-card, .tracking-card, .login-card { padding: 22px; }
  .form-grid.two { grid-template-columns: 1fr; }
  .tracking-result dl { grid-template-columns: 1fr; }
  .dashboard-main { padding: 20px 13px; }
  .dashboard-top { align-items: flex-start; }
  .dashboard-top h1 { font-size: 27px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { padding: 15px; }
  .footer-grid { grid-template-columns: 1fr; gap: 25px; }
  .space-gateway { padding-block: 35px 55px; }
  .space-login-card, .space-track-card, .password-change-card, .space-panel { padding: 20px; }
  .space-welcome { display: block; }
  .space-secure-badge { margin-top: 14px; }
  .space-metrics { grid-template-columns: 1fr; }
  .space-appointment { grid-template-columns: auto 1fr; }
  .space-account-security { align-items: stretch; flex-direction: column; }
  .space-appointment .status-badge { grid-column: 1 / -1; justify-self: stretch; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Centre NASSER operations portal */
.sidebar nav a { display: flex; align-items: center; gap: 10px; }
.sidebar nav a span { width: 24px; color: var(--gold); text-align: center; }
.sidebar-version { display: flex; justify-content: space-between; margin-top: auto; margin-bottom: 12px; padding: 12px; color: rgba(255,255,255,.66); background: rgba(255,255,255,.06); border-radius: 11px; font-size: 10px; }
.sidebar-version strong { color: white; }
.team-language-switcher { align-self: stretch; justify-content: center; margin: 16px 0 9px; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); }
.team-language-switcher button { color: rgba(255,255,255,.65); }
.team-language-switcher button.active { color: white; background: var(--blue); }
.loading-state { padding: 80px 20px; color: var(--muted); text-align: center; }
.success-banner { margin: 16px 0 0; padding: 12px 14px; color: #075f49; background: #e4f7ef; border: 1px solid #bde8d8; border-radius: 12px; font-size: 13px; }
.metrics-six { grid-template-columns: repeat(6, 1fr); }
.metrics-four { grid-template-columns: repeat(4, 1fr); }
.metric small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.module-actions, .row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.module-actions .button { min-height: 42px; padding: 11px 15px; }
.search-form { display: flex; align-items: center; gap: 7px; }
.search-form input { min-width: 260px; min-height: 42px; }
.mini-button { display: inline-grid; place-items: center; min-height: 35px; padding: 7px 11px; color: var(--teal); background: #edf7f4; border: 1px solid #cde5dd; border-radius: 9px; font-size: 11px; font-weight: 800; cursor: pointer; }
.mini-button:hover { background: #dff1eb; }
.status-badge, .yes-pill { display: inline-flex; align-items: center; padding: 5px 8px; color: #35555e; background: #edf2f1; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-pending { color: #8a5c00; background: #fff5d7; }
.status-confirmed, .yes-pill { color: #075f49; background: #e0f5ec; }
.status-cancelled, .status-declined { color: #8f1d27; background: #fff0f1; }

.admin-dialog { width: min(720px, calc(100% - 28px)); max-height: calc(100vh - 36px); padding: 0; overflow-y: auto; color: var(--ink); background: white; border: 0; border-radius: 22px; box-shadow: 0 24px 90px rgba(4,29,37,.28); }
.admin-dialog-wide { width: min(980px, calc(100% - 28px)); }
.admin-dialog-small { width: min(520px, calc(100% - 28px)); }
.admin-dialog::backdrop { background: rgba(4,29,37,.64); backdrop-filter: blur(3px); }
.admin-dialog form, #detail-dialog-content { display: grid; gap: 18px; padding: 26px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 24px; }
.dialog-head .eyebrow { margin-bottom: 3px; }
.icon-button { width: 37px; min-height: 37px; padding: 0; color: var(--muted); background: #f2f4f3; border: 0; border-radius: 50%; font-size: 24px; cursor: pointer; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.button-danger { color: #971f2b; background: #fff0f1; border: 1px solid #efc2c7; }
.account-security-panel { display: grid; gap: 14px; padding: 17px; background: #f7faf9; border: 1px solid var(--line); border-radius: 15px; }
.account-security-panel + .account-security-panel { margin-top: 14px; }
.account-security-panel p { margin: 4px 0 0; color: var(--muted-strong); font-size: 12px; line-height: 1.7; }
.account-security-panel label { display: grid; gap: 6px; color: var(--muted-strong); font-size: 11px; font-weight: 700; }
.account-security-panel input { background: white; }
.security-positive { background: #eef9f5; border-color: #c7e7db; }
.mfa-enrollment ol { margin: 0; padding-inline-start: 24px; color: var(--muted-strong); font-size: 12px; line-height: 1.9; }
.mfa-secret { display: block; padding: 14px; overflow-wrap: anywhere; color: var(--navy); background: white; border: 1px dashed #8bb7aa; border-radius: 10px; font-size: 16px; letter-spacing: 2px; text-align: center; }
.mfa-recovery-box { display: grid; gap: 11px; padding: 17px; color: #684800; background: #fff8df; border: 1px solid #ead69a; border-radius: 15px; }
.mfa-recovery-box p { margin: 0; font-size: 12px; }
.recovery-code-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.recovery-code-grid code { padding: 8px; color: var(--navy); background: white; border-radius: 7px; font-size: 12px; text-align: center; }
.security-session-list { display: grid; gap: 8px; }
.security-session { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px; background: white; border: 1px solid var(--line); border-radius: 11px; }
.security-session p { max-width: 420px; overflow-wrap: anywhere; }
.security-session small { color: var(--muted); font-size: 10px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-hint { margin: 0; padding: 11px 13px; color: var(--muted); background: #f3f7f6; border-radius: 10px; font-size: 11px; }
.weekday-field { display: flex; flex-wrap: wrap; gap: 8px 17px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; }
.weekday-field legend { padding-inline: 7px; color: var(--muted); font-size: 11px; font-weight: 800; }
.weekday-field label { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 5px; font-size: 11px; }
.weekday-field input { width: 16px; min-height: 16px; }

.agenda-panel { overflow: visible; }
.agenda-head { align-items: center; }
.agenda-filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 13px 20px; background: #f7f9f8; border-bottom: 1px solid var(--line); }
.agenda-filters label { min-width: 180px; }
.agenda-filters select { min-height: 39px; padding: 6px 9px; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(155px, 1fr)); width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.week-day { min-height: 580px; border-inline-start: 1px solid var(--line); }
.week-day:first-child { border-inline-start: 0; }
.week-day > header { display: grid; gap: 2px; padding: 13px 10px; background: #f8faf9; border-bottom: 1px solid var(--line); text-align: center; }
.week-day > header span { color: var(--muted); font-size: 9px; }
.week-day.today > header { color: white; background: var(--teal); }
.week-day.today > header span { color: rgba(255,255,255,.74); }
.week-day.closed { background: repeating-linear-gradient(-45deg, #fafbfa, #fafbfa 8px, #f5f6f5 8px, #f5f6f5 16px); }
.day-slots { display: grid; align-content: start; gap: 8px; padding: 8px; }
.day-empty { margin: 35px 0; color: #a4afac; font-size: 10px; text-align: center; }
.appointment-card { display: grid; gap: 8px; padding: 10px; background: white; border: 1px solid #dfe7e4; border-inline-start: 4px solid var(--teal); border-radius: 10px; box-shadow: 0 5px 12px rgba(11,52,67,.06); }
.appointment-card > div { display: grid; gap: 2px; }
.appointment-card time { color: var(--teal); font-size: 10px; font-weight: 900; direction: ltr; text-align: right; }
.appointment-card strong { font-size: 12px; }
.appointment-card small { color: var(--muted); font-size: 9px; }
.appointment-card-actions { display: grid; gap: 6px; align-content: start; }
.appointment-card-actions .mini-button,
.appointment-card-actions .appointment-status { width: 100%; min-width: 0; font-size: 9px; }
.manual-whatsapp { border-color: #8bd4b1; background: #ecfbf3; color: #075e54; text-align: center; text-decoration: none; }
.manual-whatsapp:hover { background: #dcf8e8; }
.manual-whatsapp:disabled { border-color: #dfe7e4; background: #f4f6f5; color: #8a9896; cursor: not-allowed; }
.manual-reminder-notice small { display: block; margin-top: 7px; color: var(--muted); }
.appointment-status { min-height: 32px; padding: 4px 6px; font-size: 9px; }

.detail-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.detail-summary p { margin: 0; padding: 12px; background: #f5f8f7; border-radius: 10px; font-size: 11px; }
.compact-list { display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
.compact-list article { display: grid; grid-template-columns: 1fr auto; gap: 3px 15px; padding: 12px; color: var(--ink); background: #f8faf9; border: 1px solid var(--line); border-radius: 11px; }
.compact-list article small { grid-column: 1 / -1; color: var(--muted); }
.integration-notice { margin-bottom: 18px; padding: 18px 20px; color: #694900; background: #fff7dc; border: 1px solid #f1dc9a; border-radius: 15px; }
.integration-notice p { margin: 5px 0 0; font-size: 12px; }
.integration-notice.integration-ready { color: #075f49; background: #e6f7f1; border-color: #bde5d8; }
.whatsapp-config-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.whatsapp-config-grid article { min-width: 0; padding: 16px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.whatsapp-config-grid span, .whatsapp-config-grid strong { display: block; }
.whatsapp-config-grid span { color: var(--muted); font-size: 10px; }
.whatsapp-config-grid strong { margin-top: 5px; overflow-wrap: anywhere; color: var(--navy); font-size: 12px; }
.reminder-error { max-width: 260px; color: #9b202b !important; white-space: normal; }
.reminder-preview-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 11px 13px; background: #f3f7f6; border-radius: 10px; font-size: 10px; }
.reminder-preview-meta span { color: var(--muted); }
.reminder-message-preview { padding: 20px; color: #163f49; background: #e7f5ef; border: 1px solid #c4e4d8; border-radius: 16px; font-size: 14px; line-height: 2; white-space: pre-wrap; }
.cash-panel { margin-top: 18px; }
.cash-panel .panel-head label { min-width: 180px; }
.cash-panel input { min-height: 40px; }
.cash-list { padding: 18px; }

.print-page { margin: 0; background: #eef1f0; }
.print-document { width: min(850px, calc(100% - 30px)); min-height: 100vh; margin: 24px auto; padding: 55px; background: white; box-shadow: var(--shadow); }
.print-document > header { display: flex; justify-content: space-between; padding-bottom: 24px; border-bottom: 3px solid var(--teal); }
.print-document h1 { margin: 0; color: var(--navy); }
.print-document header p { margin: 3px 0; color: var(--muted); }
.print-document header > div:last-child { display: grid; align-content: start; gap: 5px; text-align: left; }
.print-document header > div:last-child strong { color: var(--teal); font-size: 28px; }
.print-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin: 30px 0; padding: 16px; background: #f4f8f7; }
.print-document table { min-width: 0; }
.print-total { margin: 24px 0; margin-inline-start: auto; width: min(330px, 100%); padding: 18px; background: #edf7f4; border-radius: 12px; }
.print-total p { display: flex; justify-content: space-between; }
.print-document footer { margin-top: 60px; padding-top: 15px; color: var(--muted); border-top: 1px solid var(--line); text-align: center; font-size: 10px; }

/* Centre NASSER clinical follow-up */
.clinical-privacy-note { display: flex; align-items: center; gap: 16px; margin: 26px 0 18px; padding: 16px 20px; color: #084e42; background: #e5f6f0; border: 1px solid #bde4d7; border-radius: 15px; }
.clinical-privacy-note p { margin: 0; color: #40736a; font-size: 11px; }
.body-map-field { padding: 18px; border: 1px solid var(--line); border-radius: 16px; }
.body-map-field legend { padding-inline: 8px; color: var(--navy); font-size: 12px; font-weight: 900; }
.body-map-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.body-map-layout > section { padding: 15px; background: #f7faf9; border-radius: 14px; }
.body-map-layout h3 { margin: 0 0 11px; color: var(--teal); font-size: 13px; text-align: center; }
.body-zone-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.body-zone { min-height: 38px; padding: 7px; color: #42626a; background: white; border: 1px solid #d8e3df; border-radius: 9px; font-size: 10px; cursor: pointer; }
.body-zone:hover, .body-zone.selected { color: white; background: var(--teal); border-color: var(--teal); }
.body-map-field .form-hint { margin-top: 12px; }

/* Interactive anatomical map */
.anatomy-field { padding: 20px; background: #f8fbfa; border-color: #b8d8cf; }
.anatomy-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 15px; }
.anatomy-toolbar strong, .anatomy-toolbar small { display: block; }
.anatomy-toolbar strong { color: var(--navy); font-size: 12px; }
.anatomy-toolbar small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.anatomy-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px 9px; max-width: 620px; }
.anatomy-legend span { display: inline-flex; align-items: center; gap: 4px; color: #50686b; font-size: 8px; }
.anatomy-legend i, .anatomy-dot { width: 9px; height: 9px; flex: 0 0 9px; background: var(--annotation-color); border-radius: 50%; box-shadow: 0 0 0 2px color-mix(in srgb, var(--annotation-color), transparent 75%); }
.symptom-pain { --annotation-color: #d83b4b; --zone-color: #d83b4b; }
.symptom-stiffness { --annotation-color: #e58b22; --zone-color: #e58b22; }
.symptom-tingling { --annotation-color: #18a06f; --zone-color: #18a06f; }
.symptom-numbness { --annotation-color: #3479c9; --zone-color: #3479c9; }
.symptom-swelling { --annotation-color: #8a55b8; --zone-color: #8a55b8; }
.symptom-weakness { --annotation-color: #b59a18; --zone-color: #b59a18; }
.symptom-other { --annotation-color: #66777b; --zone-color: #66777b; }
.anatomy-workspace { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(290px, .75fr); gap: 14px; align-items: start; }
.anatomy-models { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.anatomy-card { padding: 12px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.anatomy-card > header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.anatomy-card > header strong { color: var(--teal); font-size: 11px; }
.anatomy-card > header span { color: var(--muted); font-size: 7px; }
.anatomy-svg { display: block; width: min(100%, 285px); height: auto; max-height: 580px; margin: 10px auto 0; overflow: visible; }
.anatomy-zone { cursor: pointer; outline: none; }
.anatomy-zone ellipse, .anatomy-zone rect { fill: #e9f0ee; stroke: #9dafab; stroke-width: 1.5; transition: fill .15s ease, stroke .15s ease, filter .15s ease; }
.anatomy-zone:hover ellipse, .anatomy-zone:hover rect,
.anatomy-zone:focus ellipse, .anatomy-zone:focus rect { fill: #d4e8e2; stroke: var(--teal); filter: drop-shadow(0 2px 3px rgba(14, 83, 78, .18)); }
.anatomy-zone.selected ellipse, .anatomy-zone.selected rect { fill: var(--zone-color); stroke: #fff; stroke-width: 2.5; filter: drop-shadow(0 2px 5px color-mix(in srgb, var(--zone-color), transparent 60%)); }
.anatomy-zone.active ellipse, .anatomy-zone.active rect { stroke: var(--navy); stroke-width: 4; }
.anatomy-zone.recommended:not(.selected) ellipse, .anatomy-zone.recommended:not(.selected) rect { stroke: var(--gold); stroke-width: 4; stroke-dasharray: 7 4; }
.anatomy-panel { position: sticky; top: 10px; display: grid; gap: 12px; }
.anatomy-empty, #anatomy-editor, .anatomy-annotations { padding: 14px; background: white; border: 1px solid var(--line); border-radius: 13px; }
.anatomy-empty { padding: 30px 14px; text-align: center; }
.anatomy-empty strong { color: var(--teal); }
.anatomy-empty p { margin: 6px 0 0; color: var(--muted); font-size: 9px; }
.anatomy-editor-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; margin-bottom: 10px; }
.anatomy-editor-head small { color: var(--muted); font-size: 8px; }
.anatomy-editor-head h3 { margin: 3px 0 0; color: var(--navy); font-size: 13px; }
#anatomy-editor > label { margin-top: 9px; font-size: 9px; }
#anatomy-editor select, #anatomy-editor textarea { min-height: 40px; font-size: 9px; }
#anatomy-editor textarea { min-height: 76px; }
#anatomy-intensity { min-height: 28px; padding: 0; accent-color: var(--teal); }
#anatomy-intensity-value { color: var(--teal); font-weight: 900; }
.anatomy-editor-actions { display: flex; gap: 7px; margin-top: 10px; }
.anatomy-editor-actions .button { flex: 1; min-height: 42px; }
.anatomy-annotation-list { display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.anatomy-annotation-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; width: 100%; padding: 9px; color: var(--navy); background: #f5f9f7; border: 1px solid #dce8e4; border-radius: 9px; text-align: start; cursor: pointer; }
.anatomy-annotation-item:hover { border-color: #9acabd; }
.anatomy-annotation-item strong, .anatomy-annotation-item small { display: block; }
.anatomy-annotation-item strong { font-size: 9px; }
.anatomy-annotation-item small { margin-top: 3px; color: var(--muted); font-size: 7px; }
.anatomy-annotation-item b { color: var(--teal); font-size: 8px; }
.anatomy-record-summary { margin-top: 12px; padding: 12px; background: #f8f5ff; border: 1px solid #ded2ee; border-radius: 12px; }
.anatomy-record-summary > header { display: flex; justify-content: space-between; align-items: center; }
.anatomy-record-summary h4 { margin: 0; color: #694292; font-size: 11px; }
.anatomy-record-summary header span { color: #694292; font-size: 8px; }
.anatomy-record-summary ul { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 9px 0 0; padding: 0; list-style: none; }
.anatomy-record-summary li { display: flex; align-items: flex-start; gap: 7px; padding: 7px; background: white; border-radius: 8px; }
.anatomy-record-summary strong, .anatomy-record-summary small { display: block; }
.anatomy-record-summary strong { font-size: 8px; }
.anatomy-record-summary small { margin-top: 2px; color: var(--muted); font-size: 7px; }
.anatomy-record-summary p { margin: 8px 0 0; font-size: 8px; }
.anatomy-print { margin-top: 18px; padding: 13px; border: 1px solid #d9cfeb; border-radius: 9px; break-inside: avoid; }
.anatomy-print h3 { color: #694292; }
.anatomy-print .anatomy-dot { display: inline-block; margin-inline-end: 5px; }

/* Local clinical assistant */
.clinical-assistant { margin: 4px 0 20px; padding: 18px; background: linear-gradient(145deg, #f1f8f6, #f8f6ff); border: 1px solid #bcded4; border-radius: 17px; }
.clinical-assistant > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.clinical-assistant > header h3 { margin: 2px 0 0; color: var(--navy); font-size: 17px; }
.assistant-local-badge { padding: 6px 9px; color: #075f49; background: #ddf3ec; border: 1px solid #b7e2d5; border-radius: 999px; font-size: 8px; font-weight: 900; }
.assistant-summary { padding: 13px 15px; color: white; background: linear-gradient(135deg, var(--teal), #164660); border-radius: 13px; }
.assistant-summary h4 { margin: 0 0 7px; font-size: 13px; }
.assistant-summary ul { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 22px; margin: 0; padding-inline-start: 18px; font-size: 9px; line-height: 1.7; }
.assistant-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.assistant-grid > section { padding: 12px; background: rgba(255,255,255,.88); border: 1px solid #dae8e4; border-radius: 12px; }
.assistant-grid > section > h4 { margin: 0 0 8px; color: var(--navy); font-size: 10px; }
.assistant-alerts, .assistant-trends { display: grid; gap: 6px; }
.assistant-alert { padding: 8px 9px; border-inline-start: 3px solid #6f8785; border-radius: 8px; }
.assistant-alert strong, .assistant-alert p { display: block; margin: 0; }
.assistant-alert strong { font-size: 9px; }
.assistant-alert p { margin-top: 3px; color: inherit; font-size: 8px; line-height: 1.6; }
.assistant-alert-urgent { color: #8e1e29; background: #fff0f1; border-color: #c52f3c; }
.assistant-alert-attention { color: #755d2c; background: #fff7e3; border-color: #d1a541; }
.assistant-alert-info { color: #315d59; background: #eaf5f2; border-color: var(--teal); }
.assistant-trend { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 9px; background: #f5f8f7; border-radius: 8px; }
.assistant-trend strong, .assistant-trend small { display: block; }
.assistant-trend strong { color: var(--navy); font-size: 8px; }
.assistant-trend small { margin-top: 2px; color: var(--muted); font-size: 7px; }
.assistant-trend > span { display: flex; align-items: center; gap: 5px; white-space: nowrap; color: #536b69; font-size: 8px; }
.assistant-trend > span i { color: var(--muted); font-style: normal; }
.trend-improved { border-inline-start: 3px solid #169f70; }
.trend-worsened { border-inline-start: 3px solid #c52f3c; }
.trend-stable, .trend-changed { border-inline-start: 3px solid #6f8785; }
.assistant-goals { display: grid; gap: 5px; margin: 0 0 9px; padding-inline-start: 19px; color: #355a57; font-size: 8px; line-height: 1.65; }
.assistant-completeness { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 9px; }
.assistant-completeness > div { height: 8px; overflow: hidden; background: #e5ecea; border-radius: 999px; }
.assistant-completeness span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--gold), var(--teal)); border-radius: inherit; }
.assistant-completeness strong { color: var(--teal); font-size: 10px; }
.assistant-completeness .completion-0 { width: 0; }
.assistant-completeness .completion-10 { width: 10%; }
.assistant-completeness .completion-20 { width: 20%; }
.assistant-completeness .completion-30 { width: 30%; }
.assistant-completeness .completion-40 { width: 40%; }
.assistant-completeness .completion-50 { width: 50%; }
.assistant-completeness .completion-60 { width: 60%; }
.assistant-completeness .completion-70 { width: 70%; }
.assistant-completeness .completion-80 { width: 80%; }
.assistant-completeness .completion-90 { width: 90%; }
.assistant-completeness .completion-100 { width: 100%; }
.assistant-grid details { margin-top: 8px; color: var(--muted); font-size: 8px; }
.assistant-grid details p { margin: 5px 0 0; line-height: 1.6; }
.assistant-complete, .assistant-empty { margin: 7px 0 0; color: var(--muted); font-size: 8px; }
.assistant-disclaimer { margin: 10px 0 0; padding-top: 9px; color: #755d2c; border-top: 1px solid #dfe9e6; font-size: 8px; line-height: 1.7; }
.clinical-record-head { align-items: center; }
.clinical-record-columns { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; }
.section-mini-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.section-mini-head h3 { margin: 0; }
.section-mini-head span { min-width: 27px; padding: 4px 7px; color: var(--teal); background: #e6f4f0; border-radius: 999px; text-align: center; font-size: 10px; font-weight: 900; }
.clinical-timeline { display: grid; gap: 11px; max-height: 62vh; padding-inline-end: 4px; overflow-y: auto; }
.clinical-card, .session-card { padding: 15px; background: #fbfcfb; border: 1px solid var(--line); border-inline-start: 4px solid var(--teal); border-radius: 14px; }
.clinical-card > header, .session-card > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.clinical-card h3 { margin: 7px 0 0; font-size: 15px; }
.clinical-card header > div:last-child { display: grid; gap: 3px; text-align: left; }
.clinical-card header small, .clinical-card footer, .session-card footer { color: var(--muted); font-size: 9px; }
.clinical-card-grid, .clinical-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 12px; }
.clinical-card p, .session-card p, .clinical-details-grid p { margin: 0; padding: 9px; white-space: pre-wrap; background: white; border-radius: 9px; font-size: 10px; }
.clinical-card p b, .session-card p b, .clinical-print-grid b { display: block; margin-bottom: 4px; color: var(--teal); font-size: 9px; }
.clinical-card details, .session-card details { margin-top: 10px; }
.clinical-card summary, .session-card summary { color: var(--teal); font-size: 10px; font-weight: 800; cursor: pointer; }
.clinical-card footer, .session-card footer { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.session-card { border-inline-start-color: var(--gold); }
.session-card > p { margin-top: 8px; }
.session-metrics { display: flex; gap: 7px; margin: 10px 0; }
.session-metrics span { padding: 5px 8px; color: #655027; background: #fff7e4; border-radius: 999px; font-size: 9px; font-weight: 800; }
.clinical-print-section { margin-top: 28px; break-inside: avoid; }
.clinical-print-section h2 { padding-bottom: 8px; color: var(--navy); border-bottom: 2px solid var(--teal); }
.clinical-print-section h3 { margin: 20px 0 7px; color: var(--teal); font-size: 14px; }
.clinical-print-section > p { white-space: pre-wrap; font-size: 11px; }
.clinical-print-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.clinical-print-grid p { margin: 0; padding: 11px; white-space: pre-wrap; background: #f5f8f7; border-radius: 8px; font-size: 10px; }
.print-signature { color: var(--muted); font-size: 10px !important; }

/* Specialized clinical assessments */
.specialized-field { margin: 18px 0; padding: 20px; border: 1px solid #b7dacf; border-radius: 16px; background: #f8fcfa; }
.specialized-field > legend { padding-inline: 9px; color: var(--teal); font-size: 12px; font-weight: 900; }
.template-selector { max-width: 680px; }
.clinical-guidance { margin: 14px 0; padding: 13px 15px; color: #315d59; background: #e7f5f1; border-inline-start: 4px solid var(--teal); border-radius: 10px; }
.clinical-guidance strong { color: var(--teal); font-size: 11px; }
.clinical-guidance p { margin: 4px 0 0; font-size: 10px; line-height: 1.8; }
.specialized-block { margin-top: 18px; }
.specialized-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.specialized-title h3 { margin: 0; color: var(--navy); font-size: 13px; }
.specialized-title span { color: var(--muted); font-size: 9px; }
.red-flag-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.red-flag-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 7px; padding: 9px; background: white; border: 1px solid #e5d8d9; border-radius: 10px; }
.red-flag-row > input[type="checkbox"] { width: 17px; min-height: 17px; accent-color: #b4313b; }
.red-flag-row > span { color: #65353a; font-size: 9px; font-weight: 700; }
.red-flag-row > input[type="text"] { grid-column: 1 / -1; min-height: 35px; font-size: 9px; }
.special-test-list { display: grid; gap: 8px; }
.special-test-row { display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(120px, .7fr)); align-items: end; gap: 9px; padding: 11px; background: white; border: 1px solid var(--line); border-radius: 11px; }
.special-test-row > div { align-self: center; }
.special-test-row strong, .special-test-row small { display: block; }
.special-test-row strong { color: var(--navy); font-size: 11px; }
.special-test-row small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.6; }
.special-test-row label, .outcome-grid label { font-size: 8px; }
.special-test-row select, .special-test-row input { min-height: 38px; font-size: 9px; }
.outcome-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.outcome-grid > label { padding: 10px; background: white; border: 1px solid var(--line); border-radius: 10px; }
.score-input { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.score-input input { min-width: 0; min-height: 38px; }
.score-input small { white-space: nowrap; color: var(--muted); }
.clinical-disclaimer { margin: 16px 0 0; padding: 11px 13px; color: #755d2c; background: #fff7e3; border-radius: 10px; font-size: 9px; line-height: 1.8; }
.specialized-summary { margin-top: 12px; padding: 13px; background: #eef8f4; border: 1px solid #c8e7dc; border-radius: 12px; }
.specialized-summary > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.specialized-summary h4 { margin: 3px 0 0; color: var(--teal); font-size: 12px; }
.specialized-summary header small { color: var(--muted); font-size: 8px; }
.specialized-summary header > span { padding: 4px 7px; color: #075f49; background: white; border-radius: 999px; font-size: 8px; }
.specialized-summary h5 { margin: 12px 0 6px; color: var(--navy); font-size: 9px; }
.specialized-result-list, .outcome-result-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.specialized-result-list li { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; padding: 7px; background: white; border-radius: 8px; }
.specialized-result-list strong, .outcome-result-list strong { font-size: 9px; }
.specialized-result-list small { grid-column: 1 / -1; color: var(--muted); font-size: 8px; }
.test-result { padding: 3px 6px; border-radius: 999px; font-size: 8px; font-weight: 900; }
.result-positive { color: #9b202b; background: #ffe8ea; }
.result-negative { color: #075f49; background: #e0f5ec; }
.result-equivocal, .result-contraindicated { color: #785d1f; background: #fff3cf; }
.outcome-result-list { grid-template-columns: repeat(2, 1fr); }
.outcome-result-list li { display: flex; justify-content: space-between; gap: 8px; padding: 7px; background: white; border-radius: 8px; font-size: 9px; }
.clinical-alert { margin-top: 10px; padding: 10px 12px; color: #8e1e29; background: #fff0f1; border: 1px solid #ffcbd0; border-radius: 9px; font-size: 9px; }
.clinical-alert ul { margin: 5px 0 0; padding-inline-start: 17px; }
.specialized-print { margin-top: 20px; padding: 14px; border: 1px solid #b9dbd0; border-radius: 9px; break-inside: avoid; }
.specialized-print h4 { margin: 15px 0 6px; color: var(--navy); font-size: 11px; }

/* Team accounts, roles, audit and exports */
.security-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .55fr); gap: 18px; margin-bottom: 18px; }
.security-grid .panel { margin: 0; }
.security-note { display: flex; align-items: center; gap: 16px; margin: 0 20px 18px; padding: 13px 15px; color: #075f49; background: #e8f7f2; border: 1px solid #c8e9de; border-radius: 12px; }
.security-note p, .panel-copy { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.team-role { min-width: 135px; min-height: 37px; padding: 6px 8px; font-size: 10px; }
.current-account { display: block; width: fit-content; margin-top: 4px; padding: 3px 7px; color: #075f49; background: #e0f5ec; border-radius: 999px; }
.account-status { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 900; }
.account-status.active { color: #075f49; background: #e0f5ec; }
.account-status.inactive { color: #8f1d27; background: #fff0f1; }
.export-panel { padding-bottom: 20px; }
.export-panel .panel-copy { padding: 0 20px 16px; }
.export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 0 20px; }
.export-card { display: grid; gap: 4px; min-height: 82px; padding: 14px; color: var(--navy); background: #f4f8f7; border: 1px solid var(--line); border-radius: 12px; }
.export-card:hover { color: var(--teal); border-color: #acd7ca; }
.export-card span { color: var(--muted); font-size: 9px; }
.export-full { grid-column: 1 / -1; color: white; background: var(--teal); border-color: var(--teal); }
.export-full:hover { color: white; background: #0c6a66; }
.export-full span { color: rgba(255,255,255,.72); }
.permission-panel, .audit-panel { margin-top: 18px; }
.permission-matrix { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 10px; padding: 20px; overflow-x: auto; }
.role-card { min-width: 180px; padding: 14px; background: #f8faf9; border: 1px solid var(--line); border-radius: 13px; }
.role-card header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.role-card header span { color: var(--muted); font-size: 9px; }
.role-card > div { display: grid; gap: 5px; }
.permission-chip { display: block; padding: 6px 8px; color: #9aa6a3; background: #f0f2f1; border-radius: 7px; font-size: 9px; }
.permission-chip.allowed { color: #075f49; background: #e2f5ee; }
.audit-panel td:first-child strong, .audit-panel td:first-child small { display: block; }
.audit-panel td:first-child small { margin-top: 3px; color: var(--muted); }

@media (max-width: 1200px) {
  .metrics-six { grid-template-columns: repeat(3, 1fr); }
  .week-grid { display: grid; }
  .security-grid { grid-template-columns: 1fr; }
  .permission-matrix { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
  .anatomy-workspace { grid-template-columns: 1fr; }
  .anatomy-panel { position: static; grid-template-columns: 1fr 1fr; }
  .anatomy-annotations { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .sidebar { position: static; height: auto; display: grid; grid-template-columns: 1fr auto; padding: 14px; }
  .sidebar nav { grid-column: 1 / -1; display: flex; overflow-x: auto; order: 3; }
  .sidebar nav a { flex: 0 0 auto; }
  .sidebar-version { display: none; }
  .logout-button { margin: 0; }
  .metrics-six, .metrics-four { grid-template-columns: repeat(2, 1fr); }
  .module-actions { width: 100%; }
  .panel-head { align-items: flex-start; flex-wrap: wrap; }
  .form-grid.three { grid-template-columns: 1fr 1fr; }
  .detail-summary { grid-template-columns: 1fr 1fr; }
  .clinical-record-columns { grid-template-columns: 1fr; }
  .clinical-timeline { max-height: none; }
  .permission-matrix { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .special-test-row { grid-template-columns: 1fr 1fr; }
  .special-test-row > div { grid-column: 1 / -1; }
  .outcome-grid { grid-template-columns: 1fr 1fr; }
  .anatomy-toolbar { display: block; }
  .anatomy-legend { justify-content: flex-start; margin-top: 10px; }
}

@media (max-width: 620px) {
  .metrics-six, .metrics-four { grid-template-columns: 1fr 1fr; }
  .module-actions, .search-form { width: 100%; }
  .search-form input { min-width: 0; }
  .form-grid.three { grid-template-columns: 1fr; }
  .admin-dialog form, #detail-dialog-content { padding: 18px; }
  .dialog-actions .button { flex: 1; }
  .print-document { width: 100%; margin: 0; padding: 24px 16px; box-shadow: none; }
  .print-meta { grid-template-columns: 1fr; }
  .body-map-layout, .clinical-card-grid, .clinical-details-grid, .clinical-print-grid, .assistant-grid, .assistant-summary ul { grid-template-columns: 1fr; }
  .clinical-privacy-note { display: block; }
  .clinical-privacy-note p { margin-top: 5px; }
  .security-note { display: block; }
  .security-note p { margin-top: 4px; }
  .export-grid, .permission-matrix { grid-template-columns: 1fr; }
  .red-flag-grid, .special-test-row, .outcome-grid, .outcome-result-list { grid-template-columns: 1fr; }
  .special-test-row > div { grid-column: auto; }
  .anatomy-models, .anatomy-panel, .anatomy-record-summary ul { grid-template-columns: 1fr; }
  .anatomy-annotations { grid-column: auto; }
  .anatomy-card > header { display: block; }
  .anatomy-card > header span { display: block; margin-top: 3px; }
  .whatsapp-config-grid { grid-template-columns: 1fr; }
}

@media print {
  .print-page { background: white; }
  .print-document { width: 100%; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
}

/* Centre NASSER aggregated analytics */
.analytics-toolbar { margin: 24px 0 0; padding: 18px; }
.analytics-toolbar form { display: grid; gap: 14px; }
.statistics-presets, .statistics-dates { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; }
.statistics-dates label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.statistics-dates input { min-height: 42px; padding: 8px 11px; }
.statistics-print-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 24px 2px 0; }
.statistics-print-head h2, .statistics-print-head p { margin: 0; }
.statistics-print-head > p { color: var(--muted); font-size: 12px; }
.analytics-metrics { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); }
.analytics-metric small { font-weight: 800; }
.trend-up { color: #08755a !important; }
.trend-down { color: #a33a43 !important; }
.trend-steady { color: var(--muted) !important; }
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.analytics-panel { min-width: 0; }
.analytics-panel .panel-head { align-items: center; }
.analytics-panel .panel-head > span, .analytics-panel .panel-head > strong { color: var(--teal); font-size: 12px; }
.analytics-wide { grid-column: 1 / -1; }
.column-chart { overflow-x: auto; padding: 16px 18px 18px; }
.column-chart svg { display: block; width: 100%; min-width: 420px; height: 235px; }
.chart-column { fill: var(--teal); }
.chart-axis { stroke: #cdd8d5; stroke-width: 1; }
.column-chart text { fill: var(--muted); font-size: 7px; }
.horizontal-chart { display: grid; gap: 14px; padding: 20px; }
.horizontal-chart-row { display: grid; gap: 6px; }
.horizontal-chart-row > div { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; }
.horizontal-chart-row > div strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.horizontal-chart-row > div span { color: var(--muted); font-weight: 800; }
.horizontal-chart-row svg { display: block; width: 100%; height: 8px; }
.chart-track { fill: #e7eeec; }
.chart-fill { fill: var(--gold); }
.operations-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 20px; }
.operations-grid article { padding: 15px; background: #f4f8f7; border-radius: 13px; }
.operations-grid span, .operations-grid small { display: block; color: var(--muted); font-size: 10px; }
.operations-grid strong { display: block; margin: 5px 0; color: var(--navy); font-size: 24px; }
.analytics-empty { padding: 38px 20px; color: var(--muted); text-align: center; }
.analytics-privacy { margin: 16px 0 0; padding: 14px; color: #46616a; background: #eaf2f0; border-radius: 13px; font-size: 11px; text-align: center; }

@media (max-width: 900px) {
  .analytics-grid { grid-template-columns: 1fr; }
  .analytics-wide { grid-column: auto; }
}

@media (max-width: 620px) {
  .statistics-print-head { display: block; }
  .statistics-print-head > p { margin-top: 6px; }
  .statistics-dates label, .statistics-dates .button { width: 100%; }
  .statistics-dates input { width: 100%; }
  .operations-grid { grid-template-columns: 1fr; }
  .column-chart svg { height: 190px; }
}

@media print {
  .dashboard { display: block; padding-inline-start: 0; background: white; }
  .sidebar, .dashboard-top, .dashboard-error, .success-banner, .no-print { display: none !important; }
  .dashboard-main { padding: 0; }
  .statistics-print-head { margin: 0 0 16px; }
  .analytics-metrics { grid-template-columns: repeat(4, 1fr); margin: 0 0 14px; }
  .metric, .panel { break-inside: avoid; box-shadow: none; }
  .analytics-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .column-chart svg { min-width: 0; height: 170px; }
  .analytics-privacy { margin-top: 10px; }
}

/* Professional home-program builder */
.exercise-builder { margin: 18px 0; padding: 18px; background: #f7faf9; border: 1px solid var(--line); border-radius: 16px; }
.exercise-builder .section-mini-head { margin-bottom: 14px; }
.exercise-builder-row { margin-bottom: 12px; padding: 15px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.exercise-builder-row > header { display: grid; grid-template-columns: 34px 1fr 38px; gap: 10px; align-items: end; }
.exercise-builder-row > header > span { width: 32px; height: 32px; display: grid; place-items: center; color: white; background: var(--teal); border-radius: 50%; font-weight: 900; }
.exercise-builder-row > header label { display: grid; gap: 5px; }
.exercise-dose-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; margin: 12px 0; }
.exercise-dose-grid label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; }
.exercise-builder-preview { margin-top: 12px; padding: 12px; color: #385460; background: #edf5f3; border-radius: 11px; }
.exercise-builder-preview strong { color: var(--navy); }
.exercise-builder-preview p { margin: 5px 0; line-height: 1.7; }
.exercise-builder-preview small { color: #8a5a16; }
.exercise-library-summary { margin-bottom: 18px; }
.exercise-program-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.exercise-program-card { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 18px; }
.exercise-program-card > header { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 18px; background: #f7faf9; border-bottom: 1px solid var(--line); }
.exercise-program-card > header h3, .exercise-program-card > header p { margin: 7px 0 0; }
.exercise-program-card > header p, .exercise-program-card > header small { color: var(--muted); font-size: 10px; }
.exercise-program-card > header > div:last-child { text-align: left; }
.exercise-program-card > header small { display: block; margin-top: 4px; }
.program-status-draft { color: #72510f; background: #fff1ca; }
.program-status-published { color: #075f49; background: #dff4eb; }
.program-status-completed { color: #194f8d; background: #e2efff; }
.program-status-cancelled { color: #8f1d27; background: #fff0f1; }
.exercise-program-goal { margin: 0; padding: 13px 18px; color: #385460; border-bottom: 1px solid var(--line); }
.exercise-program-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.exercise-program-list li { padding: 13px 18px; border-bottom: 1px solid var(--line); }
.exercise-program-list li strong, .exercise-program-list li small { display: block; }
.exercise-program-list li small { margin-top: 3px; color: var(--muted); }
.exercise-program-list li p { margin: 7px 0 0; color: #385460; }
.exercise-safety-note { margin: 14px 18px; padding: 12px; color: #795416; background: #fff8e8; border-radius: 10px; }
.exercise-program-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px 18px; }
.exercise-program-card > footer > div { display: flex; flex-wrap: wrap; gap: 7px; }
.exercise-program-card > footer > small { color: var(--muted); }
.exercise-print-goal, .exercise-print-safety { margin: 16px 0; padding: 15px; border-radius: 12px; }
.exercise-print-goal { background: #edf5f3; }
.exercise-print-goal p, .exercise-print-safety p { margin: 5px 0 0; }
.exercise-print-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.exercise-print-card { padding: 15px; border: 1px solid var(--line); border-radius: 13px; break-inside: avoid; }
.exercise-print-card > header { display: flex; gap: 10px; align-items: center; }
.exercise-print-card > header > span { width: 30px; height: 30px; display: grid; place-items: center; color: white; background: var(--teal); border-radius: 50%; font-weight: 900; }
.exercise-print-card h2, .exercise-print-card p { margin: 0; }
.exercise-print-card h2 { font-size: 16px; }
.exercise-print-card > p { margin-top: 10px; line-height: 1.7; }
.exercise-print-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.exercise-print-card dl div { padding: 7px; background: #f6f8f7; border-radius: 7px; }
.exercise-print-card dt { color: var(--muted); font-size: 8px; }
.exercise-print-card dd { margin: 2px 0 0; font-weight: 800; }
.exercise-public-note, .exercise-precaution { margin-top: 8px !important; padding: 8px; border-radius: 8px; }
.exercise-public-note { background: #edf5f3; }
.exercise-precaution { color: #795416; background: #fff8e8; }
.exercise-print-safety { color: #6c4b16; background: #fff8e8; }

/* Longitudinal functional progress and goals */
.progress-summary { margin: 18px 0; }
.progress-outcomes, .progress-goals { margin-top: 22px; }
.outcome-series-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.outcome-series-card { min-width: 0; padding: 15px; background: #f7faf9; border: 1px solid var(--line); border-radius: 14px; }
.outcome-series-card header, .outcome-series-card footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.outcome-series-card header strong, .outcome-series-card header small { display: block; }
.outcome-series-card header small, .outcome-series-card footer { color: var(--muted); font-size: 9px; }
.outcome-series-card header > span { color: var(--teal); font-weight: 900; }
.progress-sparkline { display: block; width: 100%; height: 82px; margin: 10px 0; }
.progress-sparkline line { stroke: #d7e1de; stroke-width: 1; }
.progress-sparkline path { fill: none; stroke: var(--teal); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.progress-sparkline circle { fill: var(--gold); stroke: white; stroke-width: 2; }
.progress-chart-empty { padding: 24px 10px; color: var(--muted); background: #f4f7f6; border-radius: 10px; text-align: center; }
.clinical-goal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.clinical-goal-card { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 17px; }
.clinical-goal-card > header { display: flex; align-items: start; justify-content: space-between; gap: 14px; padding: 17px; background: #f7faf9; border-bottom: 1px solid var(--line); }
.clinical-goal-card > header h3, .clinical-goal-card > header p { margin: 6px 0 0; }
.clinical-goal-card > header p, .goal-space-state { color: var(--muted); font-size: 9px; }
.goal-space-state { padding: 5px 8px; background: white; border-radius: 999px; white-space: nowrap; }
.goal-status-active { color: #075f49; background: #dff4eb; }
.goal-status-achieved { color: #194f8d; background: #e2efff; }
.goal-status-paused { color: #72510f; background: #fff1ca; }
.goal-status-cancelled { color: #8f1d27; background: #fff0f1; }
.goal-target-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 15px 17px; }
.goal-target-grid p { margin: 0; padding: 11px; color: #385460; background: #f4f8f7; border-radius: 10px; }
.goal-target-grid p:last-child { grid-column: 1 / -1; }
.goal-target-grid b { display: block; margin-bottom: 4px; color: var(--navy); }
.goal-progress-visual { padding: 0 17px 12px; }
.goal-progress-visual > div, .space-goal-progress > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.goal-progress-visual > div strong, .space-goal-progress > div strong { color: var(--teal); font-size: 22px; }
.goal-progress-visual > div span, .space-goal-progress > div span { color: var(--muted); font-size: 9px; }
.goal-progress-visual > svg:not(.progress-sparkline), .space-goal-progress > svg { display: block; width: 100%; height: 8px; }
.goal-progress-track { fill: #e4ece9; }
.goal-progress-fill { fill: var(--teal); }
.clinical-goal-card details { margin: 0 17px 14px; }
.clinical-goal-card details summary { color: var(--teal); cursor: pointer; font-weight: 800; }
.goal-update-list { display: grid; gap: 8px; padding: 0; list-style: none; }
.goal-update-list li { padding: 10px; background: #f7faf9; border-radius: 9px; }
.goal-update-list header { display: flex; justify-content: space-between; }
.goal-update-list p { margin: 5px 0 0; }
.goal-update-list small { color: var(--muted); }
.goal-public-note { color: #075f49; }
.clinical-goal-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 17px 17px; }
.clinical-goal-card > footer small { color: var(--muted); }
.space-follow-up-goal { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; }
.space-follow-up-goal > header { margin: 0; padding: 16px 18px; background: #eef7f4; }
.space-follow-up-goal > header span { color: var(--teal); font-size: 9px; }
.space-follow-up-goal > header h3 { margin: 3px 0 0; }
.space-follow-up-goal > header > strong { padding: 5px 8px; color: #075f49; background: white; border-radius: 999px; font-size: 10px; }
.space-follow-up-goal > p, .space-follow-up-goal > small { display: block; margin: 0; padding: 12px 18px 0; }
.space-follow-up-goal > p b { display: block; color: var(--navy); }
.space-follow-up-goal > small { color: var(--muted); }
.space-goal-progress { padding: 13px 18px; }
.space-follow-up-goal > ol { display: grid; gap: 8px; margin: 0; padding: 0 18px 18px; list-style: none; }
.space-follow-up-goal > ol li { padding: 10px; background: #f7faf9; border-radius: 9px; }
.space-follow-up-goal > ol time { color: var(--teal); font-size: 9px; font-weight: 800; }
.space-follow-up-goal > ol p { margin: 3px 0 0; }
.progress-print-outcomes { margin: 18px 0; padding: 15px; background: #edf5f3; border-radius: 12px; }
.progress-print-outcomes > h2 { margin-top: 0; }
.progress-print-outcome { margin-top: 8px; padding: 10px; background: white; border-radius: 8px; }
.progress-print-outcome h3, .progress-print-outcome p { margin: 0; }
.progress-print-goal { margin-top: 16px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; break-inside: avoid; }
.progress-print-goal > header { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.progress-print-goal h2 { margin: 2px 0 0; }
.progress-print-goal > header span { padding: 5px 8px; background: #edf5f3; border-radius: 999px; }
.progress-print-target { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.progress-print-target p { margin: 0; padding: 10px; background: #f6f8f7; border-radius: 8px; }
.progress-print-target b { display: block; }

/* Smart operational waiting list */
.dashboard-metrics { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
.waitlist-toolbar, .vacancy-matcher { margin-bottom: 16px; }
.waitlist-filter { display: grid; grid-template-columns: minmax(220px, 1fr) 220px auto; gap: 10px; align-items: end; }
.waitlist-filter label, .vacancy-matcher label { margin: 0; }
.form-grid.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.vacancy-matcher .button { grid-column: 1 / -1; justify-self: start; }
.waitlist-results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 26px 0 12px; }
.waitlist-results-head h2, .waitlist-results-head p { margin: 0; }
.waitlist-results-head p { margin-top: 3px; color: var(--muted); }
.waitlist-results-head > span { min-width: 38px; padding: 8px; color: white; background: var(--teal); border-radius: 999px; text-align: center; font-weight: 900; }
.waitlist-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.waitlist-card { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 17px; }
.waitlist-card > header { display: flex; align-items: start; justify-content: space-between; gap: 14px; padding: 17px; background: #f7faf9; border-bottom: 1px solid var(--line); }
.waitlist-card > header h3, .waitlist-card > header p { margin: 6px 0 0; }
.waitlist-card > header p, .waitlist-card > header small { color: var(--muted); }
.waitlist-card > header > div:last-child { display: grid; gap: 4px; text-align: left; }
.waitlist-card > header > div:last-child strong { color: var(--teal); }
.waitlist-status-active { color: #075f49; background: #dff4eb; }
.waitlist-status-contacted { color: #194f8d; background: #e2efff; }
.waitlist-status-booked { color: #075f49; background: #cceedd; }
.waitlist-status-paused { color: #72510f; background: #fff1ca; }
.waitlist-status-closed { color: #6b7377; background: #e9edec; }
.waitlist-match { display: grid; gap: 3px; padding: 11px 17px; color: #075f49; background: #e6f5f1; }
.waitlist-match span { font-size: 9px; }
.waitlist-preferences { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 15px 17px; }
.waitlist-preferences p { margin: 0; padding: 10px; background: #f4f8f7; border-radius: 9px; }
.waitlist-preferences b { display: block; color: var(--navy); }
.waitlist-note, .waitlist-last-contact { margin: 0 17px 12px; padding: 10px; border-radius: 9px; }
.waitlist-note { color: #385460; background: #f7faf9; }
.waitlist-last-contact { color: #6c4b16; background: #fff8e8; }
.waitlist-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 17px 17px; }
.waitlist-card > footer small { color: var(--muted); text-align: left; }

@media (max-width: 1100px) {
  .outcome-series-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clinical-goal-grid { grid-template-columns: 1fr; }
  .form-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .outcome-series-grid, .goal-target-grid, .progress-print-target { grid-template-columns: 1fr; }
  .goal-target-grid p:last-child { grid-column: auto; }
  .clinical-goal-card > header, .clinical-goal-card > footer { display: block; }
  .goal-space-state { display: inline-block; margin-top: 8px; }
  .clinical-goal-card > footer > small { display: block; margin-top: 9px; }
  .waitlist-filter, .form-grid.six, .waitlist-preferences { grid-template-columns: 1fr; }
  .waitlist-grid { grid-template-columns: 1fr; }
  .waitlist-card > header, .waitlist-card > footer { display: block; }
  .waitlist-card > header > div:last-child, .waitlist-card > footer small { margin-top: 9px; text-align: right; }
}

@media (max-width: 900px) {
  .exercise-program-grid { grid-template-columns: 1fr; }
  .exercise-dose-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 620px) {
  .exercise-builder-row > header { grid-template-columns: 30px 1fr 38px; }
  .exercise-dose-grid { grid-template-columns: 1fr 1fr; }
  .exercise-program-card > header, .exercise-program-card > footer { display: block; }
  .exercise-program-card > header > div:last-child { margin-top: 10px; text-align: right; }
  .exercise-program-card > footer > small { display: block; margin-top: 10px; }
  .exercise-print-grid { grid-template-columns: 1fr; }
}

/* Centre NASSER installable PWA */
.team-install-button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; margin: 12px 0; padding: 10px 12px; color: white; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22); border-radius: 11px; font-size: 11px; font-weight: 800; cursor: pointer; }
.team-install-button:hover { background: rgba(255,255,255,.14); }
.team-install-button span { padding: 0; color: var(--gold); }
.team-login-install { width: 100%; margin-top: 14px; }
.team-ios-help { margin: 10px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.offline-pill { color: #8f1d27; background: #fff0f1; }
.offline-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 85% 8%, rgba(21,124,120,.14), transparent 30%), var(--cream); }
.offline-page section { width: min(540px, 100%); padding: 36px; background: white; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); text-align: center; }
.offline-page img { width: 92px; height: 92px; object-fit: contain; }
.offline-page h1 { margin: 8px 0; color: var(--navy); font-size: clamp(28px, 6vw, 40px); }
.offline-page p:not(.eyebrow) { margin: 0 0 22px; color: var(--muted); line-height: 1.8; }
.team-app-standalone .sidebar, .public-app-standalone .site-header { padding-top: max(14px, env(safe-area-inset-top)); }

/* Privacy-safe Web Push notifications */
.team-push-button[data-active="1"] { color: #dff8ee; background: rgba(21,124,120,.34); border-color: rgba(124,221,190,.52); }
.team-push-button:disabled, .space-push-button:disabled { cursor: wait; opacity: .62; }
.space-welcome-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.space-push-button { color: var(--teal); background: #e6f5f1; border: 1px solid #b9ddd3; }
.space-push-button[data-active="1"] { color: #075f49; background: #d9f1e8; border-color: #9ed1c1; }

@media (max-width: 900px) {
  .dashboard { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .sidebar { padding-top: max(14px, env(safe-area-inset-top)); }
  .sidebar nav { position: fixed; z-index: 80; right: 0; bottom: 0; left: 0; display: flex; grid-column: auto; order: initial; gap: 5px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); overflow-x: auto; color: white; background: rgba(4,29,37,.98); border-top: 1px solid rgba(255,255,255,.12); box-shadow: 0 -8px 24px rgba(4,29,37,.18); scrollbar-width: none; }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar nav a { min-height: 52px; flex: 0 0 auto; flex-direction: column; justify-content: center; gap: 2px; padding: 6px 13px; scroll-snap-align: center; }
  .sidebar nav a span { width: auto; padding: 0; line-height: 1; }
  .team-install-button { grid-column: 1 / -1; margin: 2px 0 0; }
  .dashboard-main { padding-bottom: 18px; }
  button, .button, .mini-button, input, select { min-height: 44px; }
}

@media (max-width: 620px) {
  .sidebar .brand small { display: none; }
  .sidebar nav a { min-width: 76px; font-size: 10px; }
  .offline-page section { padding: 26px 20px; }
  .login-wrap { padding-top: max(30px, env(safe-area-inset-top)); padding-bottom: max(30px, env(safe-area-inset-bottom)); }
  .space-welcome-actions { justify-content: flex-start; margin-top: 14px; }
  .space-push-button { width: 100%; }
  .recovery-code-grid { grid-template-columns: 1fr; }
  .security-session { align-items: flex-start; flex-direction: column; }
}

/* Six treatment rooms and integrated finance documents */
.payment-method-field { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.payment-method-field legend { padding-inline: 8px; color: var(--muted); font-size: 11px; font-weight: 900; }
.payment-method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.payment-method-grid label { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; min-width: 0; padding: 10px; background: #f7faf9; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.payment-method-grid label:has(input:checked) { color: var(--teal); background: #e7f5f1; border-color: #8fc9ba; box-shadow: 0 0 0 2px rgba(21,124,120,.08); }
.payment-method-grid input { width: 17px; min-height: 17px; accent-color: var(--teal); }
.payment-method-grid span { min-width: 0; font-size: 11px; font-weight: 800; }
.payment-method-grid small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 600; direction: ltr; text-align: right; }
html:not([lang="en"]) .payment-method-grid small { display: none; }
.finance-tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 0 20px 20px; }
.finance-tool-grid article { display: grid; gap: 5px; padding: 14px; background: #f7faf9; border: 1px solid var(--line); border-radius: 12px; }
.finance-tool-grid strong { color: var(--navy); font-size: 12px; }
.finance-tool-grid small { color: var(--muted); font-size: 9px; line-height: 1.7; }
.monthly-report-form { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; padding: 0 20px 20px; }
.monthly-report-form label { display: grid; gap: 5px; min-width: 190px; color: var(--muted); font-size: 10px; }
.monthly-report-form input { min-height: 42px; }
.monthly-report-form p { flex: 1 1 100%; margin: 0; color: var(--muted); font-size: 10px; }
.cash-list article { grid-template-columns: minmax(0, 1fr) auto; }
.cash-receipt-link { grid-column: 2; grid-row: 2; }

.finance-print-page { background: #e9edec; }

.finance-document {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 148mm;
  min-height: 210mm;
  margin: 0 auto;
  padding: 8mm 9mm 7mm;
  background: #fff;
  color: #20324a;
  box-shadow: none;
  font-family: Tajawal, Cairo, "Segoe UI", Arial, sans-serif;
  font-size: 10.5px;
  line-height: 1.45;
}

.finance-document::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(18, 71, 122, 0.14);
  pointer-events: none;
}

.finance-document > .finance-letterhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10mm;
  min-height: 37mm;
  padding: 0 0 4mm;
  border-bottom: 1.5px solid rgba(18, 71, 122, 0.18);
}

.finance-brand {
  display: flex;
  align-items: flex-start;
  gap: 4mm;
  flex: 1 1 auto;
  min-width: 0;
}

.finance-brand-image {
  width: 31mm;
  height: 31mm;
  flex: 0 0 31mm;
  object-fit: contain;
}

.finance-brand-meta {
  display: grid;
  gap: 1.2mm;
  padding-top: 0.5mm;
}

.finance-brand-title {
  margin: 0;
  font-family: Cairo, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.1;
  font-weight: 800;
  color: #0d4b7d;
}

.finance-brand-subtitle {
  font-size: 10px;
  font-weight: 600;
  color: #55657c;
}

.finance-brand-link {
  font-size: 10px;
  font-weight: 700;
  color: #0d4b7d;
  letter-spacing: 0.02em;
}

.finance-inpe {
  display: grid;
  grid-template-rows: auto auto;
  gap: 2mm;
  justify-items: center;
  align-self: flex-start;
  flex: 0 0 42mm;
  padding-top: 1mm;
}

.finance-inpe img {
  width: 42mm;
  height: auto;
  max-height: 23mm;
  object-fit: contain;
}

.finance-inpe-code {
  font-family: Cairo, "Segoe UI", Arial, sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #22324a;
}

.finance-date {
  margin: 3mm 0 5mm;
  text-align: right;
  font-size: 10px;
  color: #334357;
}

.finance-document-body {
  position: relative;
  z-index: 1;
  flex: 1;
  font-size: inherit;
  line-height: inherit;
}

.finance-document-body > h2 {
  margin: 2mm 0 5mm;
  text-align: center;
  font-family: Cairo, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #20324a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.finance-document-body p {
  margin: 0 0 4mm;
}

.finance-watermark {
  position: absolute;
  z-index: -1;
  top: 49%;
  left: 50%;
  width: 88mm;
  height: auto;
  object-fit: contain;
  opacity: 0.05;
  transform: translateX(-50%);
}

.finance-fields {
  display: grid;
  gap: 4px;
  margin: 5mm 0 4mm;
}

.finance-fields > div {
  display: grid;
  grid-template-columns: 45mm 1fr;
  gap: 3.5mm;
  align-items: end;
  min-height: 6.5mm;
}

.finance-fields dt {
  font-weight: 700;
  color: #1f2d3e;
}

.finance-fields dt::after {
  content: " :";
  float: right;
}

.finance-fields dd {
  min-height: 5.5mm;
  margin: 0;
  padding: 0 1.2mm 1.2mm 0;
  border-bottom: 1px solid rgba(24, 54, 89, 0.18);
  font-weight: 600;
  color: #22324a;
}

.finance-fields dd strong {
  font-size: 11px;
}

.finance-amount-words {
  margin-top: 5mm;
  padding-top: 3mm;
  border-top: 1px solid rgba(18, 71, 122, 0.16);
  font-weight: 700;
}

.finance-note {
  padding: 2.2mm 2.6mm;
  color: #42575f;
  background: rgba(247, 250, 249, 0.9);
  border-inline-start: 2px solid var(--teal);
  border-radius: 4mm;
}

.finance-legal-footer {
  display: grid;
  gap: 2px;
  margin-top: auto;
  padding-top: 4mm;
  border-top: 1px solid rgba(18, 71, 122, 0.15);
  text-align: center;
  font-size: 9.3px;
  color: #314156;
  font-family: inherit;
  line-height: 1.45;
}

.finance-legal-footer strong,
.finance-legal-footer span {
  display: block;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.session-date-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 7mm;
}

.session-date-grid ol {
  margin: 0;
  padding: 0;
  list-style-position: inside;
  font-size: 11px;
}

@media (max-width: 900px) {
  .portal-hero-grid, .portal-info-grid { grid-template-columns: 1fr; }
  .portal-hero-grid { min-height: auto; gap: 42px; }
  .portal-identity { width: min(100%, 360px); margin-inline: auto; }
  .metrics-six { grid-template-columns: repeat(3, 1fr); }
  .finance-tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .payment-method-grid, .finance-tool-grid, .session-date-grid { grid-template-columns: 1fr; }
  .metrics-six { grid-template-columns: 1fr 1fr; }
  .finance-document { width: calc(100vw - 12px); min-height: auto; margin: 6px auto; padding: 6mm; }
  .finance-document > .finance-letterhead { flex-direction: row; gap: 4mm; }
  .finance-fields > div { grid-template-columns: 1fr; gap: 2px; }
  .finance-fields dt::after { float: none; }
}

@page finance {
  size: A5 portrait;
  margin: 0;
}

@media print {
  .finance-document {
    page: finance;
    width: 148mm;
    min-height: 210mm;
    margin: 0;
    padding: 8mm 9mm 7mm;
    box-shadow: none;
  }

  .finance-document > .finance-letterhead {
    flex-direction: row;
  }
}

/* public portal simplification and accessibility */
.public-access-intro { margin-bottom: 20px; }
.public-two-access { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 940px; margin-inline: auto; }
.public-two-access .access-card { min-height: 270px; }
.public-two-access .access-card h2 { margin: 0 0 9px; font-size: clamp(24px, 2.5vw, 30px); line-height: 1.25; }
.portal-identity { min-height: 336px; align-content: center; gap: 8px; padding: 34px 32px; }
.portal-identity img { width: 176px; height: 176px; }
.portal-identity strong { margin-top: 4px; font-size: clamp(26px, 2.5vw, 31px); line-height: 1.15; }
.portal-identity span { font-size: 13px; line-height: 1.5; }
.portal-features-card { background: #f7fafc; }
.portal-feature-list { margin-top: 24px; display: grid; gap: 12px; }
.portal-feature-list li { align-items: flex-start; }
.portal-feature-list b { font-size: 14px; line-height: 1.7; }
.team-shell, .admin-shell { font-size: 15px; }
.team-shell small, .admin-shell small, .panel small, .table-wrap small { font-size: max(12px, .78rem); line-height: 1.55; }
input, select, textarea, button { font-size: max(16px, 1rem); }
@media (max-width: 760px) {
  .public-two-access { grid-template-columns: 1fr; }
  .public-two-access .access-card { min-height: 240px; }
  .portal-identity { min-height: 300px; width: min(100%, 360px); }
  .portal-identity img { width: 158px; height: 158px; }
  .portal-identity strong { font-size: 27px; }
  .portal-feature-list b { font-size: 14px; }
}

/* سير العمل اليومي: pointage، خطط العلاج، المهام والفوترة من الجلسة */
.workflow-guidance {
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid #b8d9e7;
  border-inline-start: 4px solid var(--teal);
  border-radius: 16px;
  background: #f4fbfd;
  color: var(--ink);
}
.workflow-guidance strong { display:block; margin-bottom:4px; color:var(--navy); }
.workflow-guidance p { margin:0; color:var(--muted); line-height:1.7; }
.workflow-plan-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:14px; }
.workflow-plan-card { border:1px solid var(--line); border-radius:16px; padding:15px; background:var(--white); min-width:0; }
.workflow-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.workflow-card-head strong { color:var(--navy); display:block; }
.workflow-card-head small { color:var(--muted); display:block; margin-top:4px; line-height:1.55; }
.workflow-card-head > span { flex:0 0 auto; font-weight:800; color:var(--teal); background:#e8f6f3; border-radius:999px; padding:5px 9px; }
.workflow-progress { height:9px; margin:13px 0 10px; overflow:hidden; border-radius:999px; background:#e6edf2; }
.workflow-progress span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--teal),var(--blue)); }
.workflow-plan-meta { display:flex; gap:8px; flex-wrap:wrap; color:var(--muted); font-size:.84rem; }
.workflow-plan-meta span { background:#f4f7f9; border-radius:999px; padding:4px 8px; }
.workflow-plan-card > p { margin:10px 0 0; color:var(--muted); line-height:1.6; }
.workflow-task-list { display:grid; gap:10px; }
.workflow-task-card { display:flex; justify-content:space-between; gap:14px; align-items:center; border:1px solid var(--line); border-inline-start:4px solid #8aa0b4; border-radius:14px; padding:13px 15px; background:#fff; }
.workflow-task-card.priority-high { border-inline-start-color:#df8c27; }
.workflow-task-card.priority-urgent { border-inline-start-color:var(--red); background:#fff8f8; }
.workflow-task-card.priority-low { border-inline-start-color:#6aa7bd; }
.workflow-task-card strong,.workflow-task-card small { display:block; }
.workflow-task-card small { margin-top:4px; color:var(--muted); }
.workflow-task-card p { margin:7px 0 0; color:var(--muted); }
.person-plan-grid { margin-bottom:18px; }
.workflow-metrics { margin-bottom:18px; }
@media (max-width: 760px) {
  .workflow-plan-grid { grid-template-columns:1fr; }
  .workflow-task-card { align-items:flex-start; flex-direction:column; }
  .workflow-task-card .row-actions { width:100%; }
  .workflow-task-card .row-actions .mini-button { flex:1; }
  .workflow-guidance { padding:14px; }
}

/* finance, recouvrement and retrocessions */
.finance-overview-metrics { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
.finance-command-panel .panel-head > label { min-width: 170px; }
.finance-command-panel input[type="month"] { min-height: 42px; }
.aging-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 0 20px 20px; }
.aging-card { display: grid; gap: 5px; min-width: 0; padding: 14px; background: #f7fafc; border: 1px solid var(--line); border-radius: 14px; }
.aging-card span { color: var(--muted); font-size: 12px; }
.aging-card strong { color: var(--navy); font-size: 17px; }
.aging-card small { color: var(--muted); }
.aging-due_1_7 { border-inline-start: 4px solid #d89a24; }
.aging-due_8_30 { border-inline-start: 4px solid #d4751b; }
.aging-due_31_60 { border-inline-start: 4px solid #c24c35; }
.aging-due_61_plus { border-inline-start: 4px solid var(--red); background: #fff8f8; }
.finance-definition { margin: 0; padding: 0 20px 18px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.collections-panel .table-wrap small { display: block; max-width: 300px; color: var(--muted); line-height: 1.5; }
.overdue-badge { color: #8f2832; background: #fff1f2; border-color: #f0c4c8; }
.cash-metrics { margin-top: 18px; }
#collection-dialog textarea, #retrocession-dialog input, #retrocession-dialog select { width: 100%; }
@media (max-width: 980px) {
  .aging-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .aging-grid { grid-template-columns: 1fr 1fr; padding-inline: 14px; }
  .finance-command-panel .panel-head > label { width: 100%; min-width: 0; }
  .finance-overview-metrics { grid-template-columns: 1fr 1fr; }
  .collections-panel .table-wrap { overflow-x: auto; }
}

/* identity card, dossier documents, and A5 print balance */
.sidebar .brand { min-width:0; margin:0 0 28px; padding:12px; gap:10px; color:var(--navy); background:rgba(255,255,255,.96); border:1px solid rgba(255,255,255,.65); border-radius:22px; box-shadow:0 14px 34px rgba(2,23,40,.18); }
.sidebar .brand img { width:64px; height:64px; flex:0 0 64px; object-fit:contain; filter:none; }
.sidebar .brand strong { color:var(--navy); font-family:"Cairo CN",Cairo,sans-serif; font-size:17px; font-weight:800; }
.sidebar .brand small { color:#5b6b7f; font-size:11px; font-weight:600; }
.person-document-section { margin-top:18px; padding-top:16px; border-top:1px solid rgba(12,61,96,.13); }
.person-document-section .section-mini-head { align-items:flex-start; }
.person-finance-tool-grid { margin:12px 0; }
.person-document-list article { grid-template-columns:minmax(0,1fr) auto; align-items:center; }
.person-document-list .row-actions { grid-column:1/-1; justify-content:flex-end; }
.finance-document > .finance-letterhead { min-height:36mm; align-items:flex-start; }
.finance-brand-image { width:29mm; height:29mm; flex-basis:29mm; }
.finance-brand-meta { padding-top:1.5mm; gap:1mm; }
.finance-brand-title { font-size:14px; }
.finance-brand-subtitle,.finance-brand-link { font-size:9.5px; }
.finance-inpe { flex-basis:40mm; padding-top:1.5mm; }
.finance-inpe img { width:40mm; max-height:21mm; }
.finance-date { margin-top:3mm; margin-bottom:5mm; }
.finance-document-body > h2 { margin-bottom:6mm; }
.finance-fields > div { grid-template-columns:43mm 1fr; min-height:6.2mm; }
.finance-fields dd { border-bottom-color:rgba(28,65,105,.22); }
.finance-fields-compact { margin-top:3mm; }
.session-calendar-document .session-date-grid { display:grid; grid-template-columns:1fr 1fr; gap:2mm 10mm; margin:6mm 0 0; padding:0; list-style-position:inside; }
.session-calendar-document .session-date-grid li { min-height:6mm; padding:1mm 0; border-bottom:1px solid rgba(28,65,105,.18); }
.finance-receipt .finance-watermark { display:block; }
@media (max-width:620px){ .sidebar .brand{margin:0;padding:8px 10px;border-radius:18px}.sidebar .brand img{width:52px;height:52px;flex-basis:52px}.person-finance-tool-grid{grid-template-columns:1fr} }

/* immutable signed clinical records and dated addenda */
.clinical-lock-note { display:block; margin-top:5px; color:#1f6e5e !important; font-weight:800; line-height:1.45; }
.clinical-card > footer,.session-card > footer { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.clinical-addenda { margin-top:12px; padding:12px; border:1px solid #bdddd4; border-inline-start:4px solid var(--teal); border-radius:12px; background:#f2faf7; }
.clinical-addenda > header { display:flex; align-items:center; justify-content:space-between; gap:8px; color:var(--navy); }
.clinical-addenda > header span { min-width:25px; min-height:25px; display:inline-grid; place-items:center; border-radius:50%; background:#dcefe9; color:#165e50; font-weight:800; }
.clinical-addenda ol { margin:10px 0 0; padding-inline-start:20px; display:grid; gap:9px; }
.clinical-addenda li { padding:10px; border:1px solid rgba(22,94,80,.14); border-radius:10px; background:#fff; }
.clinical-addenda li > div { display:flex; justify-content:space-between; gap:10px; }
.clinical-addenda li b { color:var(--teal); }
.clinical-addenda li small { color:var(--muted); }
.clinical-addenda li p { margin-top:7px; padding:0; background:transparent; }
.clinical-print-addenda { margin-top:9px; padding:9px 11px; border:1px solid #a8cfc4; border-inline-start:3px solid #277d6d; background:#f3faf7; break-inside:avoid; }
.clinical-print-addenda h4 { margin:0 0 6px; color:#165e50; }
.clinical-print-addenda article + article { margin-top:7px; padding-top:7px; border-top:1px solid #d5e9e3; }
.clinical-print-addenda article p { margin:3px 0 0; white-space:pre-wrap; }
@media (max-width:620px){ .clinical-card > footer,.session-card > footer,.clinical-addenda li > div{align-items:flex-start;flex-direction:column} }

/* Advanced clinical record */
.dossier-safety,.clinical-episodes,.unified-clinical-timeline{margin:0 0 18px;padding:16px;background:#fbfcfb;border:1px solid var(--line);border-radius:16px}
.dossier-safety>header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px}
.dossier-safety>header h3{margin:2px 0 0;color:var(--navy);font-size:15px}
.dossier-safety>header>span,.clinical-list-alert{display:inline-grid;min-width:26px;min-height:26px;place-items:center;color:#8e1e29;background:#fff0f1;border:1px solid #efbec3;border-radius:999px;font-size:9px;font-weight:900}
.dossier-safety.has-active-alerts{background:#fffafa;border-color:#edc2c6;box-shadow:0 8px 24px rgba(142,30,41,.07)}
.dossier-alert-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.dossier-alert{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:12px;background:white;border:1px solid #e0e8e6;border-inline-start:5px solid #6f8785;border-radius:11px}
.dossier-alert-warning{border-inline-start-color:#d1a541;background:#fffbf1}.dossier-alert-critical{border-inline-start-color:#c52f3c;background:#fff5f6}.dossier-alert-info{border-inline-start-color:var(--teal);background:#f2faf7}
.dossier-alert span,.dossier-alert strong,.dossier-alert small{display:block}.dossier-alert span{color:var(--muted);font-size:8px}.dossier-alert strong{margin-top:3px;color:var(--navy);font-size:11px}.dossier-alert p{margin:5px 0;color:#3d5557;font-size:9px;line-height:1.65;white-space:pre-wrap}.dossier-alert small{color:var(--muted);font-size:7px}
.clinical-safe-state{grid-column:1/-1;margin:0;padding:12px;color:#17634f;background:#e9f7f2;border-radius:10px;font-size:9px}
.dossier-safety details{margin-top:10px;color:var(--muted);font-size:9px}.resolved-alert-list{display:grid;gap:6px;margin:8px 0 0;padding:0;list-style:none}.resolved-alert-list li{display:grid;grid-template-columns:1fr 2fr auto;gap:8px;padding:9px;background:white;border-radius:9px}.resolved-alert-list strong{color:var(--navy)}
.clinical-episode-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.clinical-episode-card{padding:13px;background:white;border:1px solid #cfe0dc;border-top:4px solid var(--teal);border-radius:12px}.clinical-episode-card.episode-closed,.clinical-episode-card.episode-cancelled{border-top-color:#849695;background:#f7f9f8}.clinical-episode-card>header,.clinical-episode-card>footer{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.clinical-episode-card header span{color:var(--teal);font-size:8px;font-weight:900}.clinical-episode-card h4{margin:3px 0 0;color:var(--navy);font-size:12px}.clinical-episode-card header strong,.clinical-episode-card footer span{color:var(--muted);font-size:8px}.clinical-episode-card>p{margin:10px 0;padding:9px;background:#f5f8f7;border-radius:8px;font-size:9px;white-space:pre-wrap}.clinical-episode-card>aside{margin-top:9px;padding:9px;color:#3c5655;background:#eef5f3;border-radius:8px;font-size:8px;white-space:pre-wrap}.clinical-episode-card>aside b{display:block;margin-bottom:3px;color:var(--teal)}
.clinical-episode-link,.clinical-unclassified{display:block;width:max-content;margin-top:5px;padding:4px 7px;border-radius:999px;font-size:7px!important}.clinical-episode-link{color:#11654f!important;background:#e4f4ee}.clinical-unclassified{color:#6a7677!important;background:#edf0ef}
.unified-clinical-timeline{margin-top:20px}.unified-clinical-timeline>ol{position:relative;display:grid;gap:0;margin:0;padding:0;list-style:none}.clinical-timeline-item{display:grid;grid-template-columns:18px 1fr;gap:10px;min-width:0}.clinical-timeline-item>span{position:relative}.clinical-timeline-item>span::before{content:"";position:absolute;inset-inline-start:7px;top:0;bottom:0;width:2px;background:#d8e4e1}.clinical-timeline-item>span::after{content:"";position:absolute;inset-inline-start:3px;top:16px;width:10px;height:10px;background:var(--teal);border:2px solid white;border-radius:50%;box-shadow:0 0 0 1px #b8cec8}.clinical-timeline-item>div{margin-bottom:8px;padding:11px 13px;background:white;border:1px solid #e1e8e6;border-radius:11px}.clinical-timeline-item header{display:flex;justify-content:space-between;gap:10px}.clinical-timeline-item header strong{color:var(--teal);font-size:8px}.clinical-timeline-item time,.clinical-timeline-item small{color:var(--muted);font-size:7px}.clinical-timeline-item h4{margin:5px 0 0;color:var(--navy);font-size:10px}.clinical-timeline-item p{margin:5px 0;color:#536b69;font-size:8px;line-height:1.6;white-space:pre-wrap}.timeline-safety_alert_created>span::after{background:#c52f3c}.timeline-safety_alert_resolved>span::after{background:#169f70}.timeline-session>span::after{background:var(--gold)}
@media(max-width:760px){.dossier-alert-grid,.clinical-episode-grid{grid-template-columns:1fr}.resolved-alert-list li{grid-template-columns:1fr}.dossier-alert,.clinical-episode-card>header,.clinical-episode-card>footer{flex-direction:column}.clinical-record-head .module-actions{width:100%}}

/* smart agenda availability and operational slot suggestions */
.smart-availability { margin-top:16px; padding:16px; border:1px solid #bddbd3; border-radius:16px; background:#f5fbf9; }
.smart-availability > header { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.smart-availability h3 { margin:2px 0 0; color:var(--navy); font-size:18px; }
.smart-availability .form-hint { margin:8px 0 12px; }
.smart-availability-empty,.smart-requested { margin:0; padding:11px 13px; border-radius:11px; color:var(--muted); background:#fff; border:1px solid var(--line); }
.smart-success { color:#165e50; background:#e7f6f1; border-color:#b9ded3; }
.smart-warning { color:#8a4f14; background:#fff7e8; border-color:#ebd5ac; }
.agenda-suggestion-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; margin-top:10px; }
.agenda-suggestion { position:relative; display:grid; gap:4px; min-width:0; padding:12px; color:var(--ink); text-align:start; background:#fff; border:1px solid #cbd9e4; border-radius:13px; cursor:pointer; }
.agenda-suggestion:hover,.agenda-suggestion:focus-visible { border-color:var(--teal); box-shadow:0 0 0 3px rgba(39,125,109,.12); outline:0; }
.agenda-suggestion.recommended { border-color:#69ad9e; background:#f0faf7; }
.agenda-suggestion.selected { border-color:var(--navy); box-shadow:0 0 0 3px rgba(12,61,96,.14); }
.agenda-suggestion span,.agenda-suggestion small { color:var(--muted); font-size:11px; }
.agenda-suggestion strong { overflow:hidden; color:var(--navy); text-overflow:ellipsis; white-space:nowrap; }
.agenda-suggestion em { position:absolute; inset-block-start:9px; inset-inline-end:9px; padding:3px 7px; color:#166253; background:#dff2ec; border-radius:999px; font-size:9px; font-style:normal; font-weight:800; }
.smart-advisory { display:block; margin-top:10px; color:var(--muted); line-height:1.55; }
@media (max-width:820px){ .agenda-suggestion-grid{grid-template-columns:1fr 1fr} }
@media (max-width:560px){ .smart-availability>header{flex-direction:column}.agenda-suggestion-grid{grid-template-columns:1fr}.smart-availability #check-availability{width:100%} }

.clinical-print-safety{margin:18px 0;padding:14px;background:#fff9f9;border:1px solid #edc2c6;border-radius:10px;break-inside:avoid}.clinical-print-safety h2{margin:0 0 9px;color:#8e1e29;font-size:14px}.clinical-print-safety article{margin-top:7px;padding:9px;background:white;border-inline-start:4px solid #d1a541;border-radius:7px}.clinical-print-safety .print-safety-critical{border-inline-start-color:#c52f3c}.clinical-print-safety p{margin:4px 0;font-size:9px}.clinical-print-safety small{color:var(--muted);font-size:8px}.clinical-print-episode{margin-top:9px;padding:11px;background:#f5f8f7;border:1px solid #d9e5e2;border-radius:8px;break-inside:avoid}.clinical-print-episode header{display:flex;justify-content:space-between;gap:10px}.clinical-print-episode header strong{color:var(--navy)}.clinical-print-episode header span{color:var(--teal);font-size:9px}.clinical-print-episode p{margin:5px 0 0;font-size:9px;white-space:pre-wrap}

/* assurance, tiers payant and daily cash reconciliation */
.insurance-command-panel,.cash-reconciliation-panel{margin-top:18px;border-top:4px solid var(--teal)}
.insurance-command-panel .panel-head,.cash-reconciliation-panel .panel-head{align-items:flex-start;flex-wrap:wrap}
.finance-insurance-metrics,.cash-reconciliation-metrics{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));margin:0;padding:0 20px 20px}
.finance-details{margin:0 20px 20px;border:1px solid var(--line);border-radius:14px;background:#fbfcfc;overflow:hidden}
.finance-details summary{padding:13px 15px;color:var(--navy);font-weight:800;cursor:pointer}
.finance-details[open] summary{border-bottom:1px solid var(--line);background:#f3f8f7}
.cash-movement-list{padding:0 20px 18px}
.cash-movement-list article{grid-template-columns:minmax(0,1fr) auto;direction:ltr;text-align:left}
.cash-movement-list article small{grid-column:1/-1}
.cash-movement-void{opacity:.55;text-decoration:line-through}
.choice-row{display:flex;gap:18px;flex-wrap:wrap;margin:12px 0;padding:12px;background:#f4f8f7;border-radius:12px}
.choice-row label{display:flex;align-items:center;gap:8px}
#payer-dialog input,#payer-dialog select,#payer-dialog textarea,#coverage-dialog input,#coverage-dialog select,#coverage-dialog textarea,#claim-dialog input,#claim-dialog select,#claim-dialog textarea,#claim-status-dialog input,#claim-status-dialog select,#claim-status-dialog textarea,#cash-movement-dialog input,#cash-movement-dialog select,#cash-closure-dialog input,#cash-closure-dialog textarea{width:100%}
@media(max-width:720px){.finance-insurance-metrics,.cash-reconciliation-metrics{grid-template-columns:1fr 1fr;padding-inline:14px}.finance-details,.cash-movement-list{margin-inline:14px;padding-inline:0}.insurance-command-panel .module-actions,.cash-reconciliation-panel .module-actions{width:100%}.insurance-command-panel .module-actions>* ,.cash-reconciliation-panel .module-actions>*{flex:1}}

/* secure pre-visit self-service */
.self-service-panel{border-top:4px solid var(--teal)}
.space-appointment-actions{display:grid;justify-items:end;gap:8px}
.space-request{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:14px;background:#f5f9f8;border:1px solid #dce9e6;border-radius:14px}
.space-request strong,.space-request small{display:block}.space-request small{margin-top:4px;color:var(--muted)}.space-request p{margin:8px 0;color:#3d5557;white-space:pre-wrap}
.space-self-service-details{margin-bottom:16px;padding:14px;background:#f6faf9;border:1px solid #d7e7e2;border-radius:14px}
.space-self-service-details summary{color:var(--navy);font-family:"Cairo CN",Cairo,sans-serif;font-weight:800;cursor:pointer}
.space-intake-form,.space-upload-form,.consent-form{display:grid;gap:12px;margin-top:14px}
.space-intake-form label,.space-upload-form label,.consent-form label{display:grid;gap:6px;color:var(--ink);font-weight:700}
.space-intake-form input,.space-intake-form select,.space-intake-form textarea,.space-upload-form input,.space-upload-form select,.consent-form input,.self-service-dialog input,.self-service-dialog select,.self-service-dialog textarea{width:100%}
.warning-signs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;padding:14px;border:1px solid var(--line);border-radius:13px}
.warning-signs legend{padding-inline:7px;color:var(--navy);font-weight:800}.warning-signs label{display:flex;grid-template-columns:auto 1fr;align-items:center;gap:8px;font-weight:500}.warning-signs input{width:auto}
.consent-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.consent-card{display:grid;align-content:space-between;gap:12px;padding:14px;background:white;border:1px solid #d9e5e2;border-radius:14px}.consent-card.is-accepted{background:#f0faf6;border-color:#b9ded3}.consent-card strong{color:var(--navy)}.consent-card p{color:var(--muted);font-size:12px;line-height:1.7}.consent-card small{color:#17634f;font-weight:700}
.consent-confirm{display:flex!important;grid-template-columns:auto 1fr!important;align-items:center;gap:8px!important}.consent-confirm input{width:auto!important}
.space-upload-form{margin:0 0 15px;padding:13px;background:#f6faf9;border-radius:13px}
.self-service-dialog{width:min(620px,calc(100% - 28px));max-height:calc(100vh - 36px);padding:0;color:var(--ink);background:white;border:0;border-radius:22px;box-shadow:0 24px 90px rgba(4,29,37,.28)}
.self-service-dialog::backdrop{background:rgba(4,29,37,.64);backdrop-filter:blur(3px)}.self-service-dialog form{display:grid;gap:16px;padding:24px}
.self-service-admin{margin-top:18px;padding:16px;background:#f7faf9;border:1px solid #dbe8e5;border-radius:16px}.self-service-admin>header{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:12px}.self-service-admin h3{margin:2px 0 0;color:var(--navy)}
.self-service-admin-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.self-service-admin-card{padding:12px;background:white;border:1px solid var(--line);border-radius:12px}.self-service-admin-card header{display:flex;justify-content:space-between;gap:8px}.self-service-admin-card p{white-space:pre-wrap}.self-service-admin-card footer{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:7px}
@media(max-width:760px){.consent-grid,.warning-signs,.self-service-admin-grid{grid-template-columns:1fr}.space-request,.space-appointment-actions{align-items:stretch}.space-request{flex-direction:column}.space-appointment-actions{grid-column:1/-1;justify-items:stretch}.space-appointment-actions .mini-button{text-align:center}}

/* V3.9 — journal quotidien des séances, règlements et couvertures */
.daily-register-panel{border-top:4px solid var(--teal)}
.daily-register-panel .panel-head{align-items:flex-start;flex-wrap:wrap}
.daily-register-metrics{grid-template-columns:repeat(auto-fit,minmax(145px,1fr))}
.daily-register-filter{display:grid;grid-template-columns:130px repeat(3,minmax(150px,1fr)) minmax(190px,1.25fr) auto;gap:10px;align-items:end;padding:16px 20px;border-block:1px solid var(--line);background:#f7faf9}
.daily-register-filter label{display:grid;gap:6px;color:var(--navy);font-size:12px;font-weight:800}
.daily-register-filter input,.daily-register-filter select{width:100%}
.daily-register-table th,.daily-register-table td{vertical-align:top}
.daily-register-table td small{display:block;margin-top:4px;color:var(--muted);font-size:10px;line-height:1.45}
.register-settled{color:#0e624a!important;background:#dff4eb!important;border-color:#b8dfd1!important}
.register-pending{color:#82510e!important;background:#fff2d8!important;border-color:#ebd19f!important}
.register-unpaid{color:#a62331!important;background:#fde9eb!important;border-color:#efbec4!important}
.register-review{color:#555f69!important;background:#edf1f3!important;border-color:#d6dde1!important}
.register-linked-payment{display:grid;gap:4px;padding:12px 14px;color:#1b594d;background:#eef9f5;border:1px solid #c8e5db;border-radius:13px}
.register-linked-payment small{color:var(--muted)}
.daily-register-fieldset{margin:0;padding:16px;border:1px solid var(--line);border-radius:15px;background:#f8fbfa}
.daily-register-fieldset legend{padding-inline:8px;color:var(--navy);font-weight:800}
.daily-register-fieldset.is-disabled{opacity:.6}
.register-balance{display:grid;align-content:center;gap:5px;min-height:68px;padding:10px 12px;background:#eaf7f2;border:1px solid #b8dccf;border-radius:11px}
.register-balance span{color:var(--muted);font-size:11px;font-weight:800}
.register-balance strong{color:#155d4e;font-size:12px;line-height:1.5}
.register-balance.invalid{background:#fff1f1;border-color:#e9b8be}.register-balance.invalid strong{color:#9b2531}
#daily-register-dialog form{gap:15px}
#daily-register-dialog input,#daily-register-dialog select,#daily-register-dialog textarea{width:100%}
@media(max-width:1120px){.daily-register-filter{grid-template-columns:repeat(3,minmax(0,1fr))}.daily-register-filter .button{width:100%}}
@media(max-width:720px){.daily-register-filter{grid-template-columns:1fr;padding:14px}.daily-register-panel .module-actions{width:100%}.daily-register-panel .module-actions>*{flex:1}.daily-register-metrics{grid-template-columns:1fr 1fr}}

@media (max-width: 620px) {
  .space-account-page .header-inner { min-height: 68px; flex-wrap: wrap; gap: 8px 10px; padding-block: 8px; }
  .space-account-page .brand { min-width: 0; flex: 1 1 175px; }
  .space-account-page .brand span { min-width: 0; }
  .space-account-page .brand strong, .space-account-page .brand small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .space-account-actions { min-width: 0; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  [dir="rtl"] .space-account-actions { justify-content: flex-start; }
  .space-account-actions .language-switcher { flex: 0 0 auto; }
  .space-account-actions .space-logout { flex: 0 0 auto; white-space: nowrap; }
}

/* V4.1.0 — saisie sécurisée du mot de passe */
.password-field{display:grid;grid-template-columns:minmax(0,1fr) 3.25rem;align-items:stretch;gap:.45rem;direction:ltr}.password-field>input{min-width:0;width:100%}.password-toggle{border:1px solid #c9d7e3;border-radius:14px;background:#f6f9fb;color:#07365f;font:inherit;font-size:1.15rem;cursor:pointer;min-height:48px}.password-toggle:hover,.password-toggle:focus-visible{background:#eaf2f7;outline:2px solid #8cb5d8;outline-offset:2px}.password-toggle[aria-pressed="true"]{background:#e4f4f0;color:#0b735f}.password-field input[type="text"]{font-family:inherit}
