/* Softodont - personalizzazioni sopra Bootstrap 5 */
:root{--bs-primary:#0e7490;--bs-primary-rgb:14,116,144;--bs-body-color:#1f2937;
--bs-link-color:#155e75;--bs-link-color-rgb:21,94,117;--bs-link-hover-color:#0e7490;--bs-link-hover-color-rgb:14,116,144;--bs-link-decoration:none}
body{background:#f3f5f7}
a{text-decoration:none}a:hover{text-decoration:underline}
.table a,.card a:not(.btn){color:#1f2937;font-weight:500;border-bottom:1px solid #cbd5e1}.table a:hover,.card a:not(.btn):hover{color:#0e7490;border-bottom-color:#0e7490;text-decoration:none}
.card-footer a,.form-text a,.text-muted a{color:#155e75;border-bottom:0;font-weight:400}.card-footer a:hover{text-decoration:underline}
.card .agenda-week a{border-bottom:0;font-weight:600}.card .app{color:#164e63;font-weight:400}.card .app:hover{color:#164e63}.card .agenda-week .hd a{color:#1f2937}
.page-link{color:#155e75}.page-item.active .page-link{background:#0e7490;border-color:#0e7490}
.btn-primary{--bs-btn-bg:#0e7490;--bs-btn-border-color:#0e7490;--bs-btn-hover-bg:#155e75;--bs-btn-hover-border-color:#155e75;--bs-btn-active-bg:#155e75;--bs-btn-active-border-color:#155e75}
.btn-outline-primary{--bs-btn-color:#0e7490;--bs-btn-border-color:#0e7490;--bs-btn-hover-bg:#0e7490;--bs-btn-hover-border-color:#0e7490;--bs-btn-active-bg:#0e7490;--bs-btn-active-border-color:#0e7490}
/* navbar */
.topnav{background:#155e75;min-height:56px}
.topnav .navbar-brand{font-weight:700;letter-spacing:.5px;font-size:1.25rem}
.topnav .navbar-nav .nav-link{color:#cfe8ee;padding:.5rem .7rem;border-radius:.375rem;display:flex;align-items:center;gap:.4rem;line-height:1.2}
.topnav .navbar-nav .nav-link .bi{font-size:1.05rem;line-height:1}
.topnav .navbar-nav .nav-link:hover{color:#fff;background:rgba(255,255,255,.08)}
.topnav .navbar-nav .nav-link.active{color:#fff;font-weight:600;background:rgba(255,255,255,.14)}
.topnav .avatar{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;background:#67e8f9;color:#0c3d4c;font-weight:700;font-size:.8rem}
@media (min-width:992px) and (max-width:1399.98px){.topnav .navbar-nav .nav-link{padding:.5rem .5rem;font-size:.9rem}.topnav .navbar-nav .nav-link .bi{display:none}}
@media (max-width:991.98px){.topnav .navbar-nav .nav-link{padding:.6rem .75rem}}
.nav-tabs .nav-link{color:#475569}.nav-tabs .nav-link.active{color:#0e7490;font-weight:600}
.table>thead th{font-size:.75rem;text-transform:uppercase;letter-spacing:.3px;color:#475569;background:#f8fafc}
.table td.actions{white-space:nowrap;text-align:right}
.num{text-align:right;font-variant-numeric:tabular-nums}
.stat .n{font-size:1.75rem;font-weight:700;color:#155e75}.stat .l{color:#6c757d;font-size:.75rem;text-transform:uppercase}
.kv dt{color:#6c757d;font-weight:500}
input.num{text-align:right}
/* agenda: griglia oraria */
.ag-grid{display:grid;grid-template-columns:56px repeat(6,1fr);border:1px solid #dee2e6;border-radius:.5rem;background:#fff;overflow:hidden;font-size:12px}
.ag-corner,.ag-head{background:#f8fafc;border-bottom:1px solid #dee2e6;padding:8px 6px;text-align:center;font-weight:600}
.ag-head{border-left:1px solid #dee2e6;min-width:0}.ag-head.today{background:#ecfeff;color:#155e75}.ag-head a{color:inherit}
.ag-times{position:relative;height:calc(var(--slots) * var(--slot-h))}
.ag-hour{position:absolute;right:6px;transform:translateY(-50%);color:#6c757d;font-size:11px;background:#fff;padding:0 2px}
.ag-day{position:relative;border-left:1px solid #dee2e6;cursor:cell;background:repeating-linear-gradient(to bottom,#fff 0,#fff calc(var(--slot-h) * 4 - 1px),#dee2e6 calc(var(--slot-h) * 4 - 1px),#dee2e6 calc(var(--slot-h) * 4))}
.ag-day.today{background:repeating-linear-gradient(to bottom,#f7feff 0,#f7feff calc(var(--slot-h) * 4 - 1px),#dee2e6 calc(var(--slot-h) * 4 - 1px),#dee2e6 calc(var(--slot-h) * 4))}
.ag-day:hover{background-color:#f0fdfa}
.ag-app{position:absolute;display:flex;flex-direction:column;gap:0;padding:2px 5px;border-radius:4px;border-left:3px solid #0e7490;background:#cffafe;color:#164e63;overflow:hidden;line-height:1.25;text-decoration:none;box-shadow:0 1px 2px rgba(0,0,0,.08);cursor:pointer}
.ag-app:hover{filter:brightness(.95);color:#164e63;z-index:2}
.ag-app.presente .ag-nome{font-weight:700}.ag-app.personale{background:#fef3c7;border-left-color:#b45309;color:#78350f}
.ag-ora{font-size:10px;opacity:.8;white-space:nowrap}.ag-nome{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ag-med{font-size:10px;opacity:.85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ag-nota{font-size:10px;opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.legend i:not(.bi){display:inline-block;width:14px;height:12px;border-radius:3px;margin-right:4px;vertical-align:middle}
@media (min-width:768px){.d-md-grid{display:grid!important}}
@media (max-width:991.98px){.ag-grid{font-size:11px}.ag-med{display:none}}
/* agenda: indisponibilità */
.ag-block{position:absolute;left:0;right:0;z-index:0;background:repeating-linear-gradient(135deg,#e2e8f0 0,#e2e8f0 6px,#f1f5f9 6px,#f1f5f9 12px);color:#475569;font-size:10px;padding:2px 5px;text-decoration:none;border-top:1px dashed #94a3b8;border-bottom:1px dashed #94a3b8;overflow:hidden;cursor:pointer}
.ag-block span{position:sticky;top:0;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card a.ag-block{border-bottom:1px dashed #94a3b8;color:#475569;font-weight:500}.ag-block:hover{filter:brightness(.97)}
.ag-head-indisp{display:flex;flex-wrap:wrap;gap:3px;justify-content:center;margin-top:4px}
.card a.ag-indisp-badge{display:inline-block;font-size:10px;font-weight:600;line-height:1.2;padding:1px 5px;border:1px solid;border-radius:999px;background:#fff;white-space:nowrap;border-bottom:1px solid}
.card a.ag-indisp-badge:hover{filter:brightness(.9);text-decoration:none}
.ag-app{z-index:1}
.card a.ag-list-block{display:block;padding:6px 10px;border-left:4px solid #94a3b8;background:repeating-linear-gradient(135deg,#f1f5f9 0,#f1f5f9 6px,#f8fafc 6px,#f8fafc 12px);color:#475569;font-size:.85rem;border-bottom:1px solid #f1f5f9;font-weight:500}
/* agenda: chip giorni della settimana */
.ag-days{display:flex;gap:6px;overflow-x:auto;padding:2px 0 8px;margin-bottom:6px;-webkit-overflow-scrolling:touch;scrollbar-width:none}.ag-days::-webkit-scrollbar{display:none}
.ag-day-chip{flex:0 0 auto;padding:5px 11px;border:1px solid #dee2e6;border-radius:999px;background:#fff;color:#475569;font-size:.85rem;white-space:nowrap;text-decoration:none}
.ag-day-chip:hover{border-color:#0e7490;color:#0e7490;text-decoration:none}
.ag-day-chip.today{border-color:#67e8f9;background:#ecfeff;color:#155e75}
.ag-day-chip.active{background:#0e7490;border-color:#0e7490;color:#fff}
.card a.ag-day-chip{border-bottom:1px solid #dee2e6;font-weight:500}.card a.ag-day-chip.active{border-color:#0e7490}
/* agenda: elenco mobile */
.ag-list-col{border:1px solid #dee2e6;border-radius:.5rem;background:#fff;margin-bottom:12px;overflow:hidden}
.ag-list-col.today{border-color:#67e8f9}
.ag-list-head{background:#f8fafc;padding:8px 10px;border-bottom:1px solid #dee2e6;font-weight:600}.ag-list-col.today .ag-list-head{background:#ecfeff;color:#155e75}
.ag-list-item{display:flex;align-items:center;gap:8px;padding:6px 8px 6px 10px;border-left:4px solid #0e7490;border-bottom:1px solid #f1f5f9}
.card a.ag-list-main{display:flex;align-items:center;gap:10px;flex:1 1 auto;min-width:0;color:#1f2937;border-bottom:0;font-weight:400;text-decoration:none}
.ag-list-item:active,.ag-list-item:hover{background:#f8fafc}
.ag-list-item.personale{background:#fffbeb}
.ag-list-ora{font-variant-numeric:tabular-nums;font-weight:600;line-height:1.1;width:44px;flex:0 0 44px}.ag-list-ora small{font-weight:400;color:#6c757d}
@media (max-width:767.98px){.legend .ms-auto{margin-left:0!important}}
/* autocomplete */
.ac-wrap{position:relative}.ac-list{position:absolute;top:100%;left:0;right:0;background:#fff;border:1px solid #dee2e6;border-radius:0 0 .375rem .375rem;box-shadow:0 6px 20px rgba(0,0,0,.08);z-index:1050;max-height:260px;overflow:auto}
.ac-list div{padding:8px 10px;cursor:pointer}.ac-list div:hover,.ac-list div.sel{background:#ecfeff}
/* login */
.login-page{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#155e75,#0e7490)}
@media print{.navbar,.no-print,.btn{display:none!important}.card{border:0!important}}
/* sidebar layout */
.layout-sidebar .app-shell{display:flex;min-height:100vh}
.layout-sidebar .app-main{flex:1 1 auto;min-width:0}
.sidebar{background:#155e75!important;color:#cfe8ee;width:240px;flex:0 0 240px;--bs-offcanvas-bg:#155e75;--bs-offcanvas-color:#cfe8ee;--bs-offcanvas-width:260px;border:0!important}
@media (min-width:992px){.sidebar{position:sticky;top:0;height:100vh;overflow-y:auto;display:flex!important;flex-direction:column;visibility:visible!important}}
@media (max-width:991.98px){.sidebar{width:260px}}
.sidebar-brand{padding:14px 16px;border-bottom:1px solid rgba(255,255,255,.12)}
.sidebar-brand .navbar-brand{font-weight:700;letter-spacing:.5px;font-size:1.25rem;margin:0}
.sidebar-nav{padding:10px 10px;flex:1 1 auto}
.side-link{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:.375rem;color:#cfe8ee;text-decoration:none;font-size:.95rem;margin-bottom:2px}
.side-link .bi{font-size:1.1rem;width:20px;text-align:center}
.side-link:hover{color:#fff;background:rgba(255,255,255,.08);text-decoration:none}
.side-link.active{color:#fff;background:rgba(255,255,255,.16);font-weight:600}
.side-head{font-size:.7rem;text-transform:uppercase;letter-spacing:.6px;color:#8fc7d1;padding:14px 12px 6px}
.sidebar-user{display:flex;align-items:center;gap:10px;padding:12px 16px;border-top:1px solid rgba(255,255,255,.12)}
.sidebar .avatar{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;background:#67e8f9;color:#0c3d4c;font-weight:700;font-size:.8rem;flex:0 0 32px}
.topbar-mobile{background:#155e75;padding:10px 16px;display:flex;align-items:center;position:sticky;top:0;z-index:1020}
/* pagina impostazioni: anteprime layout */
.layout-choice{cursor:pointer;border-width:2px}
.layout-preview{height:90px;border:1px solid #dee2e6;border-radius:6px;overflow:hidden;background:#f3f5f7}
.lp-top{height:16px;background:#155e75}.lp-side{width:34px;background:#155e75}
.lp-body{padding:8px;display:flex;gap:8px}.lp-card{flex:1;height:50px;background:#fff;border:1px solid #dee2e6;border-radius:4px}

/* Incassi: lista giorni compatta; sotto md sta sopra la tabella con altezza limitata */
.incassi-lista .list-group-item{padding:.45rem .9rem;line-height:1.25}
@media (max-width:767.98px){.incassi-giorni .incassi-lista{max-height:40vh;overflow-y:auto}}
/* odontogramma */
.odo-wrap{position:relative}
.odo-svg{width:100%;height:auto;max-height:78vh;display:block;background:#fff;border-radius:.5rem}
.odo-label{font-size:11px;font-weight:600;fill:#8b7d66;letter-spacing:1px}
.dente{cursor:pointer;outline:none}
.dente .numero{font-size:11px;font-weight:600;fill:#475569;pointer-events:none}
.dente:hover .corpo,.dente:focus .corpo{stroke:#0e7490;stroke-width:2.2}
.dente.selezionato .corpo{stroke:#0e7490;stroke-width:2.6}
.odo-wrap[data-editabile="0"] .dente{cursor:default}
.m-carie,.m-otturazione,.m-devitalizzato,.m-impianto,.m-da_estrarre,.m-parodonto,.m-nota,.m-lavoro{display:none}
.con-lavoro .m-lavoro{display:block;fill:#f59e0b;stroke:#7c2d12;stroke-width:1}
.stato-carie .m-carie{display:block;fill:#4a2c12}
.stato-otturazione .m-otturazione{display:block;fill:#8a97a8;stroke:#5f6b7a;stroke-width:.8}
.stato-devitalizzato .m-devitalizzato{display:block;fill:none;stroke:#c2410c;stroke-width:1.5}.stato-devitalizzato .m-devitalizzato .pieno{fill:#c2410c}
.stato-corona .corpo{fill:url(#odo-oro)}
.stato-ponte .corpo{fill:url(#odo-oro);stroke:#7a5a10;stroke-width:2}
.stato-impianto .corpo{fill:url(#odo-metallo)}.stato-impianto .m-impianto{display:block;fill:none;stroke:#374151;stroke-width:1.3}
.stato-assente .corpo{fill:#fff;fill-opacity:.35;stroke-dasharray:4 3;stroke:#9ca3af;filter:none}.stato-assente .solchi{display:none}
.stato-radice .corpo{fill:#c9a27a}.stato-radice .solchi{display:none}
.stato-da_estrarre .m-da_estrarre{display:block;fill:none;stroke:#dc2626;stroke-width:3;stroke-linecap:round}
.stato-mobile .corpo{fill:url(#odo-tratt)}
.stato-parodonto .m-parodonto{display:block;fill:none;stroke:#a855f7;stroke-width:2.5;stroke-linecap:round}
.con-nota .m-nota{display:block;fill:#0e7490;stroke:#fff;stroke-width:1.5}
.odo-ponti line{stroke-linecap:round;pointer-events:none}
.odo-palette .btn{--bs-btn-padding-y:.25rem;--bs-btn-padding-x:.6rem;font-size:.8rem}
.odo-palette .btn i.sw{display:inline-block;width:11px;height:11px;border-radius:3px;border:1px solid rgba(0,0,0,.25);vertical-align:-1px;margin-right:4px}
.odo-palette .btn.active{box-shadow:0 0 0 2px #0e749055}
.odo-riassunto{font-size:.85rem}
@media (max-width:767.98px){.odo-svg{max-height:none}}

/* Pulsante "Esporta XML" (fatture): viola richiesto dall'utente */
.btn-outline-xml { --bs-btn-color: #820582; --bs-btn-border-color: #820582; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #820582; --bs-btn-hover-border-color: #820582; --bs-btn-active-color: #fff; --bs-btn-active-bg: #6b046b; --bs-btn-active-border-color: #6b046b; --bs-btn-focus-shadow-rgb: 130, 5, 130; }
