:root{--ink:#18343c;--muted:#647b83;--teal:#096a70;--dark:#084b53;--line:#dce7eb;--bg:#f2f6f9;--accent:#e4f5f2;--white:#fff;font-family:Tahoma,Arial,sans-serif;color:var(--ink);font-size:16px;line-height:1.85}*{box-sizing:border-box}body{margin:0;background:var(--bg)}button,input,select,textarea{font:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:focus-visible,a:focus-visible{outline:3px solid #e2ae39;outline-offset:3px}button{border:0;background:none;color:inherit}a{color:var(--teal)}.layout{display:grid;grid-template-columns:245px 1fr;min-height:100vh}.sidebar{background:var(--dark);color:white;padding:30px 18px;display:flex;flex-direction:column;gap:26px}.brand{display:flex;align-items:center;gap:12px;padding:0 10px}.brand-mark{background:#ffffff1c;border:1px solid #ffffff40;border-radius:16px;width:48px;height:48px;display:grid;place-items:center}.brand strong{display:block;font-size:18px}.brand small{color:#b2d9db}.sidebar nav{display:grid;gap:7px}.nav-btn{display:flex;align-items:center;gap:12px;text-align:right;padding:12px 16px;border-radius:10px;color:#cbe1e3;font-size:15px}.nav-btn:hover,.nav-btn.active{background:#ffffff17;color:#fff}.nav-btn.active{box-shadow:inset -3px 0 #60dbca}.side-foot{margin-top:auto;border-top:1px solid #ffffff25;padding-top:20px;font-size:14px;color:#bad4d8}.workspace{min-width:0}.topbar{background:#fff;border-bottom:1px solid var(--line);padding:18px 34px;display:flex;justify-content:space-between;align-items:center;gap:16px}.topbar strong{font-size:16px}.topbar small{display:block;color:var(--muted);font-size:13px}.mode-switch{display:flex;gap:5px;background:var(--bg);padding:4px;border-radius:10px;flex-wrap:wrap}.mode-switch button{font-size:14px;padding:7px 12px;border-radius:7px}.mode-switch .active{background:#fff;box-shadow:0 1px 5px #18343c18;color:var(--teal)}.demo{margin:20px 34px 0;padding:10px 15px;border:1px solid #eadcb6;border-radius:9px;background:#fff9e9;font-size:13px;display:flex;align-items:center;justify-content:space-between;gap:14px;color:#735e2b}.demo button{text-decoration:underline;font-size:13px;white-space:nowrap}main{max-width:1500px;margin:auto;padding:28px 34px 50px}.heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:25px}h1{font-size:26px;margin:0;font-weight:700}h2{font-size:19px;margin:0 0 15px}h3{font-size:16px;margin:0 0 8px}p{margin:6px 0}.muted{color:var(--muted);font-size:14px}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--teal);color:white;border-radius:9px;padding:10px 18px;font-size:14px;font-weight:600}.btn.secondary{background:white;border:1px solid var(--line);color:var(--ink)}.btn.soft{background:var(--accent);color:var(--teal)}.btn.danger{background:#b44343}.actions{display:flex;gap:9px;flex-wrap:wrap}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:17px;margin-bottom:25px}.stat,.card{background:#fff;border:1px solid var(--line);border-radius:14px;padding:22px}.stat small{color:var(--muted);font-size:14px}.stat strong{font-size:30px;display:block;margin:7px 0}.stat .meta{font-size:13px;color:var(--teal)}.stat-icon{float:left;background:var(--accent);color:var(--teal);border-radius:10px;padding:9px;display:flex}.grid{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(260px,1fr);gap:22px}.card-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;gap:10px}.card-head h2{margin:0}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;text-align:right;font-size:14px}th{font-weight:400;color:var(--muted);background:#f7f9fb}td,th{padding:14px 12px;border-bottom:1px solid #edf1f3;white-space:nowrap}tbody tr:last-child td{border-bottom:0}.link{color:var(--teal);font-weight:600;padding:4px 0}.badge{padding:4px 10px;border-radius:6px;background:#e8f6f0;color:#28745d;font-size:13px;display:inline-block}.badge.amber{background:#fff3d9;color:#926b16}.badge.blue{background:#e9f1ff;color:#466bb0}.avatar{width:43px;height:43px;display:inline-flex;align-items:center;justify-content:center;background:#e6eef8;color:#58709a;border-radius:12px;font-weight:700;flex-shrink:0}.person{display:flex;align-items:center;gap:12px}.person small{display:block;color:var(--muted);font-size:13px}.quick{display:grid;grid-template-columns:1fr 1fr;gap:10px}.quick button{background:#f3f8f9;padding:18px 9px;border-radius:10px;font-size:14px;display:grid;justify-items:center;gap:8px}.note{padding:14px;border-right:3px solid #ddb050;background:#fffbf0;border-radius:5px;font-size:14px;margin-top:18px}.row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:13px 0;border-bottom:1px solid #edf1f3}.row:last-child{border:0}.tabs{display:flex;gap:22px;border-bottom:1px solid var(--line);margin:22px 0;overflow:auto}.tabs button{font-size:14px;white-space:nowrap;padding:10px 2px 14px;border-bottom:3px solid transparent;color:var(--muted)}.tabs .active{border-color:var(--teal);color:var(--teal);font-weight:700}.patient-header{display:flex;gap:16px;align-items:center}.patient-header .avatar{width:65px;height:65px;font-size:24px}.patient-header .badge{margin-right:12px}.patient-actions{margin-top:22px}.tooth-chart{direction:ltr;display:grid;grid-template-columns:repeat(16,minmax(28px,1fr));gap:7px;margin:20px 0}.tooth{display:flex;flex-direction:column;align-items:center;border-radius:9px;padding:8px 0 4px;font-size:12px;color:#7e929a;border:1px solid transparent}.tooth svg{width:25px;height:35px;fill:#f7fafd;stroke:#adbec5;stroke-width:1.5}.tooth.done svg{fill:#cdebe6;stroke:var(--teal)}.tooth.selected{background:#e5f4f2;border-color:var(--teal);color:var(--teal)}.tooth.selected svg{fill:#b4dfd8;stroke:var(--teal)}.tooth:hover{background:#edf5f7}.legend{display:flex;gap:20px;font-size:13px;justify-content:center}.legend span:before{content:'';display:inline-block;width:10px;height:10px;background:#e8edf0;border:1px solid #bacbd0;margin-left:7px;border-radius:3px}.legend span:last-child:before{background:#b4dfd8;border-color:var(--teal)}label{display:block;font-size:14px;margin-bottom:7px}input,select,textarea{width:100%;background:#fff;border:1px solid #cddce1;border-radius:8px;padding:10px 12px;color:var(--ink);min-width:0}input:focus,select:focus,textarea:focus{outline:2px solid #81bdb7;outline-offset:1px}textarea{resize:vertical;min-height:88px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:17px}.field.wide{grid-column:1/-1}.form-footer{display:flex;justify-content:flex-end;gap:10px;margin-top:25px;border-top:1px solid var(--line);padding-top:18px}.search{max-width:400px}.empty{text-align:center;padding:40px 15px;color:var(--muted);font-size:15px}.timeline{border-right:2px solid #dce9e9;margin:12px 8px;padding-right:20px}.timeline-item{position:relative;padding:0 0 23px}.timeline-item:before{content:'';position:absolute;right:-27px;top:8px;width:10px;height:10px;background:var(--teal);border:2px solid white;border-radius:50%}.timeline-item small{font-size:13px;color:var(--muted)}dialog{border:0;border-radius:16px;padding:28px;max-width:640px;width:calc(100% - 28px);max-height:90vh;color:var(--ink);box-shadow:0 20px 100px #032a3c40}dialog::backdrop{background:#0a283c70;backdrop-filter:blur(3px)}.modal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.modal-head h2{margin:0}.close{font-size:27px;line-height:1;width:35px;height:35px;color:var(--muted)}#toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);background:var(--dark);color:white;border-radius:10px;padding:12px 22px;box-shadow:0 4px 25px #1233;display:none;z-index:99;font-size:14px;max-width:90vw}.portal{max-width:700px;margin:auto}.portal-hero{background:var(--dark);color:white;border-radius:16px;padding:26px;margin:20px 0}.portal-hero .muted{color:#c0dedc}.portal-hero strong{display:block;font-size:25px;margin:12px 0}.portal .stats{grid-template-columns:1fr 1fr}.portal-menu{display:grid;grid-template-columns:1fr 1fr;gap:14px}.portal-menu button{background:white;border:1px solid var(--line);border-radius:12px;padding:22px;text-align:right}.portal-menu strong{display:block;margin:8px 0}.stepper{display:flex;gap:10px;margin-bottom:25px}.stepper span{flex:1;height:5px;border-radius:3px;background:#dce7eb}.stepper span.active{background:var(--teal)}.setup{max-width:750px;margin:auto}.logo-img{width:48px;height:48px;object-fit:contain;border-radius:8px}.gallery{display:grid;grid-template-columns:repeat(3,1fr);gap:15px}.gallery img{width:100%;height:180px;object-fit:contain;background:#f6f8fa}.rx-line{padding:15px;background:#f5f9fa;border-radius:9px;margin-bottom:12px;direction:rtl}.rx-line strong{display:block;direction:ltr;text-align:right}.catalog{max-height:180px;overflow:auto;border:1px solid var(--line);border-radius:8px;margin:8px 0}.catalog button{display:block;width:100%;text-align:right;padding:8px 12px;font-size:14px;border-bottom:1px solid var(--line)}.catalog button:hover{background:var(--accent)}.chip{display:inline-block;background:#edf3f7;padding:4px 10px;border-radius:6px;font-size:13px;margin:3px}.print-only,#printArea{display:none}svg.icon{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.preview-sheet{border:1px solid var(--line);padding:25px;background:white;margin-top:20px}.mobile-label{display:none}@media(max-width:1100px){.layout{grid-template-columns:205px 1fr}.sidebar{padding:24px 12px}.topbar,main{padding:20px}.demo{margin:16px 20px 0}.stats{grid-template-columns:repeat(2,1fr)}.grid{grid-template-columns:1fr}.tooth-chart{gap:3px}}@media(max-width:700px){.layout{display:block}.sidebar{padding:12px 16px;gap:12px}.brand{padding:0}.brand-mark{width:37px;height:37px}.brand strong{font-size:16px}.brand small,.side-foot{display:none}.sidebar nav{display:flex;overflow:auto;gap:4px}.nav-btn{padding:8px 12px;font-size:13px;white-space:nowrap}.nav-btn svg{display:none}.topbar{padding:12px 16px;align-items:flex-start;flex-direction:column;gap:10px}.topbar>div:first-child{display:none}.mode-switch{width:100%;justify-content:space-between}.mode-switch button{font-size:13px;padding:6px 8px}.demo{margin:12px 12px 0;align-items:flex-start;font-size:12px}main{padding:20px 12px}.heading{align-items:flex-start;gap:10px}h1{font-size:22px}.heading .btn{padding:8px 12px;font-size:13px}.stats{gap:10px}.stat,.card{padding:17px}.stat strong{font-size:25px}.stat-icon{display:none}.stat small{font-size:13px}.form-grid{grid-template-columns:1fr}.tabs{gap:18px}.tooth-chart{grid-template-columns:repeat(8,1fr);gap:5px}.tooth{padding:7px 0}.patient-header .badge{margin-right:0}.patient-header{align-items:flex-start}.gallery{grid-template-columns:1fr 1fr}.portal-menu{gap:10px}.portal-menu button{padding:15px}.btn{min-height:42px}.actions .btn{flex-grow:1}.card-head{flex-wrap:wrap}.patient-header h1{font-size:21px}dialog{padding:20px}}@media print{body{background:white}#app,dialog,#toast{display:none!important}#printArea{display:block;padding:15mm;color:#000;font-size:14px}#printArea h1{font-size:23px}#printArea table{font-size:13px}#printArea .watermark{border:2px solid #777;padding:10px;text-align:center;margin-bottom:20px}#printArea .print-head{display:flex;justify-content:space-between;border-bottom:2px solid #333;padding-bottom:15px;margin-bottom:20px}@page{size:A5;margin:8mm}}
/* Treatment plans carry one fee; visits are their child records. */
.treatment-cards{display:grid;gap:16px}.treatment-card{border:1px solid var(--line);border-radius:12px;padding:18px;margin-bottom:12px}.treatment-card .card-head{align-items:flex-start}.treatment-title{font-size:17px;text-align:right}.treatment-meta{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:14px;margin:12px 0}.treatment-meta strong{color:var(--teal)}.visit-links{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}.visit-links button{background:#edf5f7;border:1px solid #d7e5e8;border-radius:8px;padding:8px 12px;font-size:14px;text-align:right}.visit-links small{display:block;font-size:12px;color:var(--muted)}dialog.treatment-dialog{max-width:850px}.batch-row{border:1px solid #cddde1;border-radius:12px;padding:18px;margin:18px 0}.batch-row legend{padding:0 10px;font-weight:700;color:var(--teal)}.batch-heading{display:flex;justify-content:space-between;gap:10px;margin-bottom:15px}.batch-total{display:flex;justify-content:space-between;background:#e5f4f1;padding:16px;border-radius:10px;margin:20px 0 10px}.visit-context{background:#edf6f7;border-radius:10px;padding:14px;margin-bottom:18px;font-size:14px}.procedure-groups{display:grid;gap:10px;margin:14px 0 20px}.procedure-groups details,.revision-history{border:1px solid var(--line);padding:10px 14px;border-radius:9px}.procedure-groups summary,.revision-history summary{cursor:pointer;font-size:14px;font-weight:600}.procedure-options{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:12px}.procedure-options label{display:flex;align-items:flex-start;gap:9px;border-radius:6px;padding:8px;background:#f6f9fa;margin:0;font-size:14px;cursor:pointer}.procedure-options input{width:17px;height:17px;flex:0 0 17px;margin-top:5px;accent-color:var(--teal)}.revision-history{margin-top:15px}[hidden]{display:none!important}@media(max-width:600px){.procedure-options{grid-template-columns:1fr}.batch-heading{flex-direction:column}.batch-row{padding:13px}.treatment-meta{flex-direction:column}.treatment-card{padding:13px}}
/* Shared anatomical odontogram and inline treatment picker. */
.dental-scroll{overflow-x:auto;background:#f6f9fc;border:1px solid #dce6ed;border-radius:14px;padding:12px 10px;margin:15px 0;overscroll-behavior-x:contain}.dental-board{min-width:620px;direction:ltr;padding:0 4px}.dental-board.primary-teeth{min-width:460px}.jaw-directions{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:13px;color:var(--muted);padding:6px 10px}.jaw-directions strong{color:var(--ink);font-size:15px}.dental-jaw{display:grid;grid-template-columns:repeat(var(--count),minmax(0,1fr));gap:2px;padding:5px 0 28px}.dental-jaw.lower{padding:28px 0 5px}.dental-unit{display:flex;flex-direction:column;align-items:center;padding:2px 0;border:1px solid transparent;border-radius:10px;transform:translateY(var(--arch));min-width:0}.dental-unit:hover{background:#e6eff5;border-color:#bdcfd8}.anatomical-tooth{width:100%;max-width:52px;height:104px;overflow:visible;filter:drop-shadow(0 2px 1px #a0afb725)}.tooth-root{fill:#f3ecd9;stroke:#a7a397;stroke-width:1.15;stroke-linejoin:round}.tooth-enamel{stroke:#94a7af;stroke-width:1.25;stroke-linejoin:round}.tooth-groove{fill:none;stroke:#9eadb0;stroke-width:1.05;stroke-linecap:round;opacity:.8}.tooth-neck{fill:none;stroke:#b5b8a8;stroke-width:.8}.fdi-number{font-size:13px;font-weight:600;line-height:1.8;color:#47616d}.dental-unit.treated .tooth-enamel{fill:#cbe9e1}.dental-unit.selected{background:#d7eeec;border-color:var(--teal);box-shadow:0 0 0 1px var(--teal)}.dental-unit.selected .tooth-enamel{fill:#b5dfd8;stroke:#096a70}.dental-unit.selected .fdi-number{color:#07565c}.jaw-divider{display:flex;align-items:center;gap:15px;color:#8a9ba5;font-size:12px;text-align:center;margin:1px 0}.jaw-divider:before,.jaw-divider:after{content:'';height:1px;background:#d4e0e6;flex:1}.chart-caption{font-size:12px;color:var(--muted);text-align:center;margin:10px 0}.tooth-trigger{display:flex;justify-content:space-between;align-items:center;gap:12px;width:100%;text-align:right;background:white;border:1px solid #cddce1;border-radius:8px;padding:11px 13px}.tooth-trigger[aria-expanded=true]{border-color:var(--teal)}.tooth-trigger .muted{display:flex;gap:8px;align-items:center}.tooth-picker{margin-top:12px;padding:14px;background:#fff;border:1px solid #c6d9de;border-radius:12px}.picker-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.picker-head label{margin:0;font-size:13px}.picker-head select{padding:5px 10px}.tooth-picker .dental-scroll{margin:10px 0}.tooth-picker .anatomical-tooth{height:96px}.tooth-trigger span:first-child{font-size:14px}@media(max-width:700px){.tooth-trigger{align-items:flex-start;flex-direction:column}.tooth-picker{padding:8px}.picker-head{font-size:14px}.dental-scroll{padding:8px}.anatomical-tooth{height:95px}}

.local-auth{max-width:640px;margin:7vh auto;padding:25px}.local-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.local-save{font-size:14px;color:#096a70}.local-alert{border:1px solid #d8ad51;background:#fff3d9;padding:14px;margin-bottom:18px;border-radius:10px}.local-alert p{margin-bottom:12px}body.local-busy:after{content:'در حال ذخیره...';position:fixed;inset:0;background:#ffffffb8;display:grid;place-items:center;z-index:1000}.local-auth .card{padding:26px}.local-tools{display:flex;gap:9px;flex-wrap:wrap;margin:14px 0}.local-tools .btn{font-size:13px;padding:8px 10px}.local-auth input{direction:ltr;text-align:left}.local-auth input[name=clinicName],.local-auth input[name=doctor]{direction:rtl;text-align:right}

.license-notice{display:flex;justify-content:space-between;align-items:center;gap:18px;margin:18px 24px 0;padding:14px 16px;border:1px solid var(--line);border-radius:12px;background:#f7fafb}.license-notice p,.license-summary p{margin:5px 0 0}.license-good{border-color:#79b6a2;background:#edf9f5}.license-trial{border-color:#d8ad51;background:#fff7df}.license-locked{border-color:#d47c7c;background:#fff0f0}.license-summary{padding:14pxpx;border-radius:12px;margin-bottom:18px}.license-code-row{display:flex;gap:10px;align-items:center}.license-code-row input{font-family:monospace;letter-spacing:.04em}.license-import{border-top:1px solid var(--line);margin-top:22px;padding-top:18px}.license-import input[type=file]{padding:12px}.license-readonly [type=submit]:not(#licenseImportForm [type=submit]){opacity:.55}@media(max-width:700px){.license-notice,.license-code-row{align-items:stretch;flex-direction:column}.license-notice{margin:14px 12px 0}}

.staff-permissions{display:grid;gap:14px;margin:16px 0}.staff-permissions label{display:flex;align-items:flex-start;gap:12px;line-height:1.7}.staff-permissions input{width:20px;height:20px;flex:none}.staff-list{display:grid;gap:16px;margin-top:20px}

.lab-directory{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:18px}.lab-ledger{display:grid;gap:14px;margin-top:20px}.lab-note{white-space:pre-wrap}.lab-filters{margin-bottom:22px}.lab-ledger .rx-line{display:block}.lab-ledger small{display:block;margin-bottom:10px}

.inventory-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:18px}.inventory-ledger{display:grid;gap:14px;margin-top:20px}.inventory-ledger small{display:block;margin-bottom:8px}.inventory-filters{margin-bottom:22px}

.inventory-order-lines{display:grid;gap:10px;margin:14px 0 20px;max-height:48vh;overflow:auto;padding:2px}.inventory-order-line{display:grid;grid-template-columns:24px minmax(180px,1fr) minmax(130px,.45fr);align-items:center;gap:12px;border:1px solid var(--line);border-radius:12px;padding:12px;background:#fff}.inventory-order-line.is-low{border-color:#d8ad51;background:#fffaf0}.inventory-order-line>input{width:19px;height:19px}.inventory-order-line>span:nth-child(2){display:grid;gap:4px}.inventory-order-line small{color:var(--muted)}.order-quantity{display:grid;grid-template-columns:1fr auto;align-items:center;gap:7px}.order-quantity input{min-width:0}.inventory-low-note{margin:18px 0}.inventory-low-note.card{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px 18px}.inventory-low-note p{margin:3px 0 0}@media(max-width:700px){.inventory-order-line{grid-template-columns:24px 1fr}.order-quantity{grid-column:2}.inventory-low-note.card{align-items:stretch;flex-direction:column}}

.accounting-range{margin-bottom:22px}.accounting-range .actions{margin-top:14px}.accounting-print table{margin:14px 0}.accounting-print h3{margin-top:22px}

.report-range{margin-bottom:22px}.report-range .actions{margin-top:14px}.report-section{margin-top:20px}.report-bars{display:grid;gap:14px}.report-bar-row>div:first-child{display:flex;justify-content:space-between;gap:16px;margin-bottom:6px}.report-track{height:10px;background:#e5f0f0;border-radius:99px;overflow:hidden}.report-track i{display:block;height:100%;background:var(--teal);border-radius:inherit}.report-print table{margin:14px 0}.report-print h3{margin-top:22px}@media(max-width:700px){.report-tabs{overflow-x:auto;flex-wrap:nowrap}.report-tabs button{white-space:nowrap}.report-bar-row>div:first-child{align-items:flex-start}}

.prescription-warning{border:1px solid #d8ad51;background:#fff7df;padding:14px 16px;border-radius:12px;margin:14px 0}.prescription-warning p{margin:7px 0 0;white-space:pre-wrap}.prescription-meta{margin:18px 0}.prescription-catalog button{display:flex;justify-content:space-between;gap:15px;align-items:center}.prescription-catalog span{color:var(--muted);font-size:13px}.prescription-line{display:grid;gap:7px}.prescription-line small{color:var(--muted)}.prescription-line .actions{justify-content:flex-end}.prescription-check{display:flex;gap:12px;align-items:flex-start;line-height:1.8;margin:18px 0}.prescription-check input{width:20px;height:20px;flex:none;margin-top:5px}.prescription-record{align-items:flex-start}.prescription-record>.actions{justify-content:flex-end}.prescription-print-void{border:4px solid #991b1b;color:#991b1b;padding:12px;text-align:center;font-size:30px;font-weight:800;margin-bottom:20px}@media(max-width:700px){.prescription-catalog button,.prescription-record{align-items:flex-start;flex-direction:column}.prescription-record>.actions{justify-content:flex-start}}

.appointment-filters{display:flex;justify-content:space-between;align-items:end;gap:18px;margin-bottom:22px}.appointment-filters label{min-width:190px}.appointment-filters .tabs{margin:0}.reminder-group{margin-top:20px}.reminder-row{align-items:flex-start}.appointment-history{border-top:1px solid var(--line);margin-top:20px;padding-top:10px}.appointment-history h3{margin-top:16px}.appointment-detail-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:8px 20px}.reminder-message{min-height:120px;margin:8px 0 12px}.appointment-record small{display:block}@media(max-width:700px){.appointment-filters,.reminder-row{align-items:stretch;flex-direction:column}.appointment-filters label{min-width:0}.reminder-row>.actions{justify-content:flex-start}}

.patient-form-section{border:1px solid var(--line);border-radius:14px;padding:18px;margin:16px 0}.patient-form-section h3{margin-top:0}.patient-field-label{display:block;font-weight:700;margin-bottom:8px}.patient-check-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px}.patient-check-grid label,.patient-confirm{display:flex;align-items:flex-start;gap:10px;line-height:1.7}.patient-check-grid input,.patient-confirm input{width:20px;height:20px;flex:none;margin-top:4px}.patient-confirm{border:1px solid #d8ad51;background:#fff7df;padding:14px;border-radius:12px;margin:18px 0}.patient-confirm-neutral{border-color:var(--line);background:#f7fafb}.patient-alert{border:1px solid #d8ad51;background:#fff7df;padding:14px 16px;border-radius:12px;margin:16px 0;white-space:pre-wrap}.patient-alert-strong{display:grid;gap:5px;margin-top:20px}.patient-medical-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin:18px 0}.patient-medical-grid>div{border:1px solid var(--line);border-radius:10px;padding:12px;display:grid;gap:5px}.patient-medical-grid span{color:var(--muted);font-size:13px}.patient-tags{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 18px}.patient-history-log{border-top:1px solid var(--line);margin-top:20px;padding-top:16px}.patient-history-log summary{cursor:pointer;font-weight:700}.patient-image-form{border:1px solid var(--line);border-radius:14px;padding:18px;margin:18px 0}.patient-gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:16px}.patient-gallery figure{margin:0;border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff}.patient-gallery figure>button{display:block;width:100%;padding:0;border:0;background:#eef7f7;cursor:pointer}.patient-gallery img{display:block;width:100%;height:190px;object-fit:cover}.patient-gallery figcaption{display:grid;gap:5px;padding:12px}.patient-gallery figcaption span,.patient-gallery figcaption small{color:var(--muted)}.patient-image-large{display:block;max-width:100%;max-height:60vh;margin:0 auto 20px;border-radius:12px}@media(max-width:700px){.patient-form-section,.patient-image-form{padding:13px}.patient-medical-grid{grid-template-columns:1fr}.patient-gallery img{height:220px}}

.license-notice{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:13px 18px;border:1px solid var(--line);border-radius:12px;margin:16px 22px 0}.license-notice p{margin:3px 0 0}.license-good{background:#eaf8f3;border-color:#86c9ae}.license-trial{background:#fff7df;border-color:#d8ad51}.license-locked{background:#fff0f0;border-color:#d47c7c}.license-summary{border:1px solid var(--line);border-radius:12px;padding:14px 16px;margin-bottom:18px}.license-summary p{margin:5px 0 0}.license-code-row{display:flex;gap:9px;align-items:center}.license-code-row input{font-family:monospace;text-align:left}.license-import{border-top:1px solid var(--line);margin-top:20px;padding-top:18px}.license-readonly main [type="submit"]{opacity:.58}@media(max-width:700px){.license-notice,.license-code-row{align-items:stretch;flex-direction:column}.license-notice{margin:12px 12px 0}}

.consent-list{display:grid;gap:14px;margin-top:18px}.consent-card{border:1px solid var(--line);border-radius:14px;padding:16px}.consent-card p{white-space:pre-wrap}.consent-general{grid-column:1/-1;margin-top:-8px}.consent-section p,.consent-statement p{white-space:pre-wrap}.consent-statement{border:1px solid #79b6a2;background:#edf9f5;padding:14px 16px;border-radius:12px;margin:18px 0;line-height:1.9}.consent-decision{border:1px solid var(--line);padding:14px 16px;border-radius:12px;margin:18px 0}.consent-attachment{margin:18px 0;border:1px solid var(--line);border-radius:12px;overflow:hidden}.consent-attachment img{display:block;width:100%;max-height:420px;object-fit:contain;background:#eef7f7}.consent-attachment figcaption{padding:10px 14px}.consent-signatures{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:30px}.consent-card small,td small{display:block;margin-top:5px}.consent-list .actions{justify-content:flex-start}@media(max-width:700px){.consent-signatures{grid-template-columns:1fr}.consent-card .card-head{align-items:flex-start;flex-direction:column}}

.odontogram-legend span:before{background:#e8edf0;border-color:#bacbd0}.odontogram-legend .legend-finding:before{background:#ffdca8;border-color:#b86b1d}.odontogram-legend .legend-treated:before{background:#b4dfd8;border-color:var(--teal)}.odontogram-legend .legend-missing:before{background:#e8edf0;border-color:#a13f3f}.dental-unit.finding-active .tooth-enamel{fill:#ffdca8!important;stroke:#b86b1d}.dental-unit.finding-active .tooth-root{stroke:#b86b1d}.dental-unit.finding-missing .anatomical-tooth{opacity:.35;filter:grayscale(1)}.dental-unit.finding-missing:after{content:"×";position:absolute;inset:24px 0 auto;color:#a13f3f;font-size:34px;font-weight:800;line-height:1}.dental-unit{position:relative}.odontogram-sections{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px;margin-top:22px}.odontogram-list{display:grid;gap:12px}.odontogram-record{border:1px solid var(--line);border-radius:12px;padding:14px}.odontogram-record p{white-space:pre-wrap}.odontogram-surfaces{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0}.odontogram-surfaces span{background:#edf3f7;border-radius:6px;padding:3px 8px;font-size:12px}.odontogram-record img{display:block;max-width:100%;max-height:230px;object-fit:contain;border-radius:10px;margin-top:10px}.odontogram-record.history{background:#f7f9fb}.odontogram-checks{display:grid;grid-template-columns:repeat(auto-fit,minmax(135px,1fr));gap:9px}.odontogram-checks label{display:flex;gap:8px;align-items:center;margin:0}.odontogram-checks input{width:18px;height:18px;flex:none}.odontogram-note{border:1px solid #d8ad51;background:#fff7df;padding:12px 14px;border-radius:10px;margin:15px 0}@media(max-width:850px){.odontogram-sections{grid-template-columns:1fr}.odontogram-record .card-head{align-items:flex-start;flex-direction:column}}

@font-face{font-family:'Vazirmatn Variable';font-style:normal;font-display:swap;font-weight:100 900;src:url('fonts/vazirmatn-arabic.woff2') format('woff2')}@font-face{font-family:'Vazirmatn Variable';font-style:normal;font-display:swap;font-weight:100 900;src:url('fonts/vazirmatn-latin.woff2') format('woff2')}body,button,input,select,textarea{font-family:'Vazirmatn Variable',Tahoma,Arial,sans-serif}.home-shell{max-width:1180px;margin:0 auto}.home-hero{display:flex;justify-content:space-between;align-items:center;gap:24px;padding:24px 28px;border-radius:22px;color:#fff;background:linear-gradient(135deg,#075d63,#0e7b7e);box-shadow:0 14px 38px #0b676c24}.home-clinic{display:flex;align-items:center;gap:16px}.home-clinic img,.home-clinic-mark{width:64px;height:64px;border-radius:18px;object-fit:contain;background:#fff;color:#075d63;display:grid;place-items:center;font-size:29px;font-weight:800;padding:5px}.home-clinic h1{margin:2px 0;font-size:clamp(24px,3vw,36px)}.home-clinic p,.home-clinic small{margin:0;color:#d7f3f1}.home-today{display:grid;min-width:112px;text-align:center;padding:10px 18px;border-radius:17px;background:#ffffff18;border:1px solid #ffffff30}.home-today strong{font-size:31px}.home-today span{font-size:13px}.home-search-card{position:relative;z-index:2;max-width:760px;margin:22px auto 18px}.home-search-card>label{display:block;font-weight:800;margin:0 4px 8px}.home-search-box{display:flex;align-items:center;gap:10px;padding:0 17px;background:#fff;border:1px solid var(--line);border-radius:15px;box-shadow:0 10px 28px #164e6320}.home-search-box svg{width:20px;color:var(--teal)}.home-search-box input{border:0;box-shadow:none;padding:15px 0;font-size:16px}.home-search-box input:focus{outline:0}.home-patient-result{width:100%;display:flex;align-items:center;gap:12px;padding:10px 14px;margin-top:7px;border:1px solid var(--line);border-radius:13px;background:#fff;text-align:right;color:var(--ink);cursor:pointer}.home-patient-result:hover{border-color:var(--teal);background:#f3fbfa}.home-patient-result>span:nth-child(2){display:grid;flex:1}.home-patient-result small{color:var(--muted);margin-top:2px}.home-patient-result svg{width:18px}.home-search-help{text-align:center;margin:9px 0}.home-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:20px 0}.home-actions button{display:flex;align-items:center;gap:13px;padding:16px;border:1px solid var(--line);border-radius:16px;background:#fff;text-align:right;color:var(--ink);cursor:pointer;box-shadow:0 6px 20px #164e630c}.home-actions button:hover:not(:disabled){transform:translateY(-1px);border-color:var(--teal)}.home-actions button:disabled{opacity:.5;cursor:not-allowed}.home-actions svg{width:28px;color:var(--teal);flex:none}.home-actions span{display:grid}.home-actions small{color:var(--muted);font-weight:400;margin-top:2px}.home-grid{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(280px,.75fr);gap:18px}.home-schedule,.home-chart-card,.home-welcome{min-height:285px}.home-appointment{display:grid;grid-template-columns:64px minmax(120px,.8fr) minmax(150px,1.2fr) auto;align-items:center;gap:12px;padding:13px 3px;border-top:1px solid var(--line)}.home-appointment time{font-size:16px;font-weight:800;color:var(--teal)}.home-appointment>span:not(.badge){color:var(--muted)}.home-empty{min-height:190px;display:grid;place-content:center;justify-items:center;gap:10px;text-align:center;color:var(--muted)}.home-empty svg{width:34px}.home-week-chart{height:190px;display:grid;grid-template-columns:repeat(7,1fr);gap:9px;align-items:end;padding-top:14px}.home-chart-day{height:100%;display:grid;grid-template-rows:22px 1fr 26px;gap:5px;justify-items:center;align-items:end}.home-chart-day strong{font-size:12px}.home-chart-track{width:min(30px,75%);height:100%;display:flex;align-items:end;border-radius:8px;background:#eef5f5;overflow:hidden}.home-chart-track i{display:block;width:100%;min-height:3px;border-radius:8px 8px 3px 3px;background:linear-gradient(#58b8b1,var(--teal))}.home-chart-day small{font-size:11px;color:var(--muted);white-space:nowrap}@media(max-width:850px){.home-grid{grid-template-columns:1fr}.home-hero{padding:20px}.home-today{min-width:92px}.home-actions{grid-template-columns:1fr}.home-schedule,.home-chart-card{min-height:0}}@media(max-width:560px){.home-hero{align-items:flex-start;flex-direction:column}.home-clinic img,.home-clinic-mark{width:54px;height:54px}.home-today{display:flex;gap:7px;align-items:baseline;text-align:right}.home-today strong{font-size:24px}.home-appointment{grid-template-columns:55px 1fr auto}.home-appointment>span:not(.badge){grid-column:2/4}.home-chart-card{padding-left:12px;padding-right:12px}.home-week-chart{gap:5px}}

.demo,.license-notice,.side-foot{display:none!important}.sidebar{padding-top:24px}.brand{padding:0 7px;min-height:55px}.brand-mark{width:46px;height:46px;border-radius:14px;flex:none}.brand-mark .logo-img{width:100%;height:100%;object-fit:contain;border-radius:11px;padding:3px}.brand strong{font-size:15px;line-height:1.45;max-width:145px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.brand small{font-size:11px}.topbar{min-height:78px;padding-top:13px;padding-bottom:13px}.topbar>div:first-child strong{font-size:17px}.topbar>div:first-child small{font-size:12px}.mode-switch{background:transparent;padding:0}.local-account-bar{display:flex;align-items:center;gap:12px}.local-save{font-size:12px;color:var(--muted);white-space:nowrap}.account-button{display:flex;align-items:center;gap:10px;min-width:205px;padding:8px 11px;border:1px solid var(--line);border-radius:14px;background:#f8fbfc;text-align:right}.account-button:hover{border-color:#b5d4d4;background:#f2f9f8}.account-button>span:nth-child(2){display:grid;flex:1}.account-button strong{font-size:13px}.account-button small{font-size:11px;color:var(--muted)}.account-button>.icon{width:16px;color:var(--muted)}.account-avatar{width:38px;height:38px;border-radius:12px;background:linear-gradient(135deg,#0c7073,#4ba9a2);color:white;display:grid;place-items:center;font-weight:800;flex:none}.account-license-dot{width:9px;height:9px;border-radius:50%;flex:none;border:0}.account-license-dot.license-good{background:#2f9b70}.account-license-dot.license-trial{background:#d7a52f}.account-license-dot.license-locked{background:#c14f4f}.account-profile{display:flex;align-items:center;gap:14px;padding:4px 0 18px}.account-profile h3,.account-profile p{margin:0}.account-profile small{color:var(--muted)}.account-avatar-large{width:54px;height:54px;border-radius:16px;font-size:20px}.account-license{display:flex;align-items:center;justify-content:space-between;gap:14px;border:1px solid var(--line);border-radius:13px;padding:12px 14px;margin-bottom:16px}.account-license>div{display:grid}.account-license-label{font-size:11px;color:var(--muted)}.account-license strong{font-size:14px}.account-license small{font-size:11px;margin-top:2px}.account-license .btn{padding:7px 12px;min-height:36px}.account-menu{display:grid;grid-template-columns:1fr 1fr;gap:9px}.account-menu button{display:flex;align-items:center;gap:11px;padding:12px;border:1px solid var(--line);border-radius:12px;background:#fff;text-align:right}.account-menu button:hover{border-color:#aacdcb;background:#f5fbfa}.account-menu .icon{width:21px;color:var(--teal);flex:none}.account-menu button span{display:grid}.account-menu button strong{font-size:13px}.account-menu button small{font-size:11px;color:var(--muted)}.account-menu .account-logout{grid-column:1/-1}.account-menu .account-logout .icon,.account-menu .account-logout strong{color:#a74343}.home-hero{min-height:118px;padding:18px 22px;border:1px solid #d8e7e8;border-right:4px solid var(--teal);border-radius:18px;color:var(--ink);background:linear-gradient(135deg,#fff,#edf8f7);box-shadow:0 8px 28px #164e630d}.home-clinic{gap:14px}.home-clinic img,.home-clinic-mark{width:56px;height:56px;border:1px solid #d5e6e6;border-radius:15px;background:#fff;color:var(--teal);padding:8px}.home-clinic-mark .icon{width:30px}.home-clinic h1{margin:0;font-size:clamp(20px,2vw,25px);color:var(--ink)}.home-clinic p{margin:0;color:var(--teal);font-size:12px;font-weight:700}.home-clinic small{margin:2px 0 0;color:var(--muted);font-size:12px}.home-today{min-width:105px;padding:7px 15px;border:1px solid #d4e5e5;border-radius:14px;background:#fff;color:var(--ink)}.home-today strong{font-size:24px;color:var(--teal)}.home-today span{font-size:11px;color:var(--muted)}.home-search-card{margin-top:20px}@media(max-width:700px){.topbar{display:flex;padding:10px 16px;min-height:68px}.topbar>div:first-child{display:block}.topbar>div:first-child small{display:none}.mode-switch{width:auto}.account-button{min-width:0;padding:7px}.account-button>span:nth-child(2),.account-button>.icon{display:none}.local-save{font-size:11px}.account-menu{grid-template-columns:1fr}.account-menu .account-logout{grid-column:auto}.sidebar .brand strong{max-width:none}.home-hero{padding:15px}.home-clinic img,.home-clinic-mark{width:50px;height:50px}.home-clinic small{display:block}.home-today{min-width:auto}}@media(max-width:500px){.topbar>div:first-child strong{font-size:14px}.local-save{display:none}.home-hero{gap:13px}.home-clinic{align-items:flex-start}.home-clinic small{font-size:11px}.home-today{align-self:stretch;justify-content:center}}
.account-system{border:1px solid #d8e6e6;border-radius:14px;background:#f7fbfb;padding:13px 14px;margin:0 0 16px}.account-system-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:11px}.account-system-head>div{display:grid}.account-system-head span,.account-system-grid span{font-size:11px;color:var(--muted)}.account-system-head strong{font-size:14px}.account-system-head em{font-style:normal;font-size:11px;font-weight:700;border-radius:999px;padding:5px 9px}.system-good{color:#1d7154;background:#dff2e9}.system-warn{color:#8a5b13;background:#fff0d0}.account-system-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px 14px}.account-system-grid>div{display:grid;min-width:0}.account-system-grid code{font-family:ui-monospace,Consolas,monospace;font-size:10px;color:#3f5f64;direction:ltr;text-align:left;overflow-wrap:anywhere;white-space:normal}.account-system-grid strong{font-size:12px}.system-note{font-size:11px;color:#8a5b13;margin:10px 0 0}.account-system+.account-menu{margin-top:0}@media(max-width:700px){.account-system-grid{grid-template-columns:1fr}.account-system-head{align-items:flex-start}}

/* AVIN product identity. Clinic-specific branding remains in the home screen and print documents. */
:root{--teal:#0a7274;--dark:#214c55;--accent:#e5f6f2}
.avin-brand-mark{background:#f7fbfa;border-color:#88aaa9;overflow:hidden;padding:3px}
.avin-brand-mark img{display:block;width:100%;height:100%;object-fit:contain}
.avin-side-name{min-width:0}
.avin-side-name strong{font-family:Arial,sans-serif;font-size:20px!important;line-height:1.05!important;letter-spacing:2.3px;max-width:none!important;overflow:visible!important}
.avin-side-name small{display:block;margin-top:5px;color:#c3dfde!important}
.avin-auth-brand{display:grid;justify-items:center;gap:4px;margin:0 auto 24px;text-align:center}
.avin-auth-brand img{display:block;width:min(310px,76vw);height:auto}
.avin-auth-brand p{margin:0;color:var(--muted);font-size:14px}
.local-auth>.card{box-shadow:0 18px 55px rgba(33,76,85,.11)}
@media(max-width:700px){.avin-side-name small{display:none}.avin-side-name strong{font-size:18px!important}.avin-brand-mark{width:42px!important;height:42px!important}.avin-auth-brand{margin-bottom:18px}.avin-auth-brand img{width:min(245px,72vw)}}
.online-update-box{margin-top:18px;padding:15px;border:1px solid #c7dcde;border-radius:15px;background:#f5fafa}.online-update-box .section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.online-update-box small{display:block;color:#6b7f82;margin-top:3px}.online-update-ready{padding:13px;border-radius:12px;background:#e7f5f1;border:1px solid #b6ddd2}.online-update-ready p{margin:4px 0}
/* AVIN 0.38.5: clear inner navigation, focused dashboard, optional setup. */
[hidden]{display:none!important}
.tabs{display:flex;align-items:center;gap:5px;width:max-content;max-width:100%;padding:5px;margin:22px 0 24px;border:1px solid #d7e5e6;border-radius:13px;background:#edf3f4;overflow-x:auto;box-shadow:0 2px 7px #183f4708}
.tabs button{flex:none;min-height:39px;padding:8px 16px;border:1px solid transparent;border-radius:9px;color:#506971;font-size:13px;font-weight:650;line-height:1.3;transition:background .15s,color .15s,box-shadow .15s}
.tabs button:hover{color:#075f64;background:#ffffffae}
.tabs button.active,.tabs button[aria-selected="true"]{color:#075a60;background:#fff;border-color:#d5e5e5;box-shadow:0 2px 7px #12474d18;font-weight:800}
.tabs button:focus-visible,.feature-toggle:focus-visible,.nav-btn:focus-visible{outline:3px solid #64bbad;outline-offset:2px}
.sidebar nav [data-page="settings"]{margin-top:14px;border-top:1px solid #ffffff36;border-radius:0 0 10px 10px;padding-top:18px}
.home-shell{max-width:1170px}.home-hero{border:1px solid #d4e8e5;border-right:4px solid #0c7778;background:linear-gradient(118deg,#fff 0%,#eff9f7 75%,#e4f3ee 100%);box-shadow:0 12px 33px #0d505b0d}
.home-hero:before{content:none}.home-search-box:focus-within{border-color:#26958b;box-shadow:0 0 0 3px #35ac9b24}
.home-overview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:17px}.home-overview>div{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:13px 17px;border:1px solid #e0e9ec;background:white;border-radius:14px}.home-overview span{font-size:12px;color:var(--muted)}.home-overview strong{font-size:19px;color:#135962;white-space:nowrap}
.home-onboarding{display:flex;align-items:center;gap:16px;padding:17px 20px;margin-top:17px;border:1px solid #cce6dc;border-radius:16px;background:#f2faf5}.home-onboarding-icon{width:42px;height:42px;display:grid;place-items:center;flex:none;border-radius:12px;background:#d9f2e8;color:#106b56}.home-onboarding>div:nth-child(2){flex:1}.home-onboarding strong{font-size:15px}.home-onboarding p{margin:2px 0 0;color:var(--muted);font-size:12px}.home-onboarding-actions{display:flex;gap:10px;align-items:center}.home-onboarding .btn{white-space:nowrap;min-height:38px;padding:6px 13px}
.settings-page{max-width:1050px}.settings-tabs{margin-bottom:20px}.feature-card{padding:8px 24px}.feature-row{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:17px 0;border-bottom:1px solid #e4ecee}.feature-row:last-child{border:0}.feature-row strong,.feature-row small{display:block}.feature-row strong{font-size:15px}.feature-row small{font-size:12px;color:var(--muted);margin-top:3px}.feature-toggle{min-width:114px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 7px 6px 11px;border:1px solid #d1dedf;border-radius:30px;background:#f1f5f5;color:#566e71;font-weight:700;font-size:12px}.feature-toggle i{width:24px;height:24px;border-radius:50%;background:#b9cbce}.feature-toggle.is-on{background:#e5f6f1;color:#126958;border-color:#95d4c5}.feature-toggle.is-on i{background:#148773}.feature-note{margin:8px 0 14px;font-size:12px}.feature-future{margin-top:18px;padding:16px 23px}.feature-future h2{margin:0 0 3px;font-size:16px}.feature-future p{margin:0;font-size:12px}
@media(max-width:700px){.tabs{width:100%;margin:17px 0;padding:4px}.tabs button{padding:8px 12px;min-height:38px}.home-overview{grid-template-columns:1fr 1fr}.home-overview>div:last-child{grid-column:1/-1}.home-onboarding{align-items:flex-start;flex-wrap:wrap}.home-onboarding-actions{width:100%;justify-content:flex-start}.feature-card{padding:4px 16px}.feature-toggle{min-width:95px}}
