:root{--navy:#052b85;--blue:#0c63e7;--cyan:#10d9e8;--ink:#172033;--muted:#667085;--bg:#f4f8ff;--card:#fff;--line:#dce6f6;--danger:#c52b2b;--ok:#14804a;--shadow:0 12px 32px rgba(18,58,112,.12)}
*{box-sizing:border-box}body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;background:linear-gradient(180deg,#f7fbff 0,#eef5ff 100%);color:var(--ink);min-height:100vh}button,input,select,textarea{font:inherit}button{cursor:pointer}.hidden{display:none!important}
.topbar{position:sticky;top:0;z-index:15;display:flex;align-items:center;gap:14px;padding:10px 16px;background:linear-gradient(135deg,var(--navy),#073eae 62%,#0f78dc);color:#fff;box-shadow:0 5px 20px rgba(4,31,94,.22)}
.brand{display:flex;align-items:center;gap:10px;min-width:0}.brand img{width:42px;height:42px;border-radius:11px;background:#fff;object-fit:cover}.brand-title{font-weight:800;letter-spacing:.1px}.brand-sub{font-size:12px;opacity:.82;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:340px}.spacer{flex:1}.top-actions{display:flex;gap:8px;align-items:center}.user-pill{padding:7px 10px;border-radius:999px;background:rgba(255,255,255,.14);font-size:12px}
.shell{display:grid;grid-template-columns:225px 1fr;min-height:calc(100vh - 62px)}.sidebar{padding:16px 11px;border-right:1px solid var(--line);background:rgba(255,255,255,.85);backdrop-filter:blur(10px);display:flex;flex-direction:column;gap:7px}.navbtn{width:100%;border:0;background:transparent;text-align:left;padding:13px 14px;border-radius:10px;margin:0;color:#24324a;font-weight:750;font-size:16px;line-height:1.3}.navbtn:hover,.navbtn.active{background:#e9f2ff;color:#0648bd}.main{padding:18px;min-width:0}
.card{background:var(--card);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);padding:16px}.grid{display:grid;gap:14px}.grid.cols4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid.cols3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid.cols2{grid-template-columns:repeat(2,minmax(0,1fr))}.stat{padding:16px}.stat .n{font-size:27px;font-weight:850;color:var(--navy)}.stat .l{font-size:13px;color:var(--muted);margin-top:5px}.clickable{cursor:pointer}.clickable:hover{transform:translateY(-1px)}
h1,h2,h3{margin:0 0 12px}h1{font-size:24px}h2{font-size:19px}.section-head{display:flex;gap:10px;align-items:center;margin-bottom:12px;flex-wrap:wrap}.section-head .grow{flex:1}.muted{color:var(--muted);font-size:13px}.small{font-size:12px}.badge{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;background:#edf4ff;color:#0b4fbd;font-size:12px;font-weight:700}.badge.ok{background:#e8f8ef;color:#117242}.badge.bad{background:#ffeded;color:#aa2020}.badge.warn{background:#fff4d8;color:#8b5b00}
.btn{border:1px solid #b8cae8;background:#fff;color:#18375f;border-radius:10px;padding:9px 12px;font-weight:700}.btn:hover{background:#f3f7fd}.btn.primary{border:0;color:#fff;background:linear-gradient(135deg,#0756ce,#0795dc)}.btn.danger{border-color:#f0b5b5;color:#aa2020}.btn.ghost{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.35);color:#fff}.btn.sm{padding:6px 9px;font-size:12px}.btn:disabled{opacity:.5;cursor:not-allowed}
.field{display:flex;flex-direction:column;gap:5px}.field label{font-size:12px;color:#4c5b73;font-weight:700}.field input,.field select,.field textarea{width:100%;border:1px solid #cbd8ec;border-radius:10px;padding:9px 10px;background:#fff;outline:none}.field input:focus,.field select:focus,.field textarea:focus{border-color:#4b8cf4;box-shadow:0 0 0 3px rgba(75,140,244,.12)}.field textarea{min-height:90px;resize:vertical}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.span2{grid-column:span 2}.inline{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.tablewrap{overflow:auto;border:1px solid var(--line);border-radius:12px;background:#fff}table{width:100%;border-collapse:collapse;min-width:720px}th,td{text-align:left;padding:10px;border-bottom:1px solid #e8eef8;font-size:13px;vertical-align:top}th{background:#f4f8ff;color:#44536d;font-size:12px;position:sticky;top:0}tr:last-child td{border-bottom:0}.money{font-variant-numeric:tabular-nums;font-weight:750}
.login-wrap{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 20% 10%,#1de0ef33,transparent 30%),linear-gradient(145deg,#071c5f,#074cbe 62%,#0b8fd6)}.login-card{width:min(430px,100%);background:#fff;border-radius:22px;padding:25px;box-shadow:0 30px 70px rgba(0,0,0,.26)}.login-logo{display:flex;align-items:center;gap:12px;margin-bottom:20px}.login-logo img{width:64px;height:64px;border-radius:15px}.login-logo h1{margin:0}.login-logo p{margin:3px 0 0;color:var(--muted)}
.modal-backdrop{position:fixed;inset:0;z-index:50;background:rgba(7,20,48,.58);display:flex;align-items:center;justify-content:center;padding:18px}.modal{width:min(760px,100%);max-height:90vh;overflow:auto;background:#fff;border-radius:18px;box-shadow:0 30px 80px rgba(0,0,0,.3);padding:18px}.modal.wide{width:min(1050px,100%)}.modal-head{display:flex;align-items:center;gap:10px;margin-bottom:14px}.modal-head h2{flex:1;margin:0}.xbtn{border:0;background:#edf3fc;width:34px;height:34px;border-radius:9px;font-size:20px}.modal-note{background:#edf6ff;border:1px solid #cde2ff;padding:10px;border-radius:10px;color:#31567e;font-size:12px;margin-bottom:12px}
#toast{position:fixed;right:18px;bottom:18px;z-index:99;display:flex;flex-direction:column;gap:8px}.toast{background:#172033;color:#fff;padding:10px 13px;border-radius:10px;box-shadow:var(--shadow);max-width:330px}.toast.bad{background:#9d2323}.toast.ok{background:#176c46}
.searchbar{display:flex;gap:8px}.searchbar input{flex:1;min-width:160px;border:1px solid #cbd8ec;border-radius:10px;padding:9px 10px}.calendar-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.calendar-row input[type=date]{padding:8px;border:1px solid #cbd8ec;border-radius:9px}.appt-time{font-weight:850;color:#073eae}
.patient-picker{position:relative}.picker-results{position:absolute;left:0;right:0;top:100%;z-index:30;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow);max-height:240px;overflow:auto}.picker-item{padding:9px 10px;border-bottom:1px solid #edf2fa;cursor:pointer}.picker-item:hover{background:#f1f7ff}.picker-item:last-child{border-bottom:0}
.odontogram{background:linear-gradient(180deg,#09358f,#0571cf 38%,#05358e);border-radius:18px;padding:18px;color:#fff}.jaw{display:grid;grid-template-columns:repeat(16,minmax(42px,1fr));gap:6px;margin:10px 0}.tooth{border:0;background:transparent;padding:2px;border-radius:9px;position:relative}.tooth svg{width:100%;height:72px;filter:drop-shadow(0 2px 2px rgba(0,0,0,.18))}.tooth path{fill:#fff;stroke:#93c8ff;stroke-width:2}.tooth:hover{background:rgba(255,255,255,.13)}.tooth.haswork path{fill:#d7f8ff;stroke:#25dce9}.tooth .tn{font-size:11px;color:#fff;font-weight:800;display:block;margin-top:2px}.tooth .dot{position:absolute;right:3px;top:3px;width:9px;height:9px;border-radius:50%;background:#14dfd2;border:2px solid #fff}.jaw-label{text-align:center;font-weight:800;letter-spacing:.08em;opacity:.9}.chart-legend{text-align:center;font-size:12px;opacity:.82;margin-top:8px}
.rights-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.check{display:flex;align-items:center;gap:8px;padding:7px 8px;border:1px solid #e0e8f5;border-radius:9px;font-size:12px}.company-card{display:flex;flex-direction:column;gap:8px}.company-link{font-family:ui-monospace,Consolas,monospace;font-size:12px;background:#f1f5fb;padding:7px 8px;border-radius:8px;word-break:break-all}.license-actions{display:flex;gap:5px;flex-wrap:wrap}.report-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:12px 0}.report-summary .card{box-shadow:none}.automation-box{border:1px dashed #65a5f6;background:#f1f7ff;padding:14px;border-radius:12px}
@media(max-width:900px){.shell{grid-template-columns:1fr}.sidebar{display:flex;flex-direction:row;gap:8px;overflow:auto;border-right:0;border-bottom:1px solid var(--line);padding:8px;position:sticky;top:62px;z-index:12}.navbtn{min-width:max-content;width:auto;font-size:15px;padding:11px 13px}.grid.cols4,.grid.cols3{grid-template-columns:repeat(2,minmax(0,1fr))}.jaw{grid-template-columns:repeat(8,minmax(42px,1fr));}.tooth svg{height:62px}.brand-sub{max-width:180px}}
@media(max-width:600px){.main{padding:10px}.grid.cols4,.grid.cols3,.grid.cols2,.form-grid,.report-summary{grid-template-columns:1fr}.span2{grid-column:auto}.topbar{padding:8px}.brand img{width:36px;height:36px}.brand-title{font-size:14px}.brand-sub{font-size:10px;max-width:130px}.user-pill{display:none}.jaw{grid-template-columns:repeat(4,minmax(48px,1fr))}.tooth svg{height:60px}.modal-backdrop{padding:7px}.modal{padding:14px;max-height:95vh}.rights-grid{grid-template-columns:1fr}}
@media print{.topbar,.sidebar,.no-print,.btn{display:none!important}.shell{display:block}.main{padding:0}.card{box-shadow:none;border:0}.tablewrap{overflow:visible}table{min-width:0;font-size:11px}}
.time-invalid{border-color:#d14343!important;background:#fff0f0!important}.settings-layout{display:grid;grid-template-columns:minmax(220px,320px) 1fr;gap:22px;align-items:start}.settings-logo-box{border:1px solid var(--line);border-radius:14px;background:#f8fbff;min-height:180px;display:grid;place-items:center;padding:18px}.settings-logo-box img{max-width:100%;max-height:170px;object-fit:contain}.report-brand{display:flex;align-items:center;gap:16px;background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px;margin-bottom:12px}.report-brand img{width:74px;height:74px;object-fit:contain;border-radius:12px}.report-brand h1{margin:0 0 4px;font-size:25px}
@media(max-width:600px){.settings-layout{grid-template-columns:1fr}.report-brand img{width:58px;height:58px}.report-brand h1{font-size:20px}}
@media print{.report-brand{border:0;padding:0 0 12px;border-bottom:1px solid #bbb;border-radius:0}.report-brand img{width:68px;height:68px}.report-brand h1{font-size:22px}}
.report-panel{overflow:visible}.report-patient-card{margin:10px 0;padding:10px 12px;border:1px solid var(--line);background:#f7fbff;border-radius:10px}.report-inline-brand .report-brand{box-shadow:none;margin-top:8px}.report-panel>.section-head{border-bottom:1px solid #e7eef8;padding-bottom:10px}

/* v1.1.9 responsive polish */
@media(max-width:900px){
  .sidebar{-webkit-overflow-scrolling:touch}.navbtn{font-size:15px;padding:11px 13px}
  .section-head{align-items:flex-start}.section-head>.btn{white-space:nowrap}
}
@media(max-width:600px){
  body{font-size:14px}.topbar{gap:8px;flex-wrap:wrap}.top-actions{margin-left:auto}
  .brand{flex:1;min-width:180px}.brand-title{font-size:15px}.brand-sub{font-size:11px;max-width:180px}
  .searchbar{flex-wrap:wrap}.searchbar input{flex:1 1 100%;min-width:0}.searchbar .btn{flex:1 1 auto}
  .calendar-row>*{flex:1 1 auto}.calendar-row input[type=date]{min-width:145px}
  .section-head{display:flex}.section-head .grow{flex:1 1 100%}.section-head>.btn{flex:1 1 auto}
  .inline>.btn{min-height:38px}
  th,td{padding:9px 8px}.tablewrap{max-width:100%;-webkit-overflow-scrolling:touch}
  .modal{width:100%;border-radius:14px}.modal-head{position:sticky;top:-14px;background:#fff;z-index:4;padding-top:4px}
}

.allergy-picker{position:relative;border:1px solid #cbd8ec;border-radius:10px;background:#fff}.allergy-picker summary{cursor:pointer;list-style:none;padding:9px 34px 9px 10px;min-height:38px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative}.allergy-picker summary::-webkit-details-marker{display:none}.allergy-picker summary:after{content:"▼";position:absolute;right:11px;top:10px;font-size:11px}.allergy-picker[open] summary:after{content:"▲"}.allergy-menu{max-height:230px;overflow-y:auto;border-top:1px solid #e0e8f5;padding:8px;background:#fff}.allergy-menu .check{margin-bottom:6px}.allergy-other{padding-top:5px}.allergy-other label{display:block;margin-bottom:4px}

/* v1.1.21 mobile navigation: keep the menu compact instead of stretching to fill the screen */
@media(max-width:900px){
  .shell{display:block;min-height:calc(100vh - 62px)}
  .sidebar{height:auto;min-height:0;max-height:58px;align-items:center;align-content:center;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;padding:7px 8px;position:sticky;top:62px;z-index:12}
  .navbtn{flex:0 0 auto;width:auto!important;height:42px;min-height:42px;max-height:42px;padding:9px 13px!important;display:inline-flex;align-items:center;justify-content:center;line-height:1.1;border-radius:9px;white-space:nowrap}
  .navbtn.active{height:42px;min-height:42px;max-height:42px}
}
@media(max-width:600px){
  .sidebar{top:60px;max-height:54px;padding:6px 7px;gap:6px}
  .navbtn{height:40px;min-height:40px;max-height:40px;font-size:14px;padding:8px 11px!important}
}

/* v1.2.5 separate licensed WhatsApp reminders module */
.wa-warning{padding:14px 16px;margin:0 0 14px;background:#fff3de;color:#7d3d12;border:1px solid #efd6ab;border-radius:12px;line-height:1.5}
.wa-preview{background:#e9f4ee;padding:14px;border-radius:12px;color:#183f2c;white-space:pre-wrap;line-height:1.6}
.wa-preview p{margin:8px 0 0}
@media(max-width:680px){.wa-preview{overflow-wrap:anywhere}.wa-warning{font-size:14px}}

/* v1.2.8: Keep the left navigation visible while long Dental pages scroll.
   Desktop: sidebar stays beneath the sticky 62px header; lengthy menus scroll independently.
   Narrow screens: retain the existing horizontally scrollable sticky menu. */
@media (min-width:901px) {
  .shell { align-items: start; }
  .sidebar {
    position: sticky;
    top: 62px;
    align-self: start;
    height: calc(100vh - 62px);
    height: calc(100dvh - 62px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
  }
}
/* v1.3.1 — week booking calendar and anatomically differentiated tooth glyphs */
.booking-calendar{display:grid;grid-template-columns:repeat(7,minmax(135px,1fr));gap:7px;overflow-x:auto;margin:8px 0}
.booking-day{background:#f4f8ff;border:1px solid #d7e3f3;border-radius:10px;padding:9px;min-height:150px;display:flex;flex-direction:column;gap:7px}
.booking-day-head{font-weight:800;text-align:center;font-size:12px;color:#17386f;border-bottom:1px solid #cedaf0;padding-bottom:6px}
.booking-event{width:100%;border:1px solid #9ac1ef;background:#e4f0ff;color:#17365e;border-radius:8px;padding:7px;text-align:left;display:flex;flex-direction:column;gap:4px;cursor:pointer;font-size:12px;overflow-wrap:anywhere}
.booking-event:hover{background:#cee5ff}.booking-day>.btn{margin-top:auto}
.tooth-anatomy .tooth-root{fill:#f7fafc;stroke:#9aaeca;stroke-width:1.7}
.tooth-anatomy .tooth-crown{fill:#fffdf3;stroke:#809cc5;stroke-width:1.7}
.tooth-anatomy .tooth-groove{fill:none;stroke:#cfdae8;stroke-width:1.25}
.tooth.haswork .tooth-anatomy .tooth-crown{fill:#c6f5f3;stroke:#00bac7}
.work-day{margin:10px 0;border-top:1px solid #dce6f4;padding:9px 0}
.work-day h3{margin:4px 0 9px}
@media(max-width:1280px){.booking-calendar{grid-template-columns:repeat(4,minmax(140px,1fr))}}
@media(max-width:650px){.booking-calendar{grid-template-columns:repeat(2,minmax(130px,1fr))}}

/* v1.3.2: selectable, scrollable appointment patient directory. */
.picker-option{display:flex;flex-direction:column;align-items:flex-start;gap:3px;width:100%;text-align:left;font:inherit;background:#fff;color:inherit;border:0;border-bottom:1px solid #edf2fa;border-radius:0;}
.picker-option:hover,.picker-option:focus{background:#eaf3ff;outline:2px solid #b3d3ff;outline-offset:-2px;}
.booking-event .btn{font-size:11px;padding:4px 7px;min-height:26px;}

/* v1.3.2: next-job action beside price; lifetime jobs visible when a tooth is opened. */
.tooth-price-actions{display:flex;align-items:stretch;gap:8px}
.tooth-price-actions input{flex:1;min-width:100px;width:100%}
.tooth-price-actions .btn{flex:0 0 auto;white-space:nowrap}
.tooth-history-section{margin-top:18px;padding-top:14px;border-top:1px solid #dce6f4}
.tooth-history-section h3{margin:0 0 10px}
.tooth-history-list{max-height:300px;overflow-y:auto;border:1px solid #e2e8f3;border-radius:10px}
.tooth-history-entry{display:flex;gap:15px;justify-content:space-between;align-items:flex-start;padding:10px 12px;border-bottom:1px solid #e8edf5}
.tooth-history-entry:last-child{border-bottom:0}
.tooth-history-date{display:inline-block;margin-left:6px;font-size:12px;color:#355d93;font-weight:600}

/* v1.3.3: one expandable patient header with all dated clinical jobs. */
.patient-groups{display:grid;gap:10px}
.patient-group{border:1px solid var(--line,#d8e1ef);border-radius:12px;overflow:hidden;background:#fff}
.patient-group>summary{display:flex;align-items:center;flex-wrap:wrap;gap:10px;cursor:pointer;padding:13px 16px;font-size:14px;list-style-position:inside}
.patient-group>summary:focus-visible{outline:2px solid #2267b4;outline-offset:-2px}
.patient-group[open]>summary{border-bottom:1px solid var(--line,#d8e1ef);background:#f5f8fd}
.patient-group-title{font-weight:750;font-size:16px;margin-right:6px}
.patient-group-hint{margin-left:auto;color:#1b67ac;font-weight:700;font-size:12px}
.patient-group-body{padding:12px 14px}
.patient-profile{padding:10px 4px;border-bottom:1px solid #e9edf5}
.patient-profile:last-child{border-bottom:0}
.patient-actions{flex-wrap:wrap;margin:9px 0}
.patient-jobs{margin:12px 0 6px}
.patient-jobs h4{margin:0 0 8px;font-size:14px}
#accountArea:not(:empty){margin-top:14px}

/* v1.3.4: keep every patient action visible; only jobs expand below the original row. */
.patients-list-table td{vertical-align:middle}
.patient-name-line{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.patient-expand-btn{background:#f2f7ff;border:1px solid #c5d8ed;color:#154b85;border-radius:7px;font-size:17px;line-height:1;cursor:pointer;padding:5px 8px;transition:transform .12s}
.patient-expand-btn.expanded{background:#dcecff;transform:rotate(180deg)}
.patient-expand-btn:focus-visible{outline:2px solid #1976d2;outline-offset:2px}
.patient-doc-counter{font-size:12px;font-weight:600;color:#47617f;white-space:nowrap}
.patients-list-table .patient-actions{margin:0;gap:5px;flex-wrap:wrap;min-width:280px}
.patients-list-table .patient-jobs-row>td{padding:12px 20px;background:#f5f8fe;border-top:0}
.patient-history-title{margin-bottom:10px}
.patient-history-day{margin:9px 0 14px}
.patient-history-day>b{display:block;margin-bottom:7px}
.patients-list-table .patient-jobs-row .tablewrap{background:#fff;border-radius:7px}

/* Dental financial reports: all totals and counts are bold red. */
.report-total-text,.report-total-row td{color:#b91c1c!important;font-weight:900!important}
.report-total-row{background:#fff4f4}

/* v1.3.5: explicit Monday–Sunday weekday labels for the seven-day appointment calendar. */
.booking-weekday{font-weight:900;font-size:12px;letter-spacing:.15px}
.booking-date{font-size:11px;font-weight:650;color:#48678f;margin-top:3px}

/* v1.3.8 — compact week selector and fixed-height appointment agenda. */
.booking-week-strip{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:7px;margin:10px 0 14px}
.booking-day-pill{appearance:none;border:1px solid #d5e1f1;border-radius:11px;background:#f6f9ff;color:#1a3659;display:flex;flex-direction:column;gap:5px;align-items:flex-start;text-align:left;padding:11px 10px;cursor:pointer;min-width:0;box-shadow:none;font:inherit;transition:background .1s,border-color .1s}
.booking-day-pill:hover,.booking-day-pill:focus-visible{background:#e7f1ff;border-color:#78b2f5;outline-offset:2px}
.booking-day-pill.is-selected{border:2px solid #1979d2;background:#e4f0ff;padding:10px 9px}
.booking-day-pill.is-today .booking-weekday{color:#0873c8}
.booking-day-pill .booking-weekday{font-size:12px;font-weight:800}
.booking-day-pill .booking-date{font-size:11px;color:#526883;white-space:nowrap}
.booking-day-count{font-size:11px;background:#e8effa;border-radius:30px;padding:3px 8px;color:#18416f;white-space:nowrap}
.booking-day-pill.is-selected .booking-day-count{background:#c5ddff}
.booking-agenda{border:1px solid #d6e2f2;border-radius:13px;background:white;overflow:hidden}
.booking-agenda-head{padding:12px 15px;border-bottom:1px solid #dbe6f3;display:flex;align-items:center;justify-content:space-between;gap:10px}
.booking-agenda-head h3{margin:0 0 3px;font-size:16px;color:#12345a}
.booking-agenda-head .muted{font-size:12px}
.booking-agenda-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.booking-agenda-scroll{max-height:440px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;outline-offset:-2px}
.booking-agenda-row{display:grid;grid-template-columns:minmax(110px,0.9fr) minmax(150px,1.55fr) minmax(140px,1.5fr) auto;align-items:center;gap:12px;border-bottom:1px solid #edf1f7;padding:8px 15px;min-height:60px}
.booking-agenda-row:last-child{border-bottom:0}
.booking-agenda-row:nth-child(even){background:#f9fbfe}
.booking-agenda-row:hover{background:#eff6ff}
.booking-agenda-time,.booking-agenda-patient,.booking-agenda-detail{display:flex;flex-direction:column;min-width:0;gap:2px;font-size:12px}
.booking-agenda-time strong{font-size:14px;color:#075ba5;font-variant-numeric:tabular-nums}
.booking-agenda-time small{color:#556c86}
.booking-agenda-date{font-size:11px;font-weight:700;color:#566d85}
.booking-agenda-patient strong{overflow-wrap:anywhere;font-size:13px}
.booking-agenda-detail small{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#526882}
.booking-agenda-buttons{display:flex;gap:5px;align-items:center;justify-content:flex-end}
.booking-agenda-buttons .btn{padding:5px 8px;min-height:28px;font-size:11px}
.booking-empty{text-align:center;color:#526984;padding:34px 15px;font-size:13px}
@media(max-width:1000px){.booking-week-strip{grid-template-columns:repeat(7,minmax(115px,1fr));overflow-x:auto;padding-bottom:5px}.booking-agenda-row{grid-template-columns:90px minmax(120px,1.3fr) minmax(100px,1fr) auto;gap:8px}}
@media(max-width:660px){.booking-agenda-row{grid-template-columns:75px minmax(90px,1fr) auto;gap:8px;padding:8px 10px}.booking-agenda-detail{grid-column:2;grid-row:2}.booking-agenda-buttons{grid-column:3;grid-row:1 / span 2;flex-direction:column}.booking-agenda-head{align-items:flex-start}.booking-agenda-head h3{font-size:14px}.booking-day-pill{padding:9px}.booking-day-pill.is-selected{padding:8px}}


/* v1.3.9 — Techlodge Dental client-facing visual refresh.
   CSS-only: controls, workflow, patient/financial records and data APIs are unchanged.
   Raised buttons retain visible focus/disabled states. */
:root {
  --navy:#12376b;
  --blue:#1466b8;
  --cyan:#14b7c2;
  --ink:#192e46;
  --muted:#657991;
  --bg:#f3f7fb;
  --card:#ffffff;
  --line:#dce6f0;
  --shadow:0 9px 22px rgba(29,68,112,.075),0 2px 5px rgba(29,68,112,.035);
}
body { background:linear-gradient(125deg,#f9fbfe 0%,#eff5fa 54%,#edf6f8 100%); color:var(--ink); }
.topbar {
  background:linear-gradient(105deg,#112d59 0%,#124478 66%,#16788e 100%);
  border-bottom:1px solid rgba(255,255,255,.14);
  box-shadow:0 4px 17px rgba(20,49,86,.2);
}
.brand img {border:2px solid rgba(255,255,255,.7);box-shadow:0 2px 8px rgba(0,0,0,.17);}
.brand-title {letter-spacing:.15px}
.user-pill {background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.24)}
.sidebar {
  background:linear-gradient(180deg,#fff 0%,#f8fbfe 100%);
  border-right:1px solid #dce5f0;
  box-shadow:3px 0 13px rgba(26,65,111,.028);
}
.navbtn {
  min-height:44px;
  position:relative;
  border:1px solid transparent;
  border-radius:12px;
  color:#304963;
  font-weight:720;
  transition:background .16s ease,box-shadow .16s ease,color .16s ease,border-color .16s ease,transform .16s ease;
}
.navbtn:hover {
  background:linear-gradient(180deg,#ffffff,#eaf4fb);
  color:#125485;
  border-color:#d0e5f1;
  box-shadow:0 3px 7px rgba(29,70,110,.09),inset 0 1px 0 #fff;
  transform:translateY(-1px);
}
.navbtn.active {
  background:linear-gradient(115deg,#e5f6f8,#e8f1fe);
  border-color:#a6dadd;
  box-shadow:inset 3px 0 0 #1599a5,0 3px 9px rgba(20,92,121,.09);
  color:#104d7d;
}
.main {padding:21px 22px 30px}
h1 {font-size:25px;letter-spacing:-.55px;color:#173b60;font-weight:800}
h2,h3 {color:#1c3e5e;letter-spacing:-.23px}
.section-head {margin-bottom:17px}
.section-head .muted {line-height:1.5}
.card {
  border-color:#dae5ef;
  border-radius:17px;
  background:linear-gradient(180deg,#fff 0%,#fdfefe 100%);
  box-shadow:var(--shadow);
}
.card.stat {
  position:relative;
  overflow:hidden;
  border:1px solid #d7e5ef;
  background:linear-gradient(152deg,#fff 56%,#f2f8fe 100%);
  box-shadow:0 9px 19px rgba(25,67,112,.08),0 3px 0 #dce8f0;
  transition:transform .16s ease,box-shadow .16s ease;
}
.card.stat::before {
  content:"";position:absolute;top:0;left:0;right:0;height:4px;
  background:linear-gradient(90deg,#1789ba,#24bdb3);
}
.card.stat:nth-child(2)::before{background:linear-gradient(90deg,#b27aa2,#d28bb4)}
.card.stat:nth-child(3)::before{background:linear-gradient(90deg,#4c9f8f,#78c5a7)}
.card.stat:nth-child(4)::before{background:linear-gradient(90deg,#d49b55,#e5bf70)}
.card.stat .n{font-size:29px;letter-spacing:-.5px;color:#153d6a}
.card.stat .l{font-size:13px;color:#566d84;font-weight:680}
.card.stat.clickable:hover{transform:translateY(-2px);box-shadow:0 15px 28px rgba(22,69,113,.13),0 3px 0 #d8e7ee}
.card.stat.clickable:active{transform:translateY(1px);box-shadow:0 4px 10px rgba(22,69,113,.08),inset 0 2px 5px rgba(15,64,105,.08)}
/* 3D tactility across the normal action controls. */
.btn {
  border:1px solid #bfcedc;
  border-bottom-color:#aabfce;
  border-radius:10px;
  color:#234663;
  background:linear-gradient(180deg,#fff 0%,#f1f6fa 100%);
  box-shadow:inset 0 1px 0 #fff,0 3px 0 #d7e1ea,0 5px 9px rgba(21,58,93,.095);
  transition:transform .13s ease,box-shadow .13s ease,background .13s ease;
}
.btn:hover:not(:disabled) {background:linear-gradient(180deg,#fff,#e9f4fc);transform:translateY(-1px);box-shadow:inset 0 1px 0 #fff,0 4px 0 #cfdfeb,0 7px 11px rgba(21,58,93,.13)}
.btn:active:not(:disabled) {transform:translateY(2px);box-shadow:inset 0 2px 4px rgba(18,51,84,.15),0 1px 0 #d7e1ea}
.btn.primary {
  border:1px solid #0959a6;
  border-bottom-color:#084d90;
  color:white;
  background:linear-gradient(150deg,#198cc1 0%,#1266b7 56%,#104e97 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.36),0 3px 0 #073e79,0 6px 12px rgba(7,77,132,.18);
}
.btn.primary:hover:not(:disabled){background:linear-gradient(150deg,#1aa2c8,#1477c3 58%,#135da5);box-shadow:inset 0 1px 0 rgba(255,255,255,.4),0 4px 0 #073e79,0 8px 14px rgba(7,77,132,.21)}
.btn.primary:active:not(:disabled){box-shadow:inset 0 2px 5px rgba(0,26,71,.3),0 1px 0 #073e79}
.btn.danger {
  border-color:#edb8bb;
  border-bottom-color:#d9a0a5;
  background:linear-gradient(180deg,#fffafa,#fff0f0);
  color:#ab2a3b;
  box-shadow:inset 0 1px 0 #fff,0 3px 0 #f2d7d8,0 5px 9px rgba(120,33,44,.06);
}
.btn.danger:hover:not(:disabled){background:linear-gradient(180deg,#fffafa,#ffe5e5);box-shadow:inset 0 1px 0 #fff,0 4px 0 #eacbd0,0 7px 11px rgba(120,33,44,.12)}
.btn.ghost {color:#fff;border:1px solid rgba(255,255,255,.45);background:linear-gradient(180deg,rgba(255,255,255,.21),rgba(255,255,255,.08));box-shadow:inset 0 1px 0 rgba(255,255,255,.35),0 3px 0 rgba(0,0,0,.15)}
.btn.ghost:hover:not(:disabled) {color:#fff;background:rgba(255,255,255,.2);box-shadow:inset 0 1px 0 rgba(255,255,255,.35),0 4px 0 rgba(0,0,0,.14)}
.btn.sm {border-radius:8px}
.btn:disabled {opacity:.55;filter:saturate(.55);box-shadow:none;transform:none}
button:focus-visible,.btn:focus-visible,.navbtn:focus-visible,.booking-day-pill:focus-visible,.xbtn:focus-visible {outline:3px solid #0b9faa;outline-offset:3px}
.field input,.field select,.field textarea,.searchbar input,.calendar-row input[type=date] {
  border-color:#c6d7e5;
  border-radius:10px;
  background:#fdfefe;
  box-shadow:inset 0 2px 3px rgba(20,62,103,.035),0 1px 0 #fff;
}
.field input:focus,.field select:focus,.field textarea:focus,.searchbar input:focus,.calendar-row input[type=date]:focus {border-color:#188da7;box-shadow:0 0 0 3px rgba(21,157,173,.12);outline:none}
.field label {font-weight:750;color:#35536e}
.tablewrap {border-radius:13px;border-color:#d9e4f0;box-shadow:inset 0 1px 2px rgba(34,81,127,.02)}
th {background:#f0f6fb;color:#38546f;font-weight:800}
tbody tr:hover td {background:#f4f9fd}
.badge {border:1px solid #d8e4f4}
.modal-backdrop {background:rgba(14,33,54,.56);backdrop-filter:blur(3px)}
.modal {border:1px solid #dbe7f1;border-radius:19px;box-shadow:0 32px 80px rgba(15,34,59,.28)}
.modal-head {padding-bottom:12px;border-bottom:1px solid #e4ecf2}
.xbtn {background:linear-gradient(180deg,#fff,#e8f0f8);border:1px solid #ccdae9;box-shadow:0 2px 0 #cfdae6;cursor:pointer;color:#294964}
.login-wrap {background:radial-gradient(circle at 15% 20%,#25bfc63c,transparent 33%),linear-gradient(140deg,#102b55,#135a91 55%,#127e91)}
.login-card {border:1px solid #e8f0f6;box-shadow:0 25px 75px rgba(5,30,56,.25)}
.booking-day-pill {background:linear-gradient(180deg,#fff 0%,#f1f7fb 100%);border-color:#d5e3ee;box-shadow:0 3px 0 #dbe6ef,0 6px 10px rgba(29,67,107,.065)}
.booking-day-pill:hover {background:linear-gradient(180deg,#fff,#eaf5fa);transform:translateY(-1px);box-shadow:0 4px 0 #d1e1eb,0 8px 12px rgba(25,70,110,.09)}
.booking-day-pill.is-selected {background:linear-gradient(180deg,#e8f7f9,#e6f1fc);border-color:#2099ac;box-shadow:inset 0 2px 5px rgba(21,119,142,.08),0 3px 0 #b9dfe1}
.booking-agenda {border-color:#d7e5ee;box-shadow:0 6px 14px rgba(29,67,107,.045)}
.booking-agenda-row:hover {background:#eaf6f9}
.patient-expand-btn {background:linear-gradient(180deg,#fff,#e8f2fc);border-color:#b9d3e5;box-shadow:0 2px 0 #d1e2ed}
.patient-expand-btn:active{box-shadow:inset 0 1px 3px #d0e1eb}
.picker-item:hover,.picker-option:hover {background:#e9f6fa}
#toast .toast {box-shadow:0 9px 25px rgba(13,45,80,.18)}
@media (max-width:900px) {
  .sidebar {box-shadow:0 4px 12px rgba(16,58,105,.07);border-right:0}
  .navbtn {min-height:40px}
  .main {padding:14px}
}
@media (max-width:600px) {
  .main {padding:11px}
  h1{font-size:22px}
  .card {border-radius:13px}
  .card.stat .n{font-size:27px}
  .btn {min-height:34px}
}
@media (prefers-reduced-motion:reduce) {
  .btn,.navbtn,.card.stat,.booking-day-pill {transition:none!important}
}
@media print {
  body {background:#fff!important}
  .card,.card.stat,.booking-agenda,.tablewrap {box-shadow:none!important}
  .card.stat::before {display:none}
  tbody tr:hover td {background:transparent}
}

/* Techlodge AI, isolated from Dashboard cards and modal system. */
.gym-ai-open{display:inline-flex;align-items:center;gap:9px;border:1px solid #61becb;border-radius:13px;padding:6px 14px 6px 7px;background:linear-gradient(145deg,#124e75,#072a55);color:white;box-shadow:0 4px 0 #061c37,0 7px 15px #0c355033;font-weight:800;cursor:pointer;min-height:44px;font-size:13px;white-space:nowrap}
.gym-ai-open:hover{filter:brightness(1.08);transform:translateY(-1px)}
.gym-ai-panel{position:fixed;z-index:10003;bottom:16px;right:18px;width:min(380px,calc(100vw - 30px));height:min(520px,calc(100dvh - 30px));background:white;border:1px solid #b7d2e3;box-shadow:0 14px 44px #09294c55;border-radius:20px;display:flex;flex-direction:column;overflow:hidden;font:14px/1.4 system-ui,Segoe UI,sans-serif;color:#102b49}
.gym-ai-head{display:flex;align-items:center;gap:10px;background:linear-gradient(115deg,#0a2b55,#085c75);padding:9px 10px;color:#fff;min-height:66px;flex:none}
.gym-ai-head>div:not(.gym-ai-robot){display:flex;flex-direction:column;flex:1}.gym-ai-head strong{font-size:15px;letter-spacing:.02em}.gym-ai-head small{font-size:11px;color:#c5f7f7}
.gym-ai-head-btn{height:30px;min-width:30px;font-size:24px;line-height:1;border:1px solid #ffffff66;border-radius:9px;background:#ffffff21;color:white;cursor:pointer}
.gym-ai-count{font-size:12px;padding:7px 13px;background:#dff8fb;color:#063c55;font-weight:700;flex:none}
.gym-ai-thread{flex:1;overflow-y:auto;padding:14px 12px;display:flex;flex-direction:column;gap:12px;min-height:0}.gym-ai-answer,.gym-ai-question{padding:10px 12px;border-radius:13px;white-space:pre-wrap;overflow-wrap:anywhere;max-width:93%}.gym-ai-answer{align-self:flex-start;background:#f0f5fa;border:1px solid #dae5ed}.gym-ai-question{align-self:flex-end;background:#0e6383;color:white}
.gym-ai-form{padding:10px;display:flex;gap:6px;border-top:1px solid #dfeaf2;flex:none}.gym-ai-form input{width:0;flex:1;min-width:0;border:1px solid #b4cadb;border-radius:10px;padding:10px 11px;color:#0c2d4c;font:inherit}.gym-ai-form button{background:linear-gradient(#0ea9c2,#08739a);border:0;color:white;border-radius:10px;padding:0 12px;font-weight:700;cursor:pointer}.gym-ai-form button:disabled{opacity:.45;cursor:progress}
.gym-ai-foot{flex:none;padding:0 10px 9px;text-align:center;font-size:10px;color:#668096}.gym-ai-panel.minimized{height:66px}.gym-ai-panel.minimized>*:not(.gym-ai-head){display:none}
@media(max-width:680px){.gym-ai-panel{bottom:8px;right:8px;width:calc(100vw - 16px);height:min(480px,calc(100dvh - 16px))}.gym-ai-open{font-size:12px}}


/* Techlodge AI animated mascot: motion stays in chat and the small Dashboard launcher. */
.gym-ai-robot{display:inline-block;flex:none;width:44px;height:44px;position:relative;isolation:isolate;vertical-align:middle;overflow:visible;filter:drop-shadow(0 2px 3px #02162b55)}
.gym-ai-robot-large{width:65px;height:65px}
.gym-ai-robot-welcome{width:76px;height:76px}
.gym-ai-robot-head{display:block;position:relative;width:100%;height:100%;transform-origin:50% 65%;animation:gym-ai-nod 5.1s ease-in-out infinite}
.gym-ai-robot-base{display:block;width:100%;height:100%;object-fit:cover;border-radius:50%;user-select:none;pointer-events:none}
.gym-ai-robot-face{position:absolute;left:15%;top:22%;width:76%;height:57%;border-radius:43% 44% 46% 46% / 44% 46% 57% 56%;background:radial-gradient(circle at 35% 25%,#213d62 0%,#071d3f 47%,#030e24 100%);box-shadow:inset 0 2px 5px #3ebed04d,0 0 2px #001128;overflow:hidden}
.gym-ai-robot-eyes{position:absolute;inset:19% 11% 36%;display:flex;justify-content:space-between;align-items:center;gap:18%}
.gym-ai-eye{position:relative;display:block;width:32%;height:77%;border-radius:46%;background:radial-gradient(ellipse at 44% 38%,#bfffff,#44d3ed 45%,#0788b0 70%,#08537a 100%);border:1px solid #90f9fd;box-shadow:0 0 5px #1bd8ff80;transform-origin:50% 50%;animation:gym-ai-blink 5.4s linear infinite}
.gym-ai-pupil{position:absolute;left:31%;top:25%;width:47%;height:52%;border-radius:50%;background:radial-gradient(circle at 67% 25%,#fff 0 12%,#102d57 16%,#020c22 70%);box-shadow:inset 1px 1px 2px #04112a;animation:gym-ai-glance 7s ease-in-out infinite}
.gym-ai-robot-mouth{position:absolute;bottom:13%;left:38%;width:31%;height:18%;background:#c9ffff;border-radius:4% 4% 65% 65% / 9% 9% 92% 92%;box-shadow:0 0 4px #1ac6edaa;transform-origin:center 5%;animation:gym-ai-smile 4.1s ease-in-out infinite}
.gym-ai-thinking .gym-ai-robot-head{animation-duration:1.7s}
.gym-ai-thinking .gym-ai-pupil{animation-duration:1.35s}
.gym-ai-speaking .gym-ai-robot-head{animation-duration:1.6s}
.gym-ai-speaking .gym-ai-robot-mouth{animation:gym-ai-talk .23s ease-in-out infinite alternate}
.gym-ai-speaking .gym-ai-eye{animation-duration:3.1s}
.gym-ai-head .gym-ai-robot{border-radius:50%;border:1px solid #76edf5;background:#0c314e}
.gym-ai-welcome{display:flex;align-items:center;gap:10px;flex:none;width:100%}
.gym-ai-welcome .gym-ai-answer{flex:1;min-width:0;font-size:12px}
.gym-ai-welcome-robot{flex:none;padding:3px;border:1px solid #c7e9f2;border-radius:16px;background:linear-gradient(135deg,#e2faff,#b0d8f6)}
.gym-ai-panel.minimized .gym-ai-head{height:66px;min-height:66px}
.gym-ai-panel.minimized .gym-ai-robot-large{width:46px;height:46px}
@keyframes gym-ai-nod{0%,100%{transform:translateY(0) rotate(-3deg)}20%{transform:translateY(-2px) rotate(3deg)}50%{transform:translateY(0) rotate(0deg)}75%{transform:translateY(-1px) rotate(-4deg)}}
@keyframes gym-ai-glance{0%,12%,83%,100%{transform:translate(0,0)}20%,34%{transform:translate(-26%,0)}45%,56%{transform:translate(20%,-5%)}64%,74%{transform:translate(0,5%)}}
@keyframes gym-ai-blink{0%,40%,42%,85%,87%,100%{transform:scaleY(1)}41%,86%{transform:scaleY(.08)}}
@keyframes gym-ai-smile{0%,100%{height:17%}45%{height:22%}60%{height:19%}}
@keyframes gym-ai-talk{0%{height:9%;width:27%;left:40%;border-radius:30% 30% 48% 48%}50%{height:28%;width:25%;left:41%;border-radius:40%}100%{height:15%;width:34%;left:36%;border-radius:20% 20% 60% 60%}}
@media(max-width:450px){.gym-ai-robot-large{width:54px;height:54px}.gym-ai-robot-welcome{width:61px;height:61px}}
@media(prefers-reduced-motion:reduce){.gym-ai-robot-head,.gym-ai-eye,.gym-ai-pupil,.gym-ai-robot-mouth{animation:none!important;transition:none!important}}

/* Image previews still appear inline when requested in normal chat. */
.gym-ai-generated{border:1px solid #a9ccd6;border-radius:12px;padding:8px;display:flex;flex-direction:column;gap:7px;max-width:98%;background:#f7fcff}
.gym-ai-generated img{width:100%;height:auto;max-height:265px;object-fit:contain;border-radius:8px}
.gym-ai-generated a{font-weight:700;color:#075f86;text-align:center}


/* Attach photo for read-only image interpretation in Dental. */
#dentalAiSlot{display:block;margin:0 0 12px}
.business-total{font-weight:900;color:#c51623!important}
.low-alert .n{color:#c51623}


/* v1.4.2: large, full-width Gym-style AI row at the TOP of Dental Dashboard.
   The floating chat panel and all financial/dashboard cards remain unchanged. */
#dentalAiSlot.dental-ai-feature-row{display:block;width:100%;margin:0 0 16px}
#dentalAiSlot .gym-ai-open.dental-ai-feature-button{
  width:100%;min-height:106px;display:flex;align-items:center;justify-content:flex-start;
  padding:12px 20px 12px 13px;gap:17px;text-align:left;white-space:normal;
  background:linear-gradient(105deg,#0a2b55 0%,#105578 63%,#087d92 100%);
  color:#fff;border:1px solid #67c6d2;border-radius:18px;
  box-shadow:0 4px 0 #063047,0 10px 22px rgba(8,56,81,.16);
}
#dentalAiSlot .dental-ai-feature-button .gym-ai-robot-large{width:76px;height:76px}
#dentalAiSlot .dental-ai-banner-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:5px}
#dentalAiSlot .dental-ai-banner-copy strong{font-size:19px;font-weight:850;letter-spacing:.035em;color:#fff}
#dentalAiSlot .dental-ai-banner-copy small{font-size:13px;color:#c9f7fa;font-weight:600}
#dentalAiSlot .dental-ai-banner-action{display:inline-flex;align-items:center;gap:11px;flex:none;background:#f2fdff;color:#07516d;padding:11px 15px;border-radius:11px;font-size:13px;font-weight:800;box-shadow:0 3px 0 #9bd9e0}
#dentalAiSlot .dental-ai-feature-button:hover{filter:brightness(1.07);transform:translateY(-1px)}
#dentalAiSlot .dental-ai-feature-button:focus-visible{outline:3px solid #24c8d7;outline-offset:3px}
@media(max-width:600px){
 #dentalAiSlot .gym-ai-open.dental-ai-feature-button{min-height:86px;padding:10px 12px;gap:10px}
 #dentalAiSlot .dental-ai-feature-button .gym-ai-robot-large{width:57px;height:57px}
 #dentalAiSlot .dental-ai-banner-copy strong{font-size:15px}
 #dentalAiSlot .dental-ai-banner-copy small{font-size:11px}
 #dentalAiSlot .dental-ai-banner-action{font-size:11px;padding:9px 10px;gap:4px}
}
@media(max-width:360px){#dentalAiSlot .dental-ai-banner-action{padding:8px;font-size:10px}}
@media print{#dentalAiSlot{display:none!important}}

/* v1.4.3: generated images use the existing Gym-style conversational panel. */
.dental-ai-generated-image{display:flex;flex-direction:column;gap:10px;align-items:flex-start}
.dental-ai-generated-image img{display:block;width:min(100%,340px);max-height:420px;object-fit:contain;border-radius:12px;border:1px solid #c2d6df;background:#fff}
.dental-ai-generated-image .btn{text-decoration:none}

/* v1.4.4: Implant mode only. Existing Dental palette is retained. */
.mode-switch{white-space:nowrap;min-width:156px;font-weight:850;padding:10px 14px;border-radius:10px;background:#10d9e8;color:#073074;border:1px solid #fff}
.mode-switch.mode-dental{background:#fff;color:#073074}
.mode-switch:hover{filter:brightness(1.04)}
.implant-head{border-bottom:2px solid #dce6f6;padding-bottom:12px}
.tooth svg.anatomical{height:104px;overflow:visible}
.tooth .tooth-groove,.tooth .tooth-detail{fill:none;stroke:#539dc2;stroke-width:1.35;stroke-linecap:round}
.tooth .tooth-root,.tooth .tooth-crown{stroke-linejoin:round;stroke-width:1.7}
.tooth .tooth-occlusal{fill:rgba(255,255,255,.95);stroke:#8fc3e9;stroke-width:1.4}
@media(max-width:900px){.mode-switch{min-width:auto;padding:7px 10px;font-size:12px}.tooth svg.anatomical{height:86px}}
@media(max-width:600px){.mode-switch{font-size:11px;padding:7px 8px}.tooth svg.anatomical{height:78px}.topbar .brand-sub{max-width:110px}}

.tooth .implant-site-dot{position:absolute;left:2px;top:3px;border-radius:5px;padding:1px 5px;background:#0dd6df;color:#073269;border:1px solid white;font-size:11px;font-weight:900}

/* v1.4.6: Implant case patient picker and accessible Save action */
.implant-patient-results{display:flex;flex-direction:column;gap:0;max-height:min(245px,35vh);overflow-y:auto;overscroll-behavior:contain;border:1px solid #cbd8ec;border-radius:10px;background:#fff;scrollbar-gutter:stable;min-height:0}
.implant-patient-results[hidden]{display:none}
.implant-patient-choice{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;text-align:left;background:#fff;border:0;border-bottom:1px solid #e5eefa;padding:11px 12px;width:100%;cursor:pointer;color:#152f58;font:inherit}
.implant-patient-choice:hover,.implant-patient-choice:focus{background:#eef6ff;outline-color:#2175bd}
.implant-patient-choice span{color:#65758f;font-size:12px}
.implant-case-actions{position:sticky;bottom:-18px;z-index:2;padding:12px 4px;background:#fff;border-top:1px solid #d9e5f3;box-shadow:0 -5px 14px #fff}
@media(max-width:620px){.implant-patient-choice{flex-direction:column;gap:2px}}

/* v1.4.8 — customer-provided dental chart: full jaw order, reference crown/root shapes,
   number above upper teeth and below lower teeth. The page theme is not changed. */
.jaw-viewport{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
.odontogram .jaw.reference-jaw{display:grid;grid-template-columns:repeat(var(--tooth-count),minmax(44px,1fr));gap:2px;min-width:max(500px,calc(var(--tooth-count)*49px));margin:5px 0 11px;align-items:stretch}
.odontogram .chart-tooth{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;min-width:0;padding:0 1px 5px;border-radius:6px;cursor:pointer;gap:2px}
.odontogram .chart-tooth svg{order:1;width:100%;height:107px;max-width:52px;filter:drop-shadow(0 1px 1px rgba(0,0,0,.2));flex:none}
.odontogram .chart-tooth .tn{order:0;display:block;min-width:27px;min-height:22px;font-size:13px;line-height:20px;border:1px solid rgba(255,255,255,.56);border-radius:2px;background:rgba(255,255,255,.15);font-weight:800;color:#fff}
.odontogram .chart-tooth.chart-lower .tn{order:2}
.odontogram .chart-tooth .tooth-root{fill:#f7fafc;stroke:#8ba5ca;stroke-width:1.45;stroke-linejoin:round}
.odontogram .chart-tooth .tooth-crown{fill:#fffdf3;stroke:#7d9fc9;stroke-width:1.8;stroke-linejoin:round}
.odontogram .chart-tooth .tooth-groove{fill:none;stroke:#abc0db;stroke-width:1.25;stroke-linecap:round}
.odontogram .chart-tooth .tooth-occlusal{fill:#fffdf3;stroke:#7d9fc9;stroke-width:1.8}
.odontogram .chart-tooth .tooth-detail{fill:none;stroke:#a2b4cc;stroke-width:1.6;stroke-linecap:round}
.odontogram .chart-tooth.haswork .tooth-crown,.odontogram .chart-tooth.haswork .tooth-occlusal{fill:#c6f5f3;stroke:#00bac7}
.odontogram .chart-tooth .dot{top:24px}
.odontogram .chart-tooth.chart-lower .dot{top:3px}
@media(max-width:900px){.odontogram .jaw.reference-jaw{grid-template-columns:repeat(var(--tooth-count),minmax(45px,1fr))}.odontogram .chart-tooth svg{height:100px}}


/* v1.4.9 — Implant Follow-ups: full-width stacked panels, no sideways table scrolling.
   Scoped to this page only; Dental, case forms, data and actions are unchanged. */
.implant-followup-stack{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;width:100%;align-items:start}
.implant-followup-stack > .card{min-width:0;width:100%;box-sizing:border-box}
.implant-followup-stack .implant-followup-tablewrap{max-width:100%;width:100%;overflow-x:hidden}
.implant-followup-stack .implant-followup-table{min-width:0;width:100%;table-layout:fixed}
.implant-followup-stack .implant-followup-table th,
.implant-followup-stack .implant-followup-table td{min-width:0;overflow-wrap:anywhere;word-break:normal}
#implFollowCases .implant-followup-table th:last-child{width:40%}
.implant-followup-actions{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.implant-followup-stack .btn{max-width:100%;white-space:normal}
@media(max-width:700px){
 .implant-followup-stack .implant-followup-table thead{display:none}
 .implant-followup-stack .implant-followup-table,
 .implant-followup-stack .implant-followup-table tbody,
 .implant-followup-stack .implant-followup-table tr,
 .implant-followup-stack .implant-followup-table td{display:block;width:100%;box-sizing:border-box}
 .implant-followup-stack .implant-followup-table tr{padding:8px 10px;border-bottom:1px solid #dce6f0}
 .implant-followup-stack .implant-followup-table tr:last-child{border-bottom:0}
 .implant-followup-stack .implant-followup-table td{display:flex;flex-wrap:wrap;align-items:flex-start;gap:6px;padding:5px 0;border:0}
 .implant-followup-stack .implant-followup-table td[data-label]:before{content:attr(data-label) ":";font-weight:750;color:#365573;flex:0 0 116px}
 .implant-followup-stack .implant-followup-table td[colspan]{display:block}
 .implant-followup-stack .implant-followup-table td[colspan]:before{display:none}
 .implant-followup-stack .implant-followup-table td[data-label="Actions"]{align-items:center}
 .implant-followup-stack .implant-followup-table td[data-label="Actions"]:before{align-self:center}
}


/* v1.4.19 - Meta window fills the screen and the close control NEVER scrolls away. */
.modal-backdrop:has(.meta-fullscreen){padding:8px;align-items:center;justify-content:center;overflow:hidden;z-index:100}
.modal.meta-fullscreen,.modal.meta-fullscreen.wide{width:calc(100vw - 16px);max-width:none;height:calc(100dvh - 16px);max-height:none;overflow:hidden;display:flex;flex-direction:column;padding:0;border-radius:14px;min-width:0}
.modal.meta-fullscreen>.modal-head{display:flex;flex:0 0 auto;position:relative;top:auto;z-index:30;margin:0;padding:12px 16px;background:#fff;border-bottom:1px solid #dce6f6;box-shadow:0 2px 8px rgba(10,45,92,.10)}
.modal.meta-fullscreen>.modal-head h2{margin:0;min-width:0;overflow-wrap:anywhere}
.modal.meta-fullscreen>.modal-head .xbtn{position:relative;z-index:31;display:grid;place-items:center;flex:0 0 52px;width:52px;height:48px;font-size:30px;font-weight:800;color:#a01622;background:#fff1f1;border:2px solid #de6570;border-radius:10px;cursor:pointer}
.modal.meta-fullscreen>.modal-head .xbtn:hover{background:#ffe0e0}
.modal.meta-fullscreen>.modal-note{display:none}
.modal.meta-fullscreen>.modal-body{flex:1 1 auto;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding:14px 18px 24px}
.modal.meta-fullscreen #superMetaDetails{width:100%;max-width:none;margin:0;box-shadow:none;border:0;padding:0}
.meta-control-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.meta-control-grid>section{min-width:0}
.meta-status-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.meta-status-grid>div{background:#f6faff;border:1px solid #dce6f6;border-radius:10px;padding:12px}
.meta-ops{display:flex;flex-wrap:wrap;gap:9px;padding:12px 0;align-items:center}
.meta-ops .btn{min-height:42px}
.meta-panel-title{margin-top:18px;padding-bottom:7px;border-bottom:1px solid #dfe8f2}
@media(max-width:750px){.meta-control-grid,.meta-status-grid{grid-template-columns:1fr}.modal.meta-fullscreen>.modal-body{padding:10px}.modal.meta-fullscreen>.modal-head{padding:8px 10px}.modal.meta-fullscreen>.modal-head h2{font-size:17px}.modal.meta-fullscreen>.modal-head .xbtn{height:44px;width:48px;flex-basis:48px}}

/* v1.4.22: compact 3-way module switch, without horizontal scrolling */
.module-switch-label{display:flex;gap:8px;align-items:center;font-size:13px;font-weight:650;white-space:nowrap}
.module-switch-select{background:#fff;border:1px solid #90a4bb;color:#17365c;border-radius:8px;padding:9px;min-width:128px;max-width:190px;font-weight:700}
.top-actions{flex-wrap:wrap;justify-content:flex-end;gap:8px}
@media(max-width:680px){.module-switch-label{font-size:12px}.module-switch-select{min-width:100px;max-width:150px;padding:7px}}


/* R4 — Garage-style fullscreen, upper-right controls, close on login.
   Browser fullscreen never minimizes the operating-system window. */
.topbar .top-actions{flex-wrap:wrap;justify-content:flex-end;min-width:0}
.topbar .dental-window-control{white-space:nowrap;min-height:34px}
.login-card .dental-login-close{width:100%;margin-top:2px}
@media(max-width:750px){
 .topbar{flex-wrap:wrap;align-items:center}
 .topbar .spacer{display:none}
 .topbar .top-actions{margin-left:auto;gap:5px}
 .topbar .dental-window-control{padding:6px 7px;font-size:11px}
 .topbar .user-pill{display:none}
}
@media print{.dental-window-control,.dental-login-close{display:none!important}}
