:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#0f172a;background:#f8fafc;line-height:1.5}
*{box-sizing:border-box}html{min-height:100%;background:#f8fafc}body{margin:0;min-height:100%;background:#f8fafc;color:#0f172a}a{color:inherit}button,input,select,textarea{font:inherit}button{cursor:pointer}table{border-collapse:collapse}img,svg{max-width:100%}
html[dir="rtl"] body{direction:rtl;text-align:right}html[dir="ltr"] body{direction:ltr;text-align:left}
/* layout */
.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.grow{flex-grow:1}.flex-1{flex:1 1 0%}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.items-end{align-items:flex-end}.items-baseline{align-items:baseline}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.min-w-0{min-width:0}.min-w-60{min-width:15rem}.w-full{width:100%}.h-32{height:8rem}.h-fit{height:fit-content}.min-h-screen{min-height:100vh}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.sticky{position:sticky}.top-0{top:0}.z-20{z-index:20}.mx-auto{margin-left:auto;margin-right:auto}
.max-w-md{max-width:28rem}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-6xl{max-width:72rem}.max-w-7xl{max-width:80rem}
.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-x-4{column-gap:1rem}.gap-y-1{row-gap:.25rem}
.space-y-1>*+*{margin-top:.25rem}.space-y-2>*+*{margin-top:.5rem}.space-y-3>*+*{margin-top:.75rem}.space-y-4>*+*{margin-top:1rem}.space-y-5>*+*{margin-top:1.25rem}.space-y-6>*+*{margin-top:1.5rem}.divide-y>*+*{border-top:1px solid #e2e8f0}
/* spacing */
.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-inline:.25rem}.px-2{padding-inline:.5rem}.px-3{padding-inline:.75rem}.px-4{padding-inline:1rem}.px-6{padding-inline:1.5rem}.py-1{padding-block:.25rem}.py-2{padding-block:.5rem}.py-3{padding-block:.75rem}.py-4{padding-block:1rem}.py-8{padding-block:2rem}.pb-2{padding-bottom:.5rem}.pl-4{padding-inline-start:1rem}.pl-5{padding-inline-start:1.25rem}.ml-1{margin-inline-start:.25rem}.ml-2{margin-inline-start:.5rem}.ml-3{margin-inline-start:.75rem}.mr-2{margin-inline-end:.5rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.scroll-mt-24{scroll-margin-top:6rem}
/* typography */
.text-xs{font-size:.75rem;line-height:1rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.font-normal{font-weight:400}.font-medium{font-weight:500}.font-semibold{font-weight:600}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.underline{text-decoration:underline}.leading-relaxed{line-height:1.625}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.break-all{word-break:break-all}.whitespace-pre-wrap{white-space:pre-wrap}.list-disc{list-style-type:disc}
/* color */
.bg-white{background:#fff}.bg-slate-50{background:#f8fafc}.bg-slate-100{background:#f1f5f9}.bg-slate-900{background:#0f172a}.bg-amber-50{background:#fffbeb}.bg-emerald-50{background:#ecfdf5}.bg-red-50{background:#fef2f2}.text-white{color:#fff}.text-slate-400{color:#94a3b8}.text-slate-500{color:#64748b}.text-slate-600{color:#475569}.text-slate-700{color:#334155}.text-slate-800{color:#1e293b}.text-slate-900{color:#0f172a}.text-amber-700{color:#b45309}.text-amber-800{color:#92400e}.text-amber-900{color:#78350f}.text-emerald-700{color:#047857}.text-emerald-800{color:#065f46}.text-emerald-900{color:#064e3b}.text-red-600{color:#dc2626}.text-red-700{color:#b91c1c}.text-red-800{color:#991b1b}.text-red-900{color:#7f1d1d}
/* borders / surfaces */
.border{border:1px solid #e2e8f0}.border-b{border-bottom:1px solid #e2e8f0}.border-slate-300{border-color:#cbd5e1}.border-amber-200{border-color:#fde68a}.border-amber-300{border-color:#fcd34d}.border-amber-700{border-color:#b45309}.border-emerald-200{border-color:#a7f3d0}.border-emerald-700{border-color:#047857}.border-red-200{border-color:#fecaca}.border-red-300{border-color:#fca5a5}.rounded{border-radius:.5rem}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.shadow{box-shadow:0 1px 3px rgba(15,23,42,.12),0 1px 2px rgba(15,23,42,.08)}
/* forms */
input,select,textarea{max-width:100%;background:#fff;color:#0f172a;border:1px solid #cbd5e1;border-radius:.25rem;padding:.5rem}textarea{min-height:5rem;resize:vertical}input:focus,select:focus,textarea:focus,button:focus-visible,a:focus-visible{outline:2px solid #2563eb;outline-offset:2px}input[type="checkbox"],input[type="radio"]{width:auto;padding:0}.cursor-pointer{cursor:pointer}
button,.button{border:1px solid transparent;border-radius:.25rem;padding:.5rem 1rem;background:#0f172a;color:white}.hover\:bg-slate-50:hover{background:#f8fafc}.hover\:bg-slate-100:hover{background:#f1f5f9}
/* legacy utility classes used by installer/security screens */
.card{background:#fff;border:1px solid #e2e8f0;border-radius:.5rem;padding:1.25rem}.pill{display:inline-block;border-radius:999px;padding:.125rem .5rem;font-size:.75rem}.muted{color:#64748b}.ok{color:#047857}.danger,.error{color:#b91c1c}.note{color:#475569}.status{font-size:.875rem}.recovery{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap}.wrap{overflow-wrap:anywhere}
@media(min-width:640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:col-span-2{grid-column:span 2/span 2}}
@media(min-width:768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-\[1\.4fr_1fr_1fr_1fr\]{grid-template-columns:1.4fr 1fr 1fr 1fr}.md\:grid-cols-\[180px_1fr\]{grid-template-columns:180px minmax(0,1fr)}.md\:col-span-2{grid-column:span 2/span 2}.md\:col-span-3{grid-column:span 3/span 3}}
@media(min-width:1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-\[220px_1fr_280px\]{grid-template-columns:220px minmax(0,1fr) 280px}}
@media(min-width:1280px){.xl\:grid-cols-\[190px_minmax\(0\,1fr\)_270px\]{grid-template-columns:190px minmax(0,1fr) 270px}.xl\:sticky{position:sticky}.xl\:top-24{top:6rem}}
@media print{.no-print{display:none!important}body{background:white}.shadow{box-shadow:none}}

/* ============================================================
   EMR UI refresh v1.1 — Dr. Sammy brand-inspired clinical shell
   ============================================================ */
:root{
  color-scheme:light;
  --emr-brand-950:#102f38;
  --emr-brand-900:#153b46;
  --emr-brand-800:#1c4d5a;
  --emr-brand-700:#286777;
  --emr-brand-600:#338391;
  --emr-brand-500:#48a5ad;
  --emr-brand-400:#72bcc0;
  --emr-accent:#d9a25f;
  --emr-accent-soft:#fff4e5;
  --emr-rose:#bf7183;
  --emr-blue:#5a82bd;
  --emr-green:#4e9b78;
  --emr-purple:#8173b8;
  --emr-bg:#f4f7f8;
  --emr-surface:#ffffff;
  --emr-surface-2:#f8fafb;
  --emr-surface-3:#eef3f4;
  --emr-text:#17313a;
  --emr-text-soft:#5d7077;
  --emr-border:#dce5e7;
  --emr-shadow:0 8px 28px rgba(16,47,56,.08);
  --emr-sidebar-width:264px;
}
html[data-theme="dark"]{
  color-scheme:dark;
  --emr-bg:#0d171b;
  --emr-surface:#142126;
  --emr-surface-2:#18282e;
  --emr-surface-3:#20343b;
  --emr-text:#edf6f7;
  --emr-text-soft:#aabdc2;
  --emr-border:#2b4149;
  --emr-shadow:0 10px 32px rgba(0,0,0,.28);
  --emr-accent-soft:#30271d;
}
html,body{background:var(--emr-bg);color:var(--emr-text)}
body{transition:background .18s ease,color .18s ease}
body.emr-shell-active{padding-inline-start:var(--emr-sidebar-width);min-height:100vh}
body.emr-shell-active>main{max-width:none}

/* Correct the prototype's global button rule: link-style buttons are no longer forced white-on-dark. */
button,.button{background:transparent;color:var(--emr-text);border:0;padding:.5rem .75rem}
button.bg-slate-900,.button.bg-slate-900,.emr-btn-primary{background:var(--emr-brand-700)!important;color:#fff!important;border:1px solid var(--emr-brand-700)!important}
button.bg-white,.button.bg-white,.emr-btn-secondary{background:var(--emr-surface)!important;color:var(--emr-text)!important;border:1px solid var(--emr-border)!important}
button:hover,.button:hover{filter:brightness(.98)}
button.bg-slate-900:hover,.emr-btn-primary:hover{background:var(--emr-brand-800)!important}

/* Existing utility compatibility under light/dark theme */
.bg-white{background:var(--emr-surface)!important}.bg-slate-50{background:var(--emr-surface-2)!important}.bg-slate-100{background:var(--emr-bg)!important}.bg-slate-900{background:var(--emr-brand-700)!important}
.text-slate-900,.text-slate-800,.text-slate-700{color:var(--emr-text)!important}.text-slate-600,.text-slate-500,.text-slate-400{color:var(--emr-text-soft)!important}
.border,.border-b,.border-slate-300{border-color:var(--emr-border)!important}
.divide-y>*+*{border-color:var(--emr-border)!important}
.card{background:var(--emr-surface)!important;border-color:var(--emr-border)!important;color:var(--emr-text)!important;box-shadow:var(--emr-shadow)}
input,select,textarea{background:var(--emr-surface)!important;color:var(--emr-text)!important;border-color:var(--emr-border)!important}
input::placeholder,textarea::placeholder{color:var(--emr-text-soft)}
input:focus,select:focus,textarea:focus,button:focus-visible,a:focus-visible{outline-color:var(--emr-brand-500)}
table{color:var(--emr-text)}
th{color:var(--emr-text-soft);font-weight:600;background:var(--emr-surface-2)}
td,th{border-color:var(--emr-border)!important}
a{transition:color .15s ease,background .15s ease}
a:hover{color:var(--emr-brand-600)}

/* Permanent sidebar */
#emr-sidebar{position:fixed;inset-block:0;inset-inline-start:0;width:var(--emr-sidebar-width);z-index:1000;background:linear-gradient(180deg,var(--emr-brand-950),var(--emr-brand-900));color:#e9f4f5;display:flex;flex-direction:column;box-shadow:8px 0 28px rgba(15,47,56,.12)}
.emr-sidebar-brand{padding:20px 18px 16px;border-bottom:1px solid rgba(255,255,255,.11)}
.emr-logo-wrap{height:74px;border-radius:14px;background:rgba(255,255,255,.08);display:flex;align-items:center;justify-content:center;overflow:hidden;margin-bottom:12px}
.emr-logo-wrap img{max-height:60px;max-width:190px;object-fit:contain}.emr-logo-fallback{font-weight:700;letter-spacing:.08em;font-size:1.05rem;color:#fff}
.emr-brand-title{font-weight:700;font-size:.95rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.emr-brand-subtitle{font-size:.72rem;color:#a9c8cd;margin-top:2px}
.emr-sidebar-nav{padding:14px 10px;display:flex;flex-direction:column;gap:4px;overflow:auto;flex:1}
.emr-sidebar-link{display:flex;align-items:center;gap:11px;padding:10px 12px;border-radius:9px;color:#d7eaed;text-decoration:none;font-size:.9rem;font-weight:500}
.emr-sidebar-link:hover{background:rgba(255,255,255,.08);color:#fff}.emr-sidebar-link.active{background:linear-gradient(90deg,rgba(72,165,173,.34),rgba(72,165,173,.15));color:#fff;box-shadow:inset 3px 0 0 var(--emr-accent)}
.emr-sidebar-icon{width:19px;height:19px;display:grid;place-items:center;flex:0 0 19px}.emr-sidebar-icon svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.8}
.emr-sidebar-footer{padding:12px;border-top:1px solid rgba(255,255,255,.11)}.emr-user-chip{font-size:.78rem;color:#bcd2d6;padding:4px 8px 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.emr-sidebar-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.emr-sidebar-button{border:1px solid rgba(255,255,255,.15);background:rgba(255,255,255,.06);color:#e9f4f5;border-radius:8px;padding:8px 6px;font-size:.76rem}.emr-sidebar-button:hover{background:rgba(255,255,255,.12);color:#fff}
.emr-mobile-shell-button{display:none;position:fixed;inset-block-start:12px;inset-inline-start:12px;z-index:1100;border-radius:9px;background:var(--emr-brand-800);color:#fff;padding:8px 10px;box-shadow:var(--emr-shadow)}

/* Modern surfaces */
.rounded-lg.border.bg-white,.rounded-xl.border.bg-white,.rounded.border.bg-white{box-shadow:0 1px 2px rgba(16,47,56,.03)}
.emr-page-title{font-size:1.65rem;font-weight:700;letter-spacing:-.02em}.emr-page-subtitle{color:var(--emr-text-soft);font-size:.9rem;margin-top:3px}
.emr-panel{background:var(--emr-surface);border:1px solid var(--emr-border);border-radius:14px;box-shadow:var(--emr-shadow)}

/* Dashboard */
.emr-dashboard-hero{border-radius:18px;padding:22px 24px;background:linear-gradient(120deg,var(--emr-brand-900),var(--emr-brand-700));color:#fff;position:relative;overflow:hidden}
.emr-dashboard-hero:after{content:"";position:absolute;width:240px;height:240px;border-radius:50%;right:-70px;top:-120px;background:rgba(255,255,255,.08)}
.emr-dashboard-hero h1{margin:0;font-size:1.65rem}.emr-dashboard-hero p{margin:.35rem 0 0;color:#cce1e4;font-size:.9rem}
.emr-stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:16px}
.emr-stat-card{position:relative;background:var(--emr-surface);border:1px solid var(--emr-border);border-radius:14px;padding:18px 18px 16px;box-shadow:var(--emr-shadow);overflow:hidden}
.emr-stat-card:before{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:5px;background:var(--stat-color,var(--emr-brand-500))}.emr-stat-card.teal{--stat-color:var(--emr-brand-500)}.emr-stat-card.gold{--stat-color:var(--emr-accent)}.emr-stat-card.rose{--stat-color:var(--emr-rose)}.emr-stat-card.blue{--stat-color:var(--emr-blue)}
.emr-stat-label{font-size:.78rem;text-transform:uppercase;letter-spacing:.05em;color:var(--emr-text-soft);font-weight:650}.emr-stat-value{font-size:1.85rem;font-weight:750;margin-top:5px;color:var(--emr-text)}
.emr-chart-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:16px}.emr-chart-card{background:var(--emr-surface);border:1px solid var(--emr-border);border-radius:14px;padding:18px;box-shadow:var(--emr-shadow);min-width:0}.emr-chart-title{font-weight:700;font-size:.96rem}.emr-chart-subtitle{font-size:.75rem;color:var(--emr-text-soft);margin-top:2px}.emr-chart-wrap{height:230px;margin-top:12px;position:relative}.emr-chart-wrap canvas{width:100%;height:100%}
.emr-dashboard-lists{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:16px}.emr-dashboard-list{background:var(--emr-surface);border:1px solid var(--emr-border);border-radius:14px;padding:18px;box-shadow:var(--emr-shadow)}
.emr-list-row{padding:11px 0;border-top:1px solid var(--emr-border)}.emr-list-row:first-of-type{border-top:0}.emr-status-pill{display:inline-block;border-radius:999px;background:var(--emr-surface-3);color:var(--emr-text-soft);padding:2px 8px;font-size:.7rem}

/* Listing export toolbar */
.emr-export-toolbar{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin:8px 0 10px;flex-wrap:wrap}.emr-export-toolbar button{border:1px solid var(--emr-border);background:var(--emr-surface);color:var(--emr-text);border-radius:8px;padding:7px 10px;font-size:.77rem}.emr-export-toolbar button:hover{border-color:var(--emr-brand-500);color:var(--emr-brand-600)}

/* Admin inline-style compatibility */
html[data-theme="dark"] .wrap,html[data-theme="dark"] main{color:var(--emr-text)}
html[data-theme="dark"] nav a{background:var(--emr-surface)!important;color:var(--emr-text)!important;border-color:var(--emr-border)!important}
html[data-theme="dark"] .muted,html[data-theme="dark"] .note{color:var(--emr-text-soft)!important}

@media(max-width:980px){
  body.emr-shell-active{padding-inline-start:0;padding-top:52px}
  #emr-sidebar{transform:translateX(-105%);transition:transform .2s ease}.emr-sidebar-open #emr-sidebar{transform:translateX(0)}
  html[dir="rtl"] #emr-sidebar{transform:translateX(105%)}html[dir="rtl"].emr-sidebar-open #emr-sidebar{transform:translateX(0)}
  .emr-mobile-shell-button{display:block}.emr-stat-grid{grid-template-columns:1fr 1fr}.emr-chart-grid,.emr-dashboard-lists{grid-template-columns:1fr}
}
@media(max-width:620px){.emr-stat-grid{grid-template-columns:1fr}.emr-dashboard-hero{padding:18px}.emr-chart-wrap{height:200px}}
@media print{#emr-sidebar,.emr-mobile-shell-button,.emr-export-toolbar{display:none!important}body.emr-shell-active{padding:0!important}.emr-panel,.emr-chart-card,.emr-stat-card{box-shadow:none!important}}
body.emr-shell-active .wrap>nav{display:none!important}
body.emr-shell-active .wrap{max-width:1320px;margin:24px auto;padding-inline:24px}
html[data-theme="dark"] body{background:var(--emr-bg)!important;color:var(--emr-text)!important}
html[data-theme="dark"] .card,html[data-theme="dark"] table{background:var(--emr-surface)!important;color:var(--emr-text)!important}
html[data-theme="dark"] .bg-amber-50{background:#33291a!important}.bg-amber-50{border-color:#ead29a}
html[data-theme="dark"] .bg-emerald-50{background:#153128!important}.bg-emerald-50{border-color:#9dd9bc}
html[data-theme="dark"] .bg-red-50{background:#351d22!important}.bg-red-50{border-color:#e5a3ad}
html[data-theme="dark"] .text-amber-700,html[data-theme="dark"] .text-amber-800,html[data-theme="dark"] .text-amber-900{color:#f2cb80!important}
html[data-theme="dark"] .text-emerald-700,html[data-theme="dark"] .text-emerald-800,html[data-theme="dark"] .text-emerald-900{color:#8ed5b0!important}
html[data-theme="dark"] .text-red-600,html[data-theme="dark"] .text-red-700,html[data-theme="dark"] .text-red-800,html[data-theme="dark"] .text-red-900{color:#f2a6b1!important}

.emr-export-only{display:none!important}

/* ============================================================
   EMR UI refresh v1.6.1 — #6C3BAA purple / bright-gold system
   Source palette visually aligned with the clinic website.
   ============================================================ */
:root{
  --emr-brand-950:#2b1844;
  --emr-brand-900:#3a205b;
  --emr-brand-800:#572f88;
  --emr-brand-700:#6c3baa;
  --emr-brand-600:#8351c3;
  --emr-brand-500:#9e77d0;
  --emr-brand-400:#bca0de;
  --emr-brand-300:#d4c2ea;
  --emr-accent:#f4c95d;
  --emr-accent-strong:#ffd86d;
  --emr-accent-soft:#fff7dc;
  --emr-rose:#b85b88;
  --emr-blue:#7166b8;
  --emr-green:#5a9279;
  --emr-purple:#6c3baa;
  --emr-bg:#f7f5fa;
  --emr-surface:#ffffff;
  --emr-surface-2:#fbf9fd;
  --emr-surface-3:#f0ebf5;
  --emr-text:#281d33;
  --emr-text-soft:#6f637b;
  --emr-border:#ded6e8;
  --emr-shadow:0 8px 28px rgba(108,59,170,.09);
}
html[data-theme="dark"]{
  --emr-bg:#120d19;
  --emr-surface:#1b1424;
  --emr-surface-2:#22182e;
  --emr-surface-3:#2d203c;
  --emr-text:#f7f2fb;
  --emr-text-soft:#c1b5cd;
  --emr-border:#443354;
  --emr-shadow:0 10px 34px rgba(0,0,0,.34);
  --emr-accent-soft:#342b17;
}

/* Focus treatment follows the brand instead of browser-blue. */
input:focus,select:focus,textarea:focus,button:focus-visible,a:focus-visible{outline:2px solid var(--emr-brand-500)!important;outline-offset:2px}

/* Button system: every actual button has a visible boundary. */
button,.button{
  border:1px solid var(--emr-border)!important;
  background:var(--emr-surface)!important;
  color:var(--emr-brand-800)!important;
  border-radius:8px!important;
  font-weight:600;
  text-decoration:none;
  transition:background .14s ease,border-color .14s ease,color .14s ease,transform .05s ease;
}
button:hover,.button:hover{border-color:var(--emr-brand-500)!important;background:var(--emr-surface-2)!important;color:var(--emr-brand-900)!important;filter:none}
button:active,.button:active{transform:translateY(1px)}
button.bg-slate-900,.button.bg-slate-900,.emr-btn-primary{
  background:linear-gradient(135deg,var(--emr-brand-700),var(--emr-brand-900))!important;
  color:#fff!important;
  border-color:var(--emr-brand-700)!important;
}
button.bg-slate-900:hover,.button.bg-slate-900:hover,.emr-btn-primary:hover{background:linear-gradient(135deg,var(--emr-brand-600),var(--emr-brand-800))!important;color:#fff!important;border-color:var(--emr-accent)!important}
button.bg-white,.button.bg-white,.emr-btn-secondary{background:var(--emr-surface)!important;color:var(--emr-brand-800)!important;border-color:var(--emr-brand-400)!important}
button.underline{border:1px solid var(--emr-border)!important;text-decoration:none!important;padding:.38rem .65rem!important;background:var(--emr-surface)!important;color:var(--emr-brand-800)!important}

/* Legacy admin/security pages: plain action buttons become polished primaries. */
body.emr-shell-active .wrap .card button:not(.emr-sidebar-button),
body.emr-shell-active .wrap .card a.button{
  background:linear-gradient(135deg,var(--emr-brand-700),var(--emr-brand-900))!important;
  border:1px solid var(--emr-brand-700)!important;
  color:#fff!important;
  box-shadow:0 4px 12px rgba(73,29,127,.12);
}
body.emr-shell-active .wrap .card button:not(.emr-sidebar-button):hover,
body.emr-shell-active .wrap .card a.button:hover{
  background:linear-gradient(135deg,var(--emr-brand-600),var(--emr-brand-800))!important;
  border-color:var(--emr-accent)!important;
  color:#fff!important;
}

/* Permanent navigation: purple shell, bright-gold active marker, no inherited white boxes. */
#emr-sidebar{
  background:linear-gradient(180deg,var(--emr-brand-800) 0%,var(--emr-brand-700) 45%,var(--emr-brand-900) 100%)!important;
  box-shadow:8px 0 30px rgba(47,18,79,.18)!important;
}
.emr-sidebar-brand{border-bottom-color:rgba(255,255,255,.13)!important}
.emr-logo-wrap{background:rgba(255,255,255,.09)!important;border:1px solid rgba(255,255,255,.12)!important}
.emr-logo-fallback{color:#fff!important;letter-spacing:.08em}
.emr-brand-title{color:#fff!important}.emr-brand-subtitle{color:#d9cde7!important}
.emr-sidebar-section{
  padding:12px 12px 5px;
  color:#cdbede;
  font-size:.66rem;
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
}
nav.emr-sidebar-nav a.emr-sidebar-link{
  background:rgba(255,255,255,.035)!important;
  color:#f0e9f7!important;
  border:1px solid rgba(255,255,255,.085)!important;
  border-radius:9px!important;
  box-shadow:none!important;
}
nav.emr-sidebar-nav a.emr-sidebar-link:hover{
  background:rgba(255,255,255,.10)!important;
  color:#fff!important;
  border-color:rgba(244,201,93,.52)!important;
}
nav.emr-sidebar-nav a.emr-sidebar-link.active{
  background:linear-gradient(90deg,rgba(244,201,93,.22),rgba(255,255,255,.08))!important;
  color:#fff!important;
  border-color:rgba(244,201,93,.72)!important;
  box-shadow:inset 3px 0 0 var(--emr-accent)!important;
}
html[dir="rtl"] nav.emr-sidebar-nav a.emr-sidebar-link.active{box-shadow:inset -3px 0 0 var(--emr-accent)!important}
nav.emr-sidebar-nav a.emr-sidebar-link.is-subitem{margin-inline-start:16px;width:calc(100% - 16px);font-size:.83rem;padding-block:8px;background:rgba(255,255,255,.02)!important}
nav.emr-sidebar-nav a.emr-sidebar-link.is-subitem .emr-sidebar-icon{opacity:.85;transform:scale(.88)}
.emr-sidebar-footer{border-top-color:rgba(255,255,255,.13)!important}.emr-user-chip{color:#e2d8ec!important}
.emr-sidebar-button{
  background:rgba(255,255,255,.07)!important;
  color:#fff!important;
  border:1px solid rgba(244,201,93,.30)!important;
  font-weight:600;
}
.emr-sidebar-button:hover{background:rgba(244,201,93,.16)!important;border-color:var(--emr-accent)!important;color:#fff!important}
.emr-mobile-shell-button{background:linear-gradient(135deg,var(--emr-brand-700),var(--emr-brand-900))!important;border:1px solid var(--emr-accent)!important;color:#fff!important}

/* Dashboard color treatment. */
.emr-dashboard-hero{
  background:linear-gradient(120deg,var(--emr-brand-700) 0%,var(--emr-brand-600) 55%,var(--emr-brand-500) 100%)!important;
  box-shadow:0 12px 30px rgba(73,29,127,.16);
}
.emr-dashboard-hero:after{background:radial-gradient(circle,var(--emr-accent) 0%,rgba(244,201,93,0) 68%)!important;opacity:.16!important}
.emr-stat-card{border-color:#e3d9ec!important}
.emr-stat-card.teal{--stat-color:var(--emr-brand-600);background:linear-gradient(135deg,var(--emr-surface) 60%,#f1eaf8)!important}
.emr-stat-card.gold{--stat-color:var(--emr-accent);background:linear-gradient(135deg,var(--emr-surface) 60%,#fff6d9)!important}
.emr-stat-card.rose{--stat-color:#b85b88;background:linear-gradient(135deg,var(--emr-surface) 60%,#faeaf2)!important}
.emr-stat-card.blue{--stat-color:#7166b8;background:linear-gradient(135deg,var(--emr-surface) 60%,#eeeafb)!important}
html[data-theme="dark"] .emr-stat-card.teal,html[data-theme="dark"] .emr-stat-card.gold,html[data-theme="dark"] .emr-stat-card.rose,html[data-theme="dark"] .emr-stat-card.blue{background:var(--emr-surface)!important}
.emr-chart-card{border-top:3px solid var(--emr-brand-500)!important}.emr-chart-card:nth-child(even){border-top-color:var(--emr-accent)!important}
.emr-dashboard-list{border-top:3px solid var(--emr-brand-400)!important}
.emr-status-pill{background:#f0ebf5!important;color:var(--emr-brand-800)!important;border:1px solid #ddd2e8}
html[data-theme="dark"] .emr-status-pill{background:#2d203c!important;color:#e8def1!important;border-color:#49365d}

/* Export buttons use the same secondary-button system. */
.emr-export-toolbar button{border:1px solid var(--emr-brand-300)!important;background:var(--emr-surface)!important;color:var(--emr-brand-800)!important;font-weight:650}
.emr-export-toolbar button:hover{border-color:var(--emr-accent)!important;color:var(--emr-brand-900)!important;background:var(--emr-accent-soft)!important}

/* Admin navigation left in templates is hidden by the permanent shell; if ever shown, keep it branded. */
body.emr-shell-active .wrap>nav{display:none!important}
.wrap nav a{border:1px solid var(--emr-brand-300)!important;color:var(--emr-brand-800)!important;background:var(--emr-surface)!important}

/* Dark-theme corrections for purple system. */
html[data-theme="dark"] nav a{background:transparent!important;color:inherit!important;border-color:var(--emr-border)!important}
html[data-theme="dark"] nav.emr-sidebar-nav a.emr-sidebar-link{background:rgba(255,255,255,.035)!important;color:#f0e9f7!important;border-color:rgba(255,255,255,.085)!important}
html[data-theme="dark"] .bg-amber-50{background:#352d17!important}.bg-amber-50{border-color:#f0d77a!important}

/* ============================================================
   EMR UI refinement v1.3 — collapsible nav, spacing and logo
   ============================================================ */
/* Reset browser's default definition-list indentation so values align with labels. */
body.emr-shell-active dl dd{margin-inline-start:0!important}

/* 800x363 logo slot with minimal surrounding whitespace. */
.emr-sidebar-brand{padding:10px 12px 8px!important}
.emr-logo-wrap{
  width:100%!important;
  height:auto!important;
  aspect-ratio:800 / 363;
  padding:2px!important;
  margin:0 0 6px!important;
  border-radius:12px!important;
}
.emr-logo-wrap img{width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;object-fit:contain!important}
.emr-brand-title{line-height:1.25}.emr-brand-subtitle{margin-top:2px}

/* Collapsible parent items. Parent remains a link; chevron controls children. */
.emr-nav-tree{display:block}
.emr-sidebar-main-row{display:grid;grid-template-columns:minmax(0,1fr) 30px;gap:4px;align-items:center}
.emr-sidebar-main-row>.emr-sidebar-link{min-width:0;width:100%}
.emr-sidebar-toggle{
  width:30px!important;height:36px!important;padding:0!important;
  display:grid!important;place-items:center!important;
  border:1px solid rgba(255,255,255,.10)!important;
  background:rgba(255,255,255,.035)!important;
  color:#f7f1fb!important;border-radius:8px!important;
  box-shadow:none!important;line-height:1!important;
}
.emr-sidebar-toggle:hover{background:rgba(244,201,93,.14)!important;border-color:rgba(255,218,99,.62)!important;color:#fff!important}
.emr-sidebar-toggle span{display:block;font-size:1rem;transition:transform .16s ease;transform:rotate(-90deg)}
.emr-sidebar-toggle[aria-expanded="true"] span{transform:rotate(0deg)}
.emr-sidebar-submenu{display:grid;gap:4px;padding-top:4px}
.emr-sidebar-submenu[hidden]{display:none!important}
.emr-nav-tree.branch-active>.emr-sidebar-main-row>.emr-sidebar-link{border-color:rgba(244,201,93,.38)!important}

/* Keep export/action toolbars comfortably inside cards and table shells. */
.emr-export-toolbar{padding-inline:12px!important;margin-block:8px 10px!important}
.emr-export-toolbar>*:last-child{margin-inline-end:0!important}

/* Patient overview action group should breathe against the panel edges. */
.emr-patient-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.emr-patient-actions a{display:inline-flex;align-items:center;justify-content:center;min-height:36px}

/* Disabled encounter launch remains visibly unavailable rather than failing mysteriously. */
.emr-btn-disabled,button:disabled{opacity:.55!important;cursor:not-allowed!important;filter:none!important}

@media (max-width:900px){
  .emr-logo-wrap{aspect-ratio:800 / 363}
}

/* EMR UI v1.3.1 — unified breadcrumb prefix */
.emr-brand-breadcrumb{font-weight:650;color:var(--emr-brand-700)!important;text-decoration:none!important;white-space:nowrap}
.emr-brand-breadcrumb:hover{text-decoration:underline!important}
.emr-breadcrumb-separator{display:inline-block;margin:0 .55rem;color:var(--emr-text-soft);font-weight:600}
html[data-theme="dark"] .emr-brand-breadcrumb{color:var(--emr-gold)!important}

/* ============================================================
   EMR UI v1.4 — system-wide layout, breadcrumb and nav normalization
   ============================================================ */
/* One consistent full-width application canvas on every authenticated page. */
body.emr-shell-active > main,
body.emr-shell-active > .wrap {
  width:100%!important;
  max-width:none!important;
  margin-inline:0!important;
  padding-inline:24px!important;
}
body.emr-shell-active > .border-b > .mx-auto,
body.emr-shell-active > header > .mx-auto,
body.emr-shell-active main.mx-auto {
  width:100%!important;
  max-width:none!important;
  margin-inline:0!important;
}
body.emr-shell-active .wrap{margin-block:0!important;padding-top:24px!important;padding-bottom:40px!important}

/* Unified breadcrumb bar. Legacy back-links/top navigation are replaced by this bar. */
.emr-breadcrumb-bar{
  min-height:50px;
  width:100%;
  display:flex;
  align-items:center;
  gap:0;
  padding:12px 24px;
  border-bottom:1px solid var(--emr-border);
  background:var(--emr-surface);
  color:var(--emr-text-soft);
  overflow-x:auto;
  overflow-y:hidden;
  white-space:nowrap;
  scrollbar-width:thin;
}
.emr-breadcrumb-bar a{text-decoration:none!important}
.emr-breadcrumb-link{color:var(--emr-brand-700)!important;font-weight:600}
.emr-breadcrumb-link:hover,.emr-brand-breadcrumb:hover{text-decoration:underline!important}
.emr-brand-breadcrumb{font-weight:750;color:var(--emr-brand-800)!important}
.emr-breadcrumb-current{color:var(--emr-text)!important;font-weight:650}
.emr-breadcrumb-separator{display:inline-grid;place-items:center;margin:0 .55rem;color:var(--emr-brand-400);font-size:1.05rem;font-weight:800;line-height:1}
.emr-legacy-nav-hidden{display:none!important}
.emr-legacy-breadcrumb-source{display:none!important}
html[data-theme="dark"] .emr-breadcrumb-bar{background:var(--emr-surface);border-color:var(--emr-border)}
html[data-theme="dark"] .emr-brand-breadcrumb,html[data-theme="dark"] .emr-breadcrumb-link{color:var(--emr-accent-strong)!important}

/* Sidebar must never grow horizontally when a submenu is expanded. */
#emr-sidebar{overflow:hidden!important}
.emr-sidebar-nav{
  width:100%!important;
  min-width:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  scrollbar-gutter:stable;
}
.emr-sidebar-nav > *,
.emr-nav-tree,
.emr-sidebar-main-row,
.emr-sidebar-submenu{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
}
.emr-nav-tree{overflow:hidden!important;flex:0 0 auto!important}
.emr-sidebar-main-row{grid-template-columns:minmax(0,1fr) 28px!important;gap:5px!important}
nav.emr-sidebar-nav a.emr-sidebar-link{min-width:0!important;max-width:100%!important}
nav.emr-sidebar-nav a.emr-sidebar-link > span:last-child{
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
nav.emr-sidebar-nav a.emr-sidebar-link.is-subitem{
  margin-inline-start:14px!important;
  width:calc(100% - 14px)!important;
  max-width:calc(100% - 14px)!important;
}

/* Compact circular chevron toggle for expandable sidebar items. */
.emr-sidebar-toggle{
  width:28px!important;
  height:28px!important;
  min-width:28px!important;
  padding:0!important;
  margin:0!important;
  display:grid!important;
  place-items:center!important;
  border-radius:999px!important;
  border:1px solid rgba(255,255,255,.18)!important;
  background:rgba(255,255,255,.055)!important;
  color:#f7f1fb!important;
  box-shadow:none!important;
}
.emr-sidebar-toggle:hover{
  background:rgba(255,216,109,.16)!important;
  border-color:rgba(255,216,109,.78)!important;
  color:#fff!important;
}
.emr-sidebar-toggle svg{
  width:15px!important;
  height:15px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:2.2!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
  transition:transform .16s ease!important;
  transform:rotate(-90deg);
}
.emr-sidebar-toggle[aria-expanded="true"] svg{transform:rotate(0deg)}
.emr-sidebar-toggle span{display:none!important}

/* Preserve requested general radius utility. */
.rounded{border-radius:.5rem!important}

@media(max-width:980px){
  body.emr-shell-active > main,
  body.emr-shell-active > .wrap{padding-inline:16px!important}
  .emr-breadcrumb-bar{padding-inline:16px}
}
@media print{
  .emr-breadcrumb-bar{display:none!important}
}
body.emr-shell-active{overflow-x:hidden!important}

/* ============================================================
   EMR UI v1.5 — breadcrumb, sidebar, form and typography polish
   ============================================================ */
/* Montserrat-first typography without third-party CDN requests.
   If Montserrat is installed locally it is used; otherwise a safe system fallback is used. */
:root{
  --emr-font-sans:"Montserrat","Avenir Next","Segoe UI",Arial,sans-serif;
}
html,body,
body.emr-shell-active,
body.emr-shell-active button,
body.emr-shell-active input,
body.emr-shell-active select,
body.emr-shell-active textarea,
body.emr-shell-active table,
body.emr-shell-active th,
body.emr-shell-active td{
  font-family:var(--emr-font-sans)!important;
}
.font-mono,.recovery,code,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace!important}

/* Every normal text-entry control uses the requested 0.5rem radius. */
body.emr-shell-active input:not([type="checkbox"]):not([type="radio"]),
body.emr-shell-active select,
body.emr-shell-active textarea{
  border-radius:.5rem!important;
}

/* Consistent primary form-action behaviour: preserve white text on hover. */
body.emr-shell-active main form button:not([type="button"]):not(.emr-sidebar-button):not(.emr-sidebar-toggle),
body.emr-shell-active .wrap form button:not([type="button"]):not(.emr-sidebar-button):not(.emr-sidebar-toggle),
body.emr-shell-active main form button[type="submit"],
body.emr-shell-active .wrap form button[type="submit"],
body.emr-shell-active .wrap a.button{
  background:linear-gradient(135deg,var(--emr-brand-700),var(--emr-brand-900))!important;
  color:#fff!important;
  border:1px solid var(--emr-brand-700)!important;
  border-radius:.5rem!important;
  box-shadow:0 4px 12px rgba(73,29,127,.12);
}
body.emr-shell-active main form button:not([type="button"]):not(.emr-sidebar-button):not(.emr-sidebar-toggle):hover,
body.emr-shell-active .wrap form button:not([type="button"]):not(.emr-sidebar-button):not(.emr-sidebar-toggle):hover,
body.emr-shell-active main form button[type="submit"]:hover,
body.emr-shell-active .wrap form button[type="submit"]:hover,
body.emr-shell-active .wrap a.button:hover{
  background:linear-gradient(135deg,var(--emr-brand-600),var(--emr-brand-800))!important;
  color:#fff!important;
  border-color:var(--emr-accent)!important;
}
/* Keep export/print controls secondary even when they are buttons. */
body.emr-shell-active .emr-export-toolbar button{
  background:var(--emr-surface)!important;
  color:var(--emr-brand-800)!important;
  border-color:var(--emr-brand-300)!important;
  box-shadow:none!important;
}
body.emr-shell-active .emr-export-toolbar button:hover{
  background:var(--emr-accent-soft)!important;
  color:var(--emr-brand-900)!important;
  border-color:var(--emr-accent)!important;
}

/* Breadcrumb appearance is explicit and identical on every authenticated screen.
   Ancestor links are outlined pills; current page remains a clean bold label. */
nav.emr-breadcrumb-bar{
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  gap:0!important;
  margin:0!important;
  padding:10px 24px!important;
  min-height:58px!important;
  width:100%!important;
  background:var(--emr-surface)!important;
  border:0!important;
  border-bottom:1px solid var(--emr-border)!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
}
nav.emr-breadcrumb-bar a.emr-brand-breadcrumb,
nav.emr-breadcrumb-bar a.emr-breadcrumb-link{
  display:inline-flex!important;
  align-items:center!important;
  min-height:36px!important;
  padding:.42rem .75rem!important;
  margin:0!important;
  border:1px solid var(--emr-brand-300)!important;
  border-radius:.5rem!important;
  background:var(--emr-surface)!important;
  color:var(--emr-brand-800)!important;
  font-weight:650!important;
  line-height:1.15!important;
  text-decoration:none!important;
  box-shadow:0 1px 2px rgba(73,29,127,.04)!important;
}
nav.emr-breadcrumb-bar a.emr-brand-breadcrumb:hover,
nav.emr-breadcrumb-bar a.emr-breadcrumb-link:hover{
  background:var(--emr-surface-2)!important;
  border-color:var(--emr-accent)!important;
  color:var(--emr-brand-900)!important;
  text-decoration:none!important;
}
nav.emr-breadcrumb-bar .emr-breadcrumb-current{
  display:inline-flex!important;
  align-items:center!important;
  min-height:36px!important;
  padding:.42rem .15rem!important;
  margin:0!important;
  border:0!important;
  background:transparent!important;
  color:var(--emr-text)!important;
  font-weight:750!important;
  line-height:1.15!important;
}
nav.emr-breadcrumb-bar .emr-breadcrumb-separator{
  flex:0 0 auto!important;
  margin-inline:.55rem!important;
  color:var(--emr-brand-400)!important;
}

/* Fully isolate the application sidebar from legacy page-level nav/nav-a rules. */
#emr-sidebar{
  width:var(--emr-sidebar-width)!important;
  min-width:var(--emr-sidebar-width)!important;
  max-width:var(--emr-sidebar-width)!important;
  overflow:hidden!important;
}
#emr-sidebar nav.emr-sidebar-nav{
  display:flex!important;
  flex-direction:column!important;
  flex-wrap:nowrap!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  gap:4px!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  margin:0!important;
  padding:14px 10px!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
}
#emr-sidebar nav.emr-sidebar-nav > *{
  flex:0 0 auto!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  margin-inline:0!important;
}
#emr-sidebar nav.emr-sidebar-nav a.emr-sidebar-link{
  display:flex!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  margin:0!important;
  padding:10px 12px!important;
  border-radius:.5rem!important;
  text-decoration:none!important;
}
#emr-sidebar nav.emr-sidebar-nav a.emr-sidebar-link.is-subitem{
  width:calc(100% - 14px)!important;
  max-width:calc(100% - 14px)!important;
  margin-inline-start:14px!important;
  padding:8px 10px!important;
}

/* Parent item and toggle share one border. The toggle now visually lives inside the parent item. */
#emr-sidebar .emr-sidebar-main-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 32px!important;
  align-items:center!important;
  gap:2px!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  padding:2px!important;
  margin:0!important;
  border:1px solid rgba(255,255,255,.085)!important;
  border-radius:.5rem!important;
  background:rgba(255,255,255,.035)!important;
  overflow:hidden!important;
}
#emr-sidebar .emr-sidebar-main-row:hover{
  background:rgba(255,255,255,.09)!important;
  border-color:rgba(244,201,93,.52)!important;
}
#emr-sidebar .emr-sidebar-main-row > a.emr-sidebar-link{
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  border-radius:calc(.5rem - 2px)!important;
  padding:8px 9px!important;
}
#emr-sidebar .emr-nav-tree.branch-active > .emr-sidebar-main-row,
#emr-sidebar .emr-sidebar-main-row:has(> a.emr-sidebar-link.active){
  background:linear-gradient(90deg,rgba(244,201,93,.19),rgba(255,255,255,.065))!important;
  border-color:rgba(244,201,93,.68)!important;
  box-shadow:inset 3px 0 0 var(--emr-accent)!important;
}
#emr-sidebar .emr-sidebar-main-row > a.emr-sidebar-link:hover,
#emr-sidebar .emr-sidebar-main-row > a.emr-sidebar-link.active{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  color:#fff!important;
}
#emr-sidebar .emr-sidebar-toggle{
  width:26px!important;
  height:26px!important;
  min-width:26px!important;
  justify-self:end!important;
  margin-inline-end:2px!important;
  border:1px solid rgba(255,255,255,.20)!important;
  border-radius:999px!important;
  background:rgba(255,255,255,.075)!important;
  color:#fff!important;
}
#emr-sidebar .emr-sidebar-toggle:hover{
  background:rgba(255,216,109,.18)!important;
  border-color:rgba(255,216,109,.82)!important;
  color:#fff!important;
}

/* Current-user footer label. */
#emr-sidebar .emr-user-chip{
  display:flex!important;
  align-items:center!important;
  gap:7px!important;
  padding:5px 7px 10px!important;
  color:#fff!important;
  font-size:.78rem!important;
  font-weight:700!important;
  white-space:nowrap!important;
}
#emr-sidebar .emr-user-chip-icon{
  width:16px!important;
  height:16px!important;
  flex:0 0 16px!important;
  display:grid!important;
  place-items:center!important;
  color:var(--emr-accent-strong)!important;
}
#emr-sidebar .emr-user-chip-icon svg{
  width:16px!important;
  height:16px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.9!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}

html[data-theme="dark"] nav.emr-breadcrumb-bar a.emr-brand-breadcrumb,
html[data-theme="dark"] nav.emr-breadcrumb-bar a.emr-breadcrumb-link{
  background:var(--emr-surface)!important;
  border-color:#59426d!important;
  color:var(--emr-accent-strong)!important;
}

@media(max-width:980px){
  nav.emr-breadcrumb-bar{padding-inline:16px!important}
}


/* ============================================================
   EMR UI v1.5.1 — final visual consistency polish
   ============================================================ */
/* Link-based primary actions (for example New patient / Start encounter)
   must look and behave exactly like primary buttons. */
body.emr-shell-active a.bg-slate-900,
body.emr-shell-active a.emr-btn-primary,
body.emr-shell-active a.button.bg-slate-900{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:.4rem!important;
  background:linear-gradient(135deg,var(--emr-brand-700),var(--emr-brand-900))!important;
  color:#fff!important;
  border:1px solid var(--emr-brand-700)!important;
  border-radius:.5rem!important;
  padding:.5rem 1rem!important;
  font-weight:650!important;
  line-height:1.2!important;
  text-decoration:none!important;
  box-shadow:0 4px 12px rgba(73,29,127,.12)!important;
}
body.emr-shell-active a.bg-slate-900:hover,
body.emr-shell-active a.emr-btn-primary:hover,
body.emr-shell-active a.button.bg-slate-900:hover{
  background:linear-gradient(135deg,var(--emr-brand-600),var(--emr-brand-800))!important;
  color:#fff!important;
  border-color:var(--emr-accent)!important;
  text-decoration:none!important;
  filter:none!important;
}

/* No button-like control may render underlined text. */
body.emr-shell-active button,
body.emr-shell-active .button,
body.emr-shell-active a.bg-slate-900,
body.emr-shell-active a.emr-btn-primary,
body.emr-shell-active a.emr-btn-secondary,
body.emr-shell-active .emr-export-toolbar button,
#emr-sidebar button,
#emr-sidebar a{
  text-decoration:none!important;
}

/* Add breathing room between the logo and the workspace identity block. */
#emr-sidebar .emr-logo-wrap{margin-bottom:8px!important}
#emr-sidebar .emr-brand-title{
  margin-top:5px!important;
  margin-bottom:0!important;
}
#emr-sidebar .emr-brand-subtitle{
  margin-top:4px!important;
  margin-bottom:5px!important;
}

/* Current-user line: whole line italic, only the label is bold. */
#emr-sidebar .emr-user-chip{
  font-style:italic!important;
  font-weight:400!important;
}
#emr-sidebar .emr-user-chip strong{
  font-weight:700!important;
  font-style:italic!important;
}
#emr-sidebar .emr-user-chip-name{
  font-weight:400!important;
  font-style:italic!important;
}

/* ========================================================================== */
/* EMR v1.6.2 — Task status + expandable task cards + calendar overview views */
/* ========================================================================== */
.emr-task-card{padding:0;overflow:hidden}
.emr-task-details{margin:0}
.emr-task-summary{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem;cursor:pointer;list-style:none;user-select:none}
.emr-task-summary::-webkit-details-marker{display:none}
.emr-task-summary::marker{display:none;content:""}
.emr-task-summary:hover{background:color-mix(in srgb,var(--emr-primary-soft) 58%,transparent)}
.emr-task-summary-main{min-width:0;flex:1}
.emr-task-title{font-weight:700;transition:color .15s ease}
.emr-task-title--open{color:#dc2626!important}
.emr-task-title--completed{color:#16a34a!important}
.emr-task-title--in-progress,.emr-task-title--pending,.emr-task-title--on-hold{color:#d97706!important}
.emr-task-title--cancelled{color:#64748b!important}
.emr-task-toggle-label{flex:none;color:var(--emr-primary);font-size:.8rem;font-weight:700;white-space:nowrap}
.emr-task-toggle-open{display:none}
.emr-task-details[open] .emr-task-toggle-open{display:inline}
.emr-task-details[open] .emr-task-toggle-closed{display:none}
.emr-task-body{border-top:1px solid var(--emr-border);padding:1rem;background:var(--emr-surface-soft)}
.emr-task-description{white-space:pre-wrap;line-height:1.55;color:var(--emr-text)}
.emr-task-metadata{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem 1.25rem;margin-top:1rem}
.emr-task-metadata>div{min-width:0}
.emr-task-metadata dt{font-size:.72rem;line-height:1.2;text-transform:uppercase;letter-spacing:.04em;font-weight:800;color:var(--emr-text-soft)}
.emr-task-metadata dd{margin:.25rem 0 0;color:var(--emr-text)}
.emr-task-actions{display:flex;justify-content:flex-end;border-top:1px solid var(--emr-border);padding:.75rem 1rem;background:var(--emr-surface)}

.emr-calendar-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.emr-calendar-view-switch{display:inline-flex;overflow:hidden;border:1px solid var(--emr-border);border-radius:.65rem;background:var(--emr-surface)}
.emr-calendar-view-switch a{display:block;padding:.55rem .9rem;border-inline-end:1px solid var(--emr-border);color:var(--emr-text);font-size:.88rem;font-weight:700;text-decoration:none}
.emr-calendar-view-switch a:last-child{border-inline-end:0}
.emr-calendar-view-switch a:hover{background:var(--emr-primary-soft)}
.emr-calendar-view-switch a.is-active{background:var(--emr-primary);color:#fff}
.emr-calendar-toolbar{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin-top:1rem}
.emr-calendar-navigation,.emr-calendar-date-form{display:flex;align-items:center;gap:.5rem}
.emr-calendar-navigation a{text-decoration:none}
.emr-calendar-count{display:inline-flex;align-items:center;justify-content:center;min-width:1.5rem;height:1.5rem;padding:0 .35rem;border-radius:999px;background:var(--emr-primary-soft);color:var(--emr-primary);font-size:.72rem;font-weight:800}

.emr-calendar-status{display:inline-flex;align-items:center;width:max-content;border-radius:999px;padding:.16rem .48rem;font-size:.68rem;line-height:1.3;font-weight:800}
.emr-calendar-status--scheduled{background:#ede9fe;color:#6d28d9}
.emr-calendar-status--confirmed{background:#dbeafe;color:#1d4ed8}
.emr-calendar-status--checked-in,.emr-calendar-status--in-progress{background:#fef3c7;color:#b45309}
.emr-calendar-status--completed{background:#dcfce7;color:#15803d}
.emr-calendar-status--cancelled,.emr-calendar-status--no-show{background:#fee2e2;color:#b91c1c}
.emr-calendar-status--rescheduled{background:#e2e8f0;color:#475569}

.emr-week-grid{display:grid;grid-template-columns:repeat(7,minmax(150px,1fr));min-width:1080px;border:1px solid var(--emr-border);border-radius:.75rem;overflow:hidden;background:var(--emr-surface)}
.emr-week-day{min-width:0;border-inline-end:1px solid var(--emr-border);background:var(--emr-surface)}
.emr-week-day:last-child{border-inline-end:0}
.emr-week-day.is-today{box-shadow:inset 0 3px 0 var(--emr-primary)}
.emr-week-day-header{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.75rem;border-bottom:1px solid var(--emr-border);background:var(--emr-surface-soft)}
.emr-week-day-header a{display:flex;flex-direction:column;color:var(--emr-text);text-decoration:none}
.emr-week-day-header a span{font-size:.72rem;color:var(--emr-text-soft);text-transform:uppercase;font-weight:800}
.emr-week-day-header a strong{font-size:.92rem}
.emr-week-day-body{display:flex;flex-direction:column;gap:.55rem;padding:.6rem;min-height:300px}
.emr-calendar-event{display:flex;flex-direction:column;gap:.26rem;padding:.6rem;border:1px solid var(--emr-border);border-radius:.6rem;background:var(--emr-surface);box-shadow:0 1px 2px rgba(15,23,42,.04)}
.emr-calendar-event-time{font-size:.72rem;font-weight:800;color:var(--emr-primary)}
.emr-calendar-event-patient{font-size:.84rem;font-weight:800;color:var(--emr-text);text-decoration:none;line-height:1.25}
.emr-calendar-event-patient:hover{text-decoration:underline}
.emr-calendar-event-meta{font-size:.7rem;line-height:1.35;color:var(--emr-text-soft)}
.emr-calendar-event-action{margin-top:.15rem;font-size:.72rem;font-weight:800;color:var(--emr-primary);text-decoration:none}
.emr-calendar-event-action:hover{text-decoration:underline}
.emr-calendar-empty{padding:1rem .35rem;text-align:center;color:var(--emr-text-soft);font-size:.78rem}

.emr-month-calendar{min-width:980px;background:var(--emr-surface)}
.emr-month-weekdays,.emr-month-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}
.emr-month-weekdays>div{padding:.65rem .75rem;border-inline-end:1px solid var(--emr-border);border-bottom:1px solid var(--emr-border);background:var(--emr-surface-soft);color:var(--emr-text-soft);font-size:.72rem;text-transform:uppercase;font-weight:800;text-align:center}
.emr-month-weekdays>div:last-child{border-inline-end:0}
.emr-month-day{min-height:142px;padding:.5rem;border-inline-end:1px solid var(--emr-border);border-bottom:1px solid var(--emr-border);background:var(--emr-surface);overflow:hidden}
.emr-month-week .emr-month-day:last-child{border-inline-end:0}
.emr-month-week:last-child .emr-month-day{border-bottom:0}
.emr-month-day.is-outside-month{background:color-mix(in srgb,var(--emr-surface-soft) 74%,var(--emr-surface))}
.emr-month-day.is-outside-month .emr-month-day-header>a{opacity:.48}
.emr-month-day.is-today{box-shadow:inset 0 0 0 2px var(--emr-primary)}
.emr-month-day-header{display:flex;align-items:center;justify-content:space-between;gap:.4rem;margin-bottom:.45rem}
.emr-month-day-header>a{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;border-radius:999px;color:var(--emr-text);font-size:.8rem;font-weight:800;text-decoration:none}
.emr-month-day-header>a:hover{background:var(--emr-primary-soft);color:var(--emr-primary)}
.emr-month-day.is-today .emr-month-day-header>a{background:var(--emr-primary);color:#fff}
.emr-month-day-events{display:flex;flex-direction:column;gap:.28rem}
.emr-month-event{display:flex;align-items:center;gap:.35rem;min-width:0;padding:.26rem .34rem;border-radius:.35rem;background:var(--emr-primary-soft);color:var(--emr-text);text-decoration:none;font-size:.68rem;line-height:1.25}
.emr-month-event:hover{filter:brightness(.98)}
.emr-month-event>span{flex:none;color:var(--emr-primary);font-weight:800}
.emr-month-event>strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}
.emr-month-more{font-size:.68rem;font-weight:800;color:var(--emr-primary);text-decoration:none;padding:.15rem .25rem}
.emr-month-more:hover{text-decoration:underline}

html[data-theme="dark"] .emr-task-title--open{color:#fca5a5!important}
html[data-theme="dark"] .emr-task-title--completed{color:#86efac!important}
html[data-theme="dark"] .emr-task-title--in-progress,
html[data-theme="dark"] .emr-task-title--pending,
html[data-theme="dark"] .emr-task-title--on-hold{color:#fcd34d!important}
html[data-theme="dark"] .emr-calendar-status--scheduled,
html[data-theme="dark"] .emr-calendar-status--confirmed,
html[data-theme="dark"] .emr-calendar-status--checked-in,
html[data-theme="dark"] .emr-calendar-status--in-progress,
html[data-theme="dark"] .emr-calendar-status--completed,
html[data-theme="dark"] .emr-calendar-status--cancelled,
html[data-theme="dark"] .emr-calendar-status--no-show,
html[data-theme="dark"] .emr-calendar-status--rescheduled{background:var(--emr-surface-soft)}

@media (max-width:700px){
  .emr-task-summary{align-items:flex-start}
  .emr-task-toggle-label{font-size:0}
  .emr-task-toggle-label::after{content:"⌄";font-size:1.1rem}
  .emr-task-details[open] .emr-task-toggle-label::after{content:"⌃"}
  .emr-task-metadata{grid-template-columns:1fr}
  .emr-calendar-heading{align-items:flex-start}
  .emr-calendar-view-switch{width:100%}
  .emr-calendar-view-switch a{flex:1;text-align:center}
  .emr-calendar-toolbar{align-items:stretch}
  .emr-calendar-navigation,.emr-calendar-date-form{width:100%}
  .emr-calendar-date-form input[type="date"]{flex:1}
}

/* ========================================================================== */
/* EMR v1.6.3 — Tasks + calendar visual refinement                            */
/* ========================================================================== */

/* --- Tasks: clean expandable cards --------------------------------------- */
.emr-task-card{
  position:relative;
  padding:0!important;
  overflow:hidden;
  border:1px solid var(--emr-border)!important;
  border-radius:12px!important;
  background:var(--emr-surface)!important;
  box-shadow:0 1px 2px rgba(40,29,51,.025);
}
.emr-task-details{display:block;margin:0!important}
.emr-task-summary{
  position:relative;
  display:flex!important;
  align-items:center!important;
  min-height:70px;
  padding:14px 64px 14px 18px!important;
  cursor:pointer;
  list-style:none!important;
  user-select:none;
  transition:background-color .15s ease;
}
.emr-task-summary::-webkit-details-marker{display:none!important}
.emr-task-summary::marker{content:""!important;font-size:0!important}
.emr-task-summary:hover{background:#fbf9fd!important}
.emr-task-summary:focus-visible{outline:2px solid var(--emr-brand-500);outline-offset:-2px}
.emr-task-summary-main{display:block;min-width:0;flex:1 1 auto}
.emr-task-title{display:block;font-size:.96rem;line-height:1.35;font-weight:750!important;margin-bottom:3px}
.emr-task-title--open{color:#c92f3d!important}
.emr-task-title--completed{color:#25834f!important}
.emr-task-title--in-progress,.emr-task-title--pending,.emr-task-title--on-hold{color:#9a6417!important}
.emr-task-title--cancelled{color:#766d80!important}
.emr-task-chevron{
  position:absolute;
  right:17px;
  top:50%;
  width:31px;
  height:31px;
  transform:translateY(-50%);
  display:grid;
  place-items:center;
  border:1px solid var(--emr-brand-300);
  border-radius:999px;
  background:#f6f1fa;
  color:var(--emr-brand-500);
  transition:background-color .15s ease,border-color .15s ease,transform .18s ease;
}
.emr-task-chevron svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .18s ease}
.emr-task-summary:hover .emr-task-chevron{background:#efe7f7;border-color:var(--emr-brand-400);color:var(--emr-brand-600)}
.emr-task-details[open] .emr-task-chevron svg{transform:rotate(180deg)}
.emr-task-body{border-top:1px solid var(--emr-border)!important;padding:16px 18px 18px!important;background:#fcfafe!important}
.emr-task-description{white-space:pre-wrap;line-height:1.6;color:var(--emr-text)}
.emr-task-metadata{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 24px;margin-top:16px!important}
.emr-task-metadata>div{min-width:0}
.emr-task-metadata dt{font-size:.69rem;line-height:1.2;text-transform:uppercase;letter-spacing:.055em;font-weight:800;color:var(--emr-text-soft)}
.emr-task-metadata dd{margin:3px 0 0!important;color:var(--emr-text);font-size:.88rem}
.emr-task-actions{display:flex!important;justify-content:flex-end!important;border-top:1px solid var(--emr-border)!important;padding:10px 16px!important;background:var(--emr-surface)!important}

/* --- Calendar: command bar ------------------------------------------------ */
.emr-calendar-page-heading{margin-bottom:14px}
.emr-calendar-page-heading h1{margin:0}
.emr-calendar-shell{
  overflow:hidden;
  border:1px solid var(--emr-border);
  border-radius:14px;
  background:var(--emr-surface);
  box-shadow:0 1px 3px rgba(40,29,51,.035);
}
.emr-calendar-commandbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  min-height:72px;
  padding:12px 16px;
  border-bottom:1px solid var(--emr-border);
  background:var(--emr-surface);
}
.emr-calendar-commandbar-primary,.emr-calendar-commandbar-secondary{display:flex;align-items:center;gap:10px;min-width:0}
.emr-calendar-commandbar-primary{flex:1 1 auto}
.emr-calendar-commandbar-secondary{flex:0 0 auto}
.emr-calendar-today-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  padding:0 15px;
  border:1px solid var(--emr-brand-300);
  border-radius:9px;
  background:var(--emr-surface);
  color:var(--emr-brand-800);
  font-size:.84rem;
  font-weight:700;
  text-decoration:none!important;
}
.emr-calendar-today-button:hover{background:#f6f1fa;color:var(--emr-brand-800)!important;border-color:var(--emr-brand-400)}
.emr-calendar-arrow-group{display:flex;align-items:center;gap:2px}
.emr-calendar-arrow{
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  border-radius:999px;
  color:var(--emr-brand-700)!important;
  text-decoration:none!important;
}
.emr-calendar-arrow:hover{background:#f1eaf8!important}
.emr-calendar-arrow svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.emr-calendar-period-label{margin-left:4px;font-size:1.08rem;font-weight:720;color:var(--emr-text);white-space:nowrap}
.emr-calendar-date-form{display:flex!important;align-items:center!important;gap:6px!important;margin:0!important}
.emr-calendar-date-form input[type="date"]{height:38px;padding:0 9px!important;border:1px solid var(--emr-border)!important;border-radius:8px!important;font-size:.8rem!important;min-width:140px}
.emr-calendar-date-form button{height:38px;padding:0 11px!important;border:1px solid var(--emr-brand-300)!important;border-radius:8px!important;background:var(--emr-surface)!important;color:var(--emr-brand-800)!important;font-size:.8rem!important;font-weight:700!important}
.emr-calendar-view-switch{
  display:inline-flex!important;
  align-items:stretch;
  overflow:hidden;
  border:1px solid var(--emr-brand-300)!important;
  border-radius:9px!important;
  background:var(--emr-surface)!important;
}
.emr-calendar-view-switch a{
  display:flex!important;
  align-items:center;
  justify-content:center;
  min-width:60px;
  height:38px;
  padding:0 11px!important;
  border:0!important;
  border-inline-end:1px solid var(--emr-brand-300)!important;
  background:transparent!important;
  color:var(--emr-brand-800)!important;
  font-size:.8rem!important;
  font-weight:700!important;
  text-decoration:none!important;
}
.emr-calendar-view-switch a:last-child{border-inline-end:0!important}
.emr-calendar-view-switch a:hover{background:#f6f1fa!important}
.emr-calendar-view-switch a.is-active{background:var(--emr-brand-700)!important;color:#fff!important}
.emr-calendar-grid-scroll{width:100%;overflow:auto;background:var(--emr-surface)}
.emr-calendar-day-table-wrap{overflow-x:auto;background:var(--emr-surface)}

/* Calendar status treatment: retain meaning, but stay inside the purple system */
.emr-calendar-status{display:inline-flex;align-items:center;width:max-content;border-radius:999px;padding:.18rem .5rem;font-size:.68rem;line-height:1.3;font-weight:800;background:#eee6f6!important;color:var(--emr-brand-800)!important}
.emr-calendar-status--confirmed{background:#e4d7f1!important;color:#572f88!important}
.emr-calendar-status--checked-in,.emr-calendar-status--in-progress{background:#d9c7eb!important;color:#4a2774!important}
.emr-calendar-status--completed{background:#f1ebf7!important;color:#6c3baa!important}
.emr-calendar-status--cancelled,.emr-calendar-status--no-show{background:#eeeaf2!important;color:#776b82!important}
.emr-calendar-status--rescheduled{background:#e9def3!important;color:#70409f!important}

/* --- Week view: Google-style time grid ----------------------------------- */
.emr-week-calendar{min-width:1040px;background:var(--emr-surface)}
.emr-week-header-grid{
  display:grid;
  grid-template-columns:72px repeat(7,minmax(138px,1fr));
  border-bottom:1px solid var(--emr-border);
  background:var(--emr-surface);
}
.emr-week-timezone{display:flex;align-items:flex-end;justify-content:flex-end;padding:0 9px 10px 4px;color:var(--emr-text-soft);font-size:.65rem;border-inline-end:1px solid var(--emr-border)}
.emr-week-column-header{
  position:relative;
  min-height:72px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  border-inline-end:1px solid var(--emr-border);
  color:var(--emr-text)!important;
  text-decoration:none!important;
  background:var(--emr-surface)!important;
}
.emr-week-column-header:last-child{border-inline-end:0}
.emr-week-column-header:hover{background:#fbf9fd!important}
.emr-week-column-weekday{font-size:.66rem;letter-spacing:.055em;color:var(--emr-text-soft);font-weight:750}
.emr-week-column-date{width:34px;height:34px;display:grid;place-items:center;border-radius:999px;font-size:1rem;font-weight:650;color:var(--emr-text)}
.emr-week-column-header.is-today .emr-week-column-weekday{color:var(--emr-brand-700)}
.emr-week-column-header.is-today .emr-week-column-date{background:var(--emr-brand-700);color:#fff}
.emr-week-column-count{position:absolute;right:7px;top:7px;min-width:20px;height:20px;display:grid;place-items:center;border-radius:999px;background:#f0e8f7;color:var(--emr-brand-700);font-size:.64rem;font-weight:800}
.emr-week-body{display:grid;grid-template-columns:72px minmax(0,1fr);height:calc(var(--week-hours) * var(--hour-height));min-height:640px;background:var(--emr-surface)}
.emr-week-time-axis{position:relative;height:100%;border-inline-end:1px solid var(--emr-border);background:var(--emr-surface)}
.emr-week-time-label{position:absolute;right:9px;transform:translateY(-50%);padding:0 2px;background:var(--emr-surface);color:var(--emr-text-soft);font-size:.65rem;line-height:1;white-space:nowrap}
.emr-week-time-label:first-child{transform:translateY(3px)}
.emr-week-day-columns{display:grid;grid-template-columns:repeat(7,minmax(138px,1fr));height:100%}
.emr-week-day-column{
  position:relative;
  min-width:0;
  height:100%;
  border-inline-end:1px solid var(--emr-border);
  background-color:var(--emr-surface);
  background-image:repeating-linear-gradient(to bottom,
    transparent 0,
    transparent 31px,
    rgba(222,214,232,.48) 31px,
    rgba(222,214,232,.48) 32px,
    transparent 32px,
    transparent 63px,
    var(--emr-border) 63px,
    var(--emr-border) 64px);
}
.emr-week-day-column:last-child{border-inline-end:0}
.emr-week-day-column.is-today{background-color:#fdfbff}
.emr-week-event{
  position:absolute;
  left:4px;
  right:5px;
  min-height:30px;
  z-index:2;
  overflow:hidden;
  border:1px solid #d5c1e9;
  border-left:4px solid var(--emr-brand-700);
  border-radius:5px;
  background:#eee5f7;
  box-shadow:0 1px 2px rgba(76,42,114,.08);
}
.emr-week-event a{display:flex;flex-direction:column;height:100%;padding:5px 6px;color:#4d2a70!important;text-decoration:none!important;overflow:hidden}
.emr-week-event strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.72rem;line-height:1.2;font-weight:800}
.emr-week-event span{font-size:.64rem;line-height:1.25;color:#6c3baa;white-space:nowrap}
.emr-week-event small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.61rem;line-height:1.2;color:#78638a;margin-top:2px}
.emr-week-event:hover{filter:brightness(.985);box-shadow:0 2px 4px rgba(76,42,114,.12)}
.emr-week-event--confirmed{background:#e5d6f2;border-color:#cbb0e2;border-left-color:#8351c3}
.emr-week-event--checked-in,.emr-week-event--in-progress{background:#dbc8ec;border-color:#c1a3dc;border-left-color:#572f88}
.emr-week-event--completed{background:#f2edf7;border-color:#ddd1e8;border-left-color:#9e77d0}
.emr-week-event--cancelled,.emr-week-event--no-show{background:#f1eef4;border-color:#ded8e4;border-left-color:#8d8297;opacity:.78}
.emr-week-event--rescheduled{background:#e9def3;border-color:#d1bce4;border-left-color:#70409f}

/* --- Month view: Google-style month grid --------------------------------- */
.emr-month-calendar{width:100%;min-width:940px;background:var(--emr-surface)}
.emr-month-weekdays,.emr-month-week{display:grid!important;grid-template-columns:repeat(7,minmax(0,1fr))!important}
.emr-month-weekdays>div{
  height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 8px!important;
  border-inline-end:1px solid var(--emr-border);
  border-bottom:1px solid var(--emr-border);
  background:var(--emr-surface)!important;
  color:var(--emr-text-soft)!important;
  font-size:.66rem!important;
  letter-spacing:.055em;
  font-weight:750!important;
  text-align:center;
}
.emr-month-weekdays>div:last-child{border-inline-end:0}
.emr-month-day{
  min-height:132px!important;
  padding:7px 6px 8px!important;
  border-inline-end:1px solid var(--emr-border)!important;
  border-bottom:1px solid var(--emr-border)!important;
  background:var(--emr-surface)!important;
  overflow:hidden;
}
.emr-month-week .emr-month-day:last-child{border-inline-end:0!important}
.emr-month-week:last-child .emr-month-day{border-bottom:0!important}
.emr-month-day.is-outside-month{background:#fcfbfd!important}
.emr-month-day.is-outside-month .emr-month-day-header>a{color:#a79eaf!important}
.emr-month-day.is-today{box-shadow:none!important;background:#fdfbff!important}
.emr-month-day-header{display:flex!important;justify-content:center!important;align-items:center!important;min-height:29px;margin:0 0 5px!important}
.emr-month-day-header>a{
  min-width:29px!important;
  height:29px!important;
  width:auto!important;
  padding:0 6px;
  display:grid!important;
  place-items:center!important;
  border-radius:999px!important;
  color:var(--emr-text)!important;
  font-size:.75rem!important;
  line-height:1!important;
  font-weight:700!important;
  text-decoration:none!important;
}
.emr-month-day-header>a:hover{background:#f0e8f7!important;color:var(--emr-brand-700)!important}
.emr-month-day.is-today .emr-month-day-header>a{background:var(--emr-brand-700)!important;color:#fff!important}
.emr-month-day-events{display:flex!important;flex-direction:column!important;gap:3px!important;min-width:0}
.emr-month-event{
  display:flex!important;
  align-items:center!important;
  gap:5px!important;
  min-width:0;
  height:22px;
  padding:2px 5px!important;
  border:0!important;
  border-radius:4px!important;
  background:#f0e8f7!important;
  color:#4d2a70!important;
  text-decoration:none!important;
  font-size:.64rem!important;
  line-height:1!important;
}
.emr-month-event:hover{background:#e9def3!important;color:#3a205b!important;filter:none!important}
.emr-month-event-dot{width:6px;height:6px;flex:0 0 6px;border-radius:999px;background:var(--emr-brand-700)}
.emr-month-event-time{flex:0 0 auto!important;color:#6c3baa!important;font-weight:700!important;white-space:nowrap}
.emr-month-event strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700!important}
.emr-month-event--confirmed{background:#e8dcf3!important}.emr-month-event--confirmed .emr-month-event-dot{background:#8351c3}
.emr-month-event--checked-in,.emr-month-event--in-progress{background:#dfd0ed!important}.emr-month-event--checked-in .emr-month-event-dot,.emr-month-event--in-progress .emr-month-event-dot{background:#572f88}
.emr-month-event--completed{background:#f3eef8!important}.emr-month-event--completed .emr-month-event-dot{background:#9e77d0}
.emr-month-event--cancelled,.emr-month-event--no-show{background:#f0edf2!important;color:#776b82!important}.emr-month-event--cancelled .emr-month-event-dot,.emr-month-event--no-show .emr-month-event-dot{background:#9b91a4}
.emr-month-more{display:block;padding:2px 5px!important;color:var(--emr-brand-700)!important;font-size:.65rem!important;font-weight:800!important;text-decoration:none!important}
.emr-month-more:hover{text-decoration:underline!important}

html[data-theme="dark"] .emr-task-summary:hover,html[data-theme="dark"] .emr-task-body,html[data-theme="dark"] .emr-week-day-column.is-today,html[data-theme="dark"] .emr-month-day.is-today{background:var(--emr-surface-2)!important}
html[data-theme="dark"] .emr-task-chevron{background:var(--emr-surface-3);border-color:var(--emr-brand-700);color:var(--emr-brand-400)}
html[data-theme="dark"] .emr-week-event,html[data-theme="dark"] .emr-month-event{background:var(--emr-surface-3)!important;border-color:var(--emr-brand-800);color:var(--emr-brand-300)!important}
html[data-theme="dark"] .emr-week-event a,html[data-theme="dark"] .emr-week-event strong,html[data-theme="dark"] .emr-week-event span,html[data-theme="dark"] .emr-week-event small{color:var(--emr-brand-300)!important}

@media(max-width:1080px){
  .emr-calendar-commandbar{align-items:flex-start;flex-direction:column}
  .emr-calendar-commandbar-primary,.emr-calendar-commandbar-secondary{width:100%}
  .emr-calendar-commandbar-secondary{justify-content:space-between}
}
@media(max-width:720px){
  .emr-task-summary{padding-right:56px!important;padding-left:14px!important}
  .emr-task-chevron{right:13px}
  .emr-task-metadata{grid-template-columns:1fr!important}
  .emr-calendar-commandbar-primary{flex-wrap:wrap}
  .emr-calendar-period-label{order:3;width:100%;margin-left:0;padding-top:2px}
  .emr-calendar-commandbar-secondary{align-items:stretch;flex-direction:column}
  .emr-calendar-date-form,.emr-calendar-view-switch{width:100%}
  .emr-calendar-date-form input[type="date"]{flex:1;min-width:0}
  .emr-calendar-view-switch a{flex:1}
}

/* ========================================================================
   v1.8.0 system-wide interaction, status, form and notification refinements
   ======================================================================== */
:root{
  --emr-status-green:#1f7a4d;--emr-status-green-bg:#e9f7ef;--emr-status-green-border:#b7e3ca;
  --emr-status-blue:#355f9d;--emr-status-blue-bg:#edf4ff;--emr-status-blue-border:#c9daf3;
  --emr-status-purple:#6c3baa;--emr-status-purple-bg:#f2ebf8;--emr-status-purple-border:#d8c6e8;
  --emr-status-amber:#9a650d;--emr-status-amber-bg:#fff7e6;--emr-status-amber-border:#ecd49b;
  --emr-status-red:#a1323f;--emr-status-red-bg:#fff0f1;--emr-status-red-border:#efc1c7;
  --emr-status-gray:#687586;--emr-status-gray-bg:#f2f4f7;--emr-status-gray-border:#d9dee5;
}
.emr-status-badge{display:inline-flex;align-items:center;gap:5px;padding:3px 8px;border:1px solid transparent;border-radius:999px;font-size:.74rem;font-weight:750;line-height:1.2;white-space:nowrap}
.emr-status--active,.emr-status--enabled,.emr-status--completed,.emr-status--complete,.emr-status--paid,.emr-status--reviewed,.emr-status--signed,.emr-status--resolved,.emr-status--final{color:var(--emr-status-green)!important;background:var(--emr-status-green-bg)!important;border-color:var(--emr-status-green-border)!important}
.emr-status--scheduled,.emr-status--confirmed,.emr-status--issued,.emr-status--in_progress,.emr-status--checked_in{color:var(--emr-status-blue)!important;background:var(--emr-status-blue-bg)!important;border-color:var(--emr-status-blue-border)!important}
.emr-status--open,.emr-status--draft,.emr-status--pending,.emr-status--provisional,.emr-status--rescheduled{color:var(--emr-status-purple)!important;background:var(--emr-status-purple-bg)!important;border-color:var(--emr-status-purple-border)!important}
.emr-status--partially_paid,.emr-status--overdue{color:var(--emr-status-amber)!important;background:var(--emr-status-amber-bg)!important;border-color:var(--emr-status-amber-border)!important}
.emr-status--cancelled,.emr-status--canceled,.emr-status--no_show,.emr-status--failed,.emr-status--rejected{color:var(--emr-status-red)!important;background:var(--emr-status-red-bg)!important;border-color:var(--emr-status-red-border)!important}
.emr-status--inactive,.emr-status--disabled,.emr-status--expired,.emr-status--archived,.emr-status--closed,.emr-status--stopped{color:var(--emr-status-gray)!important;background:var(--emr-status-gray-bg)!important;border-color:var(--emr-status-gray-border)!important}

.emr-danger-button{background:#fff!important;color:#a1323f!important;border:1px solid #dfabb2!important;border-radius:8px!important;padding:8px 11px!important;font-size:.82rem!important;cursor:pointer}.emr-danger-button:hover{background:#fff3f4!important}
.emr-inline-editor{margin:10px 14px 14px;padding:14px;border:1px solid var(--emr-border);border-radius:10px;background:var(--emr-surface-2);display:grid;gap:10px}.emr-inline-editor[hidden]{display:none!important}.emr-inline-editor label{font-size:.78rem;font-weight:700;color:var(--emr-text-soft)}.emr-inline-editor input,.emr-inline-editor select,.emr-inline-editor textarea{display:block;width:100%;margin-top:5px}.emr-inline-editor-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.emr-inline-editor-full{grid-column:1/-1}.emr-task-notes{margin-top:16px;padding-top:14px;border-top:1px solid var(--emr-border)}.emr-task-notes h4{margin:0 0 8px}.emr-task-note{padding:9px 0;border-bottom:1px solid var(--emr-border)}.emr-task-note:last-child{border-bottom:0}.emr-task-note>span{margin-inline-start:8px;color:var(--emr-text-soft);font-size:.72rem}.emr-task-note p{margin:4px 0 0;white-space:pre-wrap;font-size:.86rem}

.emr-currency-input{display:flex;align-items:stretch;width:100%;max-width:100%}.emr-currency-code{display:flex;align-items:center;padding:0 11px;border:1px solid var(--emr-border-strong);border-inline-end:0;border-radius:8px 0 0 8px;background:var(--emr-surface-3);font-size:.82rem;font-weight:800;color:var(--emr-text-soft);letter-spacing:.03em}.emr-currency-input input{min-width:0;flex:1;border-radius:0 8px 8px 0!important}.emr-fixed-currency{display:inline-flex;align-items:center;gap:6px;padding:8px 10px;border:1px solid var(--emr-border);border-radius:8px;background:var(--emr-surface-2);font-weight:700}

.emr-notification-area{position:relative;margin-bottom:9px}.emr-notification-button{width:100%;display:flex;align-items:center;gap:8px;padding:9px 10px;border:1px solid rgba(255,255,255,.18);border-radius:9px;background:rgba(255,255,255,.08);color:#fff;cursor:pointer;text-align:left}.emr-notification-button:hover{background:rgba(255,255,255,.13)}.emr-notification-icon{width:18px;height:18px;display:grid;place-items:center}.emr-notification-icon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.emr-notification-badge{margin-inline-start:auto;min-width:20px;height:20px;padding:0 5px;border-radius:999px;display:grid;place-items:center;background:#fff;color:var(--emr-brand-700);font-size:.68rem;font-weight:900}.emr-notification-panel{position:absolute;left:calc(100% + 10px);bottom:0;width:min(370px,calc(100vw - 30px));max-height:520px;overflow:hidden;z-index:1200;background:var(--emr-surface);color:var(--emr-text);border:1px solid var(--emr-border);border-radius:14px;box-shadow:0 18px 50px rgba(33,20,53,.23)}.emr-notification-panel[hidden]{display:none!important}.emr-notification-panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;border-bottom:1px solid var(--emr-border)}.emr-notification-panel-head button,.emr-notification-enable{border:0;background:transparent;color:var(--emr-brand-700);font-size:.74rem;font-weight:750;cursor:pointer}.emr-notification-list{max-height:380px;overflow:auto}.emr-notification-item{width:100%;display:flex;flex-direction:column;gap:3px;padding:11px 14px;border:0;border-bottom:1px solid var(--emr-border);background:var(--emr-surface);color:var(--emr-text);text-align:left;cursor:pointer}.emr-notification-item:hover{background:var(--emr-surface-2)}.emr-notification-item.is-unread{background:#fbf8fe;border-inline-start:4px solid var(--emr-brand-500)}.emr-notification-item strong{font-size:.82rem}.emr-notification-item span{font-size:.77rem;color:var(--emr-text-soft)}.emr-notification-item small{font-size:.67rem;color:var(--emr-text-soft)}.emr-notification-empty{padding:18px;text-align:center;color:var(--emr-text-soft);font-size:.8rem}.emr-notification-enable{width:100%;padding:10px 14px;border-top:1px solid var(--emr-border);text-align:center}.emr-calendar-new-button{white-space:nowrap;background:var(--emr-brand-700)!important;color:#fff!important;border-color:var(--emr-brand-700)!important}

/* Harmonize native inputs that appear in legacy and utility views. */
body.emr-shell-active input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),body.emr-shell-active select,body.emr-shell-active textarea{border-color:var(--emr-border-strong);border-radius:8px;transition:border-color .15s ease,box-shadow .15s ease}body.emr-shell-active input:focus,body.emr-shell-active select:focus,body.emr-shell-active textarea:focus{outline:0;border-color:var(--emr-brand-500);box-shadow:0 0 0 3px rgba(108,59,170,.12)}body.emr-shell-active input::placeholder,body.emr-shell-active textarea::placeholder{color:#9a90a2;opacity:1}
html[data-theme="dark"] .emr-notification-item.is-unread{background:var(--emr-surface-2)}html[data-theme="dark"] .emr-status-badge{filter:saturate(.8)}
@media(max-width:900px){.emr-notification-panel{left:0;bottom:calc(100% + 8px)}.emr-inline-editor-grid{grid-template-columns:1fr}.emr-inline-editor-full{grid-column:auto}}

.emr-notification-panel-head>span{display:flex;align-items:center;gap:8px}

/* ========================================================================== */
/* EMR v1.8.2 — notifications, task notes, drug index, clinical workspace UX */
/* ========================================================================== */

/* Notifications: overlay above the clinical view and never behind content. */
#emr-sidebar{z-index:5000!important}
.emr-notification-area{position:relative!important;z-index:5100}
.emr-notification-panel{
  position:fixed!important;
  inset-inline-start:calc(var(--emr-sidebar-width) + 12px)!important;
  inset-inline-end:auto!important;
  bottom:82px!important;
  width:min(410px,calc(100vw - var(--emr-sidebar-width) - 30px))!important;
  max-height:min(620px,calc(100vh - 110px))!important;
  z-index:9999!important;
  overflow:hidden!important;
  border:1px solid color-mix(in srgb,var(--emr-brand-500) 24%,var(--emr-border))!important;
  border-radius:16px!important;
  background:var(--emr-surface)!important;
  box-shadow:0 24px 70px rgba(34,20,52,.30)!important;
}
.emr-notification-panel-head{padding:14px 16px 12px!important;align-items:flex-start!important}
.emr-notification-panel-head>div{display:flex;flex-direction:column;gap:2px}
.emr-notification-panel-head strong{font-size:.98rem;color:var(--emr-text)}
.emr-notification-panel-head small{font-size:.72rem;color:var(--emr-text-soft)}
.emr-notification-view-all{font-size:.76rem;font-weight:800;color:var(--emr-brand-700);text-decoration:none;padding:3px 0}
.emr-notification-panel-actions{display:flex;align-items:center;gap:8px;padding:8px 14px;border-bottom:1px solid var(--emr-border);background:var(--emr-surface-2)}
.emr-notification-panel-actions button{padding:6px 9px!important;border:1px solid var(--emr-border)!important;border-radius:8px!important;background:var(--emr-surface)!important;color:var(--emr-brand-700)!important;font-size:.72rem!important;font-weight:800!important}
.emr-notification-list{max-height:min(430px,calc(100vh - 250px))!important;overflow:auto!important;overscroll-behavior:contain}
.emr-notification-item{
  position:relative!important;
  display:grid!important;
  grid-template-columns:28px minmax(0,1fr) auto!important;
  align-items:start!important;
  gap:10px!important;
  width:100%!important;
  padding:12px 14px!important;
  border:0!important;
  border-bottom:1px solid var(--emr-border)!important;
  text-align:start!important;
  color:var(--emr-text)!important;
  transition:background .15s ease!important;
}
.emr-notification-item.is-read{background:var(--emr-surface)!important}
.emr-notification-item.is-unread{background:#f7f1fc!important;box-shadow:inset 4px 0 0 var(--emr-brand-500)!important}
html[data-theme="dark"] .emr-notification-item.is-unread{background:color-mix(in srgb,var(--emr-brand-700) 18%,var(--emr-surface))!important}
.emr-notification-item:hover{background:var(--emr-surface-2)!important}
.emr-notification-item-marker{width:28px;height:28px;border-radius:9px;display:grid;place-items:center;background:#eee9f4;flex:none}
.emr-notification-item-marker i{display:block;width:9px;height:9px;border-radius:999px;background:#8d7c9c}
.emr-notification-event--task-created .emr-notification-item-marker{background:#fff0f1}.emr-notification-event--task-created .emr-notification-item-marker i{background:#c93448}
.emr-notification-event--appointment-created .emr-notification-item-marker{background:#eef4ff}.emr-notification-event--appointment-created .emr-notification-item-marker i{background:#386cc0}
.emr-notification-event--patient-registered .emr-notification-item-marker{background:#edf8f1}.emr-notification-event--patient-registered .emr-notification-item-marker i{background:#2d8a5a}
.emr-notification-event--notification-test .emr-notification-item-marker{background:#f4edfb}.emr-notification-event--notification-test .emr-notification-item-marker i{background:var(--emr-brand-600)}
.emr-notification-item-copy{display:flex;flex-direction:column;min-width:0;gap:2px}
.emr-notification-item-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.emr-notification-item-top em{font-style:normal;font-size:.66rem;text-transform:uppercase;letter-spacing:.05em;font-weight:850;color:var(--emr-brand-700)}
.emr-notification-item-top small{font-size:.65rem;color:var(--emr-text-soft);white-space:nowrap}
.emr-notification-item-copy strong{font-size:.82rem;line-height:1.35;color:var(--emr-text)}
.emr-notification-message{font-size:.75rem!important;line-height:1.4;color:var(--emr-text-soft)!important;overflow-wrap:anywhere}
.emr-notification-state{margin-top:2px;border-radius:999px;padding:2px 7px;font-size:.62rem;font-weight:850;background:var(--emr-surface-3);color:var(--emr-text-soft)}
.emr-notification-item.is-unread .emr-notification-state{background:#eadcf6;color:var(--emr-brand-700)}
.emr-notification-loading,.emr-notification-error-state,.emr-notification-empty{min-height:104px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:20px;text-align:center;color:var(--emr-text-soft);font-size:.78rem}
.emr-notification-loading{flex-direction:row;min-height:86px}
.emr-notification-spinner{width:17px;height:17px;border:2px solid var(--emr-border);border-top-color:var(--emr-brand-600);border-radius:50%;animation:emr-spin .75s linear infinite}
@keyframes emr-spin{to{transform:rotate(360deg)}}
.emr-notification-error-state strong,.emr-notification-empty strong{color:var(--emr-text);font-size:.82rem}
.emr-notification-error-state button{margin-top:3px;border:1px solid var(--emr-border)!important;border-radius:8px!important;background:var(--emr-surface)!important;color:var(--emr-brand-700)!important;padding:6px 10px!important;font-size:.72rem!important;font-weight:800!important}
.emr-notification-enable{display:block!important;width:100%!important;padding:10px 14px!important;border-top:1px solid var(--emr-border)!important;background:var(--emr-surface-2)!important;text-align:center!important;color:var(--emr-brand-700)!important;font-size:.73rem!important;font-weight:800!important}

/* Dedicated notification center. */
.emr-notifications-page{max-width:1080px;margin:0 auto;padding:32px 28px 64px}
.emr-notifications-hero{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:24px 26px;border-radius:18px;background:linear-gradient(125deg,var(--emr-brand-800),var(--emr-brand-600));color:#fff;box-shadow:var(--emr-shadow)}
.emr-notifications-hero h1{margin:2px 0 3px;font-size:1.7rem}.emr-notifications-hero p{margin:0;color:rgba(255,255,255,.82);font-size:.87rem}.emr-eyebrow{font-size:.68rem!important;text-transform:uppercase;letter-spacing:.09em;font-weight:850;color:rgba(255,255,255,.7)!important}
.emr-notification-count-card{min-width:112px;padding:13px 16px;border:1px solid rgba(255,255,255,.2);border-radius:13px;background:rgba(255,255,255,.1);text-align:center}.emr-notification-count-card span{display:block;font-size:.7rem;text-transform:uppercase;letter-spacing:.06em}.emr-notification-count-card strong{display:block;margin-top:2px;font-size:1.7rem}
.emr-notifications-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:20px 0 14px;padding:12px 14px;border:1px solid var(--emr-border);border-radius:13px;background:var(--emr-surface);box-shadow:0 1px 2px rgba(30,20,45,.03)}
.emr-notification-filter-tabs{display:flex;gap:5px}.emr-notification-filter-tabs a{padding:7px 11px;border-radius:8px;text-decoration:none;font-size:.78rem;font-weight:800;color:var(--emr-text-soft)}.emr-notification-filter-tabs a.is-active{background:var(--emr-brand-700);color:#fff}.emr-notification-page-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.emr-notification-page-actions form{margin:0}.emr-notification-page-actions button{height:34px;padding:0 11px!important;border-radius:8px!important;font-size:.75rem!important}
.emr-notification-page-list{display:flex;flex-direction:column;gap:10px}.emr-notification-page-item{display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:14px;align-items:center;padding:16px 17px;border:1px solid var(--emr-border);border-radius:13px;background:var(--emr-surface);box-shadow:0 1px 2px rgba(30,20,45,.03)}.emr-notification-page-item.is-unread{border-color:#ccb7df;background:#faf6fd;box-shadow:inset 4px 0 0 var(--emr-brand-500)}html[data-theme="dark"] .emr-notification-page-item.is-unread{background:color-mix(in srgb,var(--emr-brand-700) 15%,var(--emr-surface))}
.emr-notification-event-marker{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;background:var(--emr-surface-3)}.emr-notification-event-marker span{width:11px;height:11px;border-radius:50%;background:#87788f}.emr-notification-event--task-created .emr-notification-event-marker{background:#fff0f1}.emr-notification-event--task-created .emr-notification-event-marker span{background:#c93448}.emr-notification-event--appointment-created .emr-notification-event-marker{background:#eef4ff}.emr-notification-event--appointment-created .emr-notification-event-marker span{background:#386cc0}.emr-notification-event--patient-registered .emr-notification-event-marker{background:#edf8f1}.emr-notification-event--patient-registered .emr-notification-event-marker span{background:#2d8a5a}.emr-notification-event--notification-test .emr-notification-event-marker{background:#f4edfb}.emr-notification-event--notification-test .emr-notification-event-marker span{background:var(--emr-brand-600)}
.emr-notification-page-content h2{margin:3px 0 2px;font-size:.94rem}.emr-notification-page-content p{margin:0;font-size:.8rem;color:var(--emr-text-soft);line-height:1.45}.emr-notification-page-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:.68rem;color:var(--emr-text-soft)}.emr-notification-event-label{font-weight:850;text-transform:uppercase;letter-spacing:.05em;color:var(--emr-brand-700)}.emr-notification-read-state{padding:2px 7px;border-radius:999px;background:var(--emr-surface-3);font-weight:800}.is-unread .emr-notification-read-state{background:#eadcf6;color:var(--emr-brand-700)}.emr-notification-page-item-actions{display:flex;gap:7px;align-items:center}.emr-notification-page-item-actions form{margin:0}.emr-notification-page-item-actions button{height:34px;padding:0 10px!important;font-size:.73rem!important;border-radius:8px!important}.emr-notifications-empty-state{margin-top:16px;padding:46px 24px;border:1px dashed var(--emr-border);border-radius:14px;background:var(--emr-surface);text-align:center;color:var(--emr-text-soft)}.emr-notifications-empty-state strong{display:block;color:var(--emr-text);font-size:.95rem}.emr-notifications-empty-state p{margin:5px 0 0;font-size:.8rem}.emr-empty-bell{width:42px;height:42px;margin:0 auto 10px;border-radius:50%;display:grid;place-items:center;background:#edf8f1;color:#2d8a5a;font-weight:900}.emr-notification-pagination{margin-top:16px}

/* Auto-dismiss success/error banners. */
.emr-flash-success,.emr-flash-error{max-width:720px;margin:22px auto;padding:13px 18px;border-radius:11px;text-align:center;font-size:.86rem;font-weight:700;transition:opacity .3s ease,transform .3s ease}.emr-flash-success{border:1px solid #a9ddbd;background:#edf8f1;color:#217346}.emr-flash-error{border:1px solid #edb8bf;background:#fff1f2;color:#a52e3d}.emr-flash-success.is-hiding,.emr-flash-error.is-hiding{opacity:0;transform:translateY(-5px)}

/* Task action and note spacing. */
.emr-task-actions{gap:8px!important;flex-wrap:wrap!important;align-items:center!important}.emr-task-actions form{margin:0!important}.emr-task-actions button{min-height:34px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important}.emr-task-notes{margin-top:18px!important;padding-top:15px!important}.emr-task-note{padding:10px 0!important}.emr-task-note-meta{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.emr-task-note-meta strong{font-size:.79rem;color:var(--emr-text)}.emr-task-note-meta time{font-size:.69rem;color:var(--emr-text-soft)}.emr-task-note p{margin:6px 0 0!important;line-height:1.5}

/* Drug Index: one alignment system for add/edit/filter fields. */
.emr-drug-index-page{max-width:1260px;margin:0 auto;padding:30px 26px 64px}.emr-drug-header{margin-bottom:18px}.emr-drug-header h1{margin:0;font-size:1.65rem}.emr-drug-header p{max-width:820px;margin:5px 0 0;color:var(--emr-text-soft);font-size:.86rem}.emr-drug-card{margin-bottom:16px;padding:20px;border:1px solid var(--emr-border);border-radius:14px;background:var(--emr-surface);box-shadow:0 1px 3px rgba(33,20,53,.04)}.emr-drug-card h2{margin:0 0 14px;font-size:1rem}.emr-drug-form-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px 14px;align-items:start}.emr-drug-field{display:flex;flex-direction:column;min-width:0;gap:5px}.emr-drug-field>span{min-height:18px;font-size:.72rem;font-weight:800;color:var(--emr-text-soft)}.emr-drug-field input,.emr-drug-field select,.emr-drug-field textarea{width:100%;min-width:0;margin:0!important}.emr-drug-field textarea{min-height:84px}.emr-drug-span-2{grid-column:span 2}.emr-drug-full{grid-column:1/-1}.emr-drug-form-actions{grid-column:1/-1;display:flex;justify-content:flex-end;gap:8px;padding-top:2px}.emr-drug-form-actions button{min-width:112px;height:36px;border-radius:8px!important;font-size:.77rem!important}.emr-drug-filters{display:grid;grid-template-columns:minmax(240px,1.5fr) repeat(3,minmax(160px,1fr));gap:12px;margin-bottom:14px;padding:14px;border:1px solid var(--emr-border);border-radius:11px;background:var(--emr-surface-2)}.emr-drug-table-wrap{overflow:auto;border:1px solid var(--emr-border);border-radius:11px}.emr-drug-table{width:100%;border-collapse:collapse}.emr-drug-table th,.emr-drug-table td{padding:11px 10px;text-align:start;vertical-align:top;border-bottom:1px solid var(--emr-border);font-size:.8rem}.emr-drug-table tr:last-child td{border-bottom:0}.emr-drug-muted{margin-top:2px;color:var(--emr-text-soft);font-size:.72rem}.emr-drug-actions{display:flex;align-items:center;gap:7px;white-space:nowrap}.emr-drug-actions form{margin:0}.emr-drug-actions button{height:32px;padding:0 9px!important;border-radius:7px!important;font-size:.72rem!important}.emr-drug-edit-cell{padding:15px!important;background:var(--emr-surface-2)}

/* Prescription and medication-review workspace cards. */
.emr-clinical-workspace{max-width:1180px;margin:0 auto;padding:26px 26px 64px}.emr-workspace-hero{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:20px 22px;border:1px solid var(--emr-border);border-radius:15px;background:var(--emr-surface);box-shadow:var(--emr-shadow)}.emr-workspace-hero h1{margin:0;font-size:1.4rem}.emr-workspace-hero p{margin:3px 0 0;font-size:.8rem;color:var(--emr-text-soft)}.emr-workspace-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(280px,.7fr);gap:16px;margin-top:16px}.emr-workspace-card{padding:18px;border:1px solid var(--emr-border);border-radius:13px;background:var(--emr-surface);box-shadow:0 1px 3px rgba(33,20,53,.035)}.emr-workspace-card h2{margin:0;font-size:.98rem}.emr-workspace-card-subtitle{margin:3px 0 0;font-size:.76rem;color:var(--emr-text-soft)}.emr-prescription-row{display:block;margin-top:10px;padding:13px;border:1px solid var(--emr-border);border-radius:10px;text-decoration:none;background:var(--emr-surface)}.emr-prescription-row:hover{border-color:var(--emr-brand-400);background:var(--emr-surface-2)}.emr-clinical-summary-list{display:flex;flex-direction:column;gap:8px;margin-top:12px}.emr-clinical-summary-item{padding:10px;border:1px solid var(--emr-border);border-radius:9px;background:var(--emr-surface-2)}.emr-clinical-summary-item strong{font-size:.79rem}.emr-clinical-summary-item p{margin:2px 0 0;font-size:.72rem;color:var(--emr-text-soft)}.emr-med-review-card{margin:0 0 18px;padding:18px;border:1px solid #cdb9df;border-radius:13px;background:#fbf7fe}.emr-med-review-card h2{margin:0;font-size:1rem}.emr-med-review-card>p{margin:3px 0 0;font-size:.76rem;color:var(--emr-text-soft)}.emr-med-review-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:13px}.emr-med-review-item{padding:12px;border:1px solid var(--emr-border);border-radius:10px;background:var(--emr-surface)}.emr-med-review-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.emr-med-review-head strong{font-size:.82rem}.emr-med-review-head time{font-size:.66rem;color:var(--emr-text-soft);white-space:nowrap}.emr-med-review-facts{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.emr-med-review-facts span{padding:3px 7px;border-radius:999px;background:var(--emr-surface-3);font-size:.68rem;color:var(--emr-text-soft)}.emr-med-review-side-effects,.emr-med-review-notes{margin:7px 0 0;font-size:.72rem;color:var(--emr-text-soft);line-height:1.45}.emr-med-review-author{margin-top:7px;font-size:.67rem;color:var(--emr-text-soft)}

/* Patient destructive action: visually separate from ordinary editing. */
.emr-patient-header-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.emr-patient-header-actions form{margin:0}.emr-patient-delete-button{height:36px;padding:0 11px!important;border:1px solid #dfabb2!important;border-radius:8px!important;background:#fff!important;color:#a1323f!important;font-size:.77rem!important;font-weight:750!important}.emr-patient-delete-button:hover{background:#fff3f4!important}

@media(max-width:980px){
  .emr-notification-panel{inset-inline-start:12px!important;inset-inline-end:12px!important;bottom:72px!important;width:auto!important;max-height:calc(100vh - 92px)!important}
  .emr-notifications-page{padding:20px 14px 48px}.emr-notifications-hero{align-items:flex-start}.emr-notifications-toolbar{align-items:flex-start;flex-direction:column}.emr-notification-page-actions{width:100%}.emr-notification-page-item{grid-template-columns:34px minmax(0,1fr)}.emr-notification-page-item-actions{grid-column:2;justify-content:flex-start}
  .emr-drug-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.emr-drug-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.emr-workspace-grid{grid-template-columns:1fr}
}
@media(max-width:640px){
  .emr-notifications-hero{flex-direction:column}.emr-notification-count-card{width:100%}.emr-notification-filter-tabs{width:100%}.emr-notification-filter-tabs a{flex:1;text-align:center}.emr-notification-page-actions button{flex:1}.emr-notification-page-item{padding:13px 12px}.emr-notification-page-item-actions{flex-wrap:wrap}
  .emr-drug-index-page{padding:20px 14px 48px}.emr-drug-form-grid,.emr-drug-filters{grid-template-columns:1fr}.emr-drug-span-2,.emr-drug-full{grid-column:auto}.emr-med-review-list{grid-template-columns:1fr}
}

/* ============================================================
   EMR v1.8.3 — Sidebar logo frameless treatment
   ============================================================ */
#emr-sidebar .emr-logo-wrap{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  padding:0!important;
}

/* ============================================================
   EMR v1.8.5 — Sidebar branding centering and frameless logo
   ============================================================ */
#emr-sidebar .emr-sidebar-brand{
  text-align:center!important;
  padding:12px 14px 10px!important;
  border-bottom:0!important;
}
#emr-sidebar .emr-logo-wrap{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  max-width:236px!important;
  margin:0 auto 10px!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  border-radius:0!important;
  padding:0!important;
}
#emr-sidebar .emr-logo-wrap img{
  display:block!important;
  width:100%!important;
  height:auto!important;
  object-fit:contain!important;
  margin:0 auto!important;
}
#emr-sidebar .emr-brand-title,
#emr-sidebar .emr-brand-subtitle{
  display:block!important;
  width:100%!important;
  text-align:center!important;
}
#emr-sidebar .emr-brand-title{
  margin-top:2px!important;
  margin-bottom:0!important;
}
#emr-sidebar .emr-brand-subtitle{
  margin-top:4px!important;
  margin-bottom:4px!important;
}

/* ============================================================
   EMR v1.8.6 — Restore brand/header separator under subtitle
   ============================================================ */
#emr-sidebar .emr-sidebar-brand{
  border-bottom:1px solid rgba(255,255,255,.14)!important;
  padding-bottom:12px!important;
  margin-bottom:2px!important;
}

/* ============================================================
   EMR v1.8.9 — Notification read-state, sound and attention UX
   ============================================================ */
/* Read/opened notifications become deliberately neutral. Event colors are reserved for unread items. */
.emr-notification-item.is-read{
  background:#f7f6f8!important;
  color:#6f6876!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .emr-notification-item.is-read{
  background:color-mix(in srgb,var(--emr-surface) 88%,#928a98 12%)!important;
}
.emr-notification-item.is-read .emr-notification-item-marker{
  background:#ece9ef!important;
}
.emr-notification-item.is-read .emr-notification-item-marker i{
  background:#9b93a2!important;
}
.emr-notification-item.is-read .emr-notification-item-top em,
.emr-notification-item.is-read .emr-notification-item-copy strong{
  color:#716978!important;
}
.emr-notification-item.is-read .emr-notification-state{
  background:#e9e6ec!important;
  color:#716978!important;
}
.emr-notification-item.is-read .emr-notification-message,
.emr-notification-item.is-read .emr-notification-item-top small{
  color:#918997!important;
}

.emr-notification-page-item.is-read{
  background:#f7f6f8!important;
  border-color:#e3dfe6!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .emr-notification-page-item.is-read{
  background:color-mix(in srgb,var(--emr-surface) 88%,#928a98 12%)!important;
}
.emr-notification-page-item.is-read .emr-notification-event-marker{
  background:#ece9ef!important;
}
.emr-notification-page-item.is-read .emr-notification-event-marker span{
  background:#9b93a2!important;
}
.emr-notification-page-item.is-read .emr-notification-event-label,
.emr-notification-page-item.is-read .emr-notification-page-content h2{
  color:#716978!important;
}
.emr-notification-page-item.is-read .emr-notification-page-content p,
.emr-notification-page-item.is-read .emr-notification-page-meta time{
  color:#918997!important;
}
.emr-notification-page-item.is-read .emr-notification-read-state{
  background:#e9e6ec!important;
  color:#716978!important;
}

/* Incoming-notification attention treatment: short and intentionally non-continuous. */
.emr-notification-button.is-alerting{
  animation:emr-notification-button-pulse .72s ease-in-out 3!important;
}
.emr-notification-badge.is-alerting{
  animation:emr-notification-badge-pop .56s ease-in-out 3!important;
}
.emr-notification-item.is-new-arrival{
  animation:emr-notification-arrival .7s ease-out 1!important;
}
@keyframes emr-notification-button-pulse{
  0%,100%{transform:scale(1);box-shadow:0 0 0 0 rgba(255,255,255,0)}
  45%{transform:scale(1.018);box-shadow:0 0 0 4px rgba(255,255,255,.16),0 0 20px rgba(217,194,238,.35)}
}
@keyframes emr-notification-badge-pop{
  0%,100%{transform:scale(1)}
  45%{transform:scale(1.28)}
}
@keyframes emr-notification-arrival{
  0%{opacity:.55;transform:translateY(5px)}
  55%{opacity:1;transform:translateY(-1px)}
  100%{opacity:1;transform:translateY(0)}
}

/* Sound toggle follows the same compact action-button language. */
.emr-notification-panel-actions [data-emr-notification-sound][aria-pressed="false"]{
  color:var(--emr-text-soft)!important;
  background:var(--emr-surface-3)!important;
}

@media (prefers-reduced-motion: reduce){
  .emr-notification-button.is-alerting,
  .emr-notification-badge.is-alerting,
  .emr-notification-item.is-new-arrival{
    animation:none!important;
  }
}

/* ============================================================
   EMR v1.9.3 — Clinical Documents Phase B: Template designer
   ============================================================ */
.doc-tpl-page{max-width:1500px;margin:0 auto;padding:24px 28px 56px}.doc-tpl-hero{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;flex-wrap:wrap;background:var(--emr-surface,#fff);border:1px solid var(--emr-border,#e3dceb);border-radius:16px;padding:22px}.doc-tpl-eyebrow{font-size:.72rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--emr-brand-500,#6c3baa)}.doc-tpl-hero h1{margin:5px 0 4px;font-size:1.65rem;line-height:1.2}.doc-tpl-subtitle{margin:0;color:var(--emr-text-soft,#64748b);font-size:.9rem;max-width:820px}.doc-tpl-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.doc-tpl-actions form{display:inline-flex;margin:0}.doc-tpl-btn{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:7px 12px;border:1px solid #d8c8eb;border-radius:9px;background:#fff;color:#572c8d;font-size:.82rem;font-weight:700;text-decoration:none!important;cursor:pointer}.doc-tpl-btn:hover{background:#f8f3fc}.doc-tpl-btn-primary{background:#63339b;color:#fff;border-color:#63339b}.doc-tpl-btn-primary:hover{background:#542982;color:#fff}.doc-tpl-btn-danger{color:#a51f38;border-color:#e9bac4}.doc-tpl-btn-danger:hover{background:#fff3f5}.doc-tpl-btn[disabled]{opacity:.48;cursor:not-allowed}.doc-tpl-statusbar{margin:18px 0;padding:12px 16px;border:1px solid #a9dfbd;background:#eefaf2;color:#176837;border-radius:10px;font-weight:700;text-align:center}.doc-tpl-filters{margin-top:16px;display:grid;grid-template-columns:minmax(220px,2fr) repeat(4,minmax(130px,1fr)) auto;gap:10px;align-items:end;background:var(--emr-surface,#fff);border:1px solid var(--emr-border,#e3dceb);border-radius:14px;padding:14px}.doc-tpl-field label,.doc-tpl-field-label{display:block;font-size:.74rem;font-weight:750;color:var(--emr-text-soft,#64748b);margin-bottom:5px}.doc-tpl-field input,.doc-tpl-field select,.doc-tpl-field textarea{width:100%;box-sizing:border-box}.doc-tpl-library{margin-top:16px;display:grid;gap:12px}.doc-tpl-card{background:var(--emr-surface,#fff);border:1px solid var(--emr-border,#e3dceb);border-radius:14px;padding:17px}.doc-tpl-card-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;flex-wrap:wrap}.doc-tpl-card h3{margin:0;font-size:1rem}.doc-tpl-meta{margin-top:5px;display:flex;gap:7px;flex-wrap:wrap;color:var(--emr-text-soft,#64748b);font-size:.76rem}.doc-tpl-description{margin:9px 0 0;color:var(--emr-text-soft,#64748b);font-size:.86rem;max-width:900px}.doc-tpl-version-summary{text-align:right;min-width:150px}.doc-tpl-version-summary strong{display:block;font-size:.93rem}.doc-tpl-card-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:13px;padding-top:13px;border-top:1px solid var(--emr-border,#eee7f3)}.doc-tpl-empty{text-align:center;padding:44px 24px;border:1px dashed #d8c8eb;border-radius:14px;background:#fff}.doc-tpl-form-card{background:#fff;border:1px solid var(--emr-border,#e3dceb);border-radius:14px;padding:18px;margin-top:16px}.doc-tpl-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}.doc-tpl-form-grid .doc-tpl-full{grid-column:1/-1}.doc-tpl-help{font-size:.74rem;color:var(--emr-text-soft,#64748b);margin-top:4px}.doc-tpl-error{font-size:.75rem;color:#b42336;margin-top:4px}.doc-tpl-designer-grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(310px,.72fr);gap:16px;align-items:start;margin-top:16px}.doc-tpl-designer-main{min-width:0}.doc-tpl-designer-side{min-width:0;position:sticky;top:84px;display:grid;gap:12px}.doc-tpl-version-banner{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 14px;border-radius:11px;background:#f7f1fc;border:1px solid #e1d2ef;margin-bottom:13px}.doc-tpl-version-banner.is-published{background:#eff8f1;border-color:#c7e6d0}.doc-tpl-sections{display:grid;gap:12px}.doc-tpl-section{background:#fff;border:1px solid var(--emr-border,#e3dceb);border-radius:14px;overflow:hidden}.doc-tpl-section-head{padding:11px 12px;background:#faf8fc;border-bottom:1px solid var(--emr-border,#e3dceb);display:flex;align-items:center;justify-content:space-between;gap:10px}.doc-tpl-section-index{display:flex;align-items:center;gap:8px;font-size:.78rem;font-weight:800;color:#5b2e8d}.doc-tpl-section-actions{display:flex;gap:5px}.doc-tpl-icon-btn{width:31px;height:31px;display:grid;place-items:center;border:1px solid #ddcfeb;border-radius:8px;background:#fff;color:#603294;cursor:pointer;font-weight:800}.doc-tpl-icon-btn:hover{background:#f4edfa}.doc-tpl-icon-btn.is-remove{color:#aa2d43}.doc-tpl-section-body{padding:13px}.doc-tpl-section-settings{display:grid;grid-template-columns:minmax(180px,1.4fr) minmax(120px,.8fr) minmax(115px,.65fr);gap:10px}.doc-tpl-flags{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin:10px 0}.doc-tpl-check{display:inline-flex;align-items:center;gap:6px;font-size:.77rem;color:#4a4253}.doc-tpl-check input{width:auto!important}.doc-tpl-toolbar{display:flex;gap:5px;flex-wrap:wrap;padding:7px;border:1px solid #d9cee6;border-bottom:0;border-radius:9px 9px 0 0;background:#f9f7fb}.doc-tpl-toolbar button{min-width:31px;height:29px;border:1px solid #ddd2e9;border-radius:6px;background:#fff;color:#4f2c73;cursor:pointer;font-size:.75rem;font-weight:750}.doc-tpl-editor{min-height:125px;border:1px solid #d9cee6;border-radius:0 0 9px 9px;padding:11px 12px;background:#fff;line-height:1.55;outline:none}.doc-tpl-editor:focus{border-color:#8b5bbb;box-shadow:0 0 0 2px rgba(108,59,170,.12)}.doc-tpl-editor p:first-child{margin-top:0}.doc-tpl-editor p:last-child{margin-bottom:0}.doc-tpl-add-section{width:100%;margin-top:12px;border:1px dashed #bda5d4;background:#fbf8fd;color:#603294;border-radius:11px;padding:11px;font-weight:750;cursor:pointer}.doc-tpl-add-section:hover{background:#f5effa}.doc-tpl-side-card{background:#fff;border:1px solid var(--emr-border,#e3dceb);border-radius:14px;padding:14px}.doc-tpl-side-card h3{font-size:.9rem;margin:0 0 4px}.doc-tpl-side-card p{font-size:.75rem;color:var(--emr-text-soft,#64748b);margin:0 0 10px}.doc-tpl-merge-group{margin-top:10px}.doc-tpl-merge-group-title{font-size:.69rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em;color:#7a6e85;margin-bottom:5px}.doc-tpl-token-list{display:flex;gap:5px;flex-wrap:wrap}.doc-tpl-token{border:1px solid #ddcfeb;background:#faf7fd;color:#5c2f8e;border-radius:7px;padding:5px 7px;font-size:.69rem;cursor:pointer}.doc-tpl-token:hover{background:#eee3f7}.doc-tpl-preview-page{background:#fff;border:1px solid #ded7e4;border-radius:7px;box-shadow:0 3px 12px rgba(55,32,71,.07);padding:22px 20px;min-height:430px;font-size:.72rem;line-height:1.55;color:#26202d;overflow:hidden}.doc-tpl-preview-brand{text-align:center;padding-bottom:9px;border-bottom:1px solid #d9cfe1;margin-bottom:14px;color:#5c3c8f}.doc-tpl-preview-brand strong{display:block;font-size:.83rem}.doc-tpl-preview-doc-title{text-align:center;text-transform:uppercase;font-weight:800;font-size:.86rem;margin:0 0 15px}.doc-tpl-preview-section{margin:0 0 13px}.doc-tpl-preview-section.is-page-break{border-top:2px dashed #d8cee1;padding-top:13px}.doc-tpl-preview-section-title{font-weight:800;font-size:.72rem;margin-bottom:4px}.doc-tpl-preview-section-content p{margin:0 0 6px}.doc-tpl-preview-footer{border-top:1px solid #ded7e4;padding-top:8px;margin-top:18px;color:#7a7180;font-size:.62rem;text-align:center}.doc-tpl-page-settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.doc-tpl-margins{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}.doc-tpl-savebar{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;margin-top:16px;padding:13px 15px;background:#fff;border:1px solid var(--emr-border,#e3dceb);border-radius:12px}.doc-tpl-readonly-section{padding:15px}.doc-tpl-readonly-section h3{font-size:.9rem;margin:0 0 7px}.doc-tpl-version-history{display:grid;gap:7px}.doc-tpl-version-link{display:flex;justify-content:space-between;gap:9px;align-items:center;border:1px solid #e0d7e8;border-radius:8px;padding:8px;text-decoration:none!important;color:inherit}.doc-tpl-version-link.is-current{border-color:#8f62ba;background:#f6f0fb}.doc-tpl-preview-shell{max-width:1000px;margin:0 auto;padding:28px}.doc-tpl-preview-a4{background:#fff;border:1px solid #ded7e4;box-shadow:0 8px 28px rgba(45,29,55,.10);margin:18px auto;padding:22mm 18mm 20mm;min-height:267mm;box-sizing:border-box}.doc-tpl-preview-a4.landscape{max-width:297mm;min-height:190mm}.doc-tpl-preview-a4.portrait{max-width:210mm}.doc-tpl-preview-letterhead{text-align:center;color:#5c3c8f;border-bottom:1px solid #d8cce2;padding-bottom:12px;margin-bottom:20px}.doc-tpl-preview-letterhead img{max-height:62px;max-width:280px;object-fit:contain}.doc-tpl-preview-letterhead h2{margin:6px 0 0;font-size:1rem}.doc-tpl-preview-body{font-family:Arial,sans-serif;font-size:11pt;line-height:1.55;color:#15121a}.doc-tpl-preview-body .doc-tpl-preview-section-title{font-size:11pt;margin-top:13px}.doc-tpl-preview-page-footer{border-top:1px solid #ddd4e3;padding-top:8px;margin-top:26px;text-align:center;font-size:8pt;color:#6e6674}.doc-tpl-warning{border:1px solid #efd7a1;background:#fff9e9;color:#7f5812;border-radius:10px;padding:11px 13px;font-size:.8rem}.doc-tpl-readonly-note{padding:11px 13px;border:1px solid #d9dce7;background:#f7f8fb;border-radius:10px;color:#525c6d;font-size:.8rem;margin-bottom:12px}
@media(max-width:1180px){.doc-tpl-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.doc-tpl-filters .doc-tpl-search{grid-column:span 2}.doc-tpl-designer-grid{grid-template-columns:1fr}.doc-tpl-designer-side{position:static;grid-template-columns:repeat(2,minmax(0,1fr))}.doc-tpl-designer-side .doc-tpl-preview-card{grid-column:1/-1}}
@media(max-width:760px){.doc-tpl-page{padding:18px 14px 46px}.doc-tpl-filters,.doc-tpl-form-grid,.doc-tpl-section-settings,.doc-tpl-page-settings-grid,.doc-tpl-designer-side{grid-template-columns:1fr}.doc-tpl-filters .doc-tpl-search,.doc-tpl-form-grid .doc-tpl-full,.doc-tpl-designer-side .doc-tpl-preview-card{grid-column:auto}.doc-tpl-margins{grid-template-columns:repeat(2,minmax(0,1fr))}.doc-tpl-version-summary{text-align:left}.doc-tpl-preview-shell{padding:14px}.doc-tpl-preview-a4{padding:16mm 12mm}}
@media print{body.emr-shell-active #emr-sidebar,.emr-breadcrumb-bar,.doc-tpl-preview-shell>.doc-tpl-actions,.doc-tpl-preview-shell>.doc-tpl-hero{display:none!important}.doc-tpl-preview-shell{padding:0!important;max-width:none!important}.doc-tpl-preview-a4{box-shadow:none!important;border:0!important;margin:0!important;max-width:none!important;min-height:0!important}}

/* ============================================================
   EMR v1.9.4 — Clinical Documents Phase C: patient workspace
   ============================================================ */
.clin-doc-page,.clin-doc-editor-page{max-width:1500px;margin:0 auto;padding:24px 28px 58px}.clin-doc-success{max-width:900px;margin:0 auto 18px;padding:12px 16px;border:1px solid #a9dfbd;background:#eefaf2;color:#176837;border-radius:10px;font-weight:800;text-align:center}.clin-doc-warning{margin:0 0 16px;padding:12px 15px;border:1px solid #efd7a1;background:#fff9e9;color:#765211;border-radius:11px;font-size:.83rem}.clin-doc-warning ul{margin:7px 0 0 18px}.clin-doc-hero{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;flex-wrap:wrap;background:var(--emr-surface,#fff);border:1px solid var(--emr-border,#e3dceb);border-radius:16px;padding:21px 22px}.clin-doc-eyebrow{font-size:.7rem;font-weight:850;letter-spacing:.08em;text-transform:uppercase;color:#6c3baa}.clin-doc-hero h1{margin:5px 0 4px;font-size:1.65rem;line-height:1.2}.clin-doc-hero p{margin:0;color:var(--emr-text-soft,#64748b);font-size:.88rem}.clin-doc-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.clin-doc-actions form{display:inline-flex;margin:0}.clin-doc-btn{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:7px 12px;border:1px solid #d7c7e8;border-radius:9px;background:#fff;color:#572c8d;font-size:.8rem;font-weight:750;text-decoration:none!important;cursor:pointer}.clin-doc-btn:hover{background:#f8f3fc}.clin-doc-btn-primary{background:#63339b;color:#fff;border-color:#63339b}.clin-doc-btn-primary:hover{background:#542982;color:#fff}.clin-doc-btn-wide{width:100%}.clin-doc-btn[disabled]{opacity:.45;cursor:not-allowed}.clin-doc-card,.clin-doc-filter-card{background:var(--emr-surface,#fff);border:1px solid var(--emr-border,#e3dceb);border-radius:14px;padding:18px;margin-top:16px}.clin-doc-card h2{margin:0;font-size:1rem}.clin-doc-card p{color:var(--emr-text-soft,#64748b);font-size:.82rem}.clin-doc-card-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.clin-doc-filter-grid{display:grid;grid-template-columns:minmax(180px,1fr) minmax(180px,1fr) auto;gap:11px;align-items:end}.clin-doc-filter-grid label,.clin-doc-form-grid label{display:block;font-size:.75rem;font-weight:750;color:#5f5569}.clin-doc-filter-grid select,.clin-doc-form-grid input,.clin-doc-form-grid select{display:block;width:100%;margin-top:5px;box-sizing:border-box}.clin-doc-filter-actions{display:flex;gap:7px}.clin-doc-list{display:grid;gap:10px;margin-top:14px}.clin-doc-row{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:14px;border:1px solid #e4dbea;border-radius:11px;background:#fff}.clin-doc-row-main{min-width:0}.clin-doc-row-title{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.clin-doc-row-meta{margin-top:4px;color:#807588;font-size:.74rem}.clin-doc-row-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}.clin-doc-revision-count{font-size:.72rem;color:#817689}.clin-doc-empty{text-align:center;padding:34px 20px;border:1px dashed #d7c5e9;border-radius:12px}.clin-doc-empty h3{margin:0 0 6px;font-size:1rem}.clin-doc-empty p{max-width:650px;margin:0 auto 14px}.clin-doc-create-grid{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:16px;align-items:start}.clin-doc-create-main{min-width:0}.clin-doc-create-aside{min-width:0}.clin-doc-sticky{position:sticky;top:84px}.clin-doc-step{display:flex;gap:12px;align-items:flex-start;margin-bottom:14px}.clin-doc-step>span{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:#6c3baa;color:#fff;font-size:.76rem;font-weight:850;flex:0 0 auto}.clin-doc-step h2{margin:1px 0 3px}.clin-doc-step p{margin:0}.clin-doc-template-select-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.clin-doc-template-choice{position:relative;cursor:pointer}.clin-doc-template-choice>input{position:absolute;opacity:0;pointer-events:none}.clin-doc-template-choice-body{display:block;height:100%;box-sizing:border-box;border:1px solid #dfd4e9;border-radius:11px;padding:13px;background:#fff}.clin-doc-template-choice input:checked+.clin-doc-template-choice-body{border-color:#7a48ad;background:#f8f2fc;box-shadow:0 0 0 2px rgba(108,59,170,.10)}.clin-doc-template-choice strong{display:block;margin:4px 0;font-size:.9rem}.clin-doc-template-choice small,.clin-doc-template-choice em{display:block;font-style:normal;color:#7e7386;font-size:.7rem;line-height:1.45}.clin-doc-template-category{font-size:.64rem;font-weight:850;text-transform:uppercase;letter-spacing:.05em;color:#6c3baa}.clin-doc-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.clin-doc-form-grid .clin-doc-full{grid-column:1/-1}.clin-doc-form-grid small{display:block;margin-top:4px;color:#81768a;font-weight:400}.clin-doc-optional{font-weight:500;color:#91849a}.clin-doc-disclosure-note{border:1px solid #ead9ae;background:#fff9e9;color:#745317;border-radius:10px;padding:10px 12px;font-size:.76rem;line-height:1.5;margin-bottom:12px}.clin-doc-source-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.clin-doc-source-option{display:flex;gap:9px;align-items:flex-start;border:1px solid #e1d7e8;border-radius:10px;padding:10px;background:#fff;cursor:pointer}.clin-doc-source-option input{margin-top:2px}.clin-doc-source-option strong,.clin-doc-source-option small{display:block}.clin-doc-source-option strong{font-size:.8rem}.clin-doc-source-option small{margin-top:2px;color:#83788c;font-size:.68rem;line-height:1.4}.clin-doc-safety-list{display:grid;gap:7px;margin:14px 0;color:#5c5362;font-size:.76rem}.clin-doc-review-lock{margin-top:14px;padding:12px 14px;border:1px solid #c8d9ef;background:#f2f7fd;border-radius:11px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;color:#334c6a;font-size:.8rem}.clin-doc-review-lock form{margin:0}.clin-doc-editor-layout{display:grid;grid-template-columns:190px minmax(0,1fr) 300px;gap:14px;align-items:start;margin-top:15px}.clin-doc-section-nav,.clin-doc-editor-aside{position:sticky;top:82px}.clin-doc-section-nav{background:#fff;border:1px solid #e2d9e9;border-radius:13px;padding:10px;display:grid;gap:4px}.clin-doc-panel-title{font-size:.76rem;font-weight:850;color:#45394f;margin-bottom:7px}.clin-doc-section-nav a{display:flex;gap:7px;align-items:flex-start;padding:8px;border-radius:8px;color:#4d4256;text-decoration:none!important;font-size:.73rem}.clin-doc-section-nav a:hover{background:#f6f1fa}.clin-doc-section-nav a.is-disabled{opacity:.5}.clin-doc-section-nav a>span{width:20px;height:20px;border-radius:6px;background:#f0e8f7;color:#6c3baa;display:grid;place-items:center;font-size:.65rem;font-weight:800;flex:0 0 auto}.clin-doc-section-nav small{display:block;font-size:.58rem;text-transform:uppercase;color:#8b7d94;margin-top:2px}.clin-doc-editor-center{min-width:0}.clin-doc-editor-meta{margin-top:0}.clin-doc-section-stack{display:grid;gap:12px;margin-top:12px}.clin-doc-edit-section{background:#fff;border:1px solid #e1d7e8;border-radius:13px;overflow:hidden;scroll-margin-top:90px}.clin-doc-edit-section.is-disabled{opacity:.58}.clin-doc-edit-section-head{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 12px;background:#faf8fc;border-bottom:1px solid #e7dfec}.clin-doc-edit-section-head>div{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.clin-doc-section-number{width:22px;height:22px;border-radius:7px;background:#eee4f7;color:#63339b;display:grid;place-items:center;font-size:.67rem;font-weight:850}.clin-doc-required,.clin-doc-locked{padding:2px 6px;border-radius:99px;font-size:.59rem;font-weight:800;text-transform:uppercase}.clin-doc-required{background:#f2eafb;color:#6c3baa}.clin-doc-locked{background:#eeeef1;color:#66606b}.clin-doc-section-toggle{display:flex!important;align-items:center;gap:6px;font-size:.7rem!important;font-weight:650!important}.clin-doc-editor-toolbar{display:flex;gap:5px;flex-wrap:wrap;padding:7px 9px;border-bottom:1px solid #e7dfec;background:#fcfbfd}.clin-doc-editor-toolbar button{height:29px;min-width:31px;border:1px solid #ddd0e9;border-radius:6px;background:#fff;color:#56307b;font-size:.72rem;font-weight:750;cursor:pointer}.clin-doc-rich-editor{min-height:125px;padding:14px 15px;line-height:1.6;outline:none;font-size:.88rem}.clin-doc-rich-editor[contenteditable="true"]:focus{box-shadow:inset 0 0 0 2px rgba(108,59,170,.12)}.clin-doc-rich-editor.is-readonly{background:#faf9fb}.clin-doc-rich-editor p:first-child{margin-top:0}.clin-doc-rich-editor p:last-child{margin-bottom:0}.clin-doc-savebar{position:sticky;bottom:10px;z-index:3;display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;background:#fff;border:1px solid #dccfea;border-radius:12px;padding:11px 13px;margin-top:13px;box-shadow:0 8px 25px rgba(61,36,77,.09)}.clin-doc-savebar strong,.clin-doc-savebar span{display:block}.clin-doc-savebar strong{font-size:.78rem}.clin-doc-savebar span{font-size:.68rem;color:#84788c;margin-top:2px}.clin-doc-ready-card{display:flex;justify-content:space-between;gap:15px;align-items:center;flex-wrap:wrap;background:#fff;border:1px solid #dcd3e4;border-radius:12px;padding:13px 15px;margin-top:13px}.clin-doc-ready-card strong{font-size:.82rem}.clin-doc-ready-card p{margin:3px 0 0;font-size:.7rem;color:#83788b}.clin-doc-editor-aside{display:grid;gap:11px}.clin-doc-side-card{background:#fff;border:1px solid #e2d9e9;border-radius:13px;padding:13px}.clin-doc-side-card p{font-size:.7rem;color:#81758a;line-height:1.45;margin:0 0 10px}.clin-doc-insert-list{display:grid;gap:6px}.clin-doc-insert-list button{display:flex;justify-content:space-between;gap:8px;align-items:center;text-align:left;border:1px solid #e0d3ea;border-radius:8px;background:#faf7fd;color:#553077;padding:8px 9px;cursor:pointer}.clin-doc-insert-list button:hover{background:#f1e8f8}.clin-doc-insert-list strong{font-size:.7rem}.clin-doc-insert-list span{font-size:.62rem;color:#8d7e99}.clin-doc-mini-empty{border:1px dashed #ddd1e7;border-radius:8px;padding:10px;color:#8a7e91;font-size:.68rem;text-align:center}.clin-doc-snapshot-options{display:grid;gap:6px;margin-bottom:10px}.clin-doc-snapshot-options label{display:flex;gap:6px;align-items:center;font-size:.69rem;color:#554b5d}.clin-doc-snapshot-options label.is-unavailable{opacity:.42}.clin-doc-provenance{display:grid;grid-template-columns:82px minmax(0,1fr);gap:6px 8px;margin:0;font-size:.68rem}.clin-doc-provenance dt{font-weight:800;color:#6d6274}.clin-doc-provenance dd{margin:0;color:#83778c;overflow-wrap:anywhere}.clin-doc-preview-shell{max-width:1050px;margin:0 auto;padding:26px}.clin-doc-preview-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:14px;background:#fff;border:1px solid #e1d8e7;border-radius:12px;padding:12px 14px}.clin-doc-preview-toolbar strong,.clin-doc-preview-toolbar span{display:block}.clin-doc-preview-toolbar span{font-size:.72rem;color:#82768a;margin-top:2px}.clin-doc-preview-toolbar>div:last-child{display:flex;gap:7px;flex-wrap:wrap}.clin-doc-a4{background:#fff;border:1px solid #ddd5e2;box-shadow:0 8px 28px rgba(45,29,55,.10);margin:0 auto;padding:22mm 18mm 20mm;min-height:267mm;box-sizing:border-box;max-width:210mm}.clin-doc-a4.landscape{max-width:297mm;min-height:190mm}.clin-doc-letterhead{text-align:center;color:#5c3c8f;border-bottom:1px solid #d8cce2;padding-bottom:12px;margin-bottom:20px}.clin-doc-letterhead img{max-height:68px;max-width:330px;object-fit:contain}.clin-doc-letterhead strong{display:block;margin-top:5px}.clin-doc-paper-body{font-family:Arial,sans-serif;font-size:11pt;line-height:1.55;color:#15121a}.clin-doc-paper-body>h1{text-align:center;font-size:15pt;text-transform:uppercase;margin:0 0 18px}.clin-doc-recipient-preview{margin-bottom:15px}.clin-doc-paper-section{margin-bottom:14px}.clin-doc-paper-section h2{font-size:11pt;margin:0 0 5px}.clin-doc-paper-section p{margin-top:0}.clin-doc-paper-section.is-page-break{page-break-before:always}.clin-doc-paper-footer{border-top:1px solid #ddd4e3;padding-top:8px;margin-top:26px;text-align:center;font-size:8pt;color:#756a7b}
@media(max-width:1180px){.clin-doc-create-grid{grid-template-columns:1fr}.clin-doc-create-aside .clin-doc-sticky{position:static}.clin-doc-editor-layout{grid-template-columns:1fr}.clin-doc-section-nav,.clin-doc-editor-aside{position:static}.clin-doc-section-nav{display:flex;overflow-x:auto}.clin-doc-section-nav a{min-width:145px}.clin-doc-editor-aside{grid-template-columns:repeat(2,minmax(0,1fr))}.clin-doc-editor-aside .clin-doc-side-card:last-child{grid-column:1/-1}}
@media(max-width:760px){.clin-doc-page,.clin-doc-editor-page{padding:18px 14px 46px}.clin-doc-filter-grid,.clin-doc-form-grid,.clin-doc-template-select-grid,.clin-doc-source-grid,.clin-doc-editor-aside{grid-template-columns:1fr}.clin-doc-form-grid .clin-doc-full,.clin-doc-editor-aside .clin-doc-side-card:last-child{grid-column:auto}.clin-doc-row{flex-direction:column}.clin-doc-row-actions{justify-content:flex-start}.clin-doc-preview-shell{padding:12px}.clin-doc-a4{padding:16mm 12mm}}
@media print{body.emr-shell-active #emr-sidebar,.emr-breadcrumb-bar,.clin-doc-preview-toolbar{display:none!important}.clin-doc-preview-shell{padding:0!important;max-width:none!important}.clin-doc-a4{box-shadow:none!important;border:0!important;margin:0!important;max-width:none!important;min-height:0!important}}
.emr-status--ready_for_review{color:var(--emr-status-blue)!important;background:var(--emr-status-blue-bg)!important;border-color:var(--emr-status-blue-border)!important}.emr-status--finalized{color:var(--emr-status-green)!important;background:var(--emr-status-green-bg)!important;border-color:var(--emr-status-green-border)!important}.emr-status--superseded{color:var(--emr-status-gray)!important;background:var(--emr-status-gray-bg)!important;border-color:var(--emr-status-gray-border)!important}.emr-status--void{color:var(--emr-status-red)!important;background:var(--emr-status-red-bg)!important;border-color:var(--emr-status-red-border)!important}

/* ============================================================
   EMR v1.9.5 — Clinical Documents Phase D lifecycle/finalization
   ============================================================ */
.clin-doc-lifecycle-card{margin:0 0 18px;padding:16px 18px;border:1px solid var(--emr-border,#ddd6ea);border-radius:14px;background:var(--emr-surface,#fff)}
.clin-doc-lifecycle-main{display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap}.clin-doc-lifecycle-main>div:first-child{min-width:0}.clin-doc-lifecycle-main strong{display:block;font-size:1rem;margin-top:3px}.clin-doc-lifecycle-main p{margin:4px 0 0;color:var(--emr-text-soft,#6b7280);font-size:.82rem}
.clin-doc-verification-line{margin-top:12px;padding:10px 12px;border-radius:9px;background:#f4effa;color:#4f2a7d;font-size:.84rem}.clin-doc-void-box{margin-top:12px;padding:12px 14px;border:1px solid #efb5bc;background:#fff2f3;border-radius:10px;color:#9b1c31;display:flex;gap:12px;align-items:flex-start}.clin-doc-void-box strong{font-size:.78rem;letter-spacing:.12em}.clin-doc-void-details{margin-top:12px;border-top:1px solid var(--emr-border,#e5e7eb);padding-top:10px}.clin-doc-void-details summary{cursor:pointer;font-size:.82rem;color:#8f1e33;font-weight:650}.clin-doc-void-details form{margin-top:10px;display:grid;gap:10px}.clin-doc-void-details textarea{width:100%;min-height:86px;margin-top:5px}
.clin-doc-btn-danger{background:#9f253a!important;border-color:#9f253a!important;color:#fff!important}.clin-doc-btn-danger:hover{filter:brightness(.95)}
.clin-doc-finalize-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,340px);gap:18px;align-items:start}.clin-doc-finalize-aside{display:grid;gap:14px;position:sticky;top:18px}.clin-doc-final-review{display:grid;gap:18px}.clin-doc-final-review article{padding-bottom:16px;border-bottom:1px solid var(--emr-border,#e5e7eb)}.clin-doc-final-review article:last-child{border-bottom:0}.clin-doc-final-review h3{margin:0 0 8px;font-size:1rem}.clin-doc-final-review p{margin:.45em 0;line-height:1.65}.clin-doc-final-review ul,.clin-doc-final-review ol{padding-inline-start:1.4rem;line-height:1.6}.clin-doc-finalize-warning{border-color:#dfc7f1!important;background:#faf6fd!important}.clin-doc-finalize-warning strong{display:block;color:#4f2a7d;margin-bottom:5px}.clin-doc-confirm-check{display:flex!important;gap:9px!important;align-items:flex-start!important;font-size:.84rem!important;line-height:1.45}.clin-doc-confirm-check input{margin-top:3px;flex:0 0 auto}.clin-doc-hash{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow-wrap:anywhere;font-size:.74rem!important}
.clin-doc-revision-history{display:grid;gap:7px}.clin-doc-revision-history>a{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 8px;padding:9px 10px;border:1px solid var(--emr-border,#e5e7eb);border-radius:9px;text-decoration:none!important;color:inherit;background:var(--emr-surface,#fff)}.clin-doc-revision-history>a.is-current{border-color:#9f7acc;background:#faf7fd}.clin-doc-revision-history small{grid-column:1/-1;color:var(--emr-text-soft,#6b7280)}
.clin-doc-signature-block{margin-top:28px;padding-top:14px;border-top:1px solid #d9d3df}.clin-doc-letterhead>div span{display:block;margin-top:3px;font-size:10px;color:#6b7280}.clin-doc-print-void{position:absolute;inset:40% 0 auto;text-align:center;font-size:72px;letter-spacing:.16em;font-weight:800;color:rgba(159,37,58,.14);transform:rotate(-18deg);pointer-events:none}
@media(max-width:900px){.clin-doc-finalize-grid{grid-template-columns:1fr}.clin-doc-finalize-aside{position:static}.clin-doc-lifecycle-main{align-items:flex-start}}
@media print{.clin-doc-print-void{display:block!important}.clin-doc-signature-block{break-inside:avoid}}

/* ============================================================
   EMR v1.9.6 — Clinical Documents Phase E: verification + issuance polish
   ============================================================ */
.clin-doc-issued-verification{display:grid;grid-template-columns:92px minmax(0,1fr) auto;align-items:center;gap:18px;margin-top:16px;padding:14px 16px;border:1px solid rgba(108,59,170,.22);border-radius:14px;background:linear-gradient(135deg,rgba(108,59,170,.07),rgba(255,255,255,.72))}
.clin-doc-issued-qr{width:86px;height:86px;padding:4px;border:1px solid var(--emr-border,#ded7e8);border-radius:10px;background:#fff}.clin-doc-issued-qr svg,.clin-doc-revision-qr svg,.clin-doc-paper-qr svg,.clin-doc-verify-qr svg{display:block;width:100%;height:100%}
.clin-doc-issued-verification-copy{min-width:0}.clin-doc-issued-verification-copy>strong{display:block;font-size:1.22rem;letter-spacing:.08em;color:var(--emr-brand-700,#4f2584);margin:3px 0}.clin-doc-issued-verification-copy p{margin:3px 0 5px;color:var(--emr-text-soft,#667085);font-size:.86rem}.clin-doc-issued-verification-copy a{font-size:.82rem;font-weight:700;color:var(--emr-brand-600,#6c3baa);text-decoration:none}.clin-doc-issued-verification-state{display:flex;flex-direction:column;align-items:flex-end;gap:7px}.clin-doc-issued-verification-state small{color:var(--emr-text-soft,#667085);white-space:nowrap}
.clin-doc-paper-verification{display:grid;grid-template-columns:minmax(0,1fr) 104px;gap:22px;align-items:center;margin-top:28px;padding:16px;border:1px solid #d9cde7;border-radius:10px;background:#faf8fc;break-inside:avoid}.clin-doc-paper-verification>div:first-child>strong{display:block;font-size:1.25rem;letter-spacing:.08em;color:#573092;margin:4px 0}.clin-doc-paper-verification p{font-size:.86rem;color:#5d5965;margin:5px 0}.clin-doc-paper-verification small{display:block;overflow-wrap:anywhere;color:#6c3baa}.clin-doc-paper-qr{width:100px;height:100px;background:#fff;padding:4px;border-radius:8px;border:1px solid #e1d8e9}
.clin-doc-revision-qr{width:148px;height:148px;margin:8px auto 14px;padding:5px;background:#fff;border:1px solid var(--emr-border,#ded7e8);border-radius:12px}.clin-doc-artifact-list{display:grid;gap:9px}.clin-doc-artifact-list>div{padding:10px;border:1px solid var(--emr-border,#e5e0ea);border-radius:10px;background:var(--emr-surface,#fff)}.clin-doc-artifact-list strong,.clin-doc-artifact-list span,.clin-doc-artifact-list small{display:block}.clin-doc-artifact-list span{margin-top:3px;font-size:.78rem;overflow-wrap:anywhere}.clin-doc-artifact-list small{margin-top:4px;color:var(--emr-text-soft,#667085);font-size:.7rem;overflow-wrap:anywhere}

.clin-doc-verify-body{min-height:100vh;margin:0;background:radial-gradient(circle at 10% 0%,rgba(108,59,170,.09),transparent 38%),#f7f5f9;color:#20172d;font-family:Montserrat,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}.clin-doc-verify-shell{max-width:790px;margin:0 auto;padding:52px 20px 70px}.clin-doc-verify-card{background:#fff;border:1px solid #e3ddec;border-radius:20px;box-shadow:0 18px 50px rgba(54,34,78,.10);overflow:hidden}.clin-doc-verify-brand{display:flex;align-items:center;gap:18px;padding:20px 24px;border-bottom:1px solid #e6dfed;background:linear-gradient(90deg,#5b3191,#7042aa);color:#fff}.clin-doc-verify-brand img{width:172px;height:70px;object-fit:contain;object-position:left center}.clin-doc-verify-brand strong{display:block;font-size:1rem}.clin-doc-verify-brand span{display:block;margin-top:3px;font-size:.76rem;color:#e8dcf2}.clin-doc-verify-intro{padding:26px 28px 12px}.clin-doc-verify-intro h1{margin:5px 0 8px;font-size:1.7rem;color:#251432}.clin-doc-verify-intro p{margin:0;line-height:1.55;color:#6b6571}.clin-doc-verify-form{padding:10px 28px 26px}.clin-doc-verify-form>label{display:block;margin-bottom:7px;font-size:.82rem;font-weight:700}.clin-doc-verify-form>div{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:9px}.clin-doc-verify-form input{min-width:0;border:1px solid #cfc2dc;border-radius:10px;padding:12px 13px;font:inherit;text-transform:uppercase;letter-spacing:.05em}.clin-doc-verify-form input:focus{outline:3px solid rgba(108,59,170,.16);border-color:#6c3baa}.clin-doc-verify-form button{border:0;border-radius:10px;padding:0 18px;background:#5d3194;color:#fff;font-weight:700;cursor:pointer}.clin-doc-verify-result{margin:0 28px 26px;border:1px solid #e3ddec;border-radius:15px;overflow:hidden}.clin-doc-verify-status-row{display:grid;grid-template-columns:50px minmax(0,1fr);gap:14px;padding:18px 20px}.clin-doc-verify-status-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:50%;font-weight:800;font-size:1.25rem}.clin-doc-verify-status-row span{font-size:.72rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em}.clin-doc-verify-status-row h2{margin:3px 0 5px;font-size:1.16rem}.clin-doc-verify-status-row p{margin:0;color:#6b6571;line-height:1.45}.clin-doc-verify-result.is-valid{border-color:#b7dcc6}.clin-doc-verify-result.is-valid .clin-doc-verify-status-row{background:#f3fbf6}.clin-doc-verify-result.is-valid .clin-doc-verify-status-icon{background:#daf1e2;color:#126234}.clin-doc-verify-result.is-valid .clin-doc-verify-status-row span{color:#126234}.clin-doc-verify-result.is-superseded{border-color:#d6c9e4}.clin-doc-verify-result.is-superseded .clin-doc-verify-status-row{background:#f8f5fb}.clin-doc-verify-result.is-superseded .clin-doc-verify-status-icon{background:#eadff3;color:#5b3191}.clin-doc-verify-result.is-superseded .clin-doc-verify-status-row span{color:#5b3191}.clin-doc-verify-result.is-void,.clin-doc-verify-result.is-revoked,.clin-doc-verify-result.is-expired,.clin-doc-verify-result.is-invalid{border-color:#efc0c5}.clin-doc-verify-result.is-void .clin-doc-verify-status-row,.clin-doc-verify-result.is-revoked .clin-doc-verify-status-row,.clin-doc-verify-result.is-expired .clin-doc-verify-status-row,.clin-doc-verify-result.is-invalid .clin-doc-verify-status-row{background:#fff5f6}.clin-doc-verify-result.is-void .clin-doc-verify-status-icon,.clin-doc-verify-result.is-revoked .clin-doc-verify-status-icon,.clin-doc-verify-result.is-expired .clin-doc-verify-status-icon,.clin-doc-verify-result.is-invalid .clin-doc-verify-status-icon{background:#f9dde0;color:#9b2430}.clin-doc-verify-result.is-void .clin-doc-verify-status-row span,.clin-doc-verify-result.is-revoked .clin-doc-verify-status-row span,.clin-doc-verify-result.is-expired .clin-doc-verify-status-row span,.clin-doc-verify-result.is-invalid .clin-doc-verify-status-row span{color:#9b2430}.clin-doc-verify-details{display:grid;grid-template-columns:minmax(0,1fr) 145px;gap:24px;padding:18px 20px;border-top:1px solid #ebe6ef;background:#fff}.clin-doc-verify-details dl{margin:0;display:grid;grid-template-columns:150px minmax(0,1fr);gap:8px 12px;font-size:.82rem}.clin-doc-verify-details dt{color:#77707e}.clin-doc-verify-details dd{margin:0;font-weight:600;overflow-wrap:anywhere}.clin-doc-verify-qr{align-self:start;text-align:center;padding:7px;border:1px solid #e2dbe9;border-radius:10px;background:#fff}.clin-doc-verify-qr span{display:block;margin-top:5px;font-size:.7rem;color:#77707e}.clin-doc-verify-footer{padding:18px 28px 24px;border-top:1px solid #ebe6ef;background:#fbfafc}.clin-doc-verify-footer strong{font-size:.78rem}.clin-doc-verify-footer p{margin:4px 0 0;font-size:.76rem;color:#77707e;line-height:1.5}
@media(max-width:700px){.clin-doc-issued-verification{grid-template-columns:72px minmax(0,1fr)}.clin-doc-issued-qr{width:68px;height:68px}.clin-doc-issued-verification-state{grid-column:1/-1;align-items:flex-start}.clin-doc-verify-shell{padding:18px 12px 40px}.clin-doc-verify-brand{display:block;text-align:center}.clin-doc-verify-brand img{width:min(220px,100%);height:auto;max-height:86px;object-position:center;margin:0 auto 10px}.clin-doc-verify-form>div{grid-template-columns:1fr}.clin-doc-verify-form button{min-height:44px}.clin-doc-verify-details{grid-template-columns:1fr}.clin-doc-verify-details dl{grid-template-columns:1fr}.clin-doc-verify-details dt{margin-top:4px}.clin-doc-verify-qr{width:140px}.clin-doc-paper-verification{grid-template-columns:1fr}.clin-doc-paper-qr{margin:0 auto}}
@media print{.clin-doc-paper-verification{break-inside:avoid}.clin-doc-verify-body{background:#fff}.clin-doc-verify-card{box-shadow:none}}

/* ============================================================
   EMR v1.9.7 — Clinical Documents Phase F
   Arabic/RTL preview + production letterhead variants
   ============================================================ */
.clin-doc-a4[dir="rtl"],.doc-tpl-preview-a4[dir="rtl"]{font-family:Tahoma,"Segoe UI",Arial,sans-serif}
.clin-doc-a4[dir="rtl"] .clin-doc-paper-body,
.doc-tpl-preview-a4[dir="rtl"] .doc-tpl-preview-body{direction:rtl;text-align:right}
.clin-doc-a4[dir="rtl"] .clin-doc-letterhead,
.doc-tpl-preview-a4[dir="rtl"] .doc-tpl-preview-letterhead{direction:rtl;text-align:right}
.clin-doc-a4[dir="rtl"] .clin-doc-paper-footer,
.doc-tpl-preview-a4[dir="rtl"] .doc-tpl-preview-page-footer{direction:rtl;text-align:right}
.clin-doc-a4[dir="rtl"] .clin-doc-paper-verification{direction:rtl;text-align:right}
.clin-doc-a4[dir="rtl"] .clin-doc-paper-verification .clin-doc-paper-qr{order:-1}

.clin-doc-letterhead,.doc-tpl-preview-letterhead{position:relative;overflow:hidden}
.clin-doc-letterhead-accent,.doc-tpl-letterhead-accent{display:none;position:absolute;inset-block-start:0;inset-inline:0;height:6px;background:linear-gradient(90deg,var(--emr-brand-700,#5b2b91),var(--emr-brand-500,#6c3baa))}
.clin-doc-a4.letterhead-formal_report .clin-doc-letterhead,
.doc-tpl-preview-a4.letterhead-formal_report .doc-tpl-preview-letterhead{background:linear-gradient(180deg,rgba(108,59,170,.07),rgba(108,59,170,0));padding-top:18px}
.clin-doc-a4.letterhead-formal_report .clin-doc-letterhead-accent,
.doc-tpl-preview-a4.letterhead-formal_report .doc-tpl-letterhead-accent{display:block}
.clin-doc-a4.letterhead-minimal .clin-doc-letterhead img,
.doc-tpl-preview-a4.letterhead-minimal .doc-tpl-preview-letterhead img{max-height:42px;max-width:155px}
.clin-doc-a4.letterhead-minimal .clin-doc-letterhead,
.doc-tpl-preview-a4.letterhead-minimal .doc-tpl-preview-letterhead{border-bottom-width:1px;padding-bottom:10px}
.clin-doc-a4.letterhead-certificate,
.doc-tpl-preview-a4.letterhead-certificate{outline:2px solid rgba(91,43,145,.52);outline-offset:-12px}
.clin-doc-a4.letterhead-certificate .clin-doc-letterhead,
.doc-tpl-preview-a4.letterhead-certificate .doc-tpl-preview-letterhead{justify-content:center;text-align:center;border-bottom:0;padding-top:12px}
.clin-doc-a4.letterhead-certificate .clin-doc-letterhead>div:last-child,
.doc-tpl-preview-a4.letterhead-certificate .doc-tpl-preview-letterhead h2{text-align:center}

@media print{
  .clin-doc-a4.letterhead-certificate,.doc-tpl-preview-a4.letterhead-certificate{outline-color:#6c3baa!important}
}

/* ============================================================
   EMR v1.9.8 — Clinical Documents end-to-end UX reconciliation
   ============================================================ */
.doc-tpl-workflow,.clin-doc-setup-flow,.clin-doc-flow{
  position:relative;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;
  margin-top:14px;background:var(--emr-surface,#fff);border:1px solid var(--emr-border,#e3dceb);
  border-radius:14px;padding:13px 14px;overflow:hidden
}
.doc-tpl-workflow>div,.clin-doc-setup-flow>div,.clin-doc-flow-step{
  position:relative;z-index:1;display:grid;grid-template-columns:30px minmax(0,1fr);gap:9px;align-items:center;
  min-width:0;padding:4px 13px
}
.doc-tpl-workflow>div:not(:last-child)::after,.clin-doc-setup-flow>div:not(:last-child)::after{
  content:"";position:absolute;inset-inline-end:-1px;top:8px;bottom:8px;width:1px;background:var(--emr-border,#e3dceb)
}
.doc-tpl-workflow span,.clin-doc-setup-flow span,.clin-doc-flow-dot{
  width:27px;height:27px;border-radius:50%;display:grid;place-items:center;background:#eee7f5;color:#67408f;
  font-size:.7rem;font-weight:850;line-height:1
}
.doc-tpl-workflow strong,.clin-doc-setup-flow strong,.clin-doc-flow-step strong{display:block;font-size:.76rem;line-height:1.2;color:var(--emr-text,#33273d)}
.doc-tpl-workflow small,.clin-doc-setup-flow small,.clin-doc-flow-step small{display:block;margin-top:2px;font-size:.64rem;line-height:1.25;color:var(--emr-text-soft,#7b7084)}
.doc-tpl-workflow>div.is-current,.clin-doc-setup-flow>div.is-current{background:#faf6fd;border-radius:9px}
.doc-tpl-workflow>div.is-current span,.clin-doc-setup-flow>div.is-current span{background:#63339b;color:#fff;box-shadow:0 0 0 4px rgba(108,59,170,.10)}
.doc-tpl-workflow>div.is-complete span{background:#e3f4e8;color:#1e6d3d}
.doc-tpl-workflow>div.is-ready span{background:#eee7f7;color:#613391}
.doc-tpl-workflow>div.is-upcoming{opacity:.7}
.doc-tpl-workflow.compact{margin-top:12px;padding:10px 11px}

.clin-doc-flow{margin-top:14px;padding:13px 16px;isolation:isolate}
.clin-doc-flow-track{position:absolute;z-index:0;top:27px;inset-inline:8%;height:2px;background:#e5ddeb}
.clin-doc-flow-step{padding:2px 11px;background:transparent}
.clin-doc-flow-step .clin-doc-flow-dot{border:2px solid #e1d6ea;background:#fff}
.clin-doc-flow-step.is-complete .clin-doc-flow-dot{background:#e4f4e9;border-color:#b9dfc6;color:#1d7040}
.clin-doc-flow-step.is-current .clin-doc-flow-dot{background:#63339b;border-color:#63339b;color:#fff;box-shadow:0 0 0 5px rgba(108,59,170,.11)}
.clin-doc-flow-step.is-current strong{color:#5c2e8e}
.clin-doc-flow-step.is-upcoming{opacity:.62}
.clin-doc-flow-terminal{position:absolute;inset-inline-end:12px;top:8px;padding:3px 8px;border-radius:99px;font-size:.6rem;font-weight:850;text-transform:uppercase;letter-spacing:.04em}
.clin-doc-flow-terminal.is-superseded{background:#eee9f3;color:#665773}.clin-doc-flow-terminal.is-void{background:#fae5e8;color:#9d2c3b}

.clin-doc-status-tabs{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin-top:14px;padding:8px;background:#fff;border:1px solid var(--emr-border,#e3dceb);border-radius:12px}
.clin-doc-status-tabs a{display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:5px 10px;border-radius:8px;color:#655a6d;text-decoration:none!important;font-size:.73rem;font-weight:750}
.clin-doc-status-tabs a:hover{background:#f7f2fb;color:#5b2d8b}.clin-doc-status-tabs a.is-active{background:#63339b;color:#fff}

.clin-doc-setup-flow{position:sticky;top:10px;z-index:4;box-shadow:0 5px 18px rgba(54,34,78,.05)}
.clin-doc-setup-flow>div{transition:background .16s ease,color .16s ease}.clin-doc-setup-flow>div.is-current strong{color:#5a2c8c}

.clin-doc-section-nav a.is-active{background:#f1e8f8;color:#542982;box-shadow:inset 3px 0 0 #6c3baa}
[dir="rtl"] .clin-doc-section-nav a.is-active{box-shadow:inset -3px 0 0 #6c3baa}
.clin-doc-savebar[data-save-state="dirty"]{border-color:#e0c66d;background:#fffdf5}.clin-doc-savebar[data-save-state="dirty"] #clin-doc-save-state{color:#805e0e}
.clin-doc-savebar[data-save-state="saving"]{border-color:#c7d6eb;background:#f8fbff}.clin-doc-savebar[data-save-state="saving"] #clin-doc-save-state{color:#325c8e}
.clin-doc-savebar[data-save-state="saved"]{border-color:#c8e2d1;background:#fbfefc}.clin-doc-savebar[data-save-state="saved"] #clin-doc-save-state{color:#236c3e}
.clin-doc-savebar[data-save-state="error"]{border-color:#edbdc4;background:#fff7f8}.clin-doc-savebar[data-save-state="error"] #clin-doc-save-state{color:#a12b3c}
.doc-tpl-savebar[data-save-state="dirty"]{border-color:#e1c86f;background:#fffdf5}.doc-tpl-savebar[data-save-state="dirty"] #doc-tpl-save-state{color:#7e5d11;font-weight:750}
.doc-tpl-savebar[data-save-state="saved"]{border-color:#d8d0e0;background:#fff}

.clin-doc-history-alert{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:12px;padding:11px 14px;border-radius:11px;font-size:.78rem}
.clin-doc-history-alert strong{font-size:.8rem}.clin-doc-history-alert span{color:#6d6474}
.clin-doc-history-alert.is-superseded{border:1px solid #ddd3e7;background:#f8f5fb;color:#5e4e6b}.clin-doc-history-alert.is-void{border:1px solid #efc4c9;background:#fff5f6;color:#982c3b}
.clin-doc-finalize-checklist{margin:10px 0 0;padding:0;list-style:none;display:grid;gap:5px;font-size:.72rem;color:#61546b}
.clin-doc-finalize-checklist li{position:relative;padding-inline-start:18px}.clin-doc-finalize-checklist li::before{content:"✓";position:absolute;inset-inline-start:0;color:#6c3baa;font-weight:850}

.clin-doc-preview-toolbar-copy{min-width:0}.clin-doc-preview-toolbar-copy>div{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.clin-doc-preview-toolbar-copy>span{display:block;margin-top:3px;color:#7c7185;font-size:.75rem}

/* Improve hierarchy and scanning without changing module behavior. */
.clin-doc-card,.doc-tpl-card,.doc-tpl-form-card,.doc-tpl-side-card,.clin-doc-side-card{box-shadow:0 2px 9px rgba(50,31,65,.025)}
.clin-doc-row{transition:border-color .14s ease,background .14s ease,transform .14s ease}.clin-doc-row:hover{border-color:#cfb9e2;background:#fefcff;transform:translateY(-1px)}
.clin-doc-template-choice-body{transition:border-color .14s ease,background .14s ease,box-shadow .14s ease,transform .14s ease}.clin-doc-template-choice:hover .clin-doc-template-choice-body{border-color:#c9b4da;transform:translateY(-1px)}
.doc-tpl-card{transition:border-color .14s ease,background .14s ease}.doc-tpl-card:hover{border-color:#d0bce1;background:#fffefe}

@media(max-width:1050px){
  .doc-tpl-workflow,.clin-doc-setup-flow,.clin-doc-flow{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .doc-tpl-workflow>div:not(:last-child)::after,.clin-doc-setup-flow>div:not(:last-child)::after{display:none}
  .clin-doc-flow-track{display:none}.clin-doc-flow-terminal{position:static;align-self:center;justify-self:start}
  .clin-doc-setup-flow{position:static}
}
@media(max-width:620px){
  .doc-tpl-workflow,.clin-doc-setup-flow,.clin-doc-flow{grid-template-columns:1fr;padding:9px}
  .doc-tpl-workflow>div,.clin-doc-setup-flow>div,.clin-doc-flow-step{padding:7px 8px}
  .clin-doc-status-tabs{overflow-x:auto;flex-wrap:nowrap}.clin-doc-status-tabs a{white-space:nowrap}
}
@media(prefers-reduced-motion:reduce){.clin-doc-row,.clin-doc-template-choice-body,.doc-tpl-card{transition:none!important;transform:none!important}}

/* ============================================================
   EMR v1.9.10 — Clinical Documents branded presentation
   ============================================================ */
.clin-doc-a4,.doc-tpl-preview-a4{
  position:relative;overflow:hidden;background:#fff;
  -webkit-print-color-adjust:exact;print-color-adjust:exact
}
.clin-doc-a4>.clin-doc-letterhead,.clin-doc-a4>.clin-doc-paper-titleblock,.clin-doc-a4>.clin-doc-paper-body,
.clin-doc-a4>.clin-doc-paper-footer,.clin-doc-a4>.clin-doc-print-void,
.doc-tpl-preview-a4>.doc-tpl-preview-letterhead,.doc-tpl-preview-a4>.clin-doc-paper-titleblock,
.doc-tpl-preview-a4>.doc-tpl-preview-body,.doc-tpl-preview-a4>.doc-tpl-preview-page-footer{position:relative;z-index:2}
.clin-doc-watermark{
  position:absolute;z-index:0;left:50%;top:48%;transform:translate(-50%,-50%) rotate(-25deg);
  width:85%;text-align:center;white-space:nowrap;pointer-events:none;user-select:none;
  font:900 clamp(38px,5.6vw,72px)/1 Montserrat,"Segoe UI",Arial,sans-serif;letter-spacing:.08em;
  color:rgba(92,60,143,.032)
}
.clin-doc-security-lines{position:absolute;z-index:0;inset:0;pointer-events:none;overflow:hidden}
.clin-doc-security-lines::before,.clin-doc-security-lines::after{
  content:"";position:absolute;left:8%;right:8%;height:34px;opacity:.72;
  background:
    repeating-radial-gradient(ellipse at 50% 50%,transparent 0 8px,rgba(92,60,143,.055) 9px 10px,transparent 11px 17px),
    linear-gradient(90deg,transparent,rgba(190,145,55,.08),transparent)
}
.clin-doc-security-lines::before{top:13px}.clin-doc-security-lines::after{bottom:13px;transform:scaleY(-1)}
.clin-doc-letterhead,.doc-tpl-preview-letterhead{
  display:grid;grid-template-columns:minmax(230px,.9fr) minmax(190px,1fr);align-items:center;gap:22px;
  text-align:left!important;color:#39204f;border:0!important;padding:0 0 16px!important;margin:0 0 13px!important;
  overflow:visible!important
}
.clin-doc-letterhead::after,.doc-tpl-preview-letterhead::after{
  content:"";position:absolute;left:0;right:0;bottom:0;height:4px;
  background:linear-gradient(to bottom,#5c3c8f 0,#5c3c8f 1px,transparent 1px,transparent 2px,#c49a43 2px,#c49a43 3px,transparent 3px)
}
.clin-doc-letterhead-logo{min-width:0;display:flex;align-items:center;justify-content:flex-start}
.clin-doc-letterhead-logo img,.clin-doc-letterhead img,.doc-tpl-preview-letterhead img{
  display:block;width:min(100%,265px);max-width:265px!important;max-height:none!important;height:auto;object-fit:contain;margin:0!important
}
.clin-doc-letterhead-meta{min-width:0;text-align:right;color:#64586c;line-height:1.35}
.clin-doc-letterhead-meta strong{display:block!important;margin:0 0 5px!important;color:#39204f;font-size:10.5pt;line-height:1.2}
.clin-doc-letterhead-meta span{display:block!important;margin:2px 0 0!important;font-size:7.8pt;color:#74697c;overflow-wrap:anywhere}
.clin-doc-letterhead-meta .clin-doc-letterhead-state{margin-top:6px!important;color:#9a7130;font-weight:800;letter-spacing:.02em;text-transform:uppercase}
.clin-doc-paper-titleblock{margin:0 0 20px;text-align:center;padding:4px 0 13px;border-bottom:1px solid rgba(92,60,143,.16)}
.clin-doc-paper-titleblock h1{margin:0;color:#311a48;font-size:16.5pt;line-height:1.2;text-transform:uppercase;letter-spacing:.01em}
.clin-doc-paper-titleblock div{margin-top:6px;font-size:7.8pt;color:#7c7183;letter-spacing:.02em}
.clin-doc-paper-body>h1{display:none}
.clin-doc-paper-section h2,.doc-tpl-preview-section-title{
  color:#40215f;position:relative;padding-inline-start:10px;border-inline-start:2px solid #c49a43
}
.clin-doc-paper-section{padding-bottom:2px}
.clin-doc-signature-block{border-top:1px solid rgba(92,60,143,.25)!important}
.clin-doc-paper-footer,.doc-tpl-preview-page-footer{
  display:grid;grid-template-columns:1fr auto 1fr;gap:10px;align-items:center;
  border:0!important;margin-top:28px!important;padding-top:11px!important;font-size:7pt!important;color:#716778!important;text-align:left!important
}
.clin-doc-paper-footer::before,.doc-tpl-preview-page-footer::before{
  content:"";position:absolute;left:0;right:0;top:0;height:4px;
  background:linear-gradient(to bottom,#5c3c8f 0,#5c3c8f 1px,transparent 1px,transparent 2px,#c49a43 2px,#c49a43 3px,transparent 3px)
}
.clin-doc-paper-footer>div:nth-child(2),.doc-tpl-preview-page-footer>div:nth-child(2){text-align:center;color:#4e4058}
.clin-doc-paper-footer>div:last-child,.doc-tpl-preview-page-footer>div:last-child{text-align:right}
.clin-doc-paper-footer strong,.doc-tpl-preview-page-footer strong{color:#40215f;letter-spacing:.05em}
.clin-doc-paper-verification{background:rgba(250,248,252,.9)!important;border-color:#d5c4e2!important}
.clin-doc-paper-qr{box-shadow:inset 0 0 0 1px rgba(196,154,67,.18)}
.clin-doc-a4[dir="rtl"] .clin-doc-letterhead,.doc-tpl-preview-a4[dir="rtl"] .doc-tpl-preview-letterhead{direction:rtl;grid-template-columns:minmax(190px,1fr) minmax(230px,.9fr)}
.clin-doc-a4[dir="rtl"] .clin-doc-letterhead-logo,.doc-tpl-preview-a4[dir="rtl"] .clin-doc-letterhead-logo{order:2;justify-content:flex-end}
.clin-doc-a4[dir="rtl"] .clin-doc-letterhead-meta,.doc-tpl-preview-a4[dir="rtl"] .clin-doc-letterhead-meta{order:1;text-align:left!important}
.clin-doc-a4[dir="rtl"] .clin-doc-paper-titleblock,.doc-tpl-preview-a4[dir="rtl"] .clin-doc-paper-titleblock{text-align:center!important;direction:rtl}
.clin-doc-a4[dir="rtl"] .clin-doc-paper-footer,.doc-tpl-preview-a4[dir="rtl"] .doc-tpl-preview-page-footer{direction:rtl}
.clin-doc-a4[dir="rtl"] .clin-doc-paper-footer>div:first-child,.doc-tpl-preview-a4[dir="rtl"] .doc-tpl-preview-page-footer>div:first-child{text-align:right}
.clin-doc-a4[dir="rtl"] .clin-doc-paper-footer>div:last-child,.doc-tpl-preview-a4[dir="rtl"] .doc-tpl-preview-page-footer>div:last-child{text-align:left}
.clin-doc-a4.letterhead-minimal .clin-doc-letterhead-logo img,.doc-tpl-preview-a4.letterhead-minimal .clin-doc-letterhead-logo img{max-width:190px!important}
.clin-doc-a4.letterhead-formal_report .clin-doc-letterhead,.doc-tpl-preview-a4.letterhead-formal_report .doc-tpl-preview-letterhead{background:linear-gradient(180deg,rgba(108,59,170,.055),rgba(108,59,170,0));padding:12px 10px 17px!important}
.clin-doc-a4.letterhead-certificate .clin-doc-letterhead,.doc-tpl-preview-a4.letterhead-certificate .doc-tpl-preview-letterhead{padding:10px 18px 16px!important}
@media(max-width:700px){
  .clin-doc-letterhead,.doc-tpl-preview-letterhead{grid-template-columns:1fr;gap:8px;text-align:center!important}
  .clin-doc-letterhead-logo,.doc-tpl-preview-letterhead .clin-doc-letterhead-logo{justify-content:center!important;order:0!important}
  .clin-doc-letterhead-meta,.clin-doc-a4[dir="rtl"] .clin-doc-letterhead-meta,.doc-tpl-preview-a4[dir="rtl"] .clin-doc-letterhead-meta{text-align:center!important;order:0!important}
  .clin-doc-paper-footer,.doc-tpl-preview-page-footer{grid-template-columns:1fr;text-align:center!important}
  .clin-doc-paper-footer>div,.doc-tpl-preview-page-footer>div{ text-align:center!important }
}
@media print{
  .clin-doc-watermark{color:rgba(92,60,143,.03)!important}
  .clin-doc-security-lines::before,.clin-doc-security-lines::after{opacity:.65!important}
}

/* ============================================================
   EMR v1.9.10.1 — Clinical watermark + patient activity control
   ============================================================ */
.clin-doc-watermark,.clin-doc-security-lines{display:none!important}
.clin-doc-watermark-logo{
  position:absolute;z-index:0;left:50%;top:50%;transform:translate(-50%,-50%);
  width:min(46%,340px);aspect-ratio:1/1;display:flex;align-items:center;justify-content:center;
  pointer-events:none;user-select:none;opacity:.055
}
.clin-doc-watermark-logo img{display:block;width:100%;height:100%;object-fit:contain}
@media print{.clin-doc-watermark-logo{opacity:.055!important}}

.patient-registry-filters{margin-top:22px;display:grid;gap:12px}
.patient-registry-search{display:flex;gap:8px;align-items:center}
.patient-status-filter-tabs{display:flex;gap:8px;flex-wrap:wrap}
.patient-status-filter-tab{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--emr-border,#ded5e8);border-radius:10px;background:#fff;padding:7px 11px;text-decoration:none!important;color:var(--emr-primary,#56308b);font-weight:700;font-size:13px}
.patient-status-filter-tab span{display:inline-flex;min-width:22px;height:22px;align-items:center;justify-content:center;border-radius:999px;background:#f3eff8;font-size:11px}
.patient-status-filter-tab.is-active{background:var(--emr-primary,#56308b);color:#fff;border-color:var(--emr-primary,#56308b)}
.patient-status-filter-tab.is-active span{background:rgba(255,255,255,.18);color:#fff}
.patient-row-inactive{background:#faf9fb;color:#7a7180}
.patient-row-inactive td:first-child{position:relative}
.patient-row-inactive td:first-child::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:#a9a1ad}
.patient-list-actions{display:flex;justify-content:flex-end;align-items:center;gap:7px;flex-wrap:wrap}
.patient-list-actions form{margin:0}
.patient-status-action{border:1px solid transparent;border-radius:8px;padding:7px 10px;font-size:12px;line-height:1.2;font-weight:750;cursor:pointer;white-space:nowrap}
.patient-status-action--activate{background:#edf8f1;border-color:#b8dfc4;color:#18713c}
.patient-status-action--deactivate{background:#f7f4f8;border-color:#d9d1dc;color:#6b596f}
.patient-status-action:hover{filter:brightness(.98)}
.patient-inactive-banner{margin-top:0;border:1px solid #d8d0dc;border-left:4px solid #8b7f91;border-radius:10px;background:#f8f6f9;padding:12px 14px;display:flex;gap:6px 16px;align-items:baseline;flex-wrap:wrap;color:#5e5564}
.patient-inactive-banner strong{color:#4c4351}
.patient-inactive-banner span{font-size:13px}
.patient-action-disabled,.patient-action-disabled:disabled{opacity:.45!important;filter:grayscale(.25);cursor:not-allowed!important;pointer-events:none!important;box-shadow:none!important}
.patient-nav-disabled{color:#aaa1ae!important;text-decoration:none!important;cursor:not-allowed!important;opacity:.72}
fieldset:disabled{opacity:.62}
fieldset:disabled input,fieldset:disabled select,fieldset:disabled textarea,fieldset:disabled button{cursor:not-allowed!important}
@media(max-width:700px){.patient-registry-search{align-items:stretch;flex-direction:column}.patient-list-actions{justify-content:flex-start}}

/* ============================================================
   EMR v1.9.10.2 — Patient list action geometry polish
   Keep Open chart outlined while matching adjacent status action.
   ============================================================ */
body.emr-shell-active .patient-list-actions a.emr-btn-secondary{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border-radius:8px!important;
  padding:7px 10px!important;
  font-size:12px!important;
  line-height:1.2!important;
  font-weight:750!important;
  white-space:nowrap!important;
  min-height:30px!important;
  box-sizing:border-box!important;
}
body.emr-shell-active .patient-list-actions .patient-status-action{
  min-height:30px!important;
  box-sizing:border-box!important;
}


/* ============================================================
   EMR v1.9.10.3 — Patient clinical-alert form frame cleanup
   ============================================================ */
.patient-alert-fieldset{
  border:0!important;
  padding:0!important;
  margin:0!important;
  min-width:0!important;
}

/* ============================================================
   EMR v1.9.10.4 — Patient chart header action height alignment
   Keep visual identities; normalize geometry only.
   ============================================================ */
body.emr-shell-active .emr-patient-header-actions > a.emr-btn-secondary,
body.emr-shell-active .emr-patient-header-actions > button,
body.emr-shell-active .emr-patient-header-actions > form > button{
  height:36px!important;
  min-height:36px!important;
  box-sizing:border-box!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding-top:0!important;
  padding-bottom:0!important;
  line-height:1!important;
  vertical-align:middle!important;
}
body.emr-shell-active .emr-patient-header-actions > a.emr-btn-secondary{
  padding-left:11px!important;
  padding-right:11px!important;
  border-radius:8px!important;
}
body.emr-shell-active .emr-patient-header-actions .patient-status-action{
  padding-left:11px!important;
  padding-right:11px!important;
}


/* ============================================================
   EMR v1.9.11.1 — reusable staff avatars
   ============================================================ */
#emr-sidebar .emr-user-chip-avatar{width:28px!important;height:28px!important;flex:0 0 28px!important;border-radius:50%!important;overflow:hidden!important;display:grid!important;place-items:center!important;background:rgba(255,255,255,.10)!important;border:1px solid rgba(255,255,255,.22)!important;color:var(--emr-accent-strong)!important}
#emr-sidebar .emr-user-chip-avatar img{width:100%!important;height:100%!important;object-fit:cover!important;display:block!important}
#emr-sidebar .emr-user-chip-avatar svg{width:15px!important;height:15px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.9!important;stroke-linecap:round!important;stroke-linejoin:round!important}
.emr-inline-user{display:flex;align-items:center;gap:10px;min-width:0}.emr-user-avatar{width:36px;height:36px;flex:0 0 36px;border-radius:50%;overflow:hidden;display:grid;place-items:center;background:linear-gradient(145deg,#7444a5,#4e257e);color:#fff;font-weight:800;font-size:.78rem;border:2px solid #fff;box-shadow:0 0 0 1px #ddcfe9}.emr-user-avatar img{width:100%;height:100%;object-fit:cover;display:block}.emr-inline-user-name{min-width:0;font-weight:700}

/* ============================================================
   EMR v1.9.11.4 — Finalization approval-card vertical alignment
   Keep the right approval column aligned with the left review card.
   ============================================================ */
.clin-doc-finalize-grid > .clin-doc-finalize-aside{
  margin-top:16px;
}
@media(max-width:900px){
  .clin-doc-finalize-grid > .clin-doc-finalize-aside{
    margin-top:0;
  }
}


/* EMR v1.9.12 — cumulative PDF/preview parity + patient-action reconciliation */
body.emr-shell-active .emr-patient-header-actions > a.emr-btn-secondary,
body.emr-shell-active .emr-patient-header-actions > button,
body.emr-shell-active .emr-patient-header-actions > form > button{
  width:118px!important;
  min-width:118px!important;
  max-width:118px!important;
  height:36px!important;
  min-height:36px!important;
  padding:0 10px!important;
  border-radius:8px!important;
  box-sizing:border-box!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  line-height:1!important;
  white-space:nowrap!important;
}
body.emr-shell-active .emr-patient-header-actions > form{
  margin:0!important;
  display:inline-flex!important;
}
@media(max-width:720px){
  body.emr-shell-active .emr-patient-header-actions > a.emr-btn-secondary,
  body.emr-shell-active .emr-patient-header-actions > button,
  body.emr-shell-active .emr-patient-header-actions > form,
  body.emr-shell-active .emr-patient-header-actions > form > button{
    width:100%!important;
    max-width:none!important;
  }
}

/* ============================================================
   EMR v1.9.14 — Unified report pricing + workflow compaction
   ============================================================ */
.doc-tpl-workflow>div,.clin-doc-setup-flow>div{
  grid-template-columns:30px minmax(0,1fr);grid-template-rows:auto auto;align-items:start;
  column-gap:9px;row-gap:1px;min-height:54px;padding:7px 13px
}
.doc-tpl-workflow>div>span,.clin-doc-setup-flow>div>span{
  grid-column:1;grid-row:1 / span 2;align-self:start;margin-top:0
}
.doc-tpl-workflow>div>strong,.clin-doc-setup-flow>div>strong{
  grid-column:2;grid-row:1;align-self:end;min-width:0
}
.doc-tpl-workflow>div>small,.clin-doc-setup-flow>div>small{
  grid-column:2;grid-row:2;min-width:0;margin-top:1px;line-height:1.3;white-space:normal;overflow-wrap:normal;word-break:normal
}
.doc-tpl-workflow{padding:10px 14px}

.doc-tpl-system-pricing{
  margin-top:14px;background:var(--emr-surface,#fff);border:1px solid var(--emr-border,#e3dceb);
  border-radius:14px;padding:16px
}
.doc-tpl-system-pricing-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;flex-wrap:wrap}
.doc-tpl-system-pricing-head h2{margin:3px 0 5px;font-size:1.08rem;line-height:1.2;color:var(--emr-text,#33273d)}
.doc-tpl-system-pricing-head p{margin:0;max-width:900px;color:var(--emr-text-soft,#7b7084);font-size:.76rem;line-height:1.45}
.doc-tpl-system-count{display:inline-flex;align-items:center;border-radius:999px;padding:6px 10px;background:#f1e8f8;color:#5b2d8b;font-size:.68rem;font-weight:850;white-space:nowrap}
.doc-tpl-system-report-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:13px}
.doc-tpl-system-report{display:flex;justify-content:space-between;align-items:center;gap:14px;border:1px solid #e8e0ee;border-radius:11px;padding:10px 12px;background:#fefcff;min-width:0}
.doc-tpl-system-report-copy{min-width:0;display:flex;flex-direction:column;gap:2px}
.doc-tpl-system-report-copy>strong{font-size:.78rem;line-height:1.25;color:#3b2947}
.doc-tpl-system-report-copy>span{font-size:.72rem;line-height:1.35;color:#6a5a72;font-weight:700;text-align:left}
[dir="rtl"] .doc-tpl-system-report-copy>span{text-align:right}
.doc-tpl-system-report-copy>small{font-size:.61rem;line-height:1.35;color:#8a7e91}
.doc-tpl-system-price{flex:0 0 auto;display:flex;align-items:baseline;gap:4px;padding:5px 8px;border-radius:9px;background:#efe6f7;color:#5d2f90;white-space:nowrap}
.doc-tpl-system-price strong{font-size:.9rem}.doc-tpl-system-price span{font-size:.62rem;font-weight:850}
.doc-tpl-internal-reports{margin-top:11px;border-top:1px solid #eee7f2;padding-top:10px}
.doc-tpl-internal-reports summary{cursor:pointer;font-size:.7rem;font-weight:800;color:#66566f;list-style-position:inside}
.doc-tpl-internal-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:9px}
.doc-tpl-internal-grid>div{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:10px;row-gap:2px;border:1px solid #ece8ef;border-radius:9px;padding:8px 10px;background:#faf9fb;min-width:0}
.doc-tpl-internal-grid strong{font-size:.7rem;color:#51465a}.doc-tpl-internal-grid span{grid-column:1;font-size:.65rem;color:#776c7e}.doc-tpl-internal-grid em{grid-column:2;grid-row:1 / span 2;align-self:center;font-size:.58rem;font-style:normal;font-weight:800;color:#7a727f;white-space:nowrap}

.clin-doc-template-choice-top{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
.clin-doc-template-price{display:inline-flex;align-items:center;flex:0 0 auto;padding:3px 7px;border-radius:999px;background:#efe6f7;color:#5c2f8b;font-size:.61rem;font-weight:850;white-space:nowrap}

@media(max-width:1050px){
  .doc-tpl-system-report-grid,.doc-tpl-internal-grid{grid-template-columns:1fr}
}
@media(max-width:620px){
  .doc-tpl-workflow>div,.clin-doc-setup-flow>div{min-height:0;padding:7px 8px}
  .doc-tpl-system-pricing{padding:12px}.doc-tpl-system-report{align-items:flex-start}.doc-tpl-system-price{margin-top:1px}
  .doc-tpl-internal-grid>div{grid-template-columns:1fr}.doc-tpl-internal-grid em{grid-column:1;grid-row:auto;margin-top:2px}
}
.doc-tpl-system-report-copy>span[dir="rtl"],.doc-tpl-internal-grid span[dir="rtl"]{text-align:right;direction:rtl}

/* ============================================================
   EMR v1.9.20.2 — Billing / financial presentation reconciliation
   ============================================================ */
/* The markup has long used Tailwind's `no-underline` utility, but the
   local shared-hosting stylesheet did not define it. Keep actual text
   links unchanged; normalize only explicit no-underline / button-like links. */
.no-underline{ text-decoration:none!important; }
a.no-underline:hover,
a.no-underline:focus{ text-decoration:none!important; }
a[class~="border"][class~="bg-white"],
a[class~="rounded"][class~="border"][role="button"],
a.emr-btn-secondary,
a.button{
  text-decoration:none!important;
}
a[class~="border"][class~="bg-white"]:hover,
a[class~="border"][class~="bg-white"]:focus,
a.emr-btn-secondary:hover,
a.emr-btn-secondary:focus,
a.button:hover,
a.button:focus{
  text-decoration:none!important;
}

/* Currency addon and numeric field are one compound control. The later
   generic input-radius rule must not re-round the input's start edge. */
.emr-currency-input{display:flex!important;align-items:stretch!important;gap:0!important}
.emr-currency-input .emr-currency-code{
  border-start-end-radius:0!important;
  border-end-end-radius:0!important;
  border-inline-end:0!important;
}
.emr-currency-input input,
body.emr-shell-active .emr-currency-input input{
  margin-inline-start:0!important;
  border-start-start-radius:0!important;
  border-end-start-radius:0!important;
  border-start-end-radius:8px!important;
  border-end-end-radius:8px!important;
}

/* Settlement columns are equal-height grid cells; do not let the waiver
   button's auto grid track stretch vertically. Both actions use one geometry. */
.emr-settlement-waiver-form{grid-template-rows:auto auto 1fr auto!important;align-content:stretch!important}
.emr-settlement-waiver-form>label{align-self:start!important}
.emr-settlement-waiver-form .emr-settlement-action{align-self:end!important}
.emr-settlement-action{
  min-height:38px!important;
  height:38px!important;
  padding-top:0!important;
  padding-bottom:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  box-sizing:border-box!important;
}

/* Financial report mini-bars. Explicit fills avoid relying on utility classes
   that are not present in the production compact stylesheet. */
.emr-financial-trend-visual{display:grid;gap:7px;min-width:270px}
.emr-financial-trend-row{display:grid;grid-template-columns:92px minmax(150px,1fr);align-items:center;gap:9px}
.emr-financial-trend-label{display:flex;align-items:center;gap:6px;font-size:.72rem;font-weight:700;color:var(--emr-text-soft)}
.emr-financial-trend-key{width:8px;height:8px;flex:0 0 8px;border-radius:999px;display:inline-block}
.emr-financial-trend-track{display:block;height:11px;border:1px solid var(--emr-border);border-radius:999px;background:var(--emr-surface-3);overflow:hidden}
.emr-financial-trend-fill{display:block;height:100%;min-width:0;border-radius:999px;transition:width .18s ease}
.emr-financial-trend-key.is-invoiced,.emr-financial-trend-fill.is-invoiced{background:var(--emr-brand-700,#6c3baa)}
.emr-financial-trend-key.is-receipts,.emr-financial-trend-fill.is-receipts{background:var(--emr-accent-strong,#ffd86d)}
@media(max-width:700px){.emr-financial-trend-row{grid-template-columns:86px minmax(120px,1fr)}}


/* ============================================================
   EMR v1.9.20.3 — hard currency-control seam reconciliation
   Physical corner declarations are intentional. The billing currency prefix
   is visually on the left in the LTR workspace; logical-radius declarations
   can be remapped by inherited direction and were not sufficient in production.
   ============================================================ */
.emr-currency-input{
  display:flex!important;
  align-items:stretch!important;
  gap:0!important;
  width:100%!important;
}
.emr-currency-input > .emr-currency-code{
  margin-right:0!important;
  border-right:0!important;
  border-top-right-radius:0!important;
  border-bottom-right-radius:0!important;
  flex:0 0 auto!important;
}
.emr-currency-input > input.emr-currency-amount,
body.emr-shell-active .emr-currency-input > input.emr-currency-amount{
  margin-left:0!important;
  border-top-left-radius:0!important;
  border-bottom-left-radius:0!important;
  border-top-right-radius:8px!important;
  border-bottom-right-radius:8px!important;
  flex:1 1 auto!important;
  min-width:0!important;
}

/* ============================================================
   EMR v1.9.21.2 — Sidebar identity footer restoration
   Restore the validated two-line current-user presentation after the
   v1.9.20.2 compact stylesheet replaced the later v1.9.17.3.2 rules.
   ============================================================ */
#emr-sidebar .emr-user-chip{
  display:flex!important;
  align-items:center!important;
  gap:9px!important;
  min-width:0!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  font-style:italic!important;
  font-weight:400!important;
}
#emr-sidebar .emr-user-chip-avatar{
  width:30px!important;
  height:30px!important;
  flex:0 0 30px!important;
  border-radius:50%!important;
  overflow:hidden!important;
  display:grid!important;
  place-items:center!important;
}
#emr-sidebar .emr-user-chip-avatar img{
  width:100%!important;
  height:100%!important;
  display:block!important;
  object-fit:cover!important;
}
#emr-sidebar .emr-user-chip-copy{
  min-width:0!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  gap:1px!important;
  line-height:1.18!important;
  font-style:italic!important;
}
#emr-sidebar .emr-user-chip-label{
  display:block!important;
  font-weight:700!important;
  font-style:italic!important;
  font-size:.72rem!important;
  opacity:.9!important;
}
#emr-sidebar .emr-user-chip-name{
  display:block!important;
  min-width:0!important;
  max-width:100%!important;
  font-weight:400!important;
  font-style:italic!important;
  font-size:.79rem!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}

/* ============================================================
   EMR global Back to Top control v1.9.21.23
   ============================================================ */
.emr-back-to-top{
  position:fixed;
  right:22px;
  bottom:22px;
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  padding:0!important;
  margin:0;
  border:1px solid rgba(255,255,255,.28)!important;
  border-radius:15px;
  background:linear-gradient(145deg,var(--emr-brand-700),var(--emr-brand-900))!important;
  color:#fff!important;
  box-shadow:0 12px 30px rgba(43,24,68,.24),0 3px 9px rgba(43,24,68,.16);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translateY(12px) scale(.92);
  transform-origin:center;
  z-index:980;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  transition:opacity .2s ease,transform .24s cubic-bezier(.2,.8,.2,1),visibility .2s ease,box-shadow .2s ease,border-color .2s ease,background .2s ease;
}
.emr-back-to-top.is-visible{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transform:translateY(0) scale(1);
}
.emr-back-to-top svg{
  width:22px;
  height:22px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:2.25;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.emr-back-to-top:hover{
  color:#fff!important;
  border-color:var(--emr-accent)!important;
  background:linear-gradient(145deg,var(--emr-brand-600),var(--emr-brand-800))!important;
  box-shadow:0 15px 34px rgba(43,24,68,.30),0 4px 12px rgba(43,24,68,.18);
  transform:translateY(-2px) scale(1.02);
}
.emr-back-to-top:active{
  transform:translateY(0) scale(.97);
}
.emr-back-to-top:focus-visible{
  outline:3px solid rgba(244,201,93,.38)!important;
  outline-offset:3px;
  border-color:var(--emr-accent)!important;
}
[data-theme="dark"] .emr-back-to-top{
  box-shadow:0 14px 34px rgba(0,0,0,.36),0 3px 10px rgba(0,0,0,.24);
}
@media (max-width:640px){
  .emr-back-to-top{
    right:14px;
    bottom:14px;
    width:46px;
    height:46px;
    border-radius:14px;
  }
}
@media (prefers-reduced-motion:reduce){
  .emr-back-to-top{transition:none!important}
}
@media print{
  .emr-back-to-top{display:none!important}
}
