/* HADER • clinical design system / 2026-11-29
   Presentation only: keep existing DOM, IDs, role checks and event handlers. */
html[data-balsam] {
  color-scheme:light;
  --ink:#132f40;--muted:#536b77;--paper:#f1f6f8;--surface:#ffffff;
  --forest:#103c42;--jade:#08786b;--stroke:#d7e5e8;--wash:#e7f5f1;
  --accent:#08786b;--tint:#e7f5f1;--hero-start:#103b44;--hero-end:#08786b;
  --gold:#966b25;--bs-ink:var(--ink);--bs-muted:var(--muted);--bs-line:var(--stroke);
  --bs-deep:var(--forest);--bs-teal:var(--accent);--bs-paper:var(--paper);
  --shadow:0 10px 30px #183b4810;--radius:20px;
}
html[data-balsam=clinic]{--accent:#176187;--tint:#eaf3fa;--hero-start:#142f49;--hero-end:#176187}
html[data-balsam=business]{--accent:#65528b;--tint:#f0edf7;--hero-start:#302c4c;--hero-end:#65528b}
html[data-balsam=urgent]{--accent:#a14038;--tint:#fff0eb;--hero-start:#512a35;--hero-end:#9c4038}
html[data-balsam=admin]{--accent:#334e75;--tint:#ecf1f7;--hero-start:#162b46;--hero-end:#334e75}
[data-balsam] body{
  color:var(--ink)!important;
  background:radial-gradient(ellipse at 100% 0%,#dcece9 0%,transparent 36rem),var(--paper)!important;
  font-family:system-ui,"Segoe UI",Tahoma,Arial,sans-serif!important;
  line-height:1.7;font-size:16px;
}
[data-balsam] :is(h1,h2,h3,h4){letter-spacing:normal;line-height:1.45;text-wrap:balance}
[data-balsam] :is(h2,h3,h4){color:var(--ink)}
[data-balsam] :is(.muted,.small,.sub,.brand-sub,.top-note){color:var(--muted)!important}
[data-balsam] :is(header,.topbar){
  background:#fff!important;border-bottom:1px solid var(--stroke)!important;
  box-shadow:0 3px 16px #132f4009!important;backdrop-filter:none!important;
}
[data-balsam] :is(.brand,.brand strong,.brand h2,.section-heading h2){color:var(--forest)!important}
[data-balsam] :is(.brand-mark,.logo){
  color:white!important;background:linear-gradient(145deg,var(--accent),var(--hero-start))!important;
  border-radius:16px!important;box-shadow:0 5px 14px #123b3520!important;
}
[data-balsam] .brand-copy small{letter-spacing:.22em;color:var(--accent)!important}
[data-balsam] :is(.hero,.welcome){
  position:relative;isolation:isolate;overflow:hidden;
  color:#fff!important;border:1px solid #ffffff21!important;border-radius:26px!important;
  background:
    radial-gradient(circle at 12% 18%,#ffffff19 0,transparent 38%),
    radial-gradient(circle at 2% 110%,#ffffff12 0,transparent 46%),
    linear-gradient(112deg,var(--hero-end),var(--hero-start) 76%)!important;
  box-shadow:0 16px 34px #15344220!important;
  padding:clamp(26px,4vw,52px)!important;text-align:start;
}
[data-balsam] :is(.hero,.welcome)::before{
  content:"";position:absolute;z-index:-1;inset:-120px auto auto -110px;
  width:340px;height:340px;border:1px solid #ffffff33;border-radius:50%;
  background:transparent;box-shadow:0 0 0 35px #ffffff09,0 0 0 72px #ffffff07;pointer-events:none;
}
[data-balsam] :is(.hero,.welcome)::after{display:none!important}
[data-balsam] :is(.hero,.welcome) :is(h1,h2,h3,p,.hero-tag,.hero-kicker){color:#fff!important}
[data-balsam] :is(.hero,.welcome) p{color:#e6f4f3!important;line-height:1.85;font-size:clamp(.92rem,1.5vw,1.1rem)!important}
[data-balsam] .hero-content{width:100%;max-width:100%}
[data-balsam] .hero-art,[data-balsam] .hero-icon{display:none!important}
[data-balsam=home] .hero{
  min-height:clamp(260px,28vw,360px);display:grid;align-content:center;
  padding-inline-end:38%!important;
}
[data-balsam=home] .hero::after{
  content:"";display:block!important;position:absolute;z-index:-1;
  inset:0 auto 0 0;width:39%;height:100%;pointer-events:none;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 340'%3E%3Cg fill='none' stroke='%23d0f6e8'%3E%3Ccircle cx='205' cy='170' r='134' opacity='.2' stroke-width='1.4'/%3E%3Ccircle cx='205' cy='170' r='106' opacity='.32' stroke-width='1.4'/%3E%3Crect x='122' y='87' width='166' height='166' rx='47' transform='rotate(-12 205 170)' fill='%23ffffff' fill-opacity='.075' stroke-opacity='.35'/%3E%3Cpath d='M205 235 C182 211 148 191 148 159 C148 130 181 121 205 148 C229 121 262 130 262 159 C262 191 228 211 205 235Z' stroke-width='6' stroke-linejoin='round'/%3E%3Cpath d='M149 181h30l14-27 17 49 14-22h37' stroke='%2395e9cf' stroke-width='5' stroke-linejoin='round' stroke-linecap='round'/%3E%3Cpath d='M82 79v22m-11-11h22M322 236v26m-13-13h26' stroke-width='3' stroke-linecap='round' opacity='.6'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat;
}
[data-balsam=home] .hero h1{font-size:clamp(2.2rem,5vw,4.1rem)!important;line-height:1.24;margin:0 0 12px!important}
[data-balsam=home] .section-heading{margin-block:clamp(1.8rem,4vw,3.1rem) 1rem}
[data-balsam=home] .portal-grid{
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:16px!important
}
[data-balsam] :is(.portal,.portal-card){
  background:#fff!important;border:1px solid var(--stroke)!important;
  border-radius:var(--radius)!important;box-shadow:var(--shadow)!important;
  color:var(--ink)!important;transition:border-color .16s,box-shadow .16s,transform .16s!important;
}
[data-balsam=home] .portal{
  min-height:166px!important;padding:20px!important;text-align:start!important;min-width:0;
  position:relative;gap:4px;justify-content:flex-start;
}
[data-balsam=home] .portal[href="patients.html"]{
  background:linear-gradient(140deg,#103b44,#08786b)!important;
  border-color:#08786b!important;color:white!important;
}
[data-balsam=home] .portal[href="patients.html"] :is(h3,p){color:white!important}
[data-balsam=home] .portal[href="patients.html"] .portal-icon{background:#ffffff20!important;color:white!important}
[data-balsam=home] .portal[href*="emergency"]{--accent:#a14038;--tint:#fff0eb}
[data-balsam=home] .portal[href*="doctor"],[data-balsam=home] .portal[href*="center"]{--accent:#176187;--tint:#eaf3fa}
[data-balsam=home] .portal[href*="representative"]{--accent:#65528b;--tint:#f0edf7}
[data-balsam] .portal-icon{
  width:54px;height:54px;background:var(--tint)!important;color:var(--accent)!important;
  border:0!important;border-radius:17px!important;box-shadow:none!important
}
[data-balsam=home] .portal h3{font-size:1.08rem!important;color:var(--ink)!important;line-height:1.45}
[data-balsam=home] .portal p{font-size:.85rem!important;color:var(--muted)!important}
@media(hover:hover){
  [data-balsam] :is(.portal,.portal-card):hover{transform:translateY(-3px)!important;border-color:var(--accent)!important;box-shadow:0 13px 32px #173b451a!important}
}
[data-balsam] :is(.card,.login-box,.login-card,.auth-card,.authCard,.workspace-panel,.panel,.chart-card,.doctor-card,.appointment,.section-card,.admin-record-card,.mc-center-card,.rep,.visitbox,.slot,.info-box,.center-card,.doctor,.service-card){
  background:#fff!important;border:1px solid var(--stroke)!important;
  border-radius:var(--radius)!important;box-shadow:var(--shadow)!important
}
[data-balsam] :is(.card,.panel,.login-card,.workspace-panel)>:is(h2,h3):first-child{
  border-inline-start:4px solid var(--accent);padding-inline-start:.7rem;
}
[data-balsam] :is(.stat,.stats .stat,.admin-mini-stat){
  background:linear-gradient(150deg,#fff,var(--tint))!important;
  border:1px solid var(--stroke)!important;border-radius:16px!important;box-shadow:0 4px 15px #173b4508!important
}
[data-balsam] .stat-value{color:var(--accent)!important;font-variant-numeric:tabular-nums}
[data-balsam] :is(button,.btn){
  background:var(--accent)!important;color:white!important;
  border:1px solid transparent!important;border-radius:12px!important;
  box-shadow:none!important;font-weight:700!important;
  transition:background .15s,opacity .15s,box-shadow .15s!important
}
[data-balsam] :is(button.secondary,.btn-light,.secondary,.light,.tab:not(.active),.picker-cancel,.portal-back){
  background:var(--tint)!important;color:var(--accent)!important;border-color:var(--stroke)!important;
}
[data-balsam] :is(button.btn-danger,button.btn-red,button.reject,button.reject-btn,button.logout,button.suspend,.btn-danger,.btn-red){
  background:#a13937!important;color:white!important
}
[data-balsam] :is(button.approve-btn,.btn-success){background:#08765c!important;color:white!important}
[data-balsam] :is(.doctor-toggle,.portal-card){background:#fff!important;color:var(--ink)!important}
[data-balsam] .doctor-toggle{border:0!important;box-shadow:none!important;min-height:0}
[data-balsam] :is(.tabs,.doctor-nav) button.active,[data-balsam] .side-link.active{
  background:var(--accent)!important;color:white!important
}
[data-balsam] :is(button,.btn):disabled{opacity:.48!important;cursor:not-allowed;transform:none!important}
[data-balsam] :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),textarea,select){
  border:1px solid #b7cbd1!important;border-radius:12px!important;
  background:#fbfdfe!important;color:var(--ink)!important;
}
[data-balsam] :is(input,select,textarea)::placeholder{color:#627985!important}
[data-balsam] :is(a,button,input,select,textarea):focus-visible{outline:3px solid #b47a2e!important;outline-offset:3px}
[data-balsam] :is(input,textarea,select):focus{border-color:var(--accent)!important;box-shadow:0 0 0 3px #08786b20!important}
[data-balsam] :is(.table-wrap,.table-container){border:1px solid var(--stroke)!important;border-radius:16px!important;overflow-x:auto}
[data-balsam] th{background:var(--tint)!important;color:var(--ink)!important}
[data-balsam] td{border-color:#e4edf0!important}
[data-balsam] tbody tr:nth-child(even){background:#f7fafb}
[data-balsam] :is(.sidebar-nav,.doctor-nav,.tabs){border-radius:14px!important}
[data-balsam] .sidebar{background:linear-gradient(180deg,#172d46,#28465c)!important}
[data-balsam] .patient-records-panel{border-inline-start:3px solid var(--accent);padding-inline:1rem;background:var(--tint)}
[data-balsam] :is(.messages,#patientEmergencyMessages,.chat-window){border-color:var(--stroke)!important}
[data-balsam] :is(.composer,.emergency-composer){background:#fff!important;border:1px solid var(--stroke)!important;border-radius:16px!important}
[data-balsam] .emergency-entry-gold{background:linear-gradient(115deg,#fffaf0,#fff0ce)!important;border-color:#e5c888!important;border-radius:20px!important}
[data-balsam] .emergency-entry-button{background:#866020!important;color:white!important}
[data-balsam=urgent] .wrap header{background:#fff5f1!important;border-top:5px solid var(--accent)!important;color:#512a35}
[data-balsam=urgent] .wrap header :is(h1,.sub){color:#512a35!important}
[data-balsam] main>h1:first-of-type{border-inline-start:5px solid var(--accent);padding-inline-start:.7em}
[data-balsam] :is(footer,.footer){color:var(--muted)!important}
@media(max-width:760px){
  [data-balsam] :is(.header-inner,.topbar-inner){gap:8px;flex-wrap:wrap;height:auto;padding-block:8px}
  [data-balsam] :is(.hero,.welcome){padding:24px!important;border-radius:20px!important}
  [data-balsam=home] .hero{min-height:255px;padding:24px 20px 100px!important}
  [data-balsam=home] .hero::after{width:175px;height:160px;inset:auto auto -26px -5px;opacity:.72}
  [data-balsam=home] .hero h1{font-size:clamp(2rem,7vw,2.8rem)!important}
  [data-balsam=home] .portal-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important}
  [data-balsam=home] .portal{min-height:152px!important;padding:15px!important;border-radius:17px!important}
  [data-balsam=home] .portal[href="patients.html"]{grid-column:1/-1;min-height:130px!important}
  [data-balsam=home] .portal h3{font-size:1rem!important}
  [data-balsam=home] .portal p{font-size:.78rem!important}
  [data-balsam] :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea){font-size:16px!important}
}
@media(max-width:345px){[data-balsam=home] .portal-grid{grid-template-columns:1fr!important}}
@media(prefers-reduced-motion:reduce){
  [data-balsam] *{scroll-behavior:auto!important;transition:none!important;animation-duration:.01ms!important}
}
