/* Dental HMS shared stylesheet — clean replacement */
:root{
 --primary:#2563eb;--primary-dark:#1d4ed8;--navy:#172554;--text:#25324b;
 --muted:#718096;--bg:#f3f7fc;--surface:#fff;--border:#e2eaf5;
 --success:#16a34a;--warning:#f59e0b;--danger:#ef4444;
 --sidebar-width:276px;--header-height:76px;--radius:16px;
 --shadow:0 8px 30px rgba(30,64,120,.07);
}
*,*::before,*:after{box-sizing:border-box}
html,body{min-height:100%;margin:0}
body{min-width:320px;background:var(--bg);color:var(--text);font:14px/1.6 "Segoe UI",Inter,Arial,sans-serif}
button,input,select,textarea{font:inherit}
a{color:inherit;text-decoration:none}
button{cursor:pointer}
.app-topbar{position:sticky;top:0;z-index:100;min-height:var(--header-height);padding:0 24px;background:linear-gradient(110deg,#1763ce,#2563eb 60%,#3984f6);color:#fff;border-bottom:1px solid rgba(255,255,255,.2);box-shadow:0 3px 12px rgba(37,99,235,.18)}
.app-topbar .container-fluid{min-height:var(--header-height)}
.app-topbar .navbar-brand{display:flex;align-items:center;gap:10px;color:#fff;font-size:21px;font-weight:750;letter-spacing:-.5px}
.brand-mark{display:grid;place-items:center;width:38px;height:38px;border-radius:11px;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.18);color:#fff}
.app-topbar .text-white a{color:#fff!important}
.app-shell{display:flex;min-height:calc(100vh - var(--header-height))}
.sidebar,aside.sidebar{position:sticky;top:var(--header-height);align-self:flex-start;flex:0 0 var(--sidebar-width);width:var(--sidebar-width);height:calc(100vh - var(--header-height));padding:18px 10px;overflow-y:auto;background:linear-gradient(180deg,#fff,#f4f9ff);border-right:1px solid var(--border);box-shadow:4px 0 20px rgba(30,64,120,.035);color:var(--text)}
.sidebar .offcanvas-body{display:block}
.nav-section-label,.sidebar-title,.sidebar .nav-heading,.nav-label{display:block;margin:6px 18px 12px;color:#8a9ab3;font-size:12px;font-weight:700;letter-spacing:.08em}
.nav-section-admin{margin-top:26px}
.sidebar nav,.sidebar-nav,.side-nav nav{display:grid;gap:4px}
.sidebar .nav-link,.sidebar a.nav-link{display:flex;align-items:center;gap:13px;min-height:48px;margin:4px 6px;padding:10px 14px;border:0;border-radius:11px;color:#52647f;font-size:14px;font-weight:600;transition:background .2s,color .2s}
.sidebar .nav-link i{flex:0 0 20px;width:20px;color:#7890b0;font-size:17px;text-align:center}
.sidebar .nav-link:hover{color:var(--primary);background:#edf5ff}
.sidebar .nav-link.active{color:#1d4ed8;background:linear-gradient(90deg,#dcecff,#eff7ff);box-shadow:inset 3px 0 0 #2563eb;font-weight:700}
.sidebar .nav-link.active i{color:var(--primary)}
.content{flex:1 1 auto;min-width:0;min-height:calc(100vh - var(--header-height));margin:0;padding:26px 30px 48px;background:var(--bg)}
.content h1,.content h2,.content h3,.content h4,.content h5{color:var(--navy);font-weight:700;letter-spacing:-.4px}
.card{min-width:0;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow)}
.card-header{background:#f7faff;color:var(--navy);border-bottom:1px solid var(--border);border-radius:var(--radius) var(--radius) 0 0;font-weight:700}
.stat{color:var(--navy);font-size:30px;font-weight:750;line-height:1.25;margin:4px 0 8px}
.table{--bs-table-color:var(--text);--bs-table-bg:#fff;--bs-table-border-color:#edf1f7;color:var(--text)}
.table thead th{background:#edf5ff;color:#24518e;font-size:12px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;padding:13px 15px;border-bottom:1px solid #d8e7fa}
.table tbody td{padding:13px 15px;vertical-align:middle}
.table tbody tr:hover>*{background:#f5f9ff}
.btn,button{border-radius:10px;font-weight:600;transition:all .2s ease}
.btn-primary{background:linear-gradient(135deg,#2563eb,#3b82f6);border-color:#2563eb;box-shadow:0 4px 12px rgba(37,99,235,.16)}
.btn-primary:hover{background:#1d4ed8;border-color:#1d4ed8;transform:translateY(-1px)}
.form-control,.form-select,input,select,textarea{border:1px solid #d9e3f0;border-radius:10px;color:var(--text)}
.form-control:focus,.form-select:focus,input:focus,select:focus,textarea:focus{border-color:#60a5fa;box-shadow:0 0 0 3px rgba(37,99,235,.12)}
/* Dashboard */
.dash-page{width:100%;max-width:1600px;margin:0 auto;color:#172b52}
.dash-heading{display:flex;justify-content:space-between;align-items:center;gap:18px;margin:0 0 22px}
.dash-heading h2{margin:0;font-size:25px;font-weight:750;letter-spacing:-.55px}
.dash-heading p,.dash-panel-head p{margin:1px 0 0;color:#7183a1;font-size:14px}
.dashboard-star{font-size:17px;color:#8294b1;vertical-align:2px;margin-left:4px}
.dash-heading-actions{display:flex;align-items:center;gap:12px}
.dash-date{display:inline-flex;align-items:center;gap:10px;padding:10px 14px;border:1px solid #dce7f5;border-radius:11px;background:#fff;color:#24395e;font-weight:600}
.dash-date i{color:#607da7;font-size:17px}
.dash-heading-actions .btn{padding:11px 17px}
.dash-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin-bottom:18px}
.dash-kpi{position:relative;min-width:0;min-height:145px;padding:15px 17px 12px;border:1px solid #e1eaf7;border-radius:15px;background:#fff;box-shadow:0 8px 25px rgba(30,64,120,.045);overflow:hidden}
.dash-kpi:after{content:"";position:absolute;inset:auto 0 0;height:40%;opacity:.65;pointer-events:none}
.kpi-teal:after{background:linear-gradient(0deg,#e7fbf5,transparent)}.kpi-blue:after{background:linear-gradient(0deg,#edf6ff,transparent)}.kpi-purple:after{background:linear-gradient(0deg,#f5edff,transparent)}.kpi-orange:after{background:linear-gradient(0deg,#fff5e8,transparent)}.kpi-pink:after{background:linear-gradient(0deg,#fff0f3,transparent)}
.kpi-top{position:relative;z-index:1;display:flex;align-items:center;gap:11px;min-width:0}
.kpi-icon{display:grid;place-items:center;flex:0 0 43px;width:43px;height:43px;border-radius:11px;font-size:21px}
.kpi-teal .kpi-icon{color:#08a879;background:#e0fbf1}.kpi-blue .kpi-icon{color:#0878ed;background:#e5f3ff}.kpi-purple .kpi-icon{color:#7135e8;background:#f1e8ff}.kpi-orange .kpi-icon{color:#e98700;background:#fff1db}.kpi-pink .kpi-icon{color:#e74760;background:#ffedf1}
.kpi-label{display:block;font-weight:700;font-size:14px;color:#1d3157;line-height:1.35}.kpi-top small{display:block;color:#7889a5;font-size:12px;margin-top:2px}
.kpi-open{margin-left:auto;align-self:flex-start;color:#647b9e;font-size:15px}
.dash-kpi>strong{position:relative;z-index:1;display:block;margin:9px 0 0;font-size:27px;line-height:1.25;letter-spacing:-.7px;color:#172d56;white-space:nowrap}
.kpi-foot{position:relative;z-index:1;display:block;margin-top:3px;color:#7183a1;font-size:12px}.kpi-foot.positive{color:#0b9d61}.kpi-foot a{color:#2563eb}
.dash-analytics{display:grid;grid-template-columns:minmax(0,.93fr) minmax(0,1.07fr);gap:14px;margin-bottom:14px}
.dash-panel{min-width:0;border:1px solid #e0e9f6;border-radius:15px;background:#fff;box-shadow:0 8px 25px rgba(30,64,120,.045);padding:15px 17px}
.dash-panel-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:7px}
.dash-panel-head h3{margin:0;color:#1b3159;font-size:17px;font-weight:750;letter-spacing:-.3px}
.dash-panel-head>i{color:#607da7}.dash-panel-head>a{color:#0969df;font-size:13px;font-weight:650;white-space:nowrap}
.patient-stats-body{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:174px;padding:0 20px 0 3px}
.patient-legend{flex:1;min-width:0}.patient-legend>div{display:grid;grid-template-columns:12px 22px minmax(0,1fr) 40px;align-items:center;gap:10px;padding:10px 0;color:#314667;font-size:13px}.patient-legend b{font-size:15px;color:#1b3159}.patient-legend em{font-style:normal;text-align:right;color:#627795;font-size:12px}.legend-dot{width:11px;height:11px;border-radius:50%}.dot-blue{background:#2384ee}.dot-teal{background:#11b99a}
.patient-donut{display:grid;place-items:center;flex:0 0 150px;width:150px;height:150px;border-radius:50%;background:conic-gradient(#2384ee 0 var(--existing),#11b99a var(--existing) 100%);position:relative}.patient-donut:before{content:"";position:absolute;inset:25px;border-radius:50%;background:#fff}.patient-donut>div{position:relative;z-index:1;text-align:center;display:flex;flex-direction:column}.patient-donut strong{font-size:22px;line-height:1.2;color:#1b3159}.patient-donut span{font-size:12px;color:#7183a1}
.revenue-chart{height:180px;display:flex;gap:12px;padding:9px 0 0}.revenue-y{display:flex;flex-direction:column;justify-content:space-between;color:#7587a4;font-size:10px;padding:0 0 19px;white-space:nowrap}.revenue-bars{flex:1;min-width:0;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;align-items:end;background:repeating-linear-gradient(to bottom,transparent 0,transparent 24%,#edf2f9 24.5%,transparent 25%);border-bottom:1px solid #e5edf7}.revenue-bar-wrap{height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:4px;min-width:0}.revenue-bar-wrap>b{font-size:11px;color:#23385f;white-space:nowrap}.revenue-bar{width:min(100%,52px);min-height:2px;border-radius:8px 8px 0 0;background:linear-gradient(180deg,#4da4f4,#b9ddff);box-shadow:inset 0 1px rgba(255,255,255,.7)}.revenue-bar-wrap>span{font-size:11px;color:#7183a1;padding:4px 0 0}
.dash-bottom{display:grid;grid-template-columns:minmax(0,1.12fr) minmax(0,.96fr) minmax(0,.82fr);gap:14px;align-items:stretch}
.today-list,.recent-list{margin-top:7px}.today-row{display:grid;grid-template-columns:69px 36px minmax(0,1fr) 75px auto;align-items:center;gap:9px;min-height:51px;border-top:1px solid #edf2f8}.today-row time,.recent-row time{font-size:11px;color:#526987;white-space:nowrap}.patient-avatar{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#dff3ff;color:#1769bf;font-size:11px;font-weight:750;flex:0 0 34px}.today-row:nth-child(2n) .patient-avatar,.recent-row:nth-child(2n) .patient-avatar{background:#eee5ff;color:#7544d5}.today-row:nth-child(3n) .patient-avatar{background:#fff0d4;color:#b66c00}.today-person,.recent-person{display:flex;flex-direction:column;min-width:0}.today-person b,.recent-person b{font-size:12px;color:#1e3359;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.today-person small,.recent-person small{font-size:10px;color:#7b8ca7;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.today-dentist{font-size:10px;color:#7284a1;white-space:nowrap}.appointment-status{font-size:10px;font-weight:650;padding:4px 8px;border-radius:20px;white-space:nowrap;background:#eef2f7;color:#50627d}.status-completed{background:#dcfce9;color:#16834b}.status-in_progress,.status-checked_in{background:#e1f0ff;color:#1769d2}.status-scheduled,.status-confirmed{background:#fff4c7;color:#a36b00}.status-cancelled,.status-no_show{background:#ffe5e7;color:#c73545}
.dash-empty{display:grid;place-items:center;min-height:170px;color:#7b8ca7;font-size:13px;border-top:1px solid #edf2f8}
.calendar-month{display:flex;align-items:center;justify-content:space-between;margin:9px 0 7px;color:#1d3157}.calendar-month b{font-size:13px}.calendar-month>span{display:grid;place-items:center;width:31px;height:29px;border:1px solid #e2eaf5;border-radius:8px;color:#385779}.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px;text-align:center}.calendar-weekday{font-size:10px;color:#7385a2;padding:3px 0 6px}.calendar-day{position:relative;display:grid;place-items:center;min-height:27px;border-radius:7px;font-size:11px;color:#304666}.calendar-day.muted{color:#c2ccda}.calendar-day.today{background:#1674e8;color:#fff;font-weight:700;box-shadow:0 3px 8px #1674e833}.calendar-day i{position:absolute;bottom:2px;width:4px;height:4px;border-radius:50%;background:#12b981}.calendar-day.today i{background:#fff}
.recent-row{display:flex;align-items:center;gap:9px;min-height:42px;border-top:1px solid #edf2f8}.recent-person{flex:1}.recent-row time{font-size:10px}
.tooth{display:grid;place-items:center;cursor:pointer}.tooth.selected{background:#dbeafe;border:2px solid var(--primary);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
@media(max-width:1250px){.dash-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.dash-bottom{grid-template-columns:repeat(2,minmax(0,1fr))}.recent-panel{grid-column:1/-1}.recent-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:16px}}
@media(max-width:991.98px){.sidebar,aside.sidebar{position:fixed;top:0;bottom:0;left:0;z-index:1055;height:100vh}.content{padding:20px}}
@media(max-width:850px){.dash-analytics,.dash-bottom{grid-template-columns:1fr}.recent-panel{grid-column:auto}.recent-list{display:block}}
@media(max-width:760px){.app-shell{display:block}.sidebar,aside.sidebar{position:fixed;width:min(300px,85vw)}.content{padding:20px}.dash-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:575.98px){.app-topbar{padding:0 12px}.app-topbar .text-white.small{font-size:11px!important}.content{padding:16px 12px 32px}.dash-heading{align-items:flex-start;flex-direction:column}.dash-heading-actions{width:100%;justify-content:space-between}.dash-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.dash-kpi{padding:12px;min-height:132px}.kpi-icon{width:36px;height:36px;flex-basis:36px;font-size:18px}.kpi-label{font-size:12px}.dash-kpi>strong{font-size:21px}.kpi-foot{font-size:10px}.patient-stats-body{padding:0;gap:6px}.patient-donut{flex-basis:115px;width:115px;height:115px}.patient-donut:before{inset:20px}.patient-legend>div{grid-template-columns:10px 18px minmax(0,1fr);gap:6px;font-size:11px}.patient-legend em{display:none}.today-row{grid-template-columns:58px 32px minmax(0,1fr) auto;gap:7px}.today-dentist{display:none}.patient-avatar{width:30px;height:30px;flex-basis:30px}.revenue-chart{gap:5px}.revenue-bars{gap:5px}}
@media(max-width:420px){.dash-kpis{grid-template-columns:1fr}.dash-heading-actions{align-items:flex-start;flex-direction:column}.dash-heading-actions .btn{width:100%}.dash-panel{padding:13px}}
@media(prefers-reduced-motion:reduce){*,*::before,*:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important}}

/* Login page */
body.login-page{min-width:320px;min-height:100vh;margin:0;background:#edf8f8;color:#122f4b;font-family:"Segoe UI",Inter,Arial,sans-serif;display:grid;place-items:center;padding:34px 24px;position:relative;overflow-x:hidden}
body.login-page:before,body.login-page:after{content:"";position:fixed;z-index:0;pointer-events:none;border-radius:50%;background:rgba(28,177,174,.055)}
body.login-page:before{width:430px;height:430px;right:-125px;top:-235px}
body.login-page:after{width:360px;height:360px;left:-210px;bottom:-245px}
.login-shell{position:relative;z-index:1;display:grid;grid-template-columns: minmax(340px,.84fr) minmax(460px,1fr);width:min(1186px,100%);min-height:680px;background:#fff;border:1px solid rgba(208,224,235,.9);border-radius:27px;overflow:hidden;box-shadow:0 22px 65px rgba(14,48,73,.13)}
.login-brand{position:relative;display:flex;flex-direction:column;justify-content:space-between;min-width:0;padding:54px 52px 45px;color:#fff;background:linear-gradient(150deg,#102f4a 0%,#123d59 63%,#087c7e 125%);overflow:hidden}
.login-brand-logo{position:relative;z-index:1;display:inline-flex;align-items:center;gap:12px;align-self:flex-start;padding:13px 19px;border-radius:12px;background:rgba(255,255,255,.97);color:#173d60;font-size:21px;font-weight:750;letter-spacing:-.35px;box-shadow:0 5px 18px rgba(0,0,0,.08)}
.login-brand-logo b{color:#0d8f91}.login-brand-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:9px;background:#2563eb;color:#fff;font-size:19px}
.login-brand-copy{position:relative;z-index:1;margin-top:54px}.login-eyebrow{display:flex;align-items:center;gap:10px;margin-bottom:21px;color:#8ce5e0;font-size:12px;font-weight:750;letter-spacing:.14em}.login-eyebrow i{font-size:16px}
.login-brand-copy h1{margin:0 0 22px;color:#fff;font-size:40px;line-height:1.23;font-weight:750;letter-spacing:-1.25px}.login-brand-copy p{max-width:400px;margin:0;color:#c4d6e4;font-size:15px;line-height:1.85}
.login-security{position:relative;z-index:1;display:flex;align-items:center;gap:14px;padding-top:25px;border-top:1px solid rgba(255,255,255,.15)}.login-security-icon{display:grid;place-items:center;flex:0 0 42px;width:42px;height:42px;border-radius:50%;background:rgba(255,255,255,.1);color:#8de1dc;font-size:18px}.login-security strong,.login-security small{display:block}.login-security strong{font-size:13px;color:#fff}.login-security small{margin-top:3px;color:#a9c5d7;font-size:11px;line-height:1.5}
.login-brand-watermark{position:absolute;right:16px;bottom:70px;color:rgba(255,255,255,.035);font-size:190px;line-height:1;transform:rotate(12deg);pointer-events:none}
.login-form-panel{display:grid;place-items:center;padding:58px 66px;background:#fff}.login-form-content{width:min(100%,440px)}.login-form-icon{display:grid;place-items:center;width:50px;height:50px;margin-bottom:20px;border-radius:14px;background:#e8f7f6;color:#0d9695;font-size:23px}.login-form-content h2{margin:0;color:#102e4c;font-size:32px;font-weight:750;letter-spacing:-.7px}.login-subtitle{margin:5px 0 30px;color:#8292a8;font-size:14px}.login-form label{display:block;margin:0 0 8px;color:#2c4562;font-size:13px;font-weight:650}.login-input-wrap{position:relative;display:flex;align-items:center;height:56px;margin-bottom:20px;border:1px solid #dce6ed;border-radius:11px;background:#fbfdfd;transition:border-color .18s,box-shadow .18s}.login-input-wrap:focus-within{border-color:#13a2a0;box-shadow:0 0 0 3px rgba(19,162,160,.11)}.login-input-wrap>i{flex:0 0 48px;text-align:center;color:#8ca2b7;font-size:15px}.login-input-wrap input{width:100%;height:100%;min-width:0;padding:0 13px 0 0;border:0;outline:0;background:transparent;color:#183650;font-size:14px}.login-input-wrap input::placeholder{color:#a6b3c1}.login-password-toggle{display:grid;place-items:center;flex:0 0 44px;height:100%;border:0;background:transparent;color:#8297ad;font-size:16px}.login-password-toggle:focus-visible{outline:2px solid #13a2a0;outline-offset:-4px;border-radius:8px}.login-submit{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;height:57px;margin-top:7px;border:0;border-radius:11px;background:linear-gradient(100deg,#119e9b,#078786);color:#fff;font-size:14px;font-weight:700;box-shadow:0 10px 22px rgba(10,146,144,.17);transition:transform .18s,box-shadow .18s}.login-submit:hover{transform:translateY(-1px);box-shadow:0 13px 25px rgba(10,146,144,.24)}.login-submit:focus-visible{outline:3px solid rgba(17,158,155,.3);outline-offset:3px}.login-error{font-size:13px;border-radius:10px}.login-footer{margin-top:37px;padding-top:20px;border-top:1px solid #e8eef2;text-align:center;color:#91a0b2;font-size:11px}
@media(max-width:900px){.login-shell{grid-template-columns:minmax(280px,.8fr) minmax(380px,1fr);min-height:620px}.login-brand{padding:42px 34px 35px}.login-brand-copy h1{font-size:34px}.login-form-panel{padding:45px 38px}}
@media(max-width:680px){body.login-page{padding:18px 12px;display:block}.login-shell{display:flex;flex-direction:column;width:min(480px,100%);min-height:0;margin:0 auto;border-radius:20px}.login-brand{min-height:225px;padding:22px 25px 24px}.login-brand-logo{padding:8px 12px;font-size:17px}.login-brand-icon{width:26px;height:26px;font-size:16px}.login-brand-copy{margin-top:25px}.login-eyebrow{margin-bottom:8px;font-size:10px}.login-brand-copy h1{margin-bottom:0;font-size:25px;line-height:1.2}.login-brand-copy p,.login-security,.login-brand-watermark{display:none}.login-form-panel{padding:30px 25px 24px}.login-form-icon{width:43px;height:43px;margin-bottom:13px;font-size:20px}.login-form-content h2{font-size:27px}.login-subtitle{margin-bottom:24px}.login-footer{margin-top:27px;padding-top:15px}}
@media(prefers-reduced-motion:reduce){.login-submit,.login-input-wrap{transition:none}}


/* Consistent report actions across authenticated pages. */
.report-toolbar .btn { min-width: 92px; font-weight: 600; border-radius: .55rem; }
@page { size: auto; margin: 14mm; }
@media print {
  html, body { width: auto !important; min-width: 0 !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; background: #fff !important; color: #111827 !important; font: 10pt/1.4 Arial, sans-serif !important; }
  .app-topbar, .sidebar, .report-toolbar, .btn, button, form, .modal, .no-print, .offcanvas-backdrop { display: none !important; }
  .app-shell, main.content { display: block !important; position: static !important; width: 100% !important; max-width: none !important; min-width: 0 !important; min-height: 0 !important; height: auto !important; padding: 0 !important; margin: 0 !important; overflow: visible !important; float: none !important; }
  main.content > h1:first-child, main.content > h2:first-child { margin-top: 0 !important; padding-bottom: 3mm; border-bottom: 1.5pt solid #234f88; font-size: 19pt !important; }
  .card, .dash-panel, .dash-kpi { box-shadow: none !important; break-inside: avoid; page-break-inside: avoid; border: 1px solid #cbd5e1 !important; }
  .table-responsive { overflow: visible !important; }
  table, .table { width: 100% !important; max-width: 100% !important; border-collapse: collapse !important; table-layout: auto !important; font-size: 9pt !important; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; page-break-inside: avoid; }
  th, td { color: #111827 !important; border: 1px solid #9ca3af !important; padding: 6px 7px !important; background: #fff !important; overflow-wrap: anywhere; }
  th { background: #edf5ff !important; font-weight: 700 !important; }
  h1, h2, h3, h4, h5 { color: #172554 !important; break-after: avoid; page-break-after: avoid; }
  a { color: #111827 !important; text-decoration: none !important; }
  .dash-page, .dash-kpis, .dash-analytics, .dash-bottom { max-width: none !important; }
  .dash-kpis { grid-template-columns: repeat(3,minmax(0,1fr)) !important; }
  .dash-analytics, .dash-bottom { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  .revenue-chart { break-inside: avoid; }
}

/* Professional Dental Chart report layout (screen and print). */
.tooth-grid{display:grid;grid-template-columns:repeat(16,minmax(0,1fr));gap:7px;align-items:center;width:100%;}
.tooth-grid .tooth{min-width:0;min-height:38px;padding:5px 2px;border:1px solid #cbd8e8;border-radius:9px;background:#fff;color:#294264;font-weight:700;font-size:12px;box-shadow:0 1px 2px rgba(30,64,120,.06);}
.tooth-grid .tooth.has-finding{background:#fff4cf;border-color:#e8bd4b;color:#815600;}
.tooth-grid .tooth.selected{background:#dbeafe;border:2px solid var(--primary);color:#174ea6;}
.dental-report-header{display:none;}
@media(max-width:767px){.tooth-grid{grid-template-columns:repeat(8,minmax(0,1fr));}.tooth-grid .tooth{min-height:36px}}
@media print{
  @page{size:A4 portrait;margin:14mm 13mm 15mm;}
  html,body{min-width:0!important;background:#fff!important;color:#172b45!important;font:10pt/1.4 Arial,sans-serif!important;-webkit-print-color-adjust:exact;print-color-adjust:exact;}
  .app-topbar,.sidebar,aside.sidebar,.dental-page-heading,.dental-entry-panel,.dental-screen-hint,.btn,.alert,.offcanvas-backdrop{display:none!important;}
  .app-shell{display:block!important;min-height:0!important;}
  .content,main.content{display:block!important;width:100%!important;max-width:none!important;min-height:0!important;margin:0!important;padding:0!important;background:#fff!important;}
  .dental-report-header{display:block!important;margin:0 0 12mm!important;padding:0 0 6mm!important;border-bottom:2px solid #1e4777!important;}
  .dental-report-brand{display:flex;align-items:center;gap:8px;color:#1e4777;font-size:11pt;font-weight:700;letter-spacing:.3px;}
  .dental-report-mark{display:inline-grid;place-items:center;width:25px;height:25px;border:1px solid #b9cce2;border-radius:6px;color:#1e7c91;}
  .dental-report-label{margin-left:auto;color:#60738b;font-size:8pt;letter-spacing:1.2px;}
  .dental-report-header h2{margin:7mm 0 3mm!important;color:#17365f!important;font-size:20pt!important;font-weight:700!important;letter-spacing:0!important;}
  .dental-report-patient{display:flex;align-items:baseline;gap:12px;font-size:11pt;color:#233a58;}
  .dental-report-patient strong{font-size:12pt;}
  .dental-report-meta{display:flex;gap:20px;margin-top:2mm;color:#64748b;font-size:8.5pt;}
  .dental-chart-panel,.dental-findings-panel{margin:0 0 7mm!important;padding:5mm!important;border:1px solid #cbd5e1!important;border-radius:4px!important;box-shadow:none!important;break-inside:avoid;}
  .dental-chart-panel strong,.dental-findings-panel h5{color:#17365f!important;font-size:11pt!important;}
  .dental-chart-panel .text-muted{color:#64748b!important;}
  .tooth-grid{grid-template-columns:repeat(16,minmax(0,1fr))!important;gap:2.2mm!important;margin:3mm 0 5mm!important;}
  .tooth-grid .tooth{display:grid!important;min-width:0!important;min-height:9mm!important;padding:1mm!important;border:1px solid #aebed0!important;border-radius:2mm!important;background:#fff!important;color:#263b55!important;font-size:8.5pt!important;box-shadow:none!important;}
  .tooth-grid .tooth.has-finding{background:#fff1c2!important;border:1px solid #c18b20!important;color:#704b00!important;}
  .tooth-grid .tooth.selected{outline:none!important;border:1px solid #aebed0!important;}
  .dental-findings-panel .table{width:100%!important;border-collapse:collapse!important;font-size:8.5pt!important;}
  .dental-findings-panel .table thead th{background:#eaf1f8!important;color:#27496f!important;text-transform:uppercase;font-size:8pt!important;letter-spacing:.4px!important;padding:2.5mm!important;border:1px solid #cbd5e1!important;}
  .dental-findings-panel .table tbody td{padding:2.5mm!important;border:1px solid #d8e0e9!important;color:#263b55!important;}
  .dental-findings-panel .table tbody tr:hover>*{background:transparent!important;}
  .dental-findings-panel h5{margin-bottom:3mm!important;}
}

/* Printable clinical chart: structured to match the supplied patient chart reference. */
.dental-print-report{display:none;color:#172b45;background:#fff;font-family:Arial,sans-serif;}
.dental-print-report *{box-sizing:border-box;}
.print-titlebar{display:grid;grid-template-columns:42px 1fr 1.25fr;align-items:center;gap:10px;margin-bottom:7px;}
.print-tooth-logo{display:grid;place-items:center;height:42px;border-radius:5px;background:#17618f;color:#fff;font-size:25px;font-weight:bold;}
.print-titlebar h1{margin:0;padding:9px 12px;background:#17618f;color:#fff;font-size:19px;letter-spacing:3px;text-align:center;}
.print-id-date{height:42px;display:flex;align-items:center;justify-content:space-around;gap:5px;border:1px solid #17618f;border-radius:5px;padding:5px;font-size:10px;}
.print-id-date span{display:inline-block;min-width:50px;border-bottom:1px solid #536779;padding:0 3px 2px;}
.print-top-grid{display:grid;grid-template-columns:1.5fr 1.1fr .75fr;gap:7px;margin-bottom:7px;}
.print-section{min-width:0;border:1px solid #1681b6;border-radius:5px;overflow:hidden;background:#fff;}
.print-section h2{margin:0;padding:5px 10px;background:#17618f;color:#fff;font-size:11px;letter-spacing:.6px;font-weight:700;}
.print-fields{padding:7px 10px;display:grid;grid-template-columns:1fr 1fr;gap:5px 12px;font-size:10px;}
.print-field{display:flex;align-items:baseline;gap:6px;min-width:0;min-height:17px;}
.print-field b{white-space:nowrap;font-weight:500;}
.print-field span{flex:1;min-width:12px;min-height:15px;border-bottom:1px solid #a7b2bf;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
.print-field.full{grid-column:1/-1;}
.print-legend .legend-grid{padding:7px 10px;display:grid;grid-template-columns:1fr 1fr;gap:5px 8px;font-size:9px;}
.legend-grid>span{display:flex;align-items:center;gap:8px;min-width:0;white-space:nowrap;}
.legend-symbol{display:inline-grid;place-items:center;width:24px;flex:0 0 24px;font-style:normal;font-size:16px;color:#111;}
.legend-symbol.caries{color:#e11d48}.legend-symbol.fracture{color:#dc2626}.legend-symbol.filled{color:#64748b}.legend-symbol.sound{color:#111}
.print-notes .ruled-lines,.clinical-notes .ruled-lines{height:100%;min-height:140px;margin:7px 9px;background:repeating-linear-gradient(to bottom,transparent 0,transparent 24px,#aab6c4 25px,#aab6c4 26px);}
.print-chart-grid{display:grid;grid-template-columns:2.45fr 1fr;gap:7px;margin-bottom:7px;}
.arch-title{text-align:center;padding:4px;font-weight:700;font-size:10px;}
.arch-row{display:grid;grid-template-columns:62px 1fr;align-items:center;gap:3px;padding:2px 7px;}
.arch-row>b{font-size:9px;line-height:1.3;font-weight:600;}
.arch-teeth{display:grid;grid-template-columns:repeat(16,minmax(0,1fr));gap:3px;align-items:center;}
.print-tooth{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;gap:1px;}
.tooth-number{font-size:8px;line-height:1.2;font-weight:600;}
.tooth-shape{position:relative;display:block;width:17px;height:32px;border:1px solid #222;border-radius:7px 7px 5px 5px;background:linear-gradient(90deg,#f4f5f6,#fff 48%,#e6e8ea);clip-path:polygon(9% 0,34% 4%,50% 13%,66% 4%,91% 0,100% 17%,91% 43%,84% 56%,82% 100%,64% 100%,56% 68%,50% 61%,44% 68%,36% 100%,18% 100%,16% 56%,9% 43%,0 17%);}
.lower-teeth .tooth-shape{transform:rotate(180deg);}
.print-tooth.caries .tooth-shape{background:radial-gradient(circle at 50% 40%,#e11d48 0 20%,transparent 23%),linear-gradient(90deg,#f4f5f6,#fff 48%,#e6e8ea);}
.print-tooth.filling .tooth-shape{background:linear-gradient(135deg,#9ca3af 0 35%,#fff 36% 55%,#e5e7eb 56%);}
.print-tooth.missing .tooth-shape,.print-tooth.extracted .tooth-shape{opacity:.25;border-style:dashed;}
.print-tooth.fracture .tooth-shape{background:linear-gradient(135deg,transparent 47%,#dc2626 48% 52%,transparent 53%),linear-gradient(90deg,#f4f5f6,#fff 48%,#e6e8ea);}
.print-tooth.crown .tooth-shape{outline:1px solid #111;}
.print-primary-chart{padding-bottom:5px;}
.primary-arch-label{font-size:8px;padding:4px 8px 0;}
.primary-row{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:2px;padding:4px 6px;align-items:center;text-align:center;}
.primary-row span{display:flex;flex-direction:column;align-items:center;gap:2px;font-size:8px;}
.primary-row i{display:block;width:14px;height:23px;border:1px solid #222;border-radius:5px 5px 4px 4px;background:linear-gradient(90deg,#f4f5f6,#fff 48%,#e6e8ea);clip-path:polygon(8% 0,30% 5%,50% 13%,70% 5%,92% 0,100% 25%,85% 48%,80% 100%,60% 100%,50% 68%,40% 100%,20% 100%,15% 48%,0 25%);}
.primary-lower i{transform:rotate(180deg);}
.print-bottom-grid{display:grid;grid-template-columns:1.25fr 1fr;gap:7px;}
.treatment-plan table{width:100%;border-collapse:collapse;font-size:9px;}
.treatment-plan th,.treatment-plan td{border:1px solid #9eabb8;padding:4px 5px;height:21px;text-align:center;}
.treatment-plan th{background:#dcecf7;color:#172b45;font-weight:600;}
.treatment-plan td:nth-child(1){width:9%;}.treatment-plan td:nth-child(2){width:17%;}.treatment-plan td:nth-child(3){width:31%;}.treatment-plan td:nth-child(4){width:15%;}
.clinical-notes .ruled-lines{min-height:119px;margin-top:6px;}
.print-footer{display:flex;justify-content:space-between;margin-top:5px;color:#64748b;font-size:8px;}
@media print{
 @page{size:A4 landscape;margin:7mm;}
 .dental-print-report{display:block!important;width:100%!important;}
 .dental-screen-content,.dental-page-heading{display:none!important;}
 .print-titlebar{grid-template-columns:38px 1fr 1.25fr;margin-bottom:5px;}
 .print-titlebar h1{font-size:17px;padding:7px;}
 .print-tooth-logo,.print-id-date{height:36px;}
 .print-top-grid,.print-chart-grid,.print-bottom-grid{gap:5px;margin-bottom:5px;}
 .print-section h2{padding:4px 8px;font-size:10px;}
 .print-fields{padding:5px 8px;gap:3px 8px;font-size:9px;}
 .print-field{min-height:14px;}.print-field span{min-height:13px;}
 .print-legend .legend-grid{padding:5px 8px;gap:3px 5px;font-size:8px;}
 .legend-symbol{width:19px;flex-basis:19px;font-size:13px;}
 .arch-title{padding:2px;font-size:9px;}
 .arch-row{grid-template-columns:55px 1fr;padding:1px 5px;}
 .arch-row>b{font-size:8px;}
 .arch-teeth{gap:2px;}
 .tooth-shape{width:14px;height:26px;}
 .tooth-number{font-size:7px;}
 .primary-arch-label{font-size:7px;padding-top:2px;}
 .primary-row{padding:2px 4px;}.primary-row span{font-size:7px;}.primary-row i{width:12px;height:19px;}
 .treatment-plan table{font-size:8px;}.treatment-plan th,.treatment-plan td{height:18px;padding:3px;}
 .print-notes .ruled-lines{min-height:110px;margin:5px 7px;}
 .clinical-notes .ruled-lines{min-height:100px;margin:5px 7px;}
 .print-footer{margin-top:3px;}
}

/* On-screen clinical chart: report-style cards, not a simulated paper page. */
@media screen {
  .dental-print-report{display:block;width:100%;margin:0 0 1.25rem;padding:0;color:#172b45;background:transparent;font-family:inherit;}
  .print-titlebar{grid-template-columns:48px minmax(220px,1fr) minmax(280px,1.1fr);gap:12px;margin-bottom:12px;}
  .print-tooth-logo{height:48px;border-radius:10px;font-size:27px;}
  .print-titlebar h1{border-radius:10px;font-size:clamp(15px,1.5vw,22px);letter-spacing:1.5px;padding:13px 12px;}
  .print-id-date{height:48px;border-radius:10px;font-size:12px;background:#fff;padding:8px;gap:8px;}
  .print-top-grid{grid-template-columns:minmax(0,1.45fr) minmax(0,1.1fr) minmax(180px,.75fr);gap:12px;margin-bottom:12px;}
  .print-chart-grid{grid-template-columns:minmax(0,2.45fr) minmax(240px,1fr);gap:12px;margin-bottom:12px;}
  .print-bottom-grid{grid-template-columns:minmax(0,1.25fr) minmax(260px,1fr);gap:12px;}
  .print-section{border-color:#d6e2ef;border-radius:12px;box-shadow:0 5px 18px rgba(25,65,110,.045);}
  .print-section h2{padding:9px 13px;font-size:12px;letter-spacing:.65px;}
  .print-fields{padding:12px 14px;gap:9px 14px;font-size:12px;}
  .print-field{min-height:22px;}.print-field span{min-height:20px;}
  .print-legend .legend-grid{padding:12px 14px;gap:8px 12px;font-size:11px;}
  .legend-symbol{width:26px;flex-basis:26px;font-size:18px;}
  .print-notes .ruled-lines{min-height:150px;margin:12px 14px;}
  .arch-title{padding:8px;font-size:12px;}
  .arch-row{grid-template-columns:70px 1fr;gap:6px;padding:8px 12px;}
  .arch-row>b{font-size:11px;}.arch-teeth{gap:5px;}
  .tooth-number{font-size:10px;}.tooth-shape{width:23px;height:42px;}
  .primary-arch-label{font-size:10px;padding:8px 12px 0;}
  .primary-row{gap:4px;padding:8px 10px;}.primary-row span{font-size:10px;gap:4px;}.primary-row i{width:19px;height:31px;}
  .treatment-plan table{font-size:11px;}.treatment-plan th,.treatment-plan td{padding:7px 8px;height:30px;}
  .clinical-notes .ruled-lines{min-height:145px;margin:12px 14px;}
  .print-footer{margin-top:8px;font-size:10px;}.dental-screen-content{margin-top:1.25rem;}
}
@media screen and (max-width:900px){
  .print-titlebar{grid-template-columns:42px minmax(0,1fr);}.print-id-date{grid-column:1/-1;}
  .print-top-grid{grid-template-columns:1fr 1fr;}.print-notes{grid-column:1/-1;}
  .print-chart-grid{grid-template-columns:1fr;}.print-bottom-grid{grid-template-columns:1fr;}
  .print-tooth-chart{overflow-x:auto;}.arch-teeth{min-width:620px;}
}
@media screen and (max-width:560px){
  .print-top-grid{grid-template-columns:1fr;}.print-notes{grid-column:auto;}
  .print-fields{grid-template-columns:1fr;}.print-field.full{grid-column:auto;}
  .print-titlebar h1{font-size:14px;letter-spacing:.7px;}
}

/* Patient-specific dental report: shown only in print/PDF, never as an extra on-screen form. */
.dental-print-report{display:none!important;color:#172b45;background:#fff;font-family:Arial,sans-serif;font-size:10pt;}
.dental-print-report *{box-sizing:border-box;}
.clinical-report-heading{padding:0 0 12px;margin-bottom:14px;border-bottom:2px solid #1e4777;}
.clinical-report-brand{display:flex;align-items:center;gap:8px;color:#1e4777;font-size:11pt;font-weight:700;}
.clinical-report-logo{display:inline-grid;place-items:center;width:27px;height:27px;border:1px solid #b9cce2;border-radius:6px;color:#1e7c91;font-size:16px;}
.clinical-report-tag{margin-left:auto;color:#64748b;font-size:8pt;letter-spacing:1px;}
.clinical-report-heading h1{margin:10px 0 5px;color:#17365f;font-size:21pt;font-weight:700;}
.clinical-report-patient-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px 18px;margin-top:7px;color:#334a66;font-size:9pt;}
.clinical-report-detail{display:flex;align-items:baseline;gap:5px;min-width:0;}
.clinical-report-detail-label{flex:0 0 auto;color:#334a66;font-weight:700;}
.clinical-report-detail>span:last-child,.clinical-report-detail>strong{min-width:0;overflow-wrap:anywhere;color:#172b45;}
.clinical-report-detail>strong{font-size:9pt;}
@media screen and (max-width:640px){.clinical-report-patient-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
.clinical-report-section{border:1px solid #cbd8e8;border-radius:7px;margin-bottom:12px;overflow:hidden;break-inside:avoid;}
.clinical-report-section-title{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 11px;background:#edf4fb;border-bottom:1px solid #cbd8e8;}
.clinical-report-section-title h2{margin:0;color:#17365f;font-size:11pt;font-weight:700;}
.clinical-report-section-title span{color:#64748b;font-size:8pt;}
.clinical-arch{padding:10px 12px 8px;}
.clinical-arch-label{display:flex;align-items:baseline;gap:8px;color:#334a66;font-size:8pt;font-weight:700;letter-spacing:.5px;margin-bottom:5px;}
.clinical-arch-label span{font-weight:400;letter-spacing:0;color:#64748b;}
.clinical-tooth-row{display:grid;grid-template-columns:repeat(16,minmax(0,1fr));gap:4px;align-items:end;}
.clinical-tooth{display:flex;min-width:0;min-height:68px;flex-direction:column;align-items:center;justify-content:flex-end;gap:2px;padding:3px 1px;border:1px solid transparent;border-radius:4px;}
.clinical-tooth-number{font-size:8pt;font-weight:700;color:#334a66;}
.clinical-tooth-crown{display:block;width:20px;height:31px;border:1px solid #687789;border-radius:8px 8px 5px 5px;background:linear-gradient(90deg,#e8edf2,#fff 48%,#e1e7ed);clip-path:polygon(8% 0,30% 5%,50% 14%,70% 5%,92% 0,100% 25%,85% 48%,80% 100%,60% 100%,50% 68%,40% 100%,20% 100%,15% 48%,0 25%);}
.clinical-lower-row .clinical-tooth-crown{transform:rotate(180deg);}
.clinical-tooth-status{display:none;font-size:6pt;line-height:1.1;text-align:center;color:#64748b;}
.clinical-tooth.has-finding{background:#fff5d6;border-color:#e7bd55;}
.clinical-tooth.caries .clinical-tooth-crown{background:radial-gradient(circle at 50% 45%,#dc2626 0 24%,transparent 27%),linear-gradient(90deg,#e8edf2,#fff 48%,#e1e7ed);}
.clinical-tooth.filling .clinical-tooth-crown{background:linear-gradient(135deg,#94a3b8 0 38%,#fff 39% 57%,#cbd5e1 58%);}
.clinical-tooth.missing .clinical-tooth-crown,.clinical-tooth.extracted .clinical-tooth-crown{opacity:.2;border-style:dashed;}
.clinical-tooth.fracture .clinical-tooth-crown{background:linear-gradient(135deg,transparent 47%,#dc2626 48% 53%,transparent 54%),linear-gradient(90deg,#e8edf2,#fff 48%,#e1e7ed);}
.clinical-tooth.crown .clinical-tooth-crown{outline:2px solid #64748b;outline-offset:1px;}
.clinical-tooth.root_canal .clinical-tooth-crown{box-shadow:inset 0 -7px #dbeafe;}
.clinical-arch-midline{display:flex;align-items:center;gap:8px;margin:4px 0;color:#94a3b8;font-size:7pt;}
.clinical-arch-midline i{height:1px;flex:1;background:#d5deea;}
.lower-label{margin:5px 0 0;}
.clinical-report-legend{display:flex;flex-wrap:wrap;align-items:center;gap:5px 13px;padding:7px 12px;border-top:1px solid #e2e8f0;font-size:8pt;}
.clinical-report-legend>span{display:inline-flex;align-items:center;gap:5px;}
.legend-dot{width:9px;height:9px;border:1px solid #94a3b8;border-radius:50%;background:#fff;display:inline-block;}
.legend-dot.caries,.legend-dot.fracture{background:#dc2626;border-color:#dc2626;}.legend-dot.filling{background:#94a3b8;}.legend-dot.missing,.legend-dot.extracted{background:#fff5d6;border-style:dashed;}.legend-dot.crown{background:#64748b;}
.clinical-report-table{width:100%;border-collapse:collapse;font-size:9pt;}
.clinical-report-table th,.clinical-report-table td{padding:7px 9px;border-bottom:1px solid #e2e8f0;text-align:left;vertical-align:top;}
.clinical-report-table th{background:#f5f8fc;color:#334a66;font-size:8pt;text-transform:uppercase;letter-spacing:.35px;}
.clinical-report-table tbody tr:last-child td{border-bottom:0;}
.clinical-report-table td:first-child{width:9%;}.clinical-report-table td:nth-child(2){width:20%;}.clinical-report-table td:last-child{white-space:nowrap;width:22%;}
.report-empty{margin:0;padding:12px;color:#64748b;}
.clinical-report-footer{display:flex;justify-content:space-between;gap:10px;margin-top:8px;color:#64748b;font-size:7.5pt;}
@media print{
 @page{size:A4 landscape;margin:9mm;}
 .dental-print-report{display:block!important;width:100%!important;}
 .dental-screen-content,.dental-page-heading,.app-topbar,.sidebar,aside.sidebar,.btn,.alert{display:none!important;}
 .app-shell,.content,main.content{display:block!important;width:100%!important;max-width:none!important;min-height:0!important;margin:0!important;padding:0!important;background:#fff!important;}
 .clinical-report-heading{margin-bottom:8px;padding-bottom:8px;}
 .clinical-report-heading h1{font-size:18pt;margin:6px 0 3px;}
 .clinical-report-section{margin-bottom:8px;}
 .clinical-report-section-title{padding:5px 8px;}
 .clinical-arch{padding:6px 8px;}
 .clinical-tooth{min-height:56px;}
 .clinical-tooth-crown{width:16px;height:25px;}
 .clinical-report-table th,.clinical-report-table td{padding:5px 7px;}
 .clinical-report-footer{margin-top:5px;}
}


/* Final patient dental report print rules: prevent duplicate screen content and text overflow. */
@media print {
  @page { size: A4 landscape; margin: 7mm; }
  html, body { width:100%!important; min-width:0!important; margin:0!important; padding:0!important; background:#fff!important; color:#172b45!important; font:8pt/1.25 Arial,sans-serif!important; }
  body.report-print-mode * { visibility:hidden!important; }
  body.report-print-mode .dental-print-report,
  body.report-print-mode .dental-print-report * { visibility:visible!important; }
  body.report-print-mode .dental-print-report { display:block!important; position:absolute!important; inset:0 auto auto 0!important; width:100%!important; max-width:none!important; margin:0!important; padding:0!important; background:#fff!important; color:#172b45!important; font:8pt/1.25 Arial,sans-serif!important; }
  body.report-print-mode .dental-screen-content, body.report-print-mode .dental-page-heading,
  body.report-print-mode .report-toolbar, body.report-print-mode .app-topbar,
  body.report-print-mode .sidebar, body.report-print-mode .btn, body.report-print-mode .alert { display:none!important; }
  .clinical-report-heading { margin:0 0 5mm!important; padding:0 0 3mm!important; border-bottom:1.5pt solid #1e4777!important; }
  .clinical-report-heading h1 { margin:2mm 0!important; font-size:17pt!important; line-height:1.1!important; }
  .clinical-report-brand { font-size:9pt!important; }
  .clinical-report-logo { width:7mm!important; height:7mm!important; }
  .clinical-report-patient-grid { grid-template-columns:repeat(3,minmax(0,1fr))!important; gap:1.5mm 5mm!important; margin-top:2mm!important; font-size:8pt!important; }
  .clinical-report-detail { gap:1mm!important; }
  .clinical-report-detail-label { font-size:7.5pt!important; }
  .clinical-report-detail>span:last-child,.clinical-report-detail>strong { font-size:8pt!important; }
  .clinical-report-section { margin:0 0 4mm!important; border:1px solid #cbd8e8!important; border-radius:2mm!important; overflow:visible!important; break-inside:avoid!important; page-break-inside:avoid!important; }
  .clinical-report-section-title { padding:2mm 3mm!important; background:#edf4fb!important; }
  .clinical-report-section-title h2 { font-size:9pt!important; }
  .clinical-arch { padding:2mm 3mm!important; }
  .clinical-arch-label { margin:0 0 1mm!important; font-size:7pt!important; }
  .clinical-tooth-row { gap:1mm!important; }
  .clinical-tooth { min-height:14mm!important; padding:0.5mm!important; gap:0!important; }
  .clinical-tooth-number { font-size:7pt!important; }
  .clinical-tooth-crown { width:5mm!important; height:8mm!important; }
  .clinical-tooth-status { display:none!important; }
  .clinical-arch-midline { margin:1mm 0!important; font-size:6pt!important; }
  .clinical-report-legend { padding:1.5mm 3mm!important; gap:1mm 4mm!important; font-size:7pt!important; }
  .clinical-report-table { width:100%!important; table-layout:fixed!important; font-size:7.5pt!important; }
  .clinical-report-table th,.clinical-report-table td { padding:1.5mm 2mm!important; overflow-wrap:anywhere!important; }
  .clinical-report-table th { font-size:7pt!important; }
  .clinical-report-table td:last-child { white-space:normal!important; }
  .clinical-report-footer { margin-top:2mm!important; font-size:6.5pt!important; }
}


/* Final print/PDF patient header: keep patient metadata on one horizontal line. */
@media print {
  body.report-print-mode .clinical-report-heading .clinical-report-patient-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: baseline !important;
    justify-content: flex-start !important;
    gap: 0 4mm !important;
    width: 100% !important;
    margin: 2mm 0 0 !important;
    padding: 0 !important;
    font-size: 8pt !important;
  }

  body.report-print-mode .clinical-report-heading .clinical-report-detail {
    display: inline-flex !important;
    flex: 0 1 auto !important;
    align-items: baseline !important;
    gap: 1mm !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: visible !important;
  }

  body.report-print-mode .clinical-report-heading .clinical-report-detail-label {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    font-weight: 700 !important;
  }

  body.report-print-mode .clinical-report-heading .clinical-report-detail > span:last-child,
  body.report-print-mode .clinical-report-heading .clinical-report-detail > strong {
    display: inline !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
  }
}


/* Ensure all patient metadata is presented in a single horizontal header row
   in the browser print preview and saved PDF. */
@media print {
  body.report-print-mode .clinical-report-heading .clinical-report-patient-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: baseline !important;
    justify-content: flex-start !important;
    gap: 0 4mm !important;
    width: 100% !important;
    margin: 2mm 0 0 !important;
    padding: 0 !important;
    font-size: 7.5pt !important;
    line-height: 1.2 !important;
  }

  body.report-print-mode .clinical-report-heading .clinical-report-detail {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    flex-direction: row !important;
    align-items: baseline !important;
    gap: 1mm !important;
    min-width: 0 !important;
    margin: 0 !important;
    white-space: nowrap !important;
  }

  body.report-print-mode .clinical-report-heading .clinical-report-detail-label,
  body.report-print-mode .clinical-report-heading .clinical-report-detail > span:last-child,
  body.report-print-mode .clinical-report-heading .clinical-report-detail > strong {
    display: inline !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    font-size: 7.5pt !important;
  }
}

/* Definitive print rules for the patient-specific dental chart report.
   These apply even when the browser invokes print directly (without JS mode). */
@media print {
  @page { size: A4 landscape; margin: 7mm; }
  html, body { width:100%!important; min-width:0!important; margin:0!important; padding:0!important; background:#fff!important; }
  body .dental-screen-content,
  body .dental-page-heading,
  body .report-toolbar,
  body .app-topbar,
  body .sidebar,
  body aside.sidebar { display:none!important; }
  body .dental-print-report { display:block!important; position:static!important; width:100%!important; max-width:none!important; margin:0!important; padding:0!important; color:#172b45!important; background:#fff!important; font:8pt/1.25 Arial,sans-serif!important; }
  body .dental-print-report .clinical-report-patient-grid { display:flex!important; flex-flow:row nowrap!important; align-items:baseline!important; justify-content:flex-start!important; gap:0 4mm!important; width:100%!important; margin:2mm 0 0!important; padding:0!important; font-size:7.5pt!important; }
  body .dental-print-report .clinical-report-detail { display:inline-flex!important; flex:0 0 auto!important; flex-direction:row!important; align-items:baseline!important; gap:1mm!important; min-width:0!important; margin:0!important; white-space:nowrap!important; }
  body .dental-print-report .clinical-report-detail-label,
  body .dental-print-report .clinical-report-detail>span:last-child,
  body .dental-print-report .clinical-report-detail>strong { display:inline!important; flex:0 0 auto!important; min-width:0!important; white-space:nowrap!important; overflow-wrap:normal!important; word-break:normal!important; font-size:7.5pt!important; }
  body .dental-print-report .clinical-report-section { break-inside:avoid!important; page-break-inside:avoid!important; }
  body .dental-print-report .clinical-tooth-row { display:grid!important; grid-template-columns:repeat(16,minmax(0,1fr))!important; gap:1mm!important; }
  body .dental-print-report .clinical-tooth { display:flex!important; min-height:14mm!important; }
}

/* Dental HMS visual refresh — shared screen UI across every module.
   Print/report styles above remain intentionally untouched. */
@media screen {
  :root {
    --primary:#3563e9;
    --primary-dark:#244ac7;
    --navy:#172b4d;
    --text:#26364f;
    --muted:#718096;
    --bg:#f4f7fb;
    --surface:#ffffff;
    --border:#e3eaf3;
    --radius:16px;
    --shadow:0 10px 28px rgba(24,48,86,.065);
  }
  body { background:radial-gradient(ellipse at 85% 0%,rgba(99,102,241,.07),transparent 32%),var(--bg); }
  .app-topbar {
    background:linear-gradient(110deg,#143d69 0%,#2457a6 48%,#3e55c8 100%);
    box-shadow:0 5px 18px rgba(24,54,110,.2);
  }
  .brand-mark { background:linear-gradient(145deg,rgba(255,255,255,.24),rgba(255,255,255,.08));box-shadow:inset 0 1px rgba(255,255,255,.25); }
  .sidebar,aside.sidebar { background:linear-gradient(180deg,#fff 0%,#f9fbff 68%,#f4f7ff 100%); }
  .sidebar .nav-link { position:relative; }
  .sidebar .nav-link i { transition:transform .2s ease,color .2s ease; }
  .sidebar .nav-link:hover i { transform:translateY(-1px) scale(1.06); }
  .sidebar a[href="index.php"] i {color:#4782df}
  .sidebar a[href="index.php?page=patients"] i {color:#12a58a}
  .sidebar a[href="index.php?page=appointments"] i {color:#8b5cf6}
  .sidebar a[href="index.php?page=dental"] i {color:#0d9bb5}
  .sidebar a[href="index.php?page=billing"] i {color:#e09a24}
  .sidebar a[href="index.php?page=inventory"] i {color:#4b83c5}
  .sidebar a[href="index.php?page=expenses"] i {color:#e06b76}
  .sidebar a[href="index.php?page=services"] i {color:#19a58a}
  .sidebar a[href="index.php?page=users"] i {color:#8b5cf6}
  .sidebar a[href="index.php?page=branches"] i {color:#d28a28}
  .sidebar .nav-link.active {background:linear-gradient(100deg,#e8f0ff,#f0f5ff);box-shadow:inset 3px 0 #4168e8,0 4px 12px rgba(55,91,190,.055);}
  .content { background:transparent; }
  .content > .d-flex.justify-content-between,
  .content > .d-flex.align-items-center { margin-bottom:1.15rem!important; }
  .content h2 { font-size:clamp(1.25rem,1.6vw,1.65rem);letter-spacing:-.55px; }
  .content h2:after { content:"";display:block;width:38px;height:3px;margin-top:7px;border-radius:9px;background:linear-gradient(90deg,#18b6a4,#5276ed);opacity:.9; }
  .content .card { border:1px solid rgba(220,230,243,.95);box-shadow:var(--shadow);overflow:hidden; }
  .content .card:not(.modal-content) { transition:box-shadow .2s ease,border-color .2s ease; }
  .content .card:not(.modal-content):hover { border-color:#d4e0f1;box-shadow:0 12px 32px rgba(24,48,86,.085); }
  .content .card-header { background:linear-gradient(90deg,#f0f6ff,#f8fbff);border-bottom:1px solid #e1eaf5; }
  .content .stat-card { position:relative; }
  .content .stat-card:before { content:"";position:absolute;inset:0 0 auto;height:4px;background:linear-gradient(90deg,#18b6a4,#4f70e8); }
  .content .table-responsive { border-radius:12px; }
  .content .table { margin-bottom:0; }
  .content .table thead th { background:#edf3ff;color:#385b91;border-color:#dfe8f5; }
  .content .table tbody tr:nth-child(even)>* { background-color:#fbfcff; }
  .content .table tbody tr:hover>* { background:#f0f7ff; }
  .content .form-control,.content .form-select,.content input:not([type=checkbox]):not([type=radio]),.content select,.content textarea { min-height:40px;border-color:#dce5f0;background-color:#fff; }
  .content .form-control:focus,.content .form-select:focus,.content input:focus,.content select:focus,.content textarea:focus { border-color:#7b9af1;box-shadow:0 0 0 3px rgba(65,104,232,.12); }
  .content .btn { border-radius:10px;padding:.48rem .85rem; }
  .content .btn-success { background:linear-gradient(135deg,#0eaa83,#20bd9a);border-color:#0eaa83; }
  .content .btn-danger { background:linear-gradient(135deg,#e35d6a,#f07883);border-color:#e35d6a; }
  .content .btn-info { background:linear-gradient(135deg,#169db5,#36bfd0);border-color:#169db5; }
  .content .btn-outline-primary { border-color:#9eb5f5;color:#315bd0; }
  .content .btn-outline-primary:hover { background:#edf3ff;color:#244ac7; }
  .content .badge { padding:.42em .68em;border-radius:7px;font-weight:650;letter-spacing:.01em; }
  .content .alert { border:0;border-left:4px solid currentColor;border-radius:12px;box-shadow:0 5px 16px rgba(24,48,86,.045); }
  .modal-content { border:1px solid #e0e8f3;border-radius:16px;box-shadow:0 22px 60px rgba(16,35,67,.2); }
  .modal-header { background:linear-gradient(90deg,#eef5ff,#fbfcff);border-bottom-color:#e4ebf5; }
  .modal-footer { border-top-color:#e8edf5; }
  .report-toolbar { opacity:.92; }
  @media(max-width:767.98px) {
    .content { padding:18px 14px 34px!important; }
    .content > .d-flex.justify-content-between { align-items:flex-start!important; }
    .content .table { min-width:620px; }
  }
}

/* Clinical quick-select controls */
@media screen {
  .clinical-picker .clinical-picker-toggle { min-height:44px; padding:.58rem .8rem; white-space:normal; }
  .clinical-picker .clinical-picker-toggle::after { float:right; margin-top:.45rem; }
  .clinical-picker-menu { min-width:100%; max-height:300px; overflow:auto; border:1px solid #dce5f0; border-radius:12px; }
  .clinical-picker-option { cursor:pointer; color:#31415c; }
  .clinical-picker-option:hover { background:#edf4ff; }
  .clinical-picker-option .form-check-input { width:1rem; height:1rem; }
  .clinical-picker-option:has(.form-check-input:checked) { background:#eaf7f4; color:#146c5b; font-weight:600; }
  .clinical-picker .form-text { font-size:.76rem; color:#7a879b; }
  .clinical-picker.is-invalid .clinical-picker-toggle { border-color:#dc3545; }
}

/* Clean patient reports for Print / Save as PDF. The application UI never appears in these reports. */
.patient-print-report{display:none!important;background:#fff;color:#172b45;font-family:Arial,sans-serif;font-size:10pt;}
.patient-print-report.active{display:none!important;}
.patient-report-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding-bottom:10px;margin-bottom:12px;border-bottom:2px solid #1e4777;}
.patient-report-brand{font-size:10pt;font-weight:700;color:#1e4777;letter-spacing:.2px;}
.patient-report-brand span{float:right;margin-left:30px;color:#64748b;font-size:7.5pt;letter-spacing:1px;}
.patient-report-header h1{margin:7px 0 0;color:#17365f;font-size:19pt;line-height:1.1;}
.patient-report-date{color:#64748b;font-size:8.5pt;white-space:nowrap;}
.patient-report-details{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px 18px;margin-bottom:12px;color:#263e5a;font-size:9pt;}
.patient-report-details>div{min-width:0;overflow-wrap:anywhere;}
.patient-report-details .full{grid-column:1/-1;}
.patient-report-details b{color:#17365f;}
.patient-report-grid-two{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.patient-report-section{border:1px solid #cbd8e8;border-radius:6px;margin-bottom:10px;overflow:hidden;break-inside:avoid;}
.patient-report-section h2{margin:0;padding:6px 9px;background:#edf4fb;border-bottom:1px solid #cbd8e8;color:#17365f;font-size:10.5pt;}
.patient-report-section p{margin:0;padding:8px 10px;line-height:1.4;min-height:30px;}
.patient-report-table{width:100%;border-collapse:collapse;font-size:8.5pt;}
.patient-report-table th,.patient-report-table td{padding:6px 7px;border-bottom:1px solid #dbe4ef;text-align:left;vertical-align:top;}
.patient-report-table th{background:#f5f8fc;color:#334a66;font-size:7.5pt;text-transform:uppercase;letter-spacing:.25px;}
.patient-report-table tbody tr:last-child td{border-bottom:0;}
.patient-report-footer{display:flex;justify-content:space-between;gap:12px;margin-top:7px;color:#64748b;font-size:7.5pt;}
.patient-report-details-compact{margin-bottom:10px;}
.patient-report-section h2{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.patient-report-section h2 .report-count{font-size:7.5pt;font-weight:500;color:#64748b;}

@media print{
  .report-print-mode .patient-print-report{display:none!important;}
  .report-print-mode .patient-print-report.active{display:block!important;width:100%!important;}
  .report-print-mode .app-topbar,.report-print-mode .sidebar,.report-print-mode aside.sidebar,.report-print-mode .report-toolbar,.report-print-mode .patient-header,.report-print-mode .clinical-nav,.report-print-mode .tab-content,.report-print-mode .btn,.report-print-mode .alert,.report-print-mode .modal,.report-print-mode .offcanvas-backdrop{display:none!important;}
  .report-print-mode .app-shell,.report-print-mode .content,.report-print-mode main.content{display:block!important;width:100%!important;max-width:none!important;min-height:0!important;margin:0!important;padding:0!important;background:#fff!important;}
  .report-print-mode .patient-report-header{margin-bottom:9px;padding-bottom:8px;}
  .report-print-mode .patient-report-header h1{font-size:18pt;}
  .report-print-mode .patient-report-section{margin-bottom:8px;}
  .report-print-mode .patient-report-table th,.report-print-mode .patient-report-table td{padding:5px 6px;}
  .report-print-mode .patient-report-footer{margin-top:5px;}
}

/* Patient-specific Print/PDF fix: the dental chart report uses a global visibility mask;
   explicitly expose the selected patient report as well. */
@media print {
  body.report-print-mode .patient-print-report.active,
  body.report-print-mode .patient-print-report.active * {
    visibility: visible !important;
  }
  body.report-print-mode .patient-print-report.active {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #172b45 !important;
    font: 9pt/1.35 Arial, sans-serif !important;
  }
  body.report-print-mode .patient-print-report.active .patient-report-header {
    display: flex !important;
    visibility: visible !important;
  }
  body.report-print-mode .patient-print-report.active .patient-report-details {
    display: grid !important;
    visibility: visible !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  body.report-print-mode .patient-print-report.active .patient-report-section,
  body.report-print-mode .patient-print-report.active .patient-report-section * {
    visibility: visible !important;
  }
  body.report-print-mode .patient-print-report.active .patient-report-grid-two {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
  }
  body.report-print-mode .patient-print-report.active .patient-report-table {
    display: table !important;
    visibility: visible !important;
    width: 100% !important;
  }
  body.report-print-mode .patient-print-report.active .patient-report-table thead {
    display: table-header-group !important;
  }
  body.report-print-mode .patient-print-report.active .patient-report-table tbody {
    display: table-row-group !important;
  }
  body.report-print-mode .patient-print-report.active .patient-report-table tr {
    display: table-row !important;
  }
  body.report-print-mode .patient-print-report.active .patient-report-table th,
  body.report-print-mode .patient-print-report.active .patient-report-table td {
    display: table-cell !important;
    visibility: visible !important;
  }
  body.report-print-mode .patient-print-report.active .patient-report-footer,
  body.report-print-mode .patient-print-report.active .patient-report-footer * {
    visibility: visible !important;
  }
}


/* Administration command center */
.global-patient-search{height:38px;min-width:300px;align-items:center;gap:8px;padding:0 10px;border:1px solid rgba(255,255,255,.25);border-radius:12px;background:rgba(255,255,255,.12);color:#fff;}
.global-patient-search i{opacity:.9}.global-patient-search input{width:210px;border:0;outline:0;background:transparent;color:#fff;font-size:.86rem}.global-patient-search input::placeholder{color:rgba(255,255,255,.78)}.global-patient-search kbd{padding:2px 6px;border:1px solid rgba(255,255,255,.28);border-radius:6px;color:#dce8ff;background:rgba(0,0,0,.08);font-size:.68rem}.header-quick-link{width:36px;height:36px;align-items:center;justify-content:center;border-radius:10px;color:#fff;text-decoration:none;background:rgba(255,255,255,.12);font-size:1rem}.header-quick-link:hover{color:#fff;background:rgba(255,255,255,.2)}
.admin-command-grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(320px,.95fr);gap:18px;margin-bottom:18px}.quick-actions-panel,.alerts-panel{padding:18px}.command-badge{font-size:.72rem;color:#6b4f00;background:#fff5cf;border:1px solid #f1dc8a;padding:5px 9px;border-radius:999px;font-weight:700}.quick-actions-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.quick-action-card{position:relative;display:flex;align-items:center;gap:11px;min-height:78px;padding:12px;border:1px solid #e2e8f0;border-radius:14px;text-decoration:none;color:#172b45;background:#fff;transition:.18s ease;overflow:hidden}.quick-action-card:hover{transform:translateY(-2px);border-color:#b7cbe8;box-shadow:0 8px 22px rgba(32,70,110,.10);color:#172b45}.quick-action-card>b,.quick-action-card small{display:block}.quick-action-card b{font-size:.84rem}.quick-action-card small{margin-top:3px;color:#748196;font-size:.72rem;line-height:1.3}.quick-action-icon{width:38px;height:38px;display:grid;place-items:center;border-radius:11px;font-size:1.05rem;flex:0 0 auto}.qa-teal .quick-action-icon{color:#0b8f7a;background:#e4faf5}.qa-blue .quick-action-icon{color:#2d68d9;background:#e9f1ff}.qa-purple .quick-action-icon{color:#7652d6;background:#f0ebff}.qa-orange .quick-action-icon{color:#d37a13;background:#fff1dd}.qa-pink .quick-action-icon{color:#d34f7a;background:#ffeaf1}.qa-indigo .quick-action-icon{color:#515cc8;background:#eceeff}.quick-action-arrow{position:absolute;right:9px;top:9px;color:#a2aec0;font-size:.78rem}.alert-count{min-width:26px;height:26px;display:grid;place-items:center;border-radius:50%;background:#edf2f7;color:#64748b;font-size:.75rem;font-weight:800}.alert-count.has-alerts{background:#fff0e8;color:#d45b27}.admin-alert-list{display:flex;flex-direction:column;gap:8px}.admin-alert{display:flex;gap:10px;align-items:center;padding:10px 11px;border-radius:12px;text-decoration:none;border:1px solid #e7ebf2;color:#24324b;background:#fbfcfe}.admin-alert:hover{color:#172b45;background:#fff;box-shadow:0 4px 14px rgba(32,70,110,.07)}.admin-alert-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;flex:0 0 auto}.admin-alert-copy b,.admin-alert-copy small{display:block}.admin-alert-copy b{font-size:.77rem;line-height:1.35}.admin-alert-copy small{margin-top:3px;color:#6c788a;font-size:.69rem;font-weight:600}.alert-warning .admin-alert-icon{background:#fff4d6;color:#c8870a}.alert-danger .admin-alert-icon{background:#ffe8e8;color:#cf4d55}.alert-info .admin-alert-icon{background:#e8f5ff;color:#2778bd}.alert-primary .admin-alert-icon{background:#eaf0ff;color:#3c67d8}.all-clear{display:flex;align-items:center;gap:12px;padding:18px 8px}.all-clear>span{width:40px;height:40px;display:grid;place-items:center;border-radius:12px;background:#e5f8ee;color:#16885b;font-size:1.2rem}.all-clear b,.all-clear small{display:block}.all-clear b{font-size:.85rem}.all-clear small{margin-top:3px;color:#748196;font-size:.72rem}.workflow-strip{display:grid;grid-template-columns:1.3fr repeat(5,1fr);gap:0;align-items:stretch;margin-bottom:18px;border:1px solid #dce5f0;border-radius:16px;background:#fff;overflow:hidden;box-shadow:0 3px 12px rgba(33,67,104,.04)}.workflow-title,.workflow-metric{padding:14px 15px}.workflow-title{display:flex;align-items:center;gap:10px;background:linear-gradient(135deg,#f7fbff,#eef5ff)}.workflow-icon{width:36px;height:36px;display:grid;place-items:center;border-radius:11px;background:#e1ecff;color:#2f68d6}.workflow-title b,.workflow-title small{display:block}.workflow-title b{font-size:.84rem}.workflow-title small{margin-top:2px;color:#7a8799;font-size:.68rem}.workflow-metric{text-decoration:none;border-left:1px solid #e8edf4;color:#26364d;transition:.15s}.workflow-metric:hover{background:#f9fbff;color:#26364d}.workflow-metric span,.workflow-metric small{display:block;color:#78869a;font-size:.68rem}.workflow-metric strong{display:block;margin:5px 0 2px;font-size:1rem;color:#1e3d68}.workflow-metric small{font-size:.65rem}
@media (max-width:1100px){.global-patient-search{min-width:240px}.quick-actions-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.admin-command-grid{grid-template-columns:1fr}.workflow-strip{grid-template-columns:repeat(3,1fr)}.workflow-title{grid-column:1/-1}.workflow-metric:nth-child(2){border-left:0}}
@media (max-width:700px){.quick-actions-grid{grid-template-columns:1fr}.workflow-strip{grid-template-columns:1fr 1fr}.workflow-title{grid-column:1/-1}.workflow-metric:nth-child(odd){border-left:0}.global-patient-search{display:none!important}}

/* Generic reports for all non-patient menu pages. */
.generic-print-report{display:none!important;background:#fff;color:#172b45;font-family:Arial,sans-serif;font-size:9.5pt;}
.generic-report-header{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;padding:0 0 10px;margin-bottom:12px;border-bottom:2px solid #1e4777;}
.generic-report-brand{font-size:10pt;font-weight:700;color:#1e4777;letter-spacing:.2px;}
.generic-report-brand span{margin-left:24px;color:#64748b;font-size:7.5pt;letter-spacing:1px;}
.generic-report-header h1{margin:6px 0 0;color:#17365f;font-size:19pt;line-height:1.1;}
.generic-report-date{color:#64748b;font-size:8.5pt;white-space:nowrap;}
.generic-report-section{border:1px solid #cbd8e8;border-radius:7px;margin-bottom:12px;overflow:hidden;break-inside:avoid;}
.generic-report-section h2{margin:0;padding:7px 10px;background:#edf4fb;border-bottom:1px solid #cbd8e8;color:#17365f;font-size:10.5pt;}
.generic-report-table{width:100%;border-collapse:collapse;font-size:8.5pt;}
.generic-report-table th,.generic-report-table td{padding:6px 8px;border-bottom:1px solid #dbe4ef;text-align:left;vertical-align:top;}
.generic-report-table th{background:#f5f8fc;color:#334a66;font-size:7.5pt;text-transform:uppercase;letter-spacing:.25px;}
.generic-report-table tbody tr:last-child td{border-bottom:0;}
.generic-report-footer{display:flex;justify-content:space-between;gap:12px;margin-top:7px;color:#64748b;font-size:7.5pt;}
@media print{
  body.report-print-mode *{visibility:hidden!important;}
  body.report-print-mode .generic-print-report,
  body.report-print-mode .generic-print-report *{visibility:visible!important;}
  body.report-print-mode .generic-print-report{display:block!important;position:static!important;width:100%!important;max-width:none!important;margin:0!important;padding:0!important;background:#fff!important;color:#172b45!important;font:9pt/1.35 Arial,sans-serif!important;}
  body.report-print-mode .generic-report-header{display:flex!important;margin-bottom:9px!important;padding-bottom:8px!important;}
  body.report-print-mode .generic-report-header h1{font-size:18pt!important;}
  body.report-print-mode .generic-report-section{display:block!important;margin-bottom:8px!important;}
  body.report-print-mode .generic-report-table{display:table!important;width:100%!important;}
  body.report-print-mode .generic-report-table thead{display:table-header-group!important;}
  body.report-print-mode .generic-report-table tbody{display:table-row-group!important;}
  body.report-print-mode .generic-report-table tr{display:table-row!important;}
  body.report-print-mode .generic-report-table th,body.report-print-mode .generic-report-table td{display:table-cell!important;padding:5px 6px!important;visibility:visible!important;}
  body.report-print-mode .generic-report-footer,body.report-print-mode .generic-report-footer *{visibility:visible!important;}
}

/* Stage 5: clinical operations & administration center */
.nav-section-clinical{margin-top:18px;color:#6b7f98;font-size:.67rem;letter-spacing:.08em;font-weight:800}
.admin-feature-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.admin-feature-card{position:relative;display:flex;align-items:center;gap:12px;min-height:104px;padding:16px;border:1px solid #e2e8f0;border-radius:16px;background:#fff;text-decoration:none;color:#172b45;box-shadow:0 4px 15px rgba(32,70,110,.05);transition:.18s}.admin-feature-card:hover{transform:translateY(-2px);color:#172b45;box-shadow:0 10px 26px rgba(32,70,110,.10);border-color:#c5d5ea}.admin-feature-card h5{margin:0;font-size:.9rem}.admin-feature-card p{margin:4px 0 0;color:#77859a;font-size:.72rem;line-height:1.35}.admin-feature-card>.bi-arrow-up-right{margin-left:auto;align-self:flex-start;color:#a1adbd;font-size:.8rem}.admin-feature-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:13px;flex:0 0 auto;font-size:1.15rem}.af-primary .admin-feature-icon{background:#e8efff;color:#3269dc}.af-info .admin-feature-icon{background:#e7f6ff;color:#1978b8}.af-success .admin-feature-icon{background:#e5f8ef;color:#16895c}.af-warning .admin-feature-icon{background:#fff5d8;color:#bc8100}.af-danger .admin-feature-icon{background:#ffe9eb;color:#c94e59}.af-purple .admin-feature-icon{background:#f0eaff;color:#7652d6}.af-dark .admin-feature-icon{background:#edf0f4;color:#334155}.af-orange .admin-feature-icon{background:#fff0df;color:#c56b10}.admin-feature-alert{position:absolute;top:9px;right:31px;min-width:22px;height:22px;padding:0 6px;display:grid;place-items:center;border-radius:999px;background:#fff0e8;color:#d05c2a;font-size:.65rem;font-weight:800}
@media(max-width:1200px){.admin-feature-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:900px){.admin-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.admin-feature-grid{grid-template-columns:1fr}}

/* Phase 2A: doctor clinical workspace */
.clinical-avatar-lg{width:52px;height:52px;flex-basis:52px;font-size:15px;background:#e7f0ff;color:#285fc8}.clinical-workflow-summary{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}.clinical-summary-card{display:flex;align-items:center;gap:10px;padding:12px;border:1px solid #e3e9f2;border-radius:13px;background:#fff;text-decoration:none;color:#23364f;box-shadow:0 3px 12px rgba(32,70,110,.04);transition:.16s ease}.clinical-summary-card:hover{transform:translateY(-1px);color:#23364f;border-color:#c7d5e8;box-shadow:0 8px 20px rgba(32,70,110,.08)}.clinical-summary-card small,.clinical-summary-card strong{display:block}.clinical-summary-card small{font-size:.68rem;color:#718096}.clinical-summary-card strong{margin-top:3px;font-size:1rem}.summary-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;flex:0 0 auto}.summary-blue .summary-icon{background:#e8f0ff;color:#2f68d6}.summary-teal .summary-icon{background:#e4faf5;color:#0b8f7a}.summary-purple .summary-icon{background:#f0eaff;color:#7652d6}.summary-orange .summary-icon{background:#fff1dd;color:#c56f0e}.summary-pink .summary-icon{background:#ffeaf1;color:#c94e72}.summary-green .summary-icon{background:#e5f8ee;color:#16885b}.clinical-status-bar{border-color:#dfe7f1;background:#fbfcfe}.clinical-plan-card{border:1px solid #e1e8f1;box-shadow:0 2px 10px rgba(32,70,110,.03)}.clinical-balance-banner{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;border:1px solid #f1dfad;border-radius:13px;background:#fff9e8}.clinical-balance-banner small,.clinical-balance-banner strong{display:block}.clinical-balance-banner small{color:#806c3c;font-size:.7rem}.clinical-balance-banner strong{font-size:1.2rem;color:#8b5e00;margin-top:2px}.clinical-visit-print-report{display:none}.clinical-visit-report-header{display:flex;justify-content:space-between;gap:20px;padding-bottom:10px;border-bottom:2px solid #1e4777;margin-bottom:12px}.clinical-visit-report-header h1{margin:6px 0 0;color:#17365f;font-size:19pt}.clinical-visit-report-header>div:last-child{font-size:8pt;color:#64748b}.clinical-visit-report-details,.clinical-visit-print-report table{width:100%;border-collapse:collapse}.clinical-visit-report-details{margin-bottom:12px}.clinical-visit-report-details th,.clinical-visit-report-details td,.clinical-visit-print-report th,.clinical-visit-print-report td{padding:6px 8px;border:1px solid #d7e1ec;text-align:left;vertical-align:top;font-size:8pt}.clinical-visit-report-details th,.clinical-visit-print-report th{background:#f1f6fb;color:#334a66;font-weight:700}.clinical-visit-report-section{margin-bottom:10px;break-inside:avoid}.clinical-visit-report-section h2{font-size:10pt;color:#17365f;background:#edf4fb;border:1px solid #cbd8e8;border-bottom:0;padding:6px 8px;margin:0}.clinical-visit-report-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.clinical-visit-report-footer{display:flex;justify-content:space-between;color:#64748b;font-size:7.5pt;margin-top:8px}@media(max-width:1100px){.clinical-workflow-summary{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:700px){.clinical-workflow-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.clinical-visit-report-grid{grid-template-columns:1fr}}@media(max-width:480px){.clinical-workflow-summary{grid-template-columns:1fr}.clinical-summary-card{padding:10px}}
@media print{body.report-print-mode .clinical-visit-print-report,body.report-print-mode .clinical-visit-print-report *{visibility:visible!important}body.report-print-mode .clinical-visit-print-report{display:block!important;position:static!important;width:100%!important;background:#fff!important;color:#172b45!important;font:8pt/1.35 Arial,sans-serif!important}body.report-print-mode .clinical-visit-print-report h1{font-size:17pt!important}.clinical-visit-print-report table{display:table!important}.clinical-visit-print-report tr{display:table-row!important}.clinical-visit-print-report th,.clinical-visit-print-report td{display:table-cell!important;visibility:visible!important;padding:4px 5px!important}.clinical-visit-report-grid{display:grid!important;grid-template-columns:1fr 1fr!important}}
