/* HADER unified clinical identity */
html[data-balsam]{--ink:#103c50;--muted:#426575;--paper:#e8f8fa;--surface:#fff;--forest:#06435b;--jade:#008c9f;--stroke:#bce3eb;--wash:#e9fcff;--accent:#087c96;--tint:#e6f9fc;--hero-start:#03405b;--hero-end:#07849c;--radius:20px;--shadow:0 7px 24px #03435b12}
html[data-balsam] body{background:radial-gradient(ellipse at 5% 0%,#9be1eb90,transparent 34rem),linear-gradient(145deg,#e8fbff,#f8fdff 53%,#e3f6fa)!important}
html[data-balsam] :is(body>header,.topbar){background:linear-gradient(125deg,#04374e,#075f7b)!important;border-bottom:1px solid #6ed6e4!important;color:#fff!important}
html[data-balsam] :is(body>header,.topbar) :is(.brand,.brand h2,.brand strong,.brand-sub,.brand small,.brand p,.top-note),html[data-balsam] body>header>div>p{color:#fff!important}
html[data-balsam] :is(body>header,.topbar) :is(a.top-link,a.patient-home-link){color:#e5faff!important;background:#ffffff12!important;border:1px solid #92dce744!important}
html[data-balsam] :is(.brand-mark,.logo){background:linear-gradient(155deg,#12b5c4,#04718b,#033e58)!important;color:#fff!important;border:1px solid #96edf5!important}
html[data-balsam] :is(.hero,.welcome){background:radial-gradient(ellipse at 12% 100%,#36d2d7aa,transparent 42%),linear-gradient(125deg,#087e99,#03435e 65%)!important;border:1px solid #9adfeb!important}
html[data-balsam] :is(.hero,.welcome)::before{border-color:#b4ffff55;box-shadow:0 0 0 35px #ffffff0b,0 0 0 72px #ffffff09}
html[data-balsam] :is(.card,.workspace-panel,.panel,.chart-card,.doctor-card,.appointment,.section-card,.admin-record-card,.center-card,.doctor,.service-card,.rep,.visitbox,.slot){border:1px solid #c1e5ec!important;background:linear-gradient(155deg,#fff,#f4fcfe)!important;border-radius:20px!important;box-shadow:0 7px 23px #03455d0d!important;min-width:0;overflow-wrap:anywhere}
html[data-balsam] :is(.stat,.stats .stat,.admin-mini-stat,.info-item){background:linear-gradient(150deg,#f5feff,#d5f4fa)!important;border:1px solid #b5e5ed!important;border-radius:17px!important}
html[data-balsam] :is(.stat-value,.stat strong){color:#006a86!important}
html[data-balsam] :is(.portal,.portal-card){background:linear-gradient(145deg,#edfcff,#caeff4)!important;border:1px solid #fff!important;box-shadow:0 7px 20px #075d7220!important}
html[data-balsam] :is(.portal-icon,.section-icon){background:linear-gradient(145deg,#dafaff,#a4e3f0)!important;color:#006c89!important;border:1px solid #fff!important}
html[data-balsam] :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea){border:1px solid #a9d3de!important;background:#fff!important;color:#103c50!important;max-width:100%;min-width:0}
html[data-balsam] :is(button,.btn){min-height:44px}
html[data-balsam] :is(.actions,.header-actions,.top-actions){flex-wrap:wrap;gap:8px}
html[data-balsam] :is(.table-wrap,.table-container){max-width:100%;overflow:auto}
html[data-balsam] :is(.medical-history-form,.medical-record-form,.rep-form-grid,.center-grid,.profile-grid){min-width:0}
.hader-pending-only .appointment:not([data-appointment-status="pending"]){display:none!important}
.hader-pending-only:not(:has(.appointment[data-appointment-status="pending"]))::after{content:"لا توجد طلبات بانتظار الموافقة حالياً.";display:block;padding:18px;border:1px dashed #abd9e4;border-radius:14px;background:#f0fbfd;color:#386171}
html[data-balsam] .hader-role-nav{position:fixed!important;z-index:45;bottom:max(10px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(850px,calc(100% - 20px));display:flex!important;align-items:stretch;gap:4px;padding:6px!important;margin:0!important;background:linear-gradient(130deg,#075c78,#04374e)!important;border:1px solid #87e7ef!important;border-radius:22px!important;box-shadow:0 7px 28px #003a5b55!important}
html[data-balsam] .hader-role-nav[hidden]{display:none!important}
html[data-balsam] .hader-role-nav button{display:flex;flex:1;flex-direction:column;justify-content:center;align-items:center;gap:4px;min-width:0;min-height:58px;margin:0!important;padding:5px 2px!important;background:transparent!important;border:1px solid transparent!important;color:#fff!important;border-radius:16px!important;font-size:clamp(.70rem,2.7vw,.92rem)!important;line-height:1.35;text-align:center}
html[data-balsam] .hader-role-nav button.active{background:linear-gradient(145deg,#12a8b8,#00778e)!important;border-color:#97faff!important}
.hader-nav-icon{display:block;line-height:0}.hader-nav-icon svg{width:24px;height:24px}
body.hader-role-ready main{padding-bottom:calc(100px + env(safe-area-inset-bottom))!important}
.hader-role-menu{width:min(520px,calc(100% - 20px));max-height:85dvh;overflow:auto;border:1px solid #91e6ef;border-radius:24px;padding:18px;background:linear-gradient(145deg,#effdff,#c9eff5);color:#103c50;margin:auto auto max(12px,env(safe-area-inset-bottom));box-shadow:0 18px 60px #00354d55}
.hader-role-menu::backdrop{background:#032e44aa}.hader-role-menu h2{margin:0 0 15px}
.hader-role-menu-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
html[data-balsam] .hader-role-menu button{background:#fff!important;color:#07556b!important;border:1px solid #b5e0e7!important;min-height:46px;margin:0!important;padding:9px!important}
html[data-balsam] .hader-role-menu button.hader-logout{color:#9c2d35!important;background:#fff0f0!important}
body.hader-role-ready .workspace-panel{scroll-margin-top:90px}
@media(max-width:760px){html[data-balsam] body.hader-role-ready .dashboard-layout{grid-template-columns:minmax(0,1fr)!important;display:block!important}html[data-balsam] :is(.workspace,.dashboard,.rep-layout){min-width:0;max-width:100%}html[data-balsam] :is(.rep-layout,.dashboard){grid-template-columns:minmax(0,1fr)!important}html[data-balsam] :is(.day,.rep-form-grid){grid-template-columns:repeat(auto-fit,minmax(min(100%,130px),1fr))!important}html[data-balsam] body>header{gap:8px;flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){html[data-balsam] *{scroll-behavior:auto!important;transition:none!important}}