:root{
  --bg:#f4f7fb; --card:#fff; --primary:#0c63e4; --primary2:#0b4fb4;
  --text:#172033; --muted:#6b7280; --border:#dde4ee; --success:#16a34a;
  --warning:#f59e0b; --danger:#dc2626; --shadow:0 10px 30px rgba(18,38,63,.08);
}
*{box-sizing:border-box}
body{margin:0;font-family:Inter,Arial,sans-serif;background:var(--bg);color:var(--text)}
.app{display:grid;grid-template-columns:245px 1fr;min-height:100vh}
.sidebar{background:linear-gradient(180deg,#102a56,#0a1d3d);color:#fff;padding:24px 18px;position:sticky;top:0;height:100vh}
.brand{font-size:24px;font-weight:800;margin-bottom:8px}.brand small{display:block;font-size:12px;font-weight:500;opacity:.72;margin-top:5px}
.nav{margin-top:28px;display:grid;gap:10px}.nav button{border:0;background:transparent;color:#dbeafe;text-align:left;padding:13px 14px;border-radius:12px;font-weight:700;cursor:pointer}
.nav button.active,.nav button:hover{background:rgba(255,255,255,.12);color:#fff}
.main{padding:28px;min-width:0}
.topbar{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:22px}
h1{margin:0;font-size:28px}.subtitle{color:var(--muted);margin-top:6px}
.actions{display:flex;gap:10px;flex-wrap:wrap}
.btn{border:0;border-radius:10px;padding:11px 15px;font-weight:750;cursor:pointer}
.btn-primary{background:var(--primary);color:#fff}.btn-primary:hover{background:var(--primary2)}
.btn-light{background:#fff;color:var(--text);border:1px solid var(--border)}
.btn-danger{background:#fee2e2;color:#991b1b}
.grid{display:grid;gap:18px}
.stats{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:20px}
.card{background:var(--card);border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow)}
.stat{padding:20px}.stat .label{color:var(--muted);font-weight:700;font-size:13px}.stat .value{font-size:34px;font-weight:900;margin:10px 0 6px}.stat .mini{font-size:13px;color:var(--muted)}
.category{padding:20px}.category h3{margin:0 0 15px}.category-grid{grid-template-columns:repeat(4,1fr)}
.metric{background:#f8fafc;border:1px solid var(--border);border-radius:13px;padding:15px}.metric b{display:block;font-size:25px;margin-top:7px}.progress{height:10px;background:#e5e7eb;border-radius:999px;overflow:hidden;margin-top:12px}.progress>span{display:block;height:100%;background:linear-gradient(90deg,#16a34a,#22c55e)}
.section{display:none}.section.active{display:block}
.panel{padding:20px}.panel h2{margin-top:0}
.form-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:15px}
.field{display:grid;gap:7px}.field.full{grid-column:1/-1}
label{font-size:13px;font-weight:800;color:#334155}
input,select,textarea{width:100%;padding:11px 12px;border:1px solid var(--border);border-radius:10px;background:#fff;font:inherit}
textarea{min-height:90px;resize:vertical}
.form-actions{display:flex;gap:10px;margin-top:18px;flex-wrap:wrap}
.filters{display:grid;grid-template-columns:2fr repeat(4,1fr);gap:10px;margin-bottom:15px}
.table-wrap{overflow:auto;border:1px solid var(--border);border-radius:14px}
table{width:100%;border-collapse:collapse;min-width:980px;background:#fff}
th,td{padding:12px 13px;border-bottom:1px solid #edf1f5;text-align:left;font-size:13px}
th{background:#f8fafc;color:#475569;position:sticky;top:0}
.badge{display:inline-block;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:800}
.badge.rep{background:#dcfce7;color:#166534}.badge.sost{background:#fef3c7;color:#92400e}
.badge.done{background:#dbeafe;color:#1d4ed8}.badge.cancel{background:#fee2e2;color:#991b1b}
.icon-btn{border:1px solid var(--border);background:#fff;border-radius:8px;padding:7px 9px;cursor:pointer;margin-right:4px}
.empty{text-align:center;padding:34px;color:var(--muted)}
.footer-note{color:var(--muted);font-size:12px;margin-top:16px}
@media(max-width:1100px){.stats{grid-template-columns:repeat(2,1fr)}.category-grid{grid-template-columns:repeat(2,1fr)}.form-grid{grid-template-columns:repeat(2,1fr)}.filters{grid-template-columns:repeat(2,1fr)}}
@media(max-width:760px){
 .app{display:block}.sidebar{height:auto;position:static;padding:17px}.nav{grid-template-columns:repeat(4,1fr);margin-top:14px}.nav button{text-align:center;padding:10px 6px;font-size:12px}
 .main{padding:16px}.topbar{align-items:flex-start;flex-direction:column}.stats,.category-grid,.form-grid,.filters{grid-template-columns:1fr}.field.full{grid-column:auto}h1{font-size:24px}
}

/* Professional dashboard overrides */
:root{
  --bg:#eef3f8;
  --card:#ffffff;
  --primary:#0f4c81;
  --primary2:#12395d;
  --text:#162033;
  --muted:#6b778c;
  --border:#dce5ee;
  --success:#1f9d63;
  --warning:#f0a528;
  --danger:#d84a4a;
  --shadow:0 14px 35px rgba(22,32,51,.08);
}
body{
  background:
    radial-gradient(circle at top right, rgba(15,76,129,.07), transparent 28%),
    var(--bg);
}
.sidebar{
  background:linear-gradient(180deg,#0c2845 0%,#0f3d67 58%,#102b49 100%);
  box-shadow:8px 0 28px rgba(11,35,58,.10);
}
.brand{
  letter-spacing:-.3px;
}
.brand::before{display:none !important;content:none !important}
.main{
  max-width:1600px;
  width:100%;
  margin:0 auto;
}
.topbar{
  background:rgba(255,255,255,.76);
  backdrop-filter:blur(16px);
  border:1px solid rgba(220,229,238,.9);
  border-radius:18px;
  padding:18px 20px;
  box-shadow:0 10px 28px rgba(22,32,51,.05);
}
h1{
  letter-spacing:-.6px;
}
.card{
  box-shadow:var(--shadow);
}
.stats{
  grid-template-columns:repeat(4,minmax(0,1fr));
}
.stat{
  position:relative;
  overflow:hidden;
  min-height:155px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.stat::after{
  content:"";
  position:absolute;
  right:-28px;
  bottom:-42px;
  width:120px;
  height:120px;
  border-radius:50%;
  background:rgba(15,76,129,.06);
}
.stat .label{
  text-transform:uppercase;
  letter-spacing:.8px;
  font-size:11px;
}
.stat .value{
  font-size:38px;
  letter-spacing:-1.4px;
}
.dashboard-summary{
  display:grid;
  grid-template-columns:1.15fr .85fr;
  gap:18px;
  margin-bottom:20px;
}
.hero-card{
  padding:24px;
  background:linear-gradient(135deg,#0f4c81 0%,#1766a5 58%,#2f86c9 100%);
  color:#fff;
  border:none;
  position:relative;
  overflow:hidden;
}
.hero-card::after{
  content:"";
  position:absolute;
  width:260px;
  height:260px;
  border-radius:50%;
  right:-90px;
  top:-120px;
  background:rgba(255,255,255,.11);
}
.hero-card h2{
  margin:0 0 8px;
  font-size:24px;
}
.hero-card p{
  margin:0;
  opacity:.86;
}
.hero-kpis{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  margin-top:24px;
}
.hero-kpi{
  background:rgba(255,255,255,.13);
  border:1px solid rgba(255,255,255,.17);
  border-radius:14px;
  padding:15px;
}
.hero-kpi span{
  display:block;
  font-size:11px;
  opacity:.8;
  text-transform:uppercase;
  letter-spacing:.7px;
}
.hero-kpi b{
  display:block;
  font-size:26px;
  margin-top:6px;
}
.info-card{
  padding:22px;
}
.info-card h3{
  margin:0 0 14px;
}
.formula-box{
  padding:15px;
  border-radius:13px;
  background:#f4f8fc;
  border:1px solid #dfe9f2;
  color:#28415c;
  font-weight:700;
}
.formula-box small{
  display:block;
  margin-top:7px;
  color:var(--muted);
  font-weight:500;
}
.category{
  padding:0;
  overflow:hidden;
}
.category-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:18px 20px;
  border-bottom:1px solid var(--border);
  background:linear-gradient(180deg,#ffffff,#f9fbfd);
}
.category-head h3{
  margin:0;
  font-size:18px;
}
.category-tag{
  padding:7px 10px;
  border-radius:999px;
  background:#e7f1fa;
  color:#0f4c81;
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.6px;
}
.category-body{
  padding:20px;
}
.category-grid{
  grid-template-columns:repeat(4,1fr);
}
.metric{
  min-height:112px;
  background:linear-gradient(180deg,#fbfdff,#f4f8fb);
  border:1px solid #dfe7ef;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.metric span{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.65px;
  color:#6f7c90;
  font-weight:800;
}
.metric b{
  font-size:30px;
  letter-spacing:-1px;
}
.metric.primary-metric{
  background:linear-gradient(135deg,#edf7f2,#f8fffb);
  border-color:#cce9db;
}
.metric.warning-metric{
  background:linear-gradient(135deg,#fff8e8,#fffdf7);
  border-color:#f0dfb6;
}
.metric.percent-metric{
  background:linear-gradient(135deg,#eef5fb,#f8fbff);
  border-color:#d5e5f3;
}
.progress{
  height:8px;
  margin-top:10px;
}
.dashboard-section-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:6px 0 12px;
}
.dashboard-section-title h2{
  margin:0;
  font-size:19px;
}
.dashboard-section-title span{
  color:var(--muted);
  font-size:13px;
}
@media(max-width:1100px){
  .dashboard-summary{grid-template-columns:1fr}
}
@media(max-width:760px){
  .hero-kpis{grid-template-columns:1fr}
  .category-head{align-items:flex-start;flex-direction:column}
}


.percentage-cards{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
  margin-bottom:20px;
}
.percentage-card{
  padding:22px;
  position:relative;
  overflow:hidden;
}
.percentage-card::after{
  content:"";
  position:absolute;
  width:120px;
  height:120px;
  border-radius:50%;
  right:-35px;
  bottom:-50px;
  background:rgba(15,76,129,.06);
}
.percentage-card .pc-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}
.percentage-card .pc-label{
  text-transform:uppercase;
  letter-spacing:.75px;
  color:var(--muted);
  font-size:11px;
  font-weight:850;
}
.percentage-card .pc-icon{
  width:40px;
  height:40px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background:#edf5fb;
  color:#0f4c81;
  font-weight:900;
}
.percentage-card .pc-value{
  font-size:40px;
  line-height:1;
  letter-spacing:-1.7px;
  font-weight:900;
  margin:18px 0 9px;
}
.percentage-card .pc-detail{
  color:var(--muted);
  font-size:13px;
}
.chart-card{
  padding:22px;
  margin-bottom:20px;
}
.chart-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:18px;
}
.chart-header h2{margin:0 0 5px;font-size:19px}
.chart-header p{margin:0;color:var(--muted);font-size:13px}
.chart-controls select{min-width:145px}
.chart-wrap{
  position:relative;
  height:360px;
  width:100%;
  border:1px solid #e2e9f0;
  border-radius:15px;
  background:linear-gradient(180deg,#fbfdff,#f7fafc);
  overflow:hidden;
}
#monthlyChart{width:100%;height:100%;display:block}
.chart-legend{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  margin-top:14px;
  color:#566579;
  font-size:12px;
  font-weight:750;
}
.legend-item{display:flex;align-items:center;gap:7px}
.legend-dot{width:10px;height:10px;border-radius:50%}
.legend-unipol{background:#0f4c81}
.legend-rental{background:#1f9d63}
.legend-private{background:#f0a528}
@media(max-width:900px){.percentage-cards{grid-template-columns:1fr}.chart-wrap{height:300px}}


/* Mobile and layout repair */
html,body{max-width:100%;overflow-x:hidden}
.main{min-width:0;overflow-x:hidden}
.mobile-hero{margin-bottom:22px}
.category-list{grid-template-columns:1fr}
.category{width:100%;min-width:0}
.category-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.stat,.metric{min-width:0}
.stat .value,.metric b{overflow-wrap:anywhere}
.chart-card{min-width:0}
.chart-header{flex-wrap:wrap}
.chart-controls{width:auto}
.chart-controls select{max-width:100%}

@media(max-width:900px){
  .app{display:block}
  .sidebar{
    position:static;
    height:auto;
    padding:14px;
  }
  .brand{font-size:20px}
  .brand small{display:none}
  .nav{
    display:flex;
    gap:8px;
    overflow-x:auto;
    margin-top:12px;
    padding-bottom:2px;
  }
  .nav button{
    flex:0 0 auto;
    white-space:nowrap;
    text-align:center;
    padding:10px 12px;
  }
  .main{padding:14px}
  .topbar{
    padding:16px;
    border-radius:15px;
    flex-direction:column;
    align-items:stretch;
  }
  .topbar .actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    width:100%;
  }
  .topbar .btn{width:100%}
  .hero-card{padding:20px;border-radius:16px}
  .hero-kpis{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  .hero-kpi{padding:12px 9px;min-width:0}
  .hero-kpi span{font-size:9px;line-height:1.25}
  .hero-kpi b{font-size:22px}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .stat{min-height:135px;padding:16px}
  .stat .label{font-size:10px;line-height:1.3}
  .stat .value{font-size:31px}
  .category-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .category-head{padding:16px}
  .category-body{padding:14px}
  .metric{min-height:100px;padding:13px}
  .metric span{font-size:10px;line-height:1.25}
  .metric b{font-size:26px}
  .dashboard-section-title{
    align-items:flex-start;
    gap:5px;
    flex-direction:column;
    margin-top:20px;
  }
  .dashboard-section-title h2{font-size:18px}
  .chart-card{padding:15px}
  .chart-header{flex-direction:column}
  .chart-controls,.chart-controls select{width:100%}
  .chart-wrap{height:280px}
}

@media(max-width:480px){
  .main{padding:10px}
  h1{font-size:22px}
  .subtitle{font-size:13px}
  .topbar .actions{grid-template-columns:1fr}
  .hero-kpis{grid-template-columns:1fr}
  .hero-kpi{
    display:flex;
    align-items:center;
    justify-content:space-between;
  }
  .hero-kpi b{margin-top:0}
  .stats{grid-template-columns:1fr 1fr}
  .stat{min-height:120px;padding:14px}
  .stat .value{font-size:29px;margin:8px 0}
  .stat .mini{font-size:11px;line-height:1.35}
  .category-grid{grid-template-columns:1fr 1fr}
  .metric{min-height:92px}
  .category-tag{font-size:9px}
  .chart-wrap{height:245px}
  .chart-legend{gap:10px;font-size:11px}
}


.simplified-form{
  grid-template-columns:repeat(2,minmax(0,1fr));
  max-width:950px;
}
.simplified-form .field{
  min-width:0;
}
@media(max-width:760px){
  .simplified-form{grid-template-columns:1fr}
}


.substitution-progress > span{
  background:linear-gradient(90deg,#f0a528,#f5bd52);
}


.threshold-message{
  margin-top:12px;
  padding:11px 12px;
  border-radius:11px;
  border:1px solid transparent;
  line-height:1.3;
}
.threshold-message strong{
  display:block;
  font-size:12px;
  margin-bottom:4px;
}
.threshold-message small{
  display:block;
  font-size:10px;
  color:inherit;
  opacity:.88;
}
.threshold-message.warning{
  background:#fff3e6;
  border-color:#f2c48a;
  color:#9a4d00;
}
.threshold-message.ok{
  background:#eaf8f0;
  border-color:#b9e2ca;
  color:#187347;
}
.threshold-message.neutral{
  background:#f2f5f8;
  border-color:#dbe3ea;
  color:#667085;
}
.settings-divider{
  height:1px;
  background:var(--border);
  margin:26px 0;
}
.threshold-setting{
  display:flex;
  align-items:flex-end;
  gap:12px;
  max-width:430px;
}
.threshold-setting .field{
  flex:1;
}
.saved-message{
  margin-top:12px;
  padding:11px 13px;
  border-radius:10px;
  background:#eaf8f0;
  border:1px solid #b9e2ca;
  color:#187347;
  font-weight:700;
  font-size:13px;
}
@media(max-width:760px){
  .threshold-setting{
    align-items:stretch;
    flex-direction:column;
    max-width:none;
  }
  .threshold-setting .btn{width:100%}
  .threshold-message strong{font-size:11px}
}


.category-threshold{
  width:100%;
  margin-top:14px;
  padding:14px 16px;
}
.category-threshold strong{
  font-size:13px;
}
.category-threshold small{
  font-size:11px;
}
@media(max-width:760px){
  .category-threshold{
    margin-top:12px;
    padding:13px 14px;
  }
}


.topbar-right{
  display:flex;
  align-items:flex-end;
  gap:14px;
  flex-wrap:wrap;
}
.center-switcher{
  display:grid;
  gap:6px;
  min-width:230px;
}
.center-switcher label{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.7px;
  color:var(--muted);
  font-weight:850;
}
.center-switcher select{
  background:#fff;
  font-weight:750;
  border-color:#cfdbe7;
}
.center-create-row{
  display:flex;
  align-items:flex-end;
  gap:12px;
  max-width:650px;
}
.center-create-row .field{flex:1}
.centers-list{
  display:grid;
  gap:10px;
  margin-top:16px;
}
.center-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:14px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#f8fafc;
}
.center-row.active{
  background:#edf6fd;
  border-color:#b9d8ef;
}
.center-row strong{
  display:block;
  margin-bottom:4px;
}
.center-row small{
  color:var(--muted);
}
.center-row-actions{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}
.danger-action{
  color:#a11b1b;
  background:#fff5f5;
}
@media(max-width:900px){
  .topbar-right{
    width:100%;
    align-items:stretch;
    flex-direction:column;
  }
  .center-switcher{width:100%;min-width:0}
}
@media(max-width:760px){
  .center-create-row{
    flex-direction:column;
    align-items:stretch;
    max-width:none;
  }
  .center-row{
    align-items:flex-start;
    flex-direction:column;
  }
  .center-row-actions{
    width:100%;
  }
  .center-row-actions .icon-btn{
    flex:1;
  }
}


.center-info{
  flex:1;
  min-width:0;
}
.center-name-editor{
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.center-name-editor input{
  flex:1;
  min-width:180px;
  font-weight:750;
}
.save-name-btn{
  background:#eaf8f0;
  color:#187347;
  border-color:#b9e2ca;
}
.default-action{
  background:#eef5fb;
  color:#0f4c81;
  border-color:#c9deef;
}
.default-badge{
  display:inline-flex;
  align-items:center;
  padding:7px 10px;
  border-radius:999px;
  background:#eaf8f0;
  color:#187347;
  border:1px solid #b9e2ca;
  font-size:11px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.5px;
}
@media(max-width:760px){
  .center-name-editor{
    width:100%;
    align-items:stretch;
  }
  .center-name-editor input{
    width:100%;
    min-width:0;
  }
  .default-badge{
    justify-content:center;
    flex:1;
  }
}


.period-panel{
  padding:18px 20px;
  margin-bottom:20px;
}
.period-panel-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:15px;
  margin-bottom:15px;
}
.period-panel-head h2{margin:0 0 5px;font-size:18px}
.period-panel-head p{margin:0;color:var(--muted);font-size:13px}
.period-mode{
  display:flex;
  gap:4px;
  padding:4px;
  border-radius:12px;
  background:#edf2f7;
}
.period-mode-btn{
  border:0;
  background:transparent;
  color:#5f6f82;
  border-radius:9px;
  padding:9px 14px;
  font-weight:800;
  cursor:pointer;
}
.period-mode-btn.active{
  background:#fff;
  color:#0f4c81;
  box-shadow:0 3px 10px rgba(20,45,75,.10);
}
.period-controls{
  display:grid;
  grid-template-columns:180px 140px minmax(200px,1fr) auto;
  align-items:end;
  gap:12px;
}
.period-description{
  min-height:44px;
  display:flex;
  align-items:center;
  padding:10px 13px;
  border-radius:10px;
  background:#f5f8fb;
  border:1px solid var(--border);
  color:#44566c;
  font-weight:750;
  font-size:13px;
}
#annualPdfBtn{
  min-height:44px;
  align-items:center;
  justify-content:center;
}
@media(max-width:1000px){
  .period-controls{grid-template-columns:1fr 1fr}
  .period-description{grid-column:1/-1}
  #annualPdfBtn{grid-column:1/-1}
}
@media(max-width:600px){
  .period-panel{padding:15px}
  .period-panel-head{flex-direction:column}
  .period-mode{width:100%}
  .period-mode-btn{flex:1}
  .period-controls{grid-template-columns:1fr}
  .period-description,#annualPdfBtn{grid-column:auto}
}


.datetime-box{
  display:flex;
  align-items:center;
  gap:11px;
  min-width:245px;
  padding:10px 13px;
  border:1px solid #d8e3ed;
  border-radius:13px;
  background:linear-gradient(180deg,#ffffff,#f6f9fc);
  box-shadow:0 7px 20px rgba(22,32,51,.06);
}
.datetime-icon{
  flex:0 0 39px;
  width:39px;
  height:39px;
  display:grid;
  place-items:center;
  border-radius:11px;
  background:linear-gradient(135deg,#e5f1fb,#cfe5f6);
  color:#0f4c81;
  font-size:21px;
  font-weight:900;
}
.datetime-content{
  min-width:0;
  display:grid;
  gap:2px;
}
.datetime-label{
  color:#7a8797;
  font-size:9px;
  line-height:1;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.75px;
}
.datetime-content strong{
  display:block;
  color:#28384d;
  font-size:12px;
  line-height:1.25;
  text-transform:capitalize;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.datetime-content b{
  color:#0f4c81;
  font-size:18px;
  line-height:1.1;
  letter-spacing:.4px;
}
@media(max-width:1180px){
  .topbar-right{
    width:100%;
  }
  .datetime-box{
    flex:1 1 245px;
  }
}
@media(max-width:900px){
  .datetime-box{
    width:100%;
    min-width:0;
  }
}
@media(max-width:480px){
  .datetime-box{
    padding:11px 12px;
  }
  .datetime-content strong{
    white-space:normal;
    font-size:11px;
  }
  .datetime-content b{
    font-size:17px;
  }
}


/* Compact date/time box */
.datetime-box{
  min-width:220px;
  padding:8px 11px;
  gap:9px;
  align-self:flex-end;
}
.datetime-icon{
  flex:0 0 34px;
  width:34px;
  height:34px;
  border-radius:10px;
  font-size:18px;
}
.datetime-content{
  display:grid;
  grid-template-columns:1fr auto;
  grid-template-areas:
    "label label"
    "date time";
  column-gap:12px;
  row-gap:1px;
  align-items:center;
}
.datetime-label{grid-area:label}
.datetime-content strong{
  grid-area:date;
  font-size:11px;
}
.datetime-content b{
  grid-area:time;
  font-size:16px;
  white-space:nowrap;
}
@media(max-width:900px){
  .datetime-box{
    width:100%;
    min-height:0;
    padding:10px 12px;
  }
  .datetime-content{
    grid-template-columns:minmax(0,1fr) auto;
  }
}
@media(max-width:480px){
  .datetime-box{
    min-height:58px;
    padding:9px 11px;
  }
  .datetime-icon{
    flex-basis:32px;
    width:32px;
    height:32px;
    font-size:17px;
  }
  .datetime-label{
    font-size:8px;
  }
  .datetime-content strong{
    font-size:10px;
    white-space:nowrap;
  }
  .datetime-content b{
    font-size:15px;
  }
}


/* Definitive fix: prevent date/time box from stretching vertically */
.datetime-box{
  flex:0 0 auto !important;
  height:auto !important;
  min-height:0 !important;
  max-height:none !important;
  align-self:stretch !important;
  justify-content:flex-start;
}
@media(max-width:1180px){
  .datetime-box{
    flex:0 0 auto !important;
  }
}
@media(max-width:900px){
  .topbar-right{
    align-items:stretch;
  }
  .datetime-box{
    width:100%;
    flex:none !important;
    height:auto !important;
    min-height:58px !important;
    padding:9px 11px !important;
  }
}
@media(max-width:480px){
  .datetime-box{
    min-height:54px !important;
    padding:8px 10px !important;
  }
}


.app-name-setting{
  display:flex;
  align-items:flex-end;
  gap:12px;
  max-width:650px;
}
.app-name-setting .field{
  flex:1;
}
#appBrandName{
  display:inline;
}
@media(max-width:760px){
  .app-name-setting{
    flex-direction:column;
    align-items:stretch;
    max-width:none;
  }
  .app-name-setting .btn{
    width:100%;
  }
  #appBrandName{
    display:inline-block;
    max-width:210px;
    vertical-align:middle;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
}


.datetime-content strong{
  font-size:15px !important;
  font-weight:850;
  letter-spacing:-.15px;
}
@media(max-width:480px){
  .datetime-content strong{
    font-size:13px !important;
  }
}


.brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.brand-mark{
  flex:0 0 auto;
  display:grid;
  place-items:center;
  width:70px;
  height:70px;
  overflow:visible;
}
.brand-mark:not(.has-logo){
  border-radius:14px;
  background:linear-gradient(135deg,#5db0ff,#0f4c81);
  box-shadow:0 8px 20px rgba(29,114,184,.35);
}
.brand-initials{
  width:100%;
  height:100%;
  display:grid;
  place-items:center;
  font-size:18px;
  font-weight:900;
  color:#fff;
}
#brandLogo{
  object-fit:contain;
  background:transparent;
  border:0;
  box-shadow:none;
}
.brand-text{
  min-width:0;
}
.logo-settings-grid{
  display:grid;
  grid-template-columns:minmax(250px,.9fr) minmax(280px,1.1fr);
  gap:18px;
  max-width:900px;
}
.logo-upload-panel,.logo-size-panel{
  padding:16px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#f8fafc;
}
.logo-upload-panel{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-content:flex-start;
}
.logo-upload-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.logo-preview-wrap{
  width:100%;
  margin-top:8px;
}
.logo-preview-wrap>span{
  display:block;
  margin-bottom:8px;
  color:var(--muted);
  font-size:11px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.65px;
}
.logo-preview-bg{
  min-height:120px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:15px;
  border-radius:12px;
  background:linear-gradient(135deg,#0c2845,#0f4c81);
  overflow:auto;
}
.logo-preview-bg img{
  object-fit:contain;
  max-width:100%;
}
#logoSettingsInitials{
  width:70px;
  height:70px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:linear-gradient(135deg,#5db0ff,#0f4c81);
  color:#fff;
  font-size:20px;
  font-weight:900;
}
.logo-size-panel{
  display:grid;
  gap:15px;
  align-content:start;
}
.size-control{
  display:grid;
  gap:7px;
}
.stepper{
  display:grid;
  grid-template-columns:44px minmax(70px,1fr) 35px 44px;
  align-items:center;
  gap:7px;
}
.stepper button{
  height:42px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  color:#0f4c81;
  font-size:23px;
  font-weight:800;
  cursor:pointer;
}
.stepper input{
  text-align:center;
  font-weight:800;
}
.stepper span{
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}
@media(max-width:900px){
  .brand-mark{
    width:var(--logo-w,70px);
    height:var(--logo-h,70px);
  }
}
@media(max-width:760px){
  .logo-settings-grid{grid-template-columns:1fr}
  .brand{
    gap:10px;
  }
  .brand-text{
    flex:1;
  }
}


:root{
  --theme-primary:#0f4c81;
  --theme-primary2:#12395d;
  --theme-accent:#2f86c9;
  --theme-soft:#e7f1fa;
  --theme-on-primary:#ffffff;
}
.sidebar{
  background:linear-gradient(180deg,var(--theme-primary2) 0%,var(--theme-primary) 58%,var(--theme-primary2) 100%) !important;
}
.nav button.active,.nav button:hover{
  background:color-mix(in srgb,var(--theme-on-primary) 16%,transparent) !important;
  color:var(--theme-on-primary) !important;
}
.btn-primary{
  background:var(--theme-primary) !important;
  color:var(--theme-on-primary) !important;
}
.btn-primary:hover{
  background:var(--theme-primary2) !important;
}
.hero-card{
  background:linear-gradient(135deg,var(--theme-primary) 0%,var(--theme-primary2) 58%,var(--theme-accent) 100%) !important;
  color:var(--theme-on-primary) !important;
}
.brand-mark:not(.has-logo),
#logoSettingsInitials{
  background:linear-gradient(135deg,var(--theme-accent),var(--theme-primary)) !important;
}
.category-tag,
.datetime-icon,
.period-mode-btn.active{
  background:var(--theme-soft) !important;
  color:var(--theme-primary) !important;
}
.datetime-content b,
.stepper button,
.center-switcher label{
  color:var(--theme-primary) !important;
}
.progress>span{
  background:linear-gradient(90deg,var(--theme-primary),var(--theme-accent)) !important;
}
.substitution-progress>span{
  background:linear-gradient(90deg,#f0a528,#f5bd52) !important;
}
.default-action{
  background:var(--theme-soft) !important;
  color:var(--theme-primary) !important;
}
.chart-card,
.period-panel,
.topbar{
  border-color:color-mix(in srgb,var(--theme-primary) 20%,#dce5ee) !important;
}
.theme-presets{
  display:grid;
  grid-template-columns:repeat(6,minmax(95px,1fr));
  gap:10px;
  max-width:900px;
}
.theme-preset{
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  padding:11px 9px;
  display:grid;
  justify-items:center;
  gap:7px;
  cursor:pointer;
  font:inherit;
}
.theme-preset.selected{
  border-color:var(--theme-primary);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--theme-primary) 14%,transparent);
}
.theme-preset b{
  font-size:12px;
}
.theme-swatch{
  width:42px;
  height:42px;
  border-radius:12px;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.08);
}
.theme-swatch.blue{background:linear-gradient(135deg,#0f4c81,#2f86c9)}
.theme-swatch.yellow{background:linear-gradient(135deg,#d69e00,#f2c94c)}
.theme-swatch.green{background:linear-gradient(135deg,#1f7a4d,#35a96b)}
.theme-swatch.red{background:linear-gradient(135deg,#b83838,#e45b5b)}
.theme-swatch.purple{background:linear-gradient(135deg,#6d3fa0,#9161c2)}
.theme-swatch.dark{background:linear-gradient(135deg,#303844,#596574)}
.custom-theme-row{
  display:flex;
  align-items:flex-end;
  gap:12px;
  flex-wrap:wrap;
  margin-top:16px;
  max-width:760px;
}
.custom-theme-row .field{
  min-width:180px;
}
#customThemeColor{
  height:46px;
  padding:5px;
  cursor:pointer;
}
@media(max-width:900px){
  .theme-presets{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:560px){
  .theme-presets{grid-template-columns:repeat(2,1fr)}
  .custom-theme-row{
    align-items:stretch;
    flex-direction:column;
  }
  .custom-theme-row .btn{width:100%}
}


.badge.adas{
  background:#ede9fe;
  color:#6d28d9;
}
.adas-metric{
  background:linear-gradient(135deg,#f3efff,#fbf9ff);
  border-color:#ddd0f7;
}
.adas-metric span{
  color:#6d3fa0;
}
.adas-note{
  margin-top:8px;
  color:#7a6a91;
  font-size:10px;
  font-weight:700;
}
.category-grid:has(.adas-metric){
  grid-template-columns:repeat(5,minmax(0,1fr));
}
@media(max-width:1100px){
  .category-grid:has(.adas-metric){
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}
@media(max-width:900px){
  .category-grid:has(.adas-metric){
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:480px){
  .category-grid:has(.adas-metric){
    grid-template-columns:1fr 1fr;
  }
  .adas-metric{
    grid-column:1/-1;
  }
}


#monthlyPdfBtn{
  min-height:44px;
  align-items:center;
  justify-content:center;
}
.modal-overlay{
  position:fixed;
  inset:0;
  z-index:9999;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(12,25,42,.62);
  backdrop-filter:blur(5px);
}
.modal-card{
  width:min(560px,100%);
  max-height:90vh;
  overflow:auto;
  padding:20px;
  border-radius:18px;
  background:#fff;
  box-shadow:0 25px 70px rgba(0,0,0,.24);
}
.modal-head{
  display:flex;
  justify-content:space-between;
  gap:15px;
  align-items:flex-start;
  margin-bottom:16px;
}
.modal-head h2{margin:0 0 5px}
.modal-head p{margin:0;color:var(--muted)}
.modal-close{
  width:36px;height:36px;border:0;border-radius:10px;
  background:#edf2f7;color:#334155;font-size:23px;cursor:pointer
}
.pdf-scope-options{display:grid;gap:10px}
.pdf-scope-option{
  display:flex;
  gap:11px;
  align-items:flex-start;
  padding:13px;
  border:1px solid var(--border);
  border-radius:12px;
  cursor:pointer;
  background:#fbfdff;
}
.pdf-scope-option:has(input:checked){
  border-color:var(--theme-primary,#0f4c81);
  background:var(--theme-soft,#e7f1fa);
}
.pdf-scope-option input{
  width:auto;
  margin-top:3px;
}
.pdf-scope-option span{display:grid;gap:3px}
.pdf-scope-option b{font-size:14px}
.pdf-scope-option small{color:var(--muted)}
.modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:18px;
}
@media(max-width:1000px){
  #monthlyPdfBtn{grid-column:1/-1}
}
@media(max-width:600px){
  #monthlyPdfBtn{grid-column:auto}
  .modal-actions{flex-direction:column-reverse}
  .modal-actions .btn{width:100%}
}


.vin-modal-card{
  width:min(520px,100%);
}
#vinModalInput{
  text-transform:uppercase;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:18px;
  font-weight:850;
  letter-spacing:1.2px;
}
.vin-counter{
  text-align:right;
  color:var(--muted);
  font-size:11px;
  font-weight:750;
}
.vin-error{
  padding:10px 12px;
  border-radius:10px;
  background:#fff0f0;
  border:1px solid #efb7b7;
  color:#a11b1b;
  font-size:12px;
  font-weight:750;
}
.vin-help{
  margin-top:12px;
  padding:11px 12px;
  border-radius:10px;
  background:var(--theme-soft,#e7f1fa);
  color:#44566c;
  font-size:12px;
  line-height:1.4;
}
@media(max-width:560px){
  #vinModalInput{
    font-size:15px;
    letter-spacing:.7px;
  }
}





.vin-form-section{
  grid-column:1/-1;
  padding:16px;
  border:1px solid color-mix(in srgb,var(--theme-primary,#0f4c81) 24%,var(--border));
  border-radius:14px;
  background:linear-gradient(180deg,#fbfdff,#f6f9fc);
}
#vin{
  text-transform:uppercase;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:17px;
  font-weight:850;
  letter-spacing:1.1px;
}
.vin-form-meta{
  display:flex;
  justify-content:space-between;
  gap:12px;
  color:var(--muted);
  font-size:11px;
}
.vin-form-meta b{
  color:var(--theme-primary,#0f4c81);
  white-space:nowrap;
}
@media(max-width:760px){
  .vin-form-section{
    grid-column:auto;
  }
}
@media(max-width:480px){
  #vin{
    font-size:15px;
    letter-spacing:.6px;
  }
  .vin-form-meta{
    align-items:flex-start;
    flex-direction:column;
    gap:4px;
  }
}


/* VIN position: immediately below Tipo intervento */
#vinFormSection{
  grid-column:1/-1;
  margin-top:0;
}
@media(max-width:760px){
  #vinFormSection{
    grid-column:1;
  }
}


.adas-import-panel{margin-bottom:20px}
.adas-step-head{
  display:flex;
  align-items:flex-start;
  gap:13px;
  margin-bottom:18px;
}
.adas-step-head h2{margin:0 0 5px}
.adas-step-head p{margin:0;color:var(--muted)}
.adas-step-number{
  flex:0 0 38px;
  width:38px;height:38px;
  display:grid;place-items:center;
  border-radius:11px;
  background:var(--theme-primary,#0f4c81);
  color:var(--theme-on-primary,#fff);
  font-weight:900;
}
.adas-drop-zone{
  min-height:230px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:9px;
  padding:25px;
  border:2px dashed color-mix(in srgb,var(--theme-primary,#0f4c81) 35%,#cbd5e1);
  border-radius:16px;
  background:linear-gradient(180deg,#fbfdff,#f5f9fc);
  text-align:center;
  transition:.18s ease;
}
.adas-drop-zone.dragging{
  border-color:var(--theme-primary,#0f4c81);
  background:var(--theme-soft,#e7f1fa);
  transform:scale(1.005);
}
.adas-upload-icon{
  width:55px;height:55px;
  display:grid;place-items:center;
  border-radius:15px;
  background:var(--theme-soft,#e7f1fa);
  color:var(--theme-primary,#0f4c81);
  font-size:28px;font-weight:900;
}
.adas-drop-zone strong{font-size:18px}
.adas-drop-zone span,.adas-drop-zone small{color:var(--muted)}
.adas-file-button{margin-top:6px;cursor:pointer}
.adas-file-info{
  align-items:center;
  justify-content:space-between;
  gap:15px;
  padding:15px;
  border:1px solid var(--border);
  border-radius:13px;
  background:#f8fafc;
}
.adas-file-info span,.adas-file-info small{display:block;color:var(--muted)}
.adas-file-info strong{display:block;margin:4px 0}
.adas-sheet-controls{
  align-items:flex-end;
  gap:12px;
  margin-top:15px;
  max-width:650px;
}
.adas-sheet-controls .field{flex:1}
.adas-import-error{
  margin-top:14px;
  padding:12px;
  border-radius:11px;
  background:#fff0f0;
  border:1px solid #efb7b7;
  color:#a11b1b;
  font-weight:750;
}
.adas-result-stats{
  grid-template-columns:repeat(4,minmax(0,1fr));
  margin-bottom:20px;
}
.adas-preview-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:15px;
  margin-bottom:15px;
}
.adas-preview-head h2{margin:0 0 5px}
.adas-preview-head p{margin:0;color:var(--muted)}
.adas-search-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.adas-search-row input{max-width:420px}
.adas-saved-status{
  padding:7px 10px;
  border-radius:999px;
  background:#f1f5f9;
  color:#64748b;
  font-size:11px;
  font-weight:850;
}
.adas-saved-status.saved{
  background:#eaf8f0;
  color:#187347;
}
.adas-vin-table{min-width:620px}
.vin-code{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:13px;
  font-weight:850;
  color:#243b55;
}
.adas-last-save{margin-top:20px}
.adas-saved-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.adas-saved-grid>div{
  padding:12px;
  border:1px solid var(--border);
  border-radius:11px;
  background:#f8fafc;
}
.adas-saved-grid span{
  display:block;
  color:var(--muted);
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.6px;
  font-weight:800;
}
.adas-saved-grid b{
  display:block;
  margin-top:5px;
  overflow-wrap:anywhere;
}
@media(max-width:1000px){
  .adas-result-stats{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:760px){
  .adas-sheet-controls,
  .adas-preview-head,
  .adas-search-row{
    align-items:stretch;
    flex-direction:column;
  }
  .adas-sheet-controls .btn,
  .adas-preview-head .btn{width:100%}
  .adas-preview-head .actions{display:grid;grid-template-columns:1fr}
  .adas-search-row input{max-width:none}
  .adas-saved-grid{grid-template-columns:1fr}
}
@media(max-width:480px){
  .adas-result-stats{grid-template-columns:1fr 1fr}
  .adas-drop-zone{min-height:200px;padding:18px}
  .adas-step-head{flex-direction:column}
}


.adas-compare-panel{
  margin-top:20px;
}
.adas-compare-filters{
  display:grid;
  grid-template-columns:minmax(180px,1.2fr) minmax(150px,.9fr) minmax(135px,.75fr) minmax(120px,.65fr) auto;
  align-items:end;
  gap:12px;
}
.adas-compare-button{
  min-height:44px;
  white-space:nowrap;
}
.adas-comparison-stats{
  grid-template-columns:repeat(6,minmax(0,1fr));
  margin-bottom:20px;
}
.adas-comparison-stats .stat{
  min-height:145px;
}
.comparison-ok{
  border-color:#b9e2ca;
  background:linear-gradient(180deg,#fff,#f2fbf6);
}
.comparison-missing{
  border-color:#efb7b7;
  background:linear-gradient(180deg,#fff,#fff5f5);
}
.comparison-extra{
  border-color:#ead39c;
  background:linear-gradient(180deg,#fff,#fffaf0);
}
.comparison-rate{
  border-color:color-mix(in srgb,var(--theme-primary,#0f4c81) 32%,#dce5ee);
}
.adas-match-progress-card{
  margin-bottom:20px;
}
.adas-match-progress-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  margin-bottom:11px;
}
.adas-match-progress-head strong{
  display:block;
  font-size:15px;
}
.adas-match-progress-head span{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:12px;
}
.adas-match-progress-head>b{
  color:var(--theme-primary,#0f4c81);
  font-size:25px;
}
.adas-match-progress{
  height:13px;
  border-radius:999px;
  background:#e7edf3;
  overflow:hidden;
}
.adas-match-progress>span{
  display:block;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,var(--theme-primary,#0f4c81),var(--theme-accent,#2f86c9));
  transition:width .35s ease;
}
.adas-comparison-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  margin-bottom:14px;
}
.adas-result-tabs{
  display:flex;
  gap:6px;
  padding:4px;
  border-radius:12px;
  background:#edf2f7;
}
.adas-result-tab{
  border:0;
  background:transparent;
  color:#5f6f82;
  border-radius:9px;
  padding:9px 12px;
  font-weight:800;
  cursor:pointer;
  white-space:nowrap;
}
.adas-result-tab span{
  display:inline-grid;
  place-items:center;
  min-width:22px;
  height:22px;
  margin-left:5px;
  padding:0 5px;
  border-radius:999px;
  background:rgba(100,116,139,.12);
  font-size:10px;
}
.adas-result-tab.active{
  background:#fff;
  color:var(--theme-primary,#0f4c81);
  box-shadow:0 3px 10px rgba(20,45,75,.10);
}
.adas-comparison-toolbar input{
  max-width:340px;
}
.adas-comparison-table{
  min-width:1050px;
}
.comparison-status{
  display:inline-flex;
  align-items:center;
  padding:6px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:850;
  white-space:nowrap;
}
.comparison-status.match{
  background:#eaf8f0;
  color:#187347;
}
.comparison-status.missing{
  background:#fff0f0;
  color:#a11b1b;
}
.comparison-status.extra{
  background:#fff5df;
  color:#946200;
}
.multiple-practice-note{
  display:block;
  margin-top:4px;
  color:#8a5f00;
  font-size:9px;
}
@media(max-width:1250px){
  .adas-comparison-stats{
    grid-template-columns:repeat(3,1fr);
  }
  .adas-compare-filters{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .adas-compare-button{
    grid-column:1/-1;
  }
}
@media(max-width:760px){
  .adas-comparison-toolbar{
    align-items:stretch;
    flex-direction:column;
  }
  .adas-result-tabs{
    width:100%;
    overflow-x:auto;
  }
  .adas-result-tab{
    flex:1 0 auto;
  }
  .adas-comparison-toolbar input{
    max-width:none;
  }
  .adas-match-progress-head{
    align-items:flex-start;
  }
}
@media(max-width:560px){
  .adas-comparison-stats{
    grid-template-columns:1fr 1fr;
  }
  .adas-compare-filters{
    grid-template-columns:1fr;
  }
  .adas-compare-button{
    grid-column:auto;
  }
}


.adas-module-tabs{
  display:flex;
  gap:6px;
  padding:5px;
  margin-bottom:18px;
  border-radius:14px;
  background:#e8eef4;
  width:max-content;
  max-width:100%;
}
.adas-module-tab{
  border:0;
  border-radius:10px;
  padding:10px 15px;
  background:transparent;
  color:#5e6c7f;
  font-weight:850;
  cursor:pointer;
}
.adas-module-tab.active{
  background:#fff;
  color:var(--theme-primary,#0f4c81);
  box-shadow:0 4px 12px rgba(20,45,75,.1);
}
.adas-module-tab span{
  display:inline-grid;
  place-items:center;
  min-width:22px;
  height:22px;
  margin-left:5px;
  padding:0 6px;
  border-radius:999px;
  background:var(--theme-soft,#e7f1fa);
  font-size:10px;
}
.adas-report-savebar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:-4px 0 16px;
  padding:13px 14px;
  border:1px solid color-mix(in srgb,var(--theme-primary,#0f4c81) 22%,var(--border));
  border-radius:12px;
  background:linear-gradient(180deg,#fff,#f6f9fc);
}
.adas-report-savebar strong{display:block}
.adas-report-savebar span{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:12px;
}
.adas-reports-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:15px;
  margin-bottom:15px;
}
.adas-reports-head h2{margin:0 0 5px}
.adas-reports-head p{margin:0;color:var(--muted)}
.adas-reports-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.adas-reports-actions input{min-width:260px}
.adas-reports-table{min-width:1200px}
.report-status{
  display:inline-flex;
  padding:6px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:850;
  white-space:nowrap;
}
.report-status.verified{background:#eaf8f0;color:#187347}
.report-status.review{background:#fff5df;color:#946200}
.report-status.correction{background:#fff0f0;color:#a11b1b}
.report-row-actions{
  display:flex;
  gap:5px;
  flex-wrap:wrap;
}
.report-modal-card{width:min(560px,100%)}
.delete-report-summary{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
  margin:8px 0 4px;
}
.delete-report-summary>div{
  padding:12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#f8fafc;
}
.delete-report-summary span{
  display:block;
  color:var(--muted);
  font-size:10px;
  text-transform:uppercase;
  font-weight:800;
}
.delete-report-summary b{
  display:block;
  margin-top:5px;
}
@media(max-width:760px){
  .adas-module-tabs{width:100%}
  .adas-module-tab{flex:1}
  .adas-report-savebar,
  .adas-reports-head{
    align-items:stretch;
    flex-direction:column;
  }
  .adas-report-savebar .btn{width:100%}
  .adas-reports-actions{flex-direction:column}
  .adas-reports-actions input{min-width:0}
  .delete-report-summary{grid-template-columns:1fr}
}


.adas-evolution-card{
  margin-bottom:20px;
}
.adas-evolution-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:15px;
  margin-bottom:16px;
}
.adas-evolution-head h2{margin:0 0 5px}
.adas-evolution-head p{margin:0;color:var(--muted)}
.adas-evolution-reference{
  padding:7px 10px;
  border-radius:999px;
  background:var(--theme-soft,#e7f1fa);
  color:var(--theme-primary,#0f4c81);
  font-size:11px;
  font-weight:850;
}
.adas-evolution-stats{
  grid-template-columns:repeat(4,minmax(0,1fr));
  margin-bottom:15px;
}
.evolution-metric{
  padding:14px;
  border:1px solid var(--border);
  border-radius:13px;
  background:#f8fafc;
}
.evolution-metric span{
  display:block;
  color:var(--muted);
  font-size:10px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.6px;
}
.evolution-metric b{
  display:block;
  margin:7px 0 3px;
  font-size:28px;
}
.evolution-metric small{color:var(--muted)}
.evolution-metric.resolved{background:#f0faf5;border-color:#b9e2ca}
.evolution-metric.persistent{background:#fff5f5;border-color:#efb7b7}
.evolution-metric.new-missing{background:#fffaf0;border-color:#ead39c}
.evolution-metric.new-file{background:#f3f0ff;border-color:#d9ccf3}
.adas-old-missing-alert{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:15px;
  padding:13px 14px;
  border:1px solid #efb7b7;
  border-radius:12px;
  background:#fff0f0;
  color:#a11b1b;
}
.adas-old-missing-alert strong,
.adas-old-missing-alert small{display:block}
.adas-old-missing-alert small{margin-top:3px}
.adas-evolution-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}
.adas-evolution-grid h3{
  margin:0 0 10px;
  font-size:15px;
}
.adas-evolution-list,.adas-timeline-panel{
  padding:14px;
  border:1px solid var(--border);
  border-radius:13px;
  background:#f8fafc;
}
.adas-priority-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:10px;
  border-radius:10px;
  border-left:4px solid #cbd5e1;
  background:#fff;
  margin-bottom:8px;
}
.adas-priority-row.high{border-left-color:#dc2626}
.adas-priority-row.medium{border-left-color:#f59e0b}
.adas-priority-row.new{border-left-color:#3b82f6}
.adas-priority-row code{
  display:block;
  font-weight:850;
}
.adas-priority-row small{
  display:block;
  margin-top:3px;
  color:var(--muted);
}
.adas-priority-age{
  display:flex;
  align-items:center;
  gap:7px;
  white-space:nowrap;
}
.adas-priority-age b{font-size:12px}
.adas-timeline-row{
  display:grid;
  grid-template-columns:minmax(110px,1fr) minmax(100px,2fr) 55px;
  gap:9px;
  align-items:center;
  margin-bottom:11px;
}
.adas-timeline-row.current{
  padding:8px;
  border-radius:9px;
  background:var(--theme-soft,#e7f1fa);
}
.adas-timeline-label strong,
.adas-timeline-label small{display:block}
.adas-timeline-label small{
  margin-top:2px;
  color:var(--muted);
  font-size:9px;
}
.adas-timeline-bar{
  height:9px;
  border-radius:999px;
  overflow:hidden;
  background:#e2e8f0;
}
.adas-timeline-bar span{
  display:block;
  height:100%;
  background:linear-gradient(90deg,var(--theme-primary,#0f4c81),var(--theme-accent,#2f86c9));
}
.adas-timeline-row>b{
  text-align:right;
  font-size:12px;
}
.adas-evolution-empty{
  padding:16px;
  text-align:center;
  color:var(--muted);
}
@media(max-width:900px){
  .adas-evolution-stats{grid-template-columns:repeat(2,1fr)}
  .adas-evolution-grid{grid-template-columns:1fr}
}
@media(max-width:600px){
  .adas-evolution-head,
  .adas-old-missing-alert{
    align-items:stretch;
    flex-direction:column;
  }
  .adas-evolution-reference{text-align:center}
  .adas-timeline-row{
    grid-template-columns:1fr;
  }
  .adas-timeline-row>b{text-align:left}
}


.nav button{
  display:flex;
  align-items:center;
  gap:11px;
  position:relative;
}
.nav button::after{
  content:"";
  position:absolute;
  right:0;
  top:25%;
  width:3px;
  height:50%;
  border-radius:999px;
  background:transparent;
}
.nav button.active::after{
  background:var(--theme-accent,#2f86c9);
}
.nav-icon{
  flex:0 0 22px;
  width:22px;
  height:22px;
  display:grid;
  place-items:center;
}
.nav-icon svg{
  width:20px;
  height:20px;
  fill:currentColor;
}
.audit-kpis{
  grid-template-columns:repeat(4,minmax(0,1fr));
  margin-bottom:20px;
}
.audit-filters{
  display:grid;
  grid-template-columns:2fr 1fr 1fr 150px 150px;
  gap:10px;
  margin-bottom:15px;
}
.audit-table{
  min-width:1100px;
}
.audit-type-icon{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:10px;
}
.audit-type-icon svg{
  width:18px;
  height:18px;
  fill:currentColor;
}
.audit-type-icon.practice{background:#eaf8f0;color:#187347}
.audit-type-icon.report{background:#f3efff;color:#6d3fa0}
.audit-type-icon.center{background:#eef5fb;color:#0f4c81}
.audit-type-icon.settings{background:#fff5df;color:#946200}
.audit-type-icon.data{background:#f1f5f9;color:#475569}
.audit-action{
  font-weight:850;
}
.audit-footer{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  margin-top:15px;
  padding-top:15px;
  border-top:1px solid var(--border);
  color:var(--muted);
  font-size:12px;
}
@media(max-width:1100px){
  .audit-filters{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:900px){
  .nav button{
    justify-content:center;
  }
  .nav button span:last-child{
    display:none;
  }
  .nav-icon{
    width:24px;
    height:24px;
  }
}
@media(max-width:760px){
  .audit-kpis{grid-template-columns:repeat(2,1fr)}
  .audit-filters{grid-template-columns:1fr}
  .audit-footer{
    align-items:stretch;
    flex-direction:column;
  }
  .audit-footer .btn{width:100%}
}


.inventory-kpis{
  grid-template-columns:repeat(4,minmax(0,1fr));
  margin-bottom:20px;
}
.inventory-form-card{
  margin-bottom:20px;
}
.inventory-form-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:15px;
  margin-bottom:18px;
}
.inventory-form-head h2{
  margin:0 0 5px;
}
.inventory-form-head p{
  margin:0;
  color:var(--muted);
}
.inventory-form-grid{
  grid-template-columns:repeat(3,minmax(0,1fr));
}
.inventory-check-label{
  min-height:44px;
  display:flex;
  align-items:center;
  gap:9px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#f8fafc;
  cursor:pointer;
}
.inventory-check-label input{
  width:auto;
  margin:0;
}
.inventory-toolbar{
  display:grid;
  grid-template-columns:2fr 1fr 1fr 1fr;
  gap:10px;
  margin-bottom:15px;
}
.inventory-table{
  min-width:1450px;
}
.inventory-row-note{
  display:block;
  max-width:230px;
  margin-top:4px;
  color:var(--muted);
  font-size:10px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.inventory-category-badge{
  display:inline-flex;
  padding:6px 9px;
  border-radius:999px;
  background:var(--theme-soft,#e7f1fa);
  color:var(--theme-primary,#0f4c81);
  font-size:11px;
  font-weight:850;
}
.inventory-stock-status{
  display:inline-flex;
  padding:6px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:850;
  white-space:nowrap;
}
.inventory-stock-status.available{
  background:#eaf8f0;
  color:#187347;
}
.inventory-stock-status.low{
  background:#fff5df;
  color:#946200;
}
.inventory-stock-status.out{
  background:#fff0f0;
  color:#a11b1b;
}
.inventory-quantity{
  font-size:17px;
}
.inventory-row-actions{
  display:flex;
  gap:5px;
  flex-wrap:wrap;
}
@media(max-width:1100px){
  .inventory-form-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .inventory-toolbar{
    grid-template-columns:repeat(2,1fr);
  }
}
@media(max-width:760px){
  .inventory-kpis{
    grid-template-columns:repeat(2,1fr);
  }
  .inventory-form-grid,
  .inventory-toolbar{
    grid-template-columns:1fr;
  }
}


#inventoryEurocode,
#inventoryOem{
  text-transform:uppercase;
}


.warehouse-tabs{
  display:flex;
  gap:6px;
  padding:5px;
  margin-bottom:18px;
  border-radius:14px;
  background:#e8eef4;
  width:max-content;
  max-width:100%;
}
.warehouse-tab{
  border:0;
  border-radius:10px;
  padding:10px 15px;
  background:transparent;
  color:#5e6c7f;
  font-weight:850;
  cursor:pointer;
}
.warehouse-tab.active{
  background:#fff;
  color:var(--theme-primary,#0f4c81);
  box-shadow:0 4px 12px rgba(20,45,75,.1);
}
.warehouse-tab span{
  display:inline-grid;
  place-items:center;
  min-width:22px;
  height:22px;
  margin-left:5px;
  padding:0 6px;
  border-radius:999px;
  background:var(--theme-soft,#e7f1fa);
  font-size:10px;
}
.warehouse-use-btn{
  background:#eaf8f0;
  color:#187347;
  border-color:#b9e2ca;
}
.warehouse-use-btn:disabled,
.icon-btn:disabled{
  opacity:.45;
  cursor:not-allowed;
}
.warehouse-section-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:15px;
  margin-bottom:15px;
}
.warehouse-section-head h2{margin:0 0 5px}
.warehouse-section-head p{margin:0;color:var(--muted)}
.warehouse-used-toolbar,
.warehouse-movements-toolbar{
  display:grid;
  grid-template-columns:2fr 1fr 1fr;
  gap:10px;
  margin-bottom:15px;
}
.warehouse-used-toolbar{
  grid-template-columns:2fr 1fr;
}
.warehouse-used-table{
  min-width:1250px;
}
.warehouse-movements-table{
  min-width:1450px;
}
.warehouse-dialog-summary{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px;
}
.warehouse-dialog-summary>div{
  padding:12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#f8fafc;
}
.warehouse-dialog-summary span{
  display:block;
  color:var(--muted);
  font-size:10px;
  text-transform:uppercase;
  font-weight:800;
}
.warehouse-dialog-summary b{
  display:block;
  margin-top:5px;
}
.warehouse-quantity-stepper{
  display:grid;
  grid-template-columns:46px 1fr 46px;
  gap:8px;
}
.warehouse-quantity-stepper button{
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  font-size:22px;
  font-weight:850;
  cursor:pointer;
}
.warehouse-quantity-stepper input{
  text-align:center;
  font-weight:850;
}
.warehouse-movement-badge{
  display:inline-flex;
  padding:6px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:850;
  white-space:nowrap;
}
.warehouse-movement-badge.utilizzo{
  background:#fff0f0;
  color:#a11b1b;
}
.warehouse-movement-badge.ripristino{
  background:#eaf8f0;
  color:#187347;
}
.warehouse-movement-badge.carico-iniziale{
  background:#eef5fb;
  color:#0f4c81;
}
.warehouse-movement-badge.rettifica{
  background:#fff5df;
  color:#946200;
}
@media(max-width:760px){
  .warehouse-tabs{
    width:100%;
    overflow-x:auto;
  }
  .warehouse-tab{
    flex:1 0 auto;
  }
  .warehouse-used-toolbar,
  .warehouse-movements-toolbar{
    grid-template-columns:1fr;
  }
  .warehouse-section-head{
    align-items:stretch;
    flex-direction:column;
  }
  .warehouse-section-head .btn{width:100%}
  .warehouse-dialog-summary{
    grid-template-columns:1fr;
  }
}


.warehouse-settings-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
  margin-top:16px;
}
.warehouse-settings-card{
  padding:16px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#f8fafc;
}
.warehouse-settings-head{
  margin-bottom:14px;
}
.warehouse-settings-head h3{
  margin:0 0 4px;
}
.warehouse-settings-head small{
  color:var(--muted);
}
.warehouse-settings-add{
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px;
  margin:13px 0;
}
.warehouse-config-list{
  display:grid;
  gap:8px;
  max-height:520px;
  overflow:auto;
  padding-right:3px;
}
.warehouse-config-row{
  display:grid;
  grid-template-columns:auto minmax(130px,1fr) auto auto auto;
  align-items:center;
  gap:6px;
  padding:9px;
  border:1px solid var(--border);
  border-radius:11px;
  background:#fff;
}
.warehouse-config-row.inactive{
  opacity:.58;
  background:#f1f5f9;
}
.warehouse-config-order{
  display:flex;
  gap:3px;
}
.warehouse-config-order .icon-btn{
  min-width:32px;
  padding:7px;
}
.warehouse-config-row input{
  min-width:0;
}
.warehouse-settings-note{
  margin-top:14px;
  padding:12px 14px;
  border-radius:11px;
  background:var(--theme-soft,#e7f1fa);
  color:#44566c;
  font-size:12px;
}
.warehouse-config-empty{
  padding:18px;
}
@media(max-width:1100px){
  .warehouse-settings-grid{
    grid-template-columns:1fr;
  }
}
@media(max-width:700px){
  .warehouse-settings-add{
    grid-template-columns:1fr;
  }
  .warehouse-settings-add .btn{
    width:100%;
  }
  .warehouse-config-row{
    grid-template-columns:1fr 1fr;
  }
  .warehouse-config-order{
    grid-column:1/-1;
  }
  .warehouse-config-row input{
    grid-column:1/-1;
  }
}


.settings-accordion{
  border:1px solid var(--border);
  border-radius:15px;
  background:#fff;
  overflow:hidden;
  box-shadow:0 8px 22px rgba(22,32,51,.05);
}
.settings-accordion-toggle{
  width:100%;
  min-height:68px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  padding:14px 16px;
  border:0;
  background:linear-gradient(180deg,#fff,#f8fafc);
  color:var(--text);
  cursor:pointer;
  text-align:left;
}
.settings-accordion-toggle:hover{
  background:var(--theme-soft,#e7f1fa);
}
.settings-accordion-title{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.settings-accordion-title>span:last-child{
  min-width:0;
}
.settings-accordion-title strong{
  display:block;
  font-size:16px;
}
.settings-accordion-title small{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:11px;
}
.settings-accordion-icon{
  flex:0 0 42px;
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:12px;
  background:var(--theme-soft,#e7f1fa);
  color:var(--theme-primary,#0f4c81);
}
.settings-accordion-icon svg{
  width:21px;
  height:21px;
  fill:currentColor;
}
.settings-accordion-arrow{
  flex:0 0 auto;
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:#eef2f6;
  color:var(--theme-primary,#0f4c81);
  font-size:21px;
  font-weight:900;
  transition:transform .25s ease;
}
.settings-accordion.open .settings-accordion-arrow{
  transform:rotate(180deg);
}
.settings-accordion-content{
  max-height:0;
  overflow:hidden;
  transition:max-height .32s ease;
}
.settings-accordion-inner{
  padding:0 16px 18px;
  border-top:1px solid transparent;
}
.settings-accordion.open .settings-accordion-inner{
  border-top-color:var(--border);
  padding-top:16px;
}
.settings-accordion-inner>p{
  margin-top:0;
}
@media(max-width:600px){
  .settings-accordion-toggle{
    min-height:62px;
    padding:12px;
  }
  .settings-accordion-icon{
    flex-basis:38px;
    width:38px;
    height:38px;
  }
  .settings-accordion-title strong{
    font-size:14px;
  }
  .settings-accordion-title small{
    font-size:10px;
  }
  .settings-accordion-inner{
    padding-left:12px;
    padding-right:12px;
  }
}


/* V30.5 layout and modal corrections */
body.modal-open{
  overflow:hidden !important;
}
#useInventoryModal,
#restoreInventoryModal,
#deleteInventoryModal{
  position:fixed !important;
  inset:0 !important;
  z-index:30000 !important;
}
#useInventoryModal[style*="display: flex"],
#restoreInventoryModal[style*="display: flex"],
#deleteInventoryModal[style*="display: flex"]{
  display:flex !important;
}
.warehouse-delete-modal{
  width:min(620px,100%);
}
.warehouse-delete-warning{
  margin-top:14px;
  padding:13px 14px;
  border:1px solid #efb7b7;
  border-radius:11px;
  background:#fff0f0;
  color:#a11b1b;
}
.warehouse-delete-warning strong,
.warehouse-delete-warning span{
  display:block;
}
.warehouse-delete-warning span{
  margin-top:4px;
  font-size:12px;
}

/* Desktop sidebar remains blue for the full viewport while scrolling */
@media(min-width:901px){
  .app{
    display:block !important;
    min-height:100vh !important;
  }
  .sidebar{
    position:fixed !important;
    left:0 !important;
    top:0 !important;
    bottom:0 !important;
    width:245px !important;
    height:100vh !important;
    min-height:100vh !important;
    overflow-y:auto !important;
    z-index:2000 !important;
  }
  .main{
    margin-left:245px !important;
    width:calc(100% - 245px) !important;
    min-height:100vh !important;
  }
}

/* Management name always stays inside the sidebar */
.brand{
  width:100%;
  min-width:0;
  align-items:center;
}
.brand-mark{
  flex-shrink:0;
}
.brand-text{
  flex:1 1 auto;
  width:calc(100% - 82px);
  min-width:0;
  overflow:hidden;
}
#appBrandName{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
  word-break:normal !important;
  line-height:1.12 !important;
  font-size:18px !important;
  overflow:hidden !important;
}
.brand-text small{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* Stronger active navigation indication */
.nav button.active{
  box-shadow:inset 4px 0 0 var(--theme-accent,#2f86c9),0 8px 18px rgba(0,0,0,.12);
}
.nav button.active .nav-icon{
  transform:scale(1.08);
}
.nav-icon{
  transition:transform .18s ease;
}

@media(max-width:900px){
  .sidebar{
    position:static !important;
    width:auto !important;
    height:auto !important;
    min-height:0 !important;
    overflow:visible !important;
  }
  .main{
    margin-left:0 !important;
    width:100% !important;
  }
  .brand-text{
    width:auto;
  }
  #appBrandName{
    font-size:18px !important;
    white-space:normal !important;
  }
}


/* V30.6: logo sopra e nome gestionale sotto */
@media(min-width:901px){
  .brand{
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    justify-content:flex-start !important;
    gap:10px !important;
    width:100% !important;
    text-align:center !important;
  }
  .brand-mark{
    margin:0 auto !important;
    flex:0 0 auto !important;
  }
  .brand-text{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    overflow:hidden !important;
    text-align:center !important;
  }
  #appBrandName{
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    white-space:normal !important;
    overflow-wrap:anywhere !important;
    line-height:1.08 !important;
    font-size:17px !important;
    font-weight:900 !important;
    text-align:center !important;
  }
  .brand-text small{
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    white-space:normal !important;
    overflow-wrap:anywhere !important;
    line-height:1.2 !important;
    text-align:center !important;
  }
}


/* V30.7 - menu laterale richiudibile */
.sidebar-toggle-btn{
  position:absolute;
  top:14px;
  right:12px;
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.18);
  border-radius:10px;
  background:rgba(255,255,255,.10);
  color:#fff;
  cursor:pointer;
  z-index:5;
}
.sidebar-toggle-btn svg{
  width:20px;
  height:20px;
  fill:currentColor;
}
.sidebar-toggle-btn:hover{
  background:rgba(255,255,255,.18);
}
#compactBrandLogo{
  width:100%;
  height:100%;
  object-fit:contain;
}
@media(min-width:901px){
  body.sidebar-collapsed .sidebar{
    width:82px !important;
  }
  body.sidebar-collapsed .main{
    margin-left:82px !important;
    width:calc(100% - 82px) !important;
  }
  body.sidebar-collapsed .brand{
    margin-top:48px !important;
  }
  body.sidebar-collapsed .brand-text{
    display:none !important;
  }
  body.sidebar-collapsed .brand-mark{
    width:46px !important;
    height:46px !important;
  }
  body.sidebar-collapsed .nav button{
    justify-content:center !important;
    padding:12px 8px !important;
  }
  body.sidebar-collapsed .nav button span:last-child{
    display:none !important;
  }
  body.sidebar-collapsed .nav-icon{
    width:26px !important;
    height:26px !important;
  }
  body.sidebar-collapsed .nav-icon svg{
    width:22px !important;
    height:22px !important;
  }
  body.sidebar-collapsed .nav button::before{
    content:attr(title);
    position:absolute;
    left:70px;
    top:50%;
    transform:translateY(-50%);
    padding:7px 9px;
    border-radius:8px;
    background:#142033;
    color:#fff;
    font-size:11px;
    font-weight:750;
    white-space:nowrap;
    opacity:0;
    pointer-events:none;
    transition:opacity .15s ease;
    z-index:9999;
    box-shadow:0 8px 20px rgba(0,0,0,.2);
  }
  body.sidebar-collapsed .nav button:hover::before{
    opacity:1;
  }
}
.compact-logo-settings{
  display:flex;
  align-items:center;
  gap:16px;
  padding:16px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#f8fafc;
  max-width:620px;
}
.compact-logo-preview-box{
  width:90px;
  height:90px;
  display:grid;
  place-items:center;
  padding:10px;
  border-radius:14px;
  background:linear-gradient(135deg,var(--theme-primary2),var(--theme-primary));
}
.compact-logo-preview-box img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
}
.compact-logo-preview-empty{
  color:#fff;
  font-size:10px;
  text-align:center;
}
.compact-logo-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
@media(max-width:600px){
  .compact-logo-settings{
    align-items:stretch;
    flex-direction:column;
  }
  .compact-logo-preview-box{
    width:100%;
  }
  .compact-logo-actions{
    flex-direction:column;
  }
  .compact-logo-actions .btn{
    width:100%;
  }
}

/* Ensure ADAS report modal is always above page */
#saveAdasReportModal,
#editAdasReportModal,
#deleteAdasReportModal{
  position:fixed !important;
  inset:0 !important;
  z-index:32000 !important;
}


/* V30.8 - correzione logo compatto e barra laterale */
@media(min-width:901px){
  .sidebar{
    overflow-y:auto !important;
    scrollbar-width:none !important;
    -ms-overflow-style:none !important;
    padding-top:70px !important;
  }
  .sidebar::-webkit-scrollbar{
    width:0 !important;
    height:0 !important;
    display:none !important;
  }
  .sidebar-toggle-btn{
    top:12px !important;
    right:50% !important;
    transform:translateX(50%) !important;
    width:40px !important;
    height:40px !important;
  }
  .brand{
    margin-top:0 !important;
  }
  body.sidebar-collapsed .brand{
    margin-top:0 !important;
  }
}
#compactBrandLogo{
  display:none;
  width:100%;
  height:100%;
  object-fit:contain;
  border:0;
  background:transparent;
}
.compact-logo-preview-box{
  overflow:hidden;
}
#compactLogoPreview{
  width:100%;
  height:100%;
  object-fit:contain;
}


/* V30.9 - notifiche interne */
.app-toast-container{
  position:fixed;
  top:50%;
  left:50%;
  right:auto;
  transform:translate(-50%,-50%);
  z-index:50000;
  display:grid;
  gap:10px;
  width:min(520px,calc(100vw - 36px));
  pointer-events:none;
}
.app-toast-container .app-toast{pointer-events:auto}
.app-toast{
  display:grid;
  grid-template-columns:42px 1fr 30px;
  gap:10px;
  align-items:center;
  padding:13px;
  border-radius:14px;
  background:#fff;
  border:1px solid var(--border);
  box-shadow:0 18px 45px rgba(10,25,45,.22);
  opacity:0;
  transform:translateY(-10px) scale(.98);
  transition:.2s ease;
}
.app-toast.show{
  opacity:1;
  transform:translateY(0) scale(1);
}
.app-toast-icon{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:11px;
  font-size:19px;
  font-weight:900;
}
.app-toast.success .app-toast-icon{background:#eaf8f0;color:#187347}
.app-toast.error .app-toast-icon{background:#fff0f0;color:#a11b1b}
.app-toast.warning .app-toast-icon{background:#fff5df;color:#946200}
.app-toast.info .app-toast-icon{background:var(--theme-soft,#e7f1fa);color:var(--theme-primary,#0f4c81)}
.app-toast-content strong,
.app-toast-content span{
  display:block;
}
.app-toast-content strong{
  margin-bottom:3px;
  font-size:13px;
}
.app-toast-content span{
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}
.app-toast-close{
  width:28px;
  height:28px;
  border:0;
  border-radius:8px;
  background:#f1f5f9;
  color:#475569;
  cursor:pointer;
  font-size:18px;
}
.app-confirm-card{
  width:min(520px,100%);
}
#appConfirmModal{
  z-index:49000 !important;
}
@media(max-width:600px){
  .app-toast-container{
    top:50%;
    left:50%;
    right:auto;
    width:calc(100vw - 28px);
    transform:translate(-50%,-50%);
  }
}


.app-slogan-setting{
  display:flex;
  align-items:flex-end;
  gap:12px;
  max-width:650px;
  margin-top:14px;
}
.app-slogan-setting .field{
  flex:1;
}
#appBrandSlogan{
  display:block;
  width:100%;
  max-width:100%;
  overflow-wrap:anywhere;
}
@media(max-width:760px){
  .app-slogan-setting{
    flex-direction:column;
    align-items:stretch;
    max-width:none;
  }
  .app-slogan-setting .btn{
    width:100%;
  }
}


/* V31.1 - stabilità logo principale */
@media(min-width:901px){
  body:not(.sidebar-collapsed) #brandLogo{
    max-width:100%;
    max-height:100%;
    object-fit:contain;
  }
  body:not(.sidebar-collapsed) #compactBrandLogo{
    display:none !important;
  }
}


.company-footer{
  grid-column:1/-1;
  margin-left:245px;
  padding:16px 28px;
  background:#0f2238;
  color:#fff;
  border-top:1px solid rgba(255,255,255,.10);
}
.company-footer-inner{
  max-width:1600px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}
.company-footer strong,
.company-footer span{
  display:block;
}
.company-footer strong{
  font-size:14px;
}
.company-footer #footerCompanyAddress{
  margin-top:4px;
  color:#cbd5e1;
  font-size:12px;
}
.company-footer-details{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:12px 18px;
  color:#cbd5e1;
  font-size:12px;
}
body.sidebar-collapsed .company-footer{
  margin-left:82px;
}
.company-settings-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
@media(max-width:900px){
  .company-footer{
    margin-left:0 !important;
    padding:15px 16px;
  }
  .company-footer-inner{
    align-items:flex-start;
    flex-direction:column;
  }
  .company-footer-details{
    justify-content:flex-start;
  }
}
@media(max-width:700px){
  .company-settings-grid{
    grid-template-columns:1fr;
  }
}


.settings-group-accordion{
  margin-bottom:14px;
  border:1px solid var(--border);
  border-radius:15px;
  background:#fff;
  overflow:hidden;
  box-shadow:0 8px 22px rgba(22,32,51,.05);
}
.settings-group-toggle{
  width:100%;
  min-height:70px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  padding:14px 16px;
  border:0;
  background:linear-gradient(180deg,#fff,#f8fafc);
  color:var(--text);
  cursor:pointer;
  text-align:left;
}
.settings-group-toggle:hover{
  background:var(--theme-soft,#e7f1fa);
}
.settings-group-title{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.settings-group-title strong{
  display:block;
  font-size:16px;
}
.settings-group-title small{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:11px;
}
.settings-group-icon{
  flex:0 0 42px;
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:12px;
  background:var(--theme-soft,#e7f1fa);
  color:var(--theme-primary,#0f4c81);
}
.settings-group-icon svg{
  width:21px;
  height:21px;
  fill:currentColor;
}
.settings-group-arrow{
  flex:0 0 auto;
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:#eef2f6;
  color:var(--theme-primary,#0f4c81);
  font-size:21px;
  font-weight:900;
  transition:transform .25s ease;
}
.settings-group-accordion.open .settings-group-arrow{
  transform:rotate(180deg);
}
.settings-group-content{
  max-height:0;
  overflow:hidden;
  transition:max-height .32s ease;
}
.settings-group-inner{
  padding:0 16px 18px;
}
.settings-group-accordion.open .settings-group-inner{
  padding-top:16px;
  border-top:1px solid var(--border);
}
.settings-group-inner>.settings-divider:first-child{
  display:none;
}
.settings-subsection h3{
  margin:0 0 5px;
}
.settings-subsection p{
  margin:0 0 14px;
  color:var(--muted);
}
.settings-inner-divider{
  height:1px;
  margin:22px 0;
  background:var(--border);
}
@media(max-width:600px){
  .settings-group-toggle{
    min-height:62px;
    padding:12px;
  }
  .settings-group-title strong{
    font-size:14px;
  }
  .settings-group-title small{
    font-size:10px;
  }
  .settings-group-inner{
    padding-left:12px;
    padding-right:12px;
  }
}


#deleteCenterModal{
  position:fixed !important;
  inset:0 !important;
  z-index:36000 !important;
}
#deleteCenterModal .delete-report-summary{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
@media(max-width:600px){
  #deleteCenterModal .delete-report-summary{
    grid-template-columns:1fr;
  }
}


.reliable-notice-container{
  position:fixed;
  top:18px;
  right:18px;
  z-index:999999;
  display:grid;
  gap:10px;
  width:min(390px,calc(100vw - 36px));
  pointer-events:none;
}
.reliable-notice{
  display:grid;
  grid-template-columns:42px 1fr 30px;
  gap:10px;
  align-items:center;
  padding:13px;
  border-radius:14px;
  background:#fff;
  border:1px solid var(--border);
  box-shadow:0 18px 50px rgba(10,25,45,.28);
  opacity:0;
  transform:translateY(-10px) scale(.98);
  transition:.2s ease;
  pointer-events:auto;
}
.reliable-notice.show{
  opacity:1;
  transform:translateY(0) scale(1);
}
.reliable-notice-icon{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:11px;
  font-size:19px;
  font-weight:900;
}
.reliable-notice.success .reliable-notice-icon{
  background:#eaf8f0;
  color:#187347;
}
.reliable-notice.error .reliable-notice-icon{
  background:#fff0f0;
  color:#a11b1b;
}
.reliable-notice.warning .reliable-notice-icon{
  background:#fff5df;
  color:#946200;
}
.reliable-notice.info .reliable-notice-icon{
  background:var(--theme-soft,#e7f1fa);
  color:var(--theme-primary,#0f4c81);
}
.reliable-notice-content strong,
.reliable-notice-content span{
  display:block;
}
.reliable-notice-content strong{
  margin-bottom:3px;
  font-size:13px;
}
.reliable-notice-content span{
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}
.reliable-notice-close{
  width:28px;
  height:28px;
  border:0;
  border-radius:8px;
  background:#f1f5f9;
  color:#475569;
  cursor:pointer;
  font-size:18px;
}
@media(max-width:600px){
  .reliable-notice-container{
    top:10px;
    right:10px;
    width:calc(100vw - 20px);
  }
}


/* V31.8 - notifiche centrate nel gestionale */
.reliable-notice-container{
  top:50% !important;
  right:auto !important;
  left:calc(50% + 122px) !important;
  width:min(430px,calc(100vw - 40px)) !important;
  transform:translate(-50%,-50%) !important;
  justify-items:stretch;
}
.reliable-notice{
  width:100%;
  box-shadow:0 24px 65px rgba(10,25,45,.30) !important;
  transform:translateY(12px) scale(.96) !important;
}
.reliable-notice.show{
  transform:translateY(0) scale(1) !important;
}
body.sidebar-collapsed .reliable-notice-container{
  left:calc(50% + 41px) !important;
}
@media(max-width:900px){
  .reliable-notice-container,
  body.sidebar-collapsed .reliable-notice-container{
    left:50% !important;
    width:calc(100vw - 28px) !important;
  }
}


.employees-kpis{
  grid-template-columns:repeat(4,minmax(0,1fr));
  margin-bottom:20px;
}
.employee-form-card{
  margin-bottom:20px;
}
.employee-form-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:15px;
  margin-bottom:18px;
}
.employee-form-head h2{
  margin:0 0 5px;
}
.employee-form-head p{
  margin:0;
  color:var(--muted);
}
.employee-form-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.employees-toolbar{
  display:grid;
  grid-template-columns:2fr 1fr 1fr 1fr;
  gap:10px;
  margin-bottom:15px;
}
.employees-table{
  min-width:1200px;
}
.employee-subline{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:10px;
}
.employee-role-badge{
  display:inline-flex;
  padding:6px 9px;
  border-radius:999px;
  background:var(--theme-soft,#e7f1fa);
  color:var(--theme-primary,#0f4c81);
  font-size:11px;
  font-weight:850;
}
.employee-status{
  display:inline-flex;
  padding:6px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:850;
}
.employee-status.active{
  background:#eaf8f0;
  color:#187347;
}
.employee-status.inactive{
  background:#f1f5f9;
  color:#64748b;
}
.employee-row-actions{
  display:flex;
  gap:5px;
  flex-wrap:wrap;
}
#deleteEmployeeModal{
  position:fixed !important;
  inset:0 !important;
  z-index:37000 !important;
}
@media(max-width:900px){
  .employees-toolbar{
    grid-template-columns:repeat(2,1fr);
  }
}
@media(max-width:760px){
  .employees-kpis{
    grid-template-columns:repeat(2,1fr);
  }
  .employee-form-grid,
  .employees-toolbar{
    grid-template-columns:1fr;
  }
}


.employee-role-legend{
  margin-bottom:20px;
}
.employee-role-legend-head h2{
  margin:0 0 5px;
}
.employee-role-legend-head p{
  margin:0 0 14px;
  color:var(--muted);
}
.employee-role-legend-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.employee-role-legend-item{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:14px;
  border:1px solid var(--border);
  border-radius:13px;
  background:#f8fafc;
}
.employee-role-legend-item strong,
.employee-role-legend-item small{
  display:block;
}
.employee-role-legend-item small{
  margin-top:4px;
  color:var(--muted);
  line-height:1.4;
}
.employee-role-icon{
  flex:0 0 42px;
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:12px;
  font-weight:900;
}
.employee-role-legend-item.owner .employee-role-icon{
  background:#f3efff;
  color:#6d3fa0;
}
.employee-role-legend-item.desk-manager .employee-role-icon{
  background:#eef5fb;
  color:#0f4c81;
}
.employee-role-legend-item.front-desk .employee-role-icon{
  background:#eaf8f0;
  color:#187347;
}
.employee-roles-multiselect{
  display:grid;
  gap:8px;
  padding:10px;
  border:1px solid var(--border);
  border-radius:11px;
  background:#f8fafc;
}
.employee-roles-multiselect label{
  display:flex;
  align-items:center;
  gap:9px;
  padding:8px 10px;
  border-radius:9px;
  background:#fff;
  cursor:pointer;
}
.employee-roles-multiselect input{
  width:auto;
  margin:0;
}
.field-help{
  display:block;
  margin-top:5px;
  color:var(--muted);
}
.employee-role-badges{
  display:flex;
  gap:5px;
  flex-wrap:wrap;
}
.employee-role-badge.role-owner{
  background:#f3efff;
  color:#6d3fa0;
}
.employee-role-badge.role-desk_manager{
  background:#eef5fb;
  color:#0f4c81;
}
.employee-role-badge.role-front_desk{
  background:#eaf8f0;
  color:#187347;
}
.role-permissions-tabs{
  display:flex;
  gap:6px;
  padding:5px;
  margin-bottom:15px;
  border-radius:12px;
  background:#e8eef4;
  overflow-x:auto;
}
.role-permission-tab{
  flex:1 0 auto;
  border:0;
  border-radius:9px;
  padding:9px 12px;
  background:transparent;
  color:#5e6c7f;
  font-weight:850;
  cursor:pointer;
}
.role-permission-tab.active{
  background:#fff;
  color:var(--theme-primary,#0f4c81);
  box-shadow:0 4px 12px rgba(20,45,75,.1);
}
.role-permissions-list{
  display:grid;
  gap:12px;
}
.role-permission-header{
  padding:13px;
  border-radius:12px;
  background:var(--theme-soft,#e7f1fa);
}
.role-permission-header strong,
.role-permission-header small{
  display:block;
}
.role-permission-header small{
  margin-top:4px;
  color:var(--muted);
}
.role-permission-group{
  padding:13px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#f8fafc;
}
.role-permission-group h4{
  margin:0 0 10px;
}
.role-permission-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  padding:9px 0;
  border-bottom:1px solid var(--border);
}
.role-permission-row:last-child{
  border-bottom:0;
}
.role-permission-row input{
  width:18px;
  height:18px;
}
@media(max-width:900px){
  .employee-role-legend-grid{
    grid-template-columns:1fr;
  }
}


.employee-account-section{
  padding:15px;
  border:1px solid var(--border);
  border-radius:13px;
  background:#f8fafc;
}
.employee-account-head{margin-bottom:13px}
.employee-account-head h3{margin:0 0 4px}
.employee-account-head small{color:var(--muted)}
.employee-account-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.password-input-wrap{display:grid;grid-template-columns:1fr auto;gap:7px}
.password-toggle-btn{
  min-width:78px;padding:0 11px;border:1px solid var(--border);
  border-radius:10px;background:#fff;color:var(--theme-primary,#0f4c81);
  font-weight:800;cursor:pointer
}
.employee-login-status{
  display:inline-flex;padding:6px 9px;border-radius:999px;
  font-size:11px;font-weight:850
}
.employee-login-status.active{background:#eaf8f0;color:#187347}
.employee-login-status.inactive{background:#fff0f0;color:#a11b1b}
.employee-login-email{
  display:block;margin-top:5px;color:var(--muted);font-size:10px
}
@media(max-width:760px){
  .employee-account-grid{grid-template-columns:1fr}
}


.auth-locked{
  overflow:hidden;
}
.login-page{
  position:fixed;
  inset:0;
  z-index:100000;
  display:grid;
  place-items:center;
  min-height:100vh;
  padding:26px;
  overflow:auto;
  background:
    radial-gradient(circle at 15% 20%,rgba(49,134,201,.24),transparent 34%),
    radial-gradient(circle at 85% 80%,rgba(34,197,94,.12),transparent 32%),
    linear-gradient(135deg,#07192b 0%,#0d2f4d 52%,#0b1f34 100%);
}
.login-ambient{
  position:fixed;
  border-radius:50%;
  filter:blur(10px);
  pointer-events:none;
}
.login-ambient-one{
  width:420px;
  height:420px;
  left:-160px;
  top:-130px;
  background:rgba(45,139,206,.12);
}
.login-ambient-two{
  width:360px;
  height:360px;
  right:-100px;
  bottom:-120px;
  background:rgba(37,211,102,.08);
}
.login-shell{
  position:relative;
  width:min(1180px,100%);
  min-height:680px;
  display:grid;
  grid-template-columns:1.15fr .85fr;
  border:1px solid rgba(255,255,255,.13);
  border-radius:30px;
  overflow:hidden;
  background:rgba(255,255,255,.07);
  box-shadow:0 40px 120px rgba(0,0,0,.42);
  backdrop-filter:blur(24px);
}
.login-showcase{
  position:relative;
  padding:52px;
  color:#fff;
  overflow:hidden;
  background:
    linear-gradient(145deg,rgba(7,25,43,.35),rgba(9,59,96,.18)),
    radial-gradient(circle at 80% 10%,rgba(61,158,228,.24),transparent 30%);
}
.login-showcase::after{
  content:"";
  position:absolute;
  width:430px;
  height:430px;
  right:-190px;
  bottom:-170px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:50%;
  box-shadow:
    0 0 0 48px rgba(255,255,255,.025),
    0 0 0 96px rgba(255,255,255,.018);
}
.login-showcase-inner{
  position:relative;
  z-index:1;
  height:100%;
  display:flex;
  flex-direction:column;
}
.login-brand-lockup{
  display:flex;
  align-items:center;
  gap:17px;
}
.login-main-logo{
  width:72px;
  height:72px;
  display:grid;
  place-items:center;
  padding:8px;
  border-radius:20px;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.17);
  box-shadow:inset 0 0 24px rgba(255,255,255,.05);
}
.login-main-logo img{
  width:100%;
  height:100%;
  object-fit:contain;
}
.login-main-logo span{
  width:100%;
  height:100%;
  display:grid;
  place-items:center;
  font-size:24px;
  font-weight:950;
}
.login-eyebrow,
.login-card-kicker{
  display:block;
  margin-bottom:6px;
  font-size:10px;
  letter-spacing:2px;
  font-weight:900;
  color:#8ed1ff;
}
.login-brand-lockup h1{
  margin:0;
  max-width:430px;
  font-size:25px;
  line-height:1.05;
}
.login-brand-lockup p{
  margin:6px 0 0;
  color:#b9cce0;
  font-size:13px;
}
.login-hero-copy{
  margin:auto 0;
  max-width:570px;
}
.login-security-pill{
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:8px 11px;
  margin-bottom:20px;
  border:1px solid rgba(142,209,255,.25);
  border-radius:999px;
  background:rgba(142,209,255,.08);
  color:#bfe5ff;
  font-size:11px;
  font-weight:800;
}
.login-security-pill svg{
  width:16px;
  height:16px;
  fill:currentColor;
}
.login-hero-copy h2{
  margin:0;
  font-size:48px;
  line-height:1.04;
  letter-spacing:-1.6px;
}
.login-hero-copy p{
  max-width:510px;
  margin:18px 0 0;
  color:#bfd0e0;
  font-size:16px;
  line-height:1.65;
}
.login-feature-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
}
.login-feature{
  display:flex;
  align-items:flex-start;
  gap:10px;
  min-width:0;
  padding:13px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:15px;
  background:rgba(255,255,255,.055);
}
.login-feature>span{
  color:#70c6ff;
  font-size:10px;
  font-weight:900;
}
.login-feature strong,
.login-feature small{
  display:block;
}
.login-feature strong{
  font-size:12px;
}
.login-feature small{
  margin-top:4px;
  color:#9eb4c8;
  font-size:9px;
  line-height:1.35;
}
.login-panel{
  display:grid;
  place-items:center;
  padding:38px;
  background:#f7f9fc;
}
.login-card{
  width:min(430px,100%);
}
.login-card-head{
  margin-bottom:28px;
}
.login-card-head h2{
  margin:0;
  color:#14253a;
  font-size:31px;
  letter-spacing:-.7px;
}
.login-card-head p{
  margin:9px 0 0;
  color:#708096;
  line-height:1.5;
}
.login-field{
  margin-bottom:17px;
}
.login-field label{
  display:block;
  margin-bottom:8px;
  color:#24374e;
  font-size:12px;
  font-weight:850;
}
.login-label-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
}
.login-link-btn{
  border:0;
  background:transparent;
  color:var(--theme-primary,#0f4c81);
  font-size:11px;
  font-weight:800;
  cursor:pointer;
}
.login-input-wrap{
  display:grid;
  grid-template-columns:22px 1fr auto;
  align-items:center;
  gap:9px;
  min-height:52px;
  padding:0 13px;
  border:1px solid #dbe4ed;
  border-radius:14px;
  background:#fff;
  transition:.18s ease;
}
.login-input-wrap:focus-within{
  border-color:var(--theme-accent,#2f86c9);
  box-shadow:0 0 0 4px rgba(47,134,201,.10);
}
.login-input-wrap svg{
  width:18px;
  height:18px;
  fill:#8495a8;
}
.login-input-wrap input{
  width:100%;
  min-width:0;
  padding:0;
  border:0;
  outline:0;
  background:transparent;
  box-shadow:none;
}
.login-password-toggle{
  border:0;
  background:transparent;
  color:var(--theme-primary,#0f4c81);
  font-size:11px;
  font-weight:850;
  cursor:pointer;
}
.login-remember{
  display:flex;
  align-items:center;
  gap:8px;
  margin:3px 0 19px;
  color:#5f7085;
  font-size:11px;
}
.login-remember input{
  width:16px;
  height:16px;
}
.login-submit{
  width:100%;
  height:54px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  border:0;
  border-radius:15px;
  background:linear-gradient(135deg,var(--theme-primary2,#164d78),var(--theme-primary,#0f4c81));
  color:#fff;
  font-size:14px;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 16px 30px rgba(15,76,129,.24);
  transition:.18s ease;
}
.login-submit:hover{
  transform:translateY(-1px);
  box-shadow:0 19px 36px rgba(15,76,129,.30);
}
.login-submit:disabled{
  opacity:.72;
  cursor:wait;
}
.login-submit svg{
  width:19px;
  height:19px;
  fill:currentColor;
}
.login-error-message{
  margin-top:12px;
  padding:11px 12px;
  border:1px solid #efc0c0;
  border-radius:11px;
  background:#fff0f0;
  color:#9f1e1e;
  font-size:11px;
  line-height:1.4;
}
.first-owner-setup{
  display:flex;
  align-items:center;
  gap:11px;
  margin-top:18px;
  padding:13px;
  border:1px solid #d6e5f2;
  border-radius:14px;
  background:#edf6fd;
}
.first-owner-icon{
  flex:0 0 36px;
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:var(--theme-primary,#0f4c81);
  color:#fff;
  font-weight:900;
}
.first-owner-setup strong,
.first-owner-setup p{
  display:block;
}
.first-owner-setup p{
  margin:3px 0 0;
  color:#607286;
  font-size:10px;
}
.first-owner-setup .btn{
  margin-left:auto;
  white-space:nowrap;
}
.login-card-footer{
  margin-top:25px;
  padding-top:18px;
  border-top:1px solid #e2e8f0;
  text-align:center;
}
.login-card-footer span,
.login-card-footer small{
  display:block;
}
.login-card-footer span{
  color:#4f6278;
  font-size:11px;
  font-weight:800;
}
.login-card-footer small{
  margin-top:5px;
  color:#94a3b8;
  font-size:9px;
}
.first-owner-modal,
.forgot-password-modal{
  width:min(620px,100%);
}
.firebase-ready-message{
  padding:15px;
  border:1px solid #d5e7f5;
  border-radius:13px;
  background:#eef7fd;
}
.firebase-ready-message strong,
.firebase-ready-message span{
  display:block;
}
.firebase-ready-message span{
  margin-top:5px;
  color:#5f7286;
  line-height:1.5;
}
.sidebar-user-card{
  position:sticky;
  bottom:0;
  display:grid;
  grid-template-columns:38px 1fr 34px;
  align-items:center;
  gap:9px;
  margin-top:auto;
  padding:12px 10px;
  border-top:1px solid rgba(255,255,255,.12);
  background:linear-gradient(180deg,rgba(15,34,56,.25),rgba(8,26,44,.96));
}
.sidebar-user-avatar{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:12px;
  background:rgba(255,255,255,.13);
  color:#fff;
  font-weight:900;
}
.sidebar-user-info{
  min-width:0;
}
.sidebar-user-info strong,
.sidebar-user-info small{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.sidebar-user-info strong{
  color:#fff;
  font-size:11px;
}
.sidebar-user-info small{
  margin-top:3px;
  color:#a8bed2;
  font-size:9px;
}
.sidebar-logout-btn{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.12);
  border-radius:10px;
  background:rgba(255,255,255,.07);
  color:#fff;
  cursor:pointer;
}
.sidebar-logout-btn svg{
  width:17px;
  height:17px;
  fill:currentColor;
}
body.sidebar-collapsed .sidebar-user-card{
  grid-template-columns:1fr;
  justify-items:center;
}
body.sidebar-collapsed .sidebar-user-info{
  display:none;
}
@media(max-width:960px){
  .login-shell{
    grid-template-columns:1fr;
    max-width:650px;
  }
  .login-showcase{
    display:none;
  }
  .login-panel{
    min-height:660px;
  }
}
@media(max-width:600px){
  .login-page{
    padding:0;
    align-items:stretch;
  }
  .login-shell{
    min-height:100vh;
    border:0;
    border-radius:0;
  }
  .login-panel{
    padding:28px 20px;
  }
  .login-card-head h2{
    font-size:27px;
  }
  .first-owner-setup{
    align-items:stretch;
    flex-direction:column;
  }
  .first-owner-setup .btn{
    width:100%;
    margin-left:0;
  }
}


@media(min-width:901px){
  .sidebar{
    display:flex !important;
    flex-direction:column !important;
  }
  .sidebar .nav{
    flex:1 0 auto;
  }
}


/* V32.5 - login senza scrollbar visibile */
.login-page{
  scrollbar-width:none !important;
  -ms-overflow-style:none !important;
}
.login-page::-webkit-scrollbar{
  width:0 !important;
  height:0 !important;
  display:none !important;
}
.login-panel,
.login-showcase,
.login-shell{
  scrollbar-width:none !important;
  -ms-overflow-style:none !important;
}
.login-panel::-webkit-scrollbar,
.login-showcase::-webkit-scrollbar,
.login-shell::-webkit-scrollbar{
  width:0 !important;
  height:0 !important;
  display:none !important;
}
.login-help-actions{
  margin-top:16px;
  text-align:center;
}
.first-access-help-modal{
  width:min(780px,100%);
}
.first-access-help-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}
.first-access-help-card{
  display:grid;
  gap:10px;
  padding:16px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#f8fafc;
}
.first-access-help-card.warning{
  background:#fffaf0;
  border-color:#f0d7a2;
}
.first-access-help-card strong,
.first-access-help-card span{
  display:block;
}
.first-access-help-card span{
  color:var(--muted);
  line-height:1.45;
}
.login-title-setting{
  margin-top:14px;
}
@media(max-width:760px){
  .first-access-help-grid{
    grid-template-columns:1fr;
  }
}


/* V32.6 - primo accesso sempre disponibile */
.first-owner-required{
  margin-top:20px;
  padding:16px !important;
  border:1px solid rgba(47,134,201,.34) !important;
  background:linear-gradient(135deg,#eef7fd,#f8fbff) !important;
  box-shadow:0 14px 30px rgba(15,76,129,.10);
}
.first-owner-required.visible{
  animation:firstOwnerAppear .28s ease;
}
.first-owner-copy{
  flex:1;
  min-width:0;
}
.first-owner-required .btn{
  min-width:170px;
}
.login-form.login-form-disabled{
  opacity:.45;
  pointer-events:none;
  filter:grayscale(.2);
}
@keyframes firstOwnerAppear{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}
@media(max-width:600px){
  .first-owner-required{
    align-items:stretch !important;
  }
  .first-owner-required .btn{
    min-width:0;
  }
}


/* V32.7 - login senza barre di scorrimento visibili */
html.auth-login-visible,
body.auth-locked{
  overflow:hidden !important;
  scrollbar-width:none !important;
  -ms-overflow-style:none !important;
}
html.auth-login-visible::-webkit-scrollbar,
body.auth-locked::-webkit-scrollbar{
  width:0 !important;
  height:0 !important;
  display:none !important;
}
.login-page{
  position:fixed !important;
  inset:0 !important;
  width:100vw !important;
  height:100vh !important;
  min-height:100vh !important;
  max-height:100vh !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  scrollbar-width:none !important;
  -ms-overflow-style:none !important;
}
.login-page::-webkit-scrollbar{
  width:0 !important;
  height:0 !important;
  display:none !important;
}
.login-shell,
.login-panel,
.login-showcase,
.login-card{
  scrollbar-width:none !important;
  -ms-overflow-style:none !important;
}
.login-shell::-webkit-scrollbar,
.login-panel::-webkit-scrollbar,
.login-showcase::-webkit-scrollbar,
.login-card::-webkit-scrollbar{
  width:0 !important;
  height:0 !important;
  display:none !important;
}
@media(min-width:961px) and (min-height:650px){
  .login-page{
    overflow:hidden !important;
  }
  .login-shell{
    height:min(680px,calc(100vh - 42px)) !important;
    min-height:0 !important;
  }
  .login-panel,
  .login-showcase{
    overflow:hidden !important;
  }
}


/* V32.8 - creazione prima utenza sempre accessibile */
.login-first-access-actions{
  display:grid !important;
  gap:11px;
  margin-top:17px;
}
.login-first-user-btn{
  width:100%;
  display:grid;
  grid-template-columns:42px 1fr;
  align-items:center;
  gap:11px;
  padding:12px 14px;
  border:1px solid #c9dfef;
  border-radius:14px;
  background:linear-gradient(135deg,#eef7fd,#f9fcff);
  color:#173a59;
  text-align:left;
  cursor:pointer;
  transition:.18s ease;
}
.login-first-user-btn:hover{
  transform:translateY(-1px);
  border-color:var(--theme-accent,#2f86c9);
  box-shadow:0 10px 24px rgba(15,76,129,.12);
}
.login-first-user-icon{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:11px;
  background:var(--theme-primary,#0f4c81);
  color:#fff;
  font-size:23px;
  font-weight:700;
}
.login-first-user-btn strong,
.login-first-user-btn small{
  display:block;
}
.login-first-user-btn strong{
  font-size:12px;
}
.login-first-user-btn small{
  margin-top:3px;
  color:#6f8194;
  font-size:10px;
}
.login-first-access-actions>.login-link-btn{
  justify-self:center;
}


/* V32.9 - menu scrollabile con profilo fisso */
@media(min-width:901px){
  .sidebar{
    overflow:hidden !important;
    padding-bottom:0 !important;
  }

  .sidebar .brand{
    flex:0 0 auto;
  }

  .sidebar .nav{
    flex:1 1 auto !important;
    min-height:0 !important;
    overflow-y:auto !important;
    overflow-x:visible !important;
    padding-bottom:14px !important;
    scrollbar-width:none !important;
    -ms-overflow-style:none !important;
  }

  .sidebar .nav::-webkit-scrollbar{
    width:0 !important;
    height:0 !important;
    display:none !important;
  }

  .sidebar-user-card{
    position:relative !important;
    bottom:auto !important;
    flex:0 0 auto !important;
    width:100% !important;
    margin-top:0 !important;
    z-index:30 !important;
    background:linear-gradient(180deg,#15395c,#0b2239) !important;
    box-shadow:0 -12px 28px rgba(0,0,0,.16);
  }
}

.sidebar-user-card{
  grid-template-columns:minmax(0,1fr) 34px !important;
}

.sidebar-user-profile-btn{
  min-width:0;
  display:grid;
  grid-template-columns:38px minmax(0,1fr);
  align-items:center;
  gap:9px;
  padding:0;
  border:0;
  background:transparent;
  color:inherit;
  text-align:left;
  cursor:pointer;
}

.sidebar-user-profile-btn:hover .sidebar-user-info strong{
  text-decoration:underline;
}

body.sidebar-collapsed .sidebar-user-card{
  grid-template-columns:1fr !important;
  gap:7px;
}

body.sidebar-collapsed .sidebar-user-profile-btn{
  grid-template-columns:1fr;
  justify-items:center;
}

body.sidebar-collapsed .sidebar-logout-btn{
  margin:0 auto;
}

/* Profilo */
.profile-layout{
  display:grid;
  grid-template-columns:320px minmax(0,1fr);
  gap:20px;
}

.profile-summary-card{
  text-align:center;
  align-self:start;
}

.profile-avatar-large{
  width:96px;
  height:96px;
  display:grid;
  place-items:center;
  margin:0 auto 14px;
  border-radius:28px;
  background:linear-gradient(135deg,var(--theme-primary2,#164d78),var(--theme-primary,#0f4c81));
  color:#fff;
  font-size:31px;
  font-weight:950;
  box-shadow:0 16px 32px rgba(15,76,129,.22);
}

.profile-summary-card h2{
  margin:0 0 10px;
}

.profile-summary-list{
  display:grid;
  gap:10px;
  margin-top:20px;
  text-align:left;
}

.profile-summary-list>div{
  padding:12px;
  border:1px solid var(--border);
  border-radius:11px;
  background:#f8fafc;
}

.profile-summary-list span,
.profile-summary-list strong{
  display:block;
}

.profile-summary-list span{
  margin-bottom:4px;
  color:var(--muted);
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.5px;
}

.profile-card-head h2{
  margin:0 0 5px;
}

.profile-card-head p{
  margin:0 0 18px;
  color:var(--muted);
}

.profile-form-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.profile-inner-divider{
  height:1px;
  margin:26px 0;
  background:var(--border);
}

@media(max-width:900px){
  .profile-layout{
    grid-template-columns:1fr;
  }
}

@media(max-width:700px){
  .profile-form-grid{
    grid-template-columns:1fr;
  }
}


/* V33.0 - profilo laterale raffinato */
.sidebar-user-card{
  margin:10px !important;
  width:calc(100% - 20px) !important;
  padding:7px !important;
  border:1px solid rgba(255,255,255,.12) !important;
  border-radius:16px !important;
  background:linear-gradient(145deg,rgba(255,255,255,.10),rgba(255,255,255,.055)) !important;
  box-shadow:0 10px 26px rgba(0,0,0,.18) !important;
  backdrop-filter:blur(12px);
}

.sidebar-user-profile-btn{
  grid-template-columns:34px minmax(0,1fr) 18px !important;
  gap:8px !important;
  padding:4px !important;
  border-radius:11px !important;
}

.sidebar-user-profile-btn:hover{
  background:rgba(255,255,255,.07) !important;
}

.sidebar-user-avatar{
  width:34px !important;
  height:34px !important;
  border-radius:10px !important;
  font-size:12px !important;
}

.sidebar-user-info strong{
  font-size:10px !important;
}

.sidebar-user-info small{
  font-size:8px !important;
}

.sidebar-user-chevron{
  display:grid;
  place-items:center;
  color:#9fb6ca;
  font-size:18px;
}

.sidebar-logout-btn{
  width:31px !important;
  height:31px !important;
  border-radius:9px !important;
}

body.sidebar-collapsed .sidebar-user-card{
  width:54px !important;
  margin:10px auto !important;
  padding:7px !important;
  border-radius:15px !important;
}

body.sidebar-collapsed .sidebar-user-profile-btn{
  grid-template-columns:1fr !important;
  padding:0 !important;
}

body.sidebar-collapsed .sidebar-user-chevron{
  display:none !important;
}

body.sidebar-collapsed .sidebar-user-avatar{
  width:36px !important;
  height:36px !important;
}

body.sidebar-collapsed .sidebar-logout-btn{
  width:36px !important;
  height:36px !important;
  margin-top:5px !important;
}

.login-first-access-actions.owner-exists #alwaysCreateFirstUserButton{
  display:none !important;
}

.login-first-access-actions.owner-exists{
  margin-top:13px !important;
}

#profileCenterSelect:disabled{
  background:#eef2f6;
  color:#64748b;
  cursor:not-allowed;
}


.password-reset-modal-card{
  width:min(560px,100%);
}
.password-reset-user-summary{
  display:grid;
  grid-template-columns:130px 1fr;
  gap:10px 14px;
  padding:14px;
  margin-bottom:14px;
  border:1px solid var(--border);
  border-radius:13px;
  background:#f8fafc;
}
.password-reset-user-summary span{
  color:var(--muted);
  font-size:11px;
}
.password-reset-user-summary strong{
  overflow-wrap:anywhere;
}
[data-delete-employee-id],
[data-delete-center-id],
[data-reset-password-id],
[data-confirm-delete-employee],
[data-confirm-delete-center]{
  pointer-events:auto !important;
  cursor:pointer !important;
}
@media(max-width:600px){
  .password-reset-user-summary{
    grid-template-columns:1fr;
  }
}


/* Conferma eliminazione irreversibile */
.irreversible-delete-card{
  width:min(500px,100%);
  text-align:center;
  padding:26px;
}
.irreversible-delete-icon{
  width:62px;
  height:62px;
  display:grid;
  place-items:center;
  margin:0 auto 14px;
  border-radius:20px;
  background:#fff0f0;
  color:#b42323;
  font-size:30px;
  font-weight:950;
}
.irreversible-delete-copy h2{
  margin:0 0 8px;
}
.irreversible-delete-copy p{
  margin:0;
  color:var(--muted);
  line-height:1.5;
}
.irreversible-delete-warning{
  margin:16px 0;
  padding:11px 13px;
  border:1px solid #efc0c0;
  border-radius:11px;
  background:#fff5f5;
  color:#9f1e1e;
  font-weight:850;
}

/* Logo pagina accesso */
.login-logo-settings-card{
  margin-top:18px;
  padding:16px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#f8fafc;
}
.login-logo-settings-head h3{
  margin:0 0 4px;
}
.login-logo-settings-head p{
  margin:0 0 15px;
  color:var(--muted);
}
.login-logo-settings-grid{
  display:grid;
  grid-template-columns:240px minmax(0,1fr);
  gap:18px;
  align-items:start;
}
.login-logo-preview-box{
  min-height:180px;
  display:grid;
  place-items:center;
  padding:16px;
  border:1px dashed #9db3c8;
  border-radius:14px;
  background:#102b47;
  overflow:hidden;
}
.login-logo-preview-box img{
  object-fit:contain;
  max-width:100%;
  max-height:150px;
}
.login-logo-preview-box span{
  color:#b8cadb;
  font-size:12px;
}
.login-logo-controls{
  display:grid;
  gap:14px;
}
.login-logo-buttons{
  margin:0;
}
.login-logo-slider{
  display:grid;
  gap:7px;
}
.login-logo-slider label{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-size:12px;
  font-weight:800;
}
.login-logo-slider strong{
  color:var(--theme-primary,#0f4c81);
}
.login-logo-slider input[type="range"]{
  width:100%;
}
@media(max-width:760px){
  .login-logo-settings-grid{
    grid-template-columns:1fr;
  }
}


/* V33.7 - barra superiore fissa */
:root{
  --app-header-height:88px;
}

.app{
  padding-top:var(--app-header-height) !important;
}

.app-fixed-header{
  position:fixed;
  inset:0 0 auto 0;
  z-index:45000;
  height:var(--app-header-height);
  display:grid;
  grid-template-columns:minmax(320px,1.2fr) minmax(340px,1fr) auto;
  align-items:center;
  gap:24px;
  padding:12px 24px;
  color:#fff;
  background:
    radial-gradient(circle at 25% 10%,rgba(66,154,222,.20),transparent 34%),
    linear-gradient(135deg,#102a56 0%,#0d3d6b 55%,#092544 100%);
  border-bottom:1px solid rgba(255,255,255,.13);
  box-shadow:0 12px 34px rgba(7,24,42,.24);
}

.app-fixed-brand{
  min-width:0;
  display:flex;
  align-items:center;
  gap:14px;
}

.app-fixed-logo-box{
  flex:0 0 62px;
  width:62px;
  height:62px;
  display:grid;
  place-items:center;
  padding:6px;
  border:1px solid rgba(255,255,255,.15);
  border-radius:17px;
  background:rgba(255,255,255,.09);
  overflow:hidden;
}

.app-fixed-logo-box img{
  width:100%;
  height:100%;
  object-fit:contain;
}

.app-fixed-logo-box span{
  width:100%;
  height:100%;
  display:grid;
  place-items:center;
  font-size:20px;
  font-weight:950;
}

.app-fixed-brand-copy{
  min-width:0;
}

.app-fixed-brand-copy strong,
.app-fixed-brand-copy small{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.app-fixed-brand-copy strong{
  font-size:18px;
  letter-spacing:.2px;
}

.app-fixed-brand-copy small{
  margin-top:5px;
  color:#b9cee1;
  font-size:11px;
}

.app-fixed-header-center{
  display:flex;
  justify-content:center;
  gap:12px;
}

.app-header-status{
  min-width:150px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.11);
  border-radius:14px;
  background:rgba(255,255,255,.07);
}

.app-header-status.cloud{
  min-width:170px;
}

.app-header-status-icon{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:rgba(255,255,255,.12);
  font-size:16px;
}

.app-header-status small,
.app-header-status strong{
  display:block;
}

.app-header-status small{
  color:#a9c0d4;
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.55px;
}

.app-header-status strong{
  margin-top:3px;
  font-size:11px;
}

.app-fixed-header-right{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
}

.app-header-clock{
  min-width:108px;
  text-align:right;
}

.app-header-clock small,
.app-header-clock strong{
  display:block;
}

.app-header-clock small{
  color:#a9c0d4;
  font-size:9px;
  text-transform:capitalize;
}

.app-header-clock strong{
  margin-top:3px;
  font-size:15px;
  letter-spacing:.5px;
}

.app-header-profile{
  display:grid;
  grid-template-columns:38px minmax(0,130px);
  align-items:center;
  gap:9px;
  padding:7px 10px 7px 7px;
  border:1px solid rgba(255,255,255,.13);
  border-radius:14px;
  background:rgba(255,255,255,.08);
  color:#fff;
  text-align:left;
  cursor:pointer;
}

.app-header-profile:hover{
  background:rgba(255,255,255,.13);
}

.app-header-avatar{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:11px;
  background:rgba(255,255,255,.15);
  font-size:12px;
  font-weight:900;
}

.app-header-user-copy{
  min-width:0;
}

.app-header-user-copy strong,
.app-header-user-copy small{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.app-header-user-copy strong{
  font-size:11px;
}

.app-header-user-copy small{
  margin-top:3px;
  color:#aac0d4;
  font-size:9px;
}

/* Sidebar solo navigazione */
.sidebar{
  top:var(--app-header-height) !important;
  height:calc(100vh - var(--app-header-height)) !important;
  padding-top:16px !important;
}

.sidebar-toggle-btn{
  position:relative !important;
  top:auto !important;
  right:auto !important;
  margin:0 auto 14px !important;
}

.sidebar .brand{
  display:none !important;
}

.main{
  padding-top:28px !important;
}

/* Footer corretto con top header */
.company-footer{
  margin-top:0 !important;
}

@media(max-width:1100px){
  .app-fixed-header{
    grid-template-columns:minmax(260px,1fr) auto;
  }

  .app-fixed-header-center{
    display:none;
  }
}

@media(max-width:900px){
  :root{
    --app-header-height:76px;
  }

  .app{
    padding-top:var(--app-header-height) !important;
  }

  .app-fixed-header{
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
    padding:9px 13px;
  }

  .app-fixed-logo-box{
    flex-basis:52px;
    width:52px;
    height:52px;
    border-radius:14px;
  }

  .app-fixed-brand-copy strong{
    font-size:14px;
  }

  .app-fixed-brand-copy small{
    font-size:9px;
  }

  .app-header-clock{
    display:none;
  }

  .app-header-profile{
    grid-template-columns:36px;
    padding:6px;
  }

  .app-header-user-copy{
    display:none;
  }

  .sidebar{
    top:auto !important;
    height:auto !important;
  }
}

@media(max-width:520px){
  .app-fixed-brand-copy small{
    display:none;
  }

  .app-fixed-logo-box{
    flex-basis:46px;
    width:46px;
    height:46px;
  }

  .app-fixed-brand-copy strong{
    font-size:12px;
  }
}


/* V33.8 - freccia menu e logo stampato sulla Top Bar */
.sidebar-toggle-btn{
  width:48px !important;
  height:48px !important;
  display:grid !important;
  place-items:center !important;
  margin:0 auto 18px !important;
  border:1px solid rgba(255,255,255,.14) !important;
  border-radius:15px !important;
  background:rgba(255,255,255,.09) !important;
  color:#fff !important;
  box-shadow:none !important;
}

.sidebar-toggle-btn:hover{
  background:rgba(255,255,255,.15) !important;
}

.sidebar-toggle-arrow{
  display:grid;
  place-items:center;
  width:100%;
  height:100%;
  font-size:29px;
  font-weight:700;
  line-height:1;
}

.sidebar-user-card{
  display:none !important;
}

.app-fixed-logo-box{
  flex:0 0 auto !important;
  min-width:0 !important;
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  overflow:visible !important;
}

.app-fixed-logo-box.has-logo img{
  display:block !important;
  max-width:300px !important;
  max-height:72px !important;
  object-fit:contain !important;
}

.app-fixed-logo-box:not(.has-logo){
  width:62px !important;
  height:62px !important;
  padding:6px !important;
  border:1px solid rgba(255,255,255,.15) !important;
  border-radius:17px !important;
  background:rgba(255,255,255,.09) !important;
}

body.sidebar-collapsed .sidebar-toggle-btn{
  margin-left:auto !important;
  margin-right:auto !important;
}


/* V33.9 - sidebar compatta, verticale e separata dalla Top Bar */
:root{
  --sidebar-header-gap:10px;
}

/* Stacco visivo dalla Top Bar */
.sidebar{
  top:calc(var(--app-header-height) + var(--sidebar-header-gap)) !important;
  height:calc(100vh - var(--app-header-height) - var(--sidebar-header-gap)) !important;
  border-top-right-radius:18px !important;
  box-shadow:8px 0 24px rgba(7,24,42,.12) !important;
  overflow:hidden !important;
}

/* Menu solo verticale */
.sidebar .nav{
  display:flex !important;
  flex-direction:column !important;
  gap:4px !important;
  min-height:0 !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  padding:0 10px 16px !important;
  scrollbar-width:none !important;
  -ms-overflow-style:none !important;
}

.sidebar .nav::-webkit-scrollbar{
  width:0 !important;
  height:0 !important;
  display:none !important;
}

/* Voci più compatte */
.sidebar .nav button{
  min-height:44px !important;
  padding:8px 10px !important;
  gap:10px !important;
  border-radius:12px !important;
  flex:0 0 auto !important;
  white-space:nowrap !important;
}

.sidebar .nav .nav-icon{
  flex:0 0 28px !important;
  width:28px !important;
  height:28px !important;
  display:grid !important;
  place-items:center !important;
}

.sidebar .nav .nav-icon svg{
  width:18px !important;
  height:18px !important;
}

/* Menu chiuso: icone centrate e tutte visibili */
body.sidebar-collapsed .sidebar{
  width:82px !important;
}

body.sidebar-collapsed .sidebar .nav{
  padding-left:8px !important;
  padding-right:8px !important;
  align-items:center !important;
}

body.sidebar-collapsed .sidebar .nav button{
  width:52px !important;
  min-width:52px !important;
  max-width:52px !important;
  min-height:42px !important;
  padding:7px !important;
  justify-content:center !important;
  overflow:visible !important;
}

body.sidebar-collapsed .sidebar .nav .nav-icon{
  flex-basis:26px !important;
  width:26px !important;
  height:26px !important;
}

body.sidebar-collapsed .sidebar .nav .nav-icon svg{
  width:17px !important;
  height:17px !important;
}

/* Freccia sempre centrata e mai tagliata */
.sidebar-toggle-btn{
  flex:0 0 46px !important;
  width:46px !important;
  height:46px !important;
  min-width:46px !important;
  min-height:46px !important;
  margin:0 auto 12px !important;
  overflow:visible !important;
  position:relative !important;
  left:auto !important;
  right:auto !important;
}

.sidebar-toggle-arrow{
  position:absolute !important;
  inset:0 !important;
  display:grid !important;
  place-items:center !important;
  transform:none !important;
  font-size:26px !important;
  line-height:1 !important;
  overflow:visible !important;
}

body.sidebar-collapsed .sidebar-toggle-btn{
  margin-left:auto !important;
  margin-right:auto !important;
  transform:none !important;
}

/* Evita qualsiasi scorrimento laterale del layout */
.app,
.main,
.sidebar{
  overflow-x:hidden !important;
}

@media(max-width:900px){
  .sidebar{
    top:auto !important;
    height:auto !important;
    border-top-right-radius:0 !important;
  }
}


/* V34.0 - tasto Esci, brand Home e selezione pulita */
.app-fixed-brand-button{
  border:0 !important;
  background:transparent !important;
  color:inherit !important;
  padding:0 !important;
  text-align:left !important;
  cursor:pointer !important;
  font:inherit !important;
}

.app-fixed-brand-button:hover .app-fixed-brand-copy strong{
  text-decoration:underline;
  text-underline-offset:3px;
}

.sidebar{
  display:flex !important;
  flex-direction:column !important;
}

.sidebar .nav{
  flex:1 1 auto !important;
}

.sidebar .nav button{
  border:1px solid transparent !important;
  box-shadow:none !important;
  outline:none !important;
  box-sizing:border-box !important;
}

.sidebar .nav button.active{
  background:linear-gradient(135deg,rgba(72,166,230,.31),rgba(47,130,197,.23)) !important;
  border:1px solid rgba(119,204,255,.42) !important;
  box-shadow:
    inset 4px 0 0 #56baf3,
    0 6px 16px rgba(5,30,55,.14) !important;
}

body.sidebar-collapsed .sidebar .nav button.active{
  width:52px !important;
  min-width:52px !important;
  max-width:52px !important;
  height:42px !important;
  min-height:42px !important;
  border-radius:13px !important;
  padding:7px !important;
  box-shadow:
    inset 3px 0 0 #56baf3,
    0 6px 15px rgba(5,30,55,.16) !important;
  overflow:hidden !important;
}

.sidebar-bottom-actions{
  flex:0 0 auto;
  padding:8px 10px 14px;
}

.sidebar-exit-btn{
  width:100%;
  min-height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  padding:9px 11px;
  border:1px solid rgba(255,255,255,.13);
  border-radius:13px;
  background:rgba(255,255,255,.08);
  color:#fff;
  font-weight:850;
  cursor:pointer;
}

.sidebar-exit-btn:hover{
  background:rgba(255,255,255,.15);
}

.sidebar-exit-btn svg{
  width:19px;
  height:19px;
  fill:currentColor;
}

body.sidebar-collapsed .sidebar-bottom-actions{
  padding-left:8px;
  padding-right:8px;
}

body.sidebar-collapsed .sidebar-exit-btn{
  width:52px;
  min-width:52px;
  max-width:52px;
  min-height:42px;
  margin:0 auto;
  padding:7px;
}

body.sidebar-collapsed .sidebar-exit-btn span{
  display:none;
}


/* V34.1 - sidebar con uscita sempre visibile */
.sidebar{
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
}

.sidebar .nav{
  flex:1 1 auto !important;
  min-height:0 !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  padding-bottom:10px !important;
}

.sidebar-bottom-actions{
  position:relative !important;
  flex:0 0 auto !important;
  width:100% !important;
  margin-top:auto !important;
  padding:8px 10px 14px !important;
  background:linear-gradient(180deg,rgba(12,45,77,.25),#0d3154 38%) !important;
  z-index:20 !important;
}

.sidebar-exit-btn{
  width:100% !important;
  min-height:44px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:9px !important;
  border:1px solid rgba(255,255,255,.15) !important;
  border-radius:13px !important;
  background:rgba(255,255,255,.09) !important;
  color:#fff !important;
}

body.sidebar-collapsed .sidebar-bottom-actions{
  padding:8px 7px 14px !important;
}

body.sidebar-collapsed .sidebar-exit-btn{
  width:52px !important;
  min-width:52px !important;
  max-width:52px !important;
  height:42px !important;
  min-height:42px !important;
  margin:0 auto !important;
  padding:7px !important;
  border-radius:13px !important;
}

body.sidebar-collapsed .sidebar-exit-btn span{
  display:none !important;
}

/* Selezione voce attiva più pulita */
.sidebar .nav button{
  position:relative !important;
  border:1px solid transparent !important;
  box-shadow:none !important;
  overflow:hidden !important;
}

.sidebar .nav button.active{
  background:rgba(70,162,224,.25) !important;
  border:1px solid rgba(120,205,255,.42) !important;
  box-shadow:0 6px 15px rgba(4,28,50,.14) !important;
}

.sidebar .nav button.active::before{
  content:"";
  position:absolute;
  left:0;
  top:7px;
  bottom:7px;
  width:4px;
  border-radius:0 4px 4px 0;
  background:#58bcf4;
}

body.sidebar-collapsed .sidebar .nav button.active{
  width:52px !important;
  height:42px !important;
  min-width:52px !important;
  max-width:52px !important;
  min-height:42px !important;
  padding:7px !important;
  border-radius:13px !important;
}

body.sidebar-collapsed .sidebar .nav button.active::before{
  top:6px;
  bottom:6px;
  width:3px;
}


/* V34.2 - selezione pulita e tasto Esci fisso */
.sidebar{display:flex!important;flex-direction:column!important;overflow:hidden!important}
.sidebar .nav{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;padding:0 8px 8px!important;gap:3px!important;scrollbar-width:none!important}
.sidebar .nav::-webkit-scrollbar{display:none!important}
.sidebar .nav button{position:relative!important;width:100%!important;min-height:40px!important;padding:6px 8px!important;margin:0!important;border:1px solid transparent!important;border-radius:12px!important;background:transparent!important;box-shadow:none!important;outline:none!important;overflow:hidden!important}
.sidebar .nav button::before,.sidebar .nav button::after{display:none!important;content:none!important}
.sidebar .nav button.active{background:rgba(74,164,226,.28)!important;border:1px solid rgba(120,205,255,.46)!important;box-shadow:0 5px 14px rgba(4,28,50,.16)!important}
body.sidebar-collapsed .sidebar .nav{align-items:center!important;padding-left:7px!important;padding-right:7px!important}
body.sidebar-collapsed .sidebar .nav button,body.sidebar-collapsed .sidebar .nav button.active{width:50px!important;min-width:50px!important;max-width:50px!important;height:40px!important;min-height:40px!important;padding:6px!important;justify-content:center!important;border-radius:12px!important}
body.sidebar-collapsed .sidebar .nav button.active{background:rgba(74,164,226,.30)!important;border:1px solid rgba(120,205,255,.50)!important;box-shadow:0 5px 14px rgba(4,28,50,.16)!important}
.sidebar-bottom-actions{position:sticky!important;bottom:0!important;flex:0 0 auto!important;width:100%!important;margin-top:auto!important;padding:8px 8px 12px!important;background:linear-gradient(180deg,rgba(13,49,84,.15),#0d3154 36%)!important;z-index:100!important}
.sidebar-exit-btn{width:100%!important;min-height:42px!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;padding:8px 10px!important;border:1px solid rgba(255,255,255,.16)!important;border-radius:12px!important;background:rgba(255,255,255,.10)!important;color:#fff!important;font-weight:850!important;cursor:pointer!important}
.sidebar-exit-btn:hover{background:rgba(255,255,255,.16)!important}
.sidebar-exit-btn svg{width:18px!important;height:18px!important;fill:currentColor!important}
body.sidebar-collapsed .sidebar-bottom-actions{padding-left:7px!important;padding-right:7px!important}
body.sidebar-collapsed .sidebar-exit-btn{width:50px!important;min-width:50px!important;max-width:50px!important;height:40px!important;min-height:40px!important;margin:0 auto!important;padding:6px!important;border-radius:12px!important}
body.sidebar-collapsed .sidebar-exit-btn span{display:none!important}


/* V34.3 - indicatori impostazioni + / − */
.settings-accordion-arrow{
  width:34px!important;height:34px!important;display:grid!important;place-items:center!important;
  border:1px solid var(--border)!important;border-radius:11px!important;background:#f3f7fb!important;
  color:var(--theme-primary,#0f4c81)!important;font-size:22px!important;font-weight:700!important;
  line-height:1!important;transform:none!important;transition:.18s ease!important;
}
.settings-accordion.open .settings-accordion-arrow{background:var(--theme-primary,#0f4c81)!important;color:#fff!important;transform:none!important}
.settings-accordion-content{overflow:hidden!important;opacity:0;pointer-events:none;transition:max-height .25s ease,opacity .18s ease!important}


/* V34.4 - indicatori Impostazioni uniformi */
.settings-accordion-arrow,
.settings-group-arrow{
  width:36px !important;
  height:36px !important;
  min-width:36px !important;
  display:grid !important;
  place-items:center !important;
  border-radius:11px !important;
  background:#eef3f7 !important;
  color:#5d7084 !important;
  font-size:22px !important;
  font-weight:800 !important;
  line-height:1 !important;
  transform:none !important;
}

.settings-accordion.open .settings-accordion-arrow,
.settings-group-accordion.open .settings-group-arrow{
  background:var(--theme-primary,#0f4c81) !important;
  color:#fff !important;
  transform:none !important;
}

.settings-accordion-content,
.settings-group-content{
  overflow:hidden !important;
  opacity:0;
  pointer-events:none;
  transition:max-height .24s ease,opacity .18s ease !important;
}

.settings-accordion.open .settings-accordion-content,
.settings-group-accordion.open .settings-group-content{
  opacity:1;
  pointer-events:auto;
}


/* V34.5 - login da tastiera, sessione persistente e accordion stabili */
.settings-accordion-content,
.settings-group-content{
  overflow:visible !important;
  transition:none !important;
}

.settings-accordion-content[hidden],
.settings-group-content[hidden]{
  display:none !important;
}

.settings-accordion-arrow,
.settings-group-arrow{
  transform:none !important;
}

.login-form input:focus,
.login-form button:focus{
  outline:3px solid rgba(75,163,226,.22) !important;
  outline-offset:2px !important;
}


/* V34.6 - login pulito e submit senza refresh */
.login-form .login-input-wrap input,
.login-form .login-input-wrap input:focus,
.login-form .login-input-wrap input:focus-visible{
  border:0 !important;
  outline:0 !important;
  box-shadow:none !important;
  background:transparent !important;
}

.login-form .login-input-wrap:focus-within{
  border-color:var(--theme-accent,#2f86c9) !important;
  box-shadow:0 0 0 4px rgba(47,134,201,.10) !important;
}

.login-form button:focus-visible{
  outline:3px solid rgba(75,163,226,.22) !important;
  outline-offset:2px !important;
}


/* V34.7 - login senza submit nativo */
#loginForm{
  display:block;
}


#loginForm .login-input-wrap input{
  border:0 !important;
  outline:0 !important;
  box-shadow:none !important;
  background:transparent !important;
}


/* V34.8 - Esci fisso e checkbox Resta connesso */
#loginRememberMe{
  appearance:auto !important;
  -webkit-appearance:checkbox !important;
  width:17px !important;
  height:17px !important;
  min-width:17px !important;
  margin:0 !important;
  accent-color:var(--theme-primary,#0f4c81);
  cursor:pointer !important;
}

.login-remember{
  cursor:pointer !important;
  user-select:none !important;
}

.sidebar{
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
}

.sidebar .nav{
  flex:1 1 auto !important;
  min-height:0 !important;
  overflow-y:auto !important;
}

.sidebar-bottom-actions{
  flex:0 0 auto !important;
  width:100% !important;
  margin-top:auto !important;
  padding:8px 8px 12px !important;
  background:linear-gradient(180deg,rgba(13,49,84,.12),#0d3154 35%) !important;
  z-index:100 !important;
}

.sidebar-exit-btn{
  width:100% !important;
  min-height:42px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
  padding:8px 10px !important;
  border:1px solid rgba(255,255,255,.16) !important;
  border-radius:12px !important;
  background:rgba(255,255,255,.10) !important;
  color:#fff !important;
  font-weight:850 !important;
  cursor:pointer !important;
}

.sidebar-exit-btn:hover{
  background:rgba(255,255,255,.16) !important;
}

.sidebar-exit-btn svg{
  width:18px !important;
  height:18px !important;
  fill:currentColor !important;
}

body.sidebar-collapsed .sidebar-bottom-actions{
  padding-left:7px !important;
  padding-right:7px !important;
}

body.sidebar-collapsed .sidebar-exit-btn{
  width:50px !important;
  min-width:50px !important;
  max-width:50px !important;
  height:40px !important;
  min-height:40px !important;
  margin:0 auto !important;
  padding:6px !important;
}

body.sidebar-collapsed .sidebar-exit-btn span{
  display:none !important;
}


/* V35.2 - login e sessione ricostruiti dalla V34.8 stabile */
html.auth-login-visible,
body.auth-locked{
  overflow:hidden !important;
  scrollbar-width:none !important;
  -ms-overflow-style:none !important;
}

html.auth-login-visible::-webkit-scrollbar,
body.auth-locked::-webkit-scrollbar,
.login-page::-webkit-scrollbar,
.login-shell::-webkit-scrollbar,
.login-panel::-webkit-scrollbar,
.login-card::-webkit-scrollbar{
  width:0 !important;
  height:0 !important;
  display:none !important;
}

.login-page{
  position:fixed !important;
  inset:0 !important;
  width:100vw !important;
  height:100vh !important;
  max-height:100vh !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  scrollbar-width:none !important;
  -ms-overflow-style:none !important;
}

@media(min-width:961px) and (min-height:650px){
  .login-page{
    overflow:hidden !important;
  }
}

.sidebar{
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
}

.sidebar .nav{
  flex:1 1 auto !important;
  min-height:0 !important;
  overflow-y:auto !important;
  padding-bottom:72px !important;
}

.sidebar-bottom-actions{
  position:absolute !important;
  left:0 !important;
  right:0 !important;
  bottom:0 !important;
  padding:9px 8px 12px !important;
  z-index:9999 !important;
  background:linear-gradient(180deg,rgba(13,49,84,0),#0d3154 34%) !important;
}

.sidebar-exit-btn{
  width:100% !important;
  min-height:44px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
  border:1px solid rgba(255,255,255,.18) !important;
  border-radius:13px !important;
  background:rgba(255,255,255,.13) !important;
  color:#fff !important;
  font-weight:850 !important;
}

.sidebar-exit-btn svg{
  width:19px !important;
  height:19px !important;
  fill:currentColor !important;
}

body.sidebar-collapsed .sidebar-exit-btn{
  width:50px !important;
  min-width:50px !important;
  max-width:50px !important;
  margin:0 auto !important;
}

body.sidebar-collapsed .sidebar-exit-btn span{
  display:none !important;
}

.logout-confirm-card{
  width:min(430px,100%);
  text-align:center;
}


/* V35.3 - sessione, salvataggio password, uscita e data/ora */
.sidebar{
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
}

.sidebar .nav{
  flex:1 1 auto !important;
  min-height:0 !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  padding-bottom:74px !important;
}

.sidebar-bottom-actions{
  position:absolute !important;
  left:0 !important;
  right:0 !important;
  bottom:0 !important;
  display:block !important;
  padding:9px 8px 12px !important;
  z-index:9999 !important;
  background:linear-gradient(180deg,rgba(13,49,84,0),#0d3154 34%) !important;
}

.sidebar-exit-btn{
  width:100% !important;
  min-height:44px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
  border:1px solid rgba(255,255,255,.18) !important;
  border-radius:13px !important;
  background:rgba(255,255,255,.13) !important;
  color:#fff !important;
  font-weight:850 !important;
  cursor:pointer !important;
}

.sidebar-exit-btn svg{
  width:19px !important;
  height:19px !important;
  fill:currentColor !important;
}

body.sidebar-collapsed .sidebar-exit-btn{
  width:50px !important;
  min-width:50px !important;
  max-width:50px !important;
  margin:0 auto !important;
}

body.sidebar-collapsed .sidebar-exit-btn span{
  display:none !important;
}

.logout-confirm-card{
  width:min(430px,100%);
  text-align:center;
}

.logout-confirm-icon{
  width:62px;
  height:62px;
  display:grid;
  place-items:center;
  margin:0 auto 14px;
  border-radius:19px;
  background:#eef5fb;
  color:var(--theme-primary,#0f4c81);
}

.logout-confirm-icon svg{
  width:30px;
  height:30px;
  fill:currentColor;
}

/* Il browser può riconoscere correttamente i campi credenziali */
#loginEmailInput,
#loginPasswordInput{
  -webkit-text-security:auto;
}


/* V35.4 - correzione verificata */
html.auth-login-visible,
body.auth-locked{
  overflow:hidden !important;
}

.login-page{
  position:fixed !important;
  inset:0 !important;
  width:100vw !important;
  height:100vh !important;
  max-height:100vh !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  scrollbar-width:none !important;
  -ms-overflow-style:none !important;
}

.login-page::-webkit-scrollbar,
.login-shell::-webkit-scrollbar,
.login-panel::-webkit-scrollbar,
.login-card::-webkit-scrollbar,
html.auth-login-visible::-webkit-scrollbar,
body.auth-locked::-webkit-scrollbar{
  width:0 !important;
  height:0 !important;
  display:none !important;
}

@media (min-width:961px) and (min-height:650px){
  .login-page{overflow:hidden !important;}
}

.sidebar{
  position:fixed !important;
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
}

.sidebar .nav{
  flex:1 1 auto !important;
  min-height:0 !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  padding-bottom:76px !important;
}

#sidebarLogoutArea{
  position:absolute !important;
  left:0 !important;
  right:0 !important;
  bottom:0 !important;
  display:block !important;
  visibility:visible !important;
  opacity:1 !important;
  width:100% !important;
  padding:9px 8px 12px !important;
  z-index:99999 !important;
  background:linear-gradient(180deg,rgba(13,49,84,0),#0d3154 34%) !important;
}

#sidebarLogoutButton{
  display:flex !important;
  visibility:visible !important;
  opacity:1 !important;
  width:100% !important;
  min-height:44px !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
  border:1px solid rgba(255,255,255,.22) !important;
  border-radius:13px !important;
  background:rgba(255,255,255,.15) !important;
  color:#fff !important;
  font-weight:850 !important;
  cursor:pointer !important;
}

#sidebarLogoutButton svg{
  width:20px !important;
  height:20px !important;
  fill:currentColor !important;
}

body.sidebar-collapsed #sidebarLogoutButton{
  width:50px !important;
  min-width:50px !important;
  max-width:50px !important;
  margin:0 auto !important;
  padding:7px !important;
}

body.sidebar-collapsed #sidebarLogoutButton span{
  display:none !important;
}


/* V35.6 - sessione refresh e uscita sempre visibile */
#sidebarLogoutArea{
  position:fixed !important;
  left:8px !important;
  bottom:10px !important;
  width:calc(var(--sidebar-width,260px) - 16px) !important;
  display:block !important;
  visibility:visible !important;
  opacity:1 !important;
  z-index:2147483000 !important;
  padding:0 !important;
  margin:0 !important;
}

#sidebarLogoutButton{
  display:flex !important;
  visibility:visible !important;
  opacity:1 !important;
  width:100% !important;
  height:44px !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
  border:1px solid rgba(255,255,255,.25) !important;
  border-radius:13px !important;
  background:#194f7d !important;
  color:#fff !important;
  font-weight:850 !important;
  cursor:pointer !important;
  box-shadow:0 8px 20px rgba(4,28,50,.30) !important;
}

#sidebarLogoutButton svg{
  width:20px !important;
  height:20px !important;
  fill:currentColor !important;
}

body.sidebar-collapsed #sidebarLogoutArea{
  width:50px !important;
  left:16px !important;
}

body.sidebar-collapsed #sidebarLogoutButton span{
  display:none !important;
}


/* V35.7 - Esci come voce del menu */
#sidebarLogoutArea,
.sidebar-bottom-actions{
  display:none !important;
}

#sidebarLogoutNavButton{
  color:#fff !important;
}

#sidebarLogoutNavButton .nav-icon svg{
  width:18px !important;
  height:18px !important;
  fill:currentColor !important;
}

#sidebarLogoutNavButton:hover{
  background:rgba(255,255,255,.12) !important;
}

body.sidebar-collapsed #sidebarLogoutNavButton .nav-label{
  display:none !important;
}

body.sidebar-collapsed #sidebarLogoutNavButton{
  width:50px !important;
  min-width:50px !important;
  max-width:50px !important;
  min-height:40px !important;
  height:40px !important;
  padding:6px !important;
  justify-content:center !important;
}


/* V35.8 - autenticazione ricostruita */
html.auth-login-visible, body.auth-locked { overflow:hidden !important; }
#loginPage { overflow:hidden !important; scrollbar-width:none !important; -ms-overflow-style:none !important; }
#loginPage::-webkit-scrollbar, #loginPage *::-webkit-scrollbar { width:0 !important; height:0 !important; display:none !important; }
#loginPage .login-shell, #loginPage .login-panel, #loginPage .login-showcase, #loginPage .login-card { overflow:hidden !important; scrollbar-width:none !important; -ms-overflow-style:none !important; }
#finalLogoutButton .nav-icon svg { width:18px !important; height:18px !important; fill:currentColor !important; }
#finalLogoutButton { color:#fff !important; }
body.sidebar-collapsed #finalLogoutButton .nav-label { display:none !important; }
body.sidebar-collapsed #finalLogoutButton { width:50px !important; min-width:50px !important; max-width:50px !important; min-height:40px !important; height:40px !important; padding:6px !important; justify-content:center !important; }


/* V35.9 - riparazione layout comune delle sezioni */
.main{
  display:block !important;
  align-content:start !important;
  justify-content:start !important;
  min-height:calc(100vh - var(--app-header-height,88px)) !important;
  height:auto !important;
  overflow:visible !important;
}

.main > .section{
  display:none !important;
  position:static !important;
  inset:auto !important;
  float:none !important;
  clear:both !important;
  width:100% !important;
  max-width:none !important;
  min-height:0 !important;
  height:auto !important;
  margin:0 !important;
  padding:0 !important;
  transform:none !important;
  translate:none !important;
  align-self:start !important;
  justify-self:stretch !important;
  align-content:start !important;
  justify-content:start !important;
  vertical-align:top !important;
}

.main > .section.active{
  display:block !important;
}

.main > .section.active > .topbar{
  position:relative !important;
  inset:auto !important;
  top:auto !important;
  left:auto !important;
  right:auto !important;
  bottom:auto !important;
  margin-top:0 !important;
  transform:none !important;
  translate:none !important;
}

#archive,
#adasVerify,
#inventory,
#employees,
#auditLog,
#settings,
#myProfile{
  min-height:0 !important;
  height:auto !important;
  margin-top:0 !important;
  padding-top:0 !important;
  transform:none !important;
}

#archive.active,
#adasVerify.active,
#inventory.active,
#employees.active,
#auditLog.active,
#settings.active,
#myProfile.active{
  display:block !important;
}

body:not(.auth-locked) .main{
  padding-bottom:28px !important;
}

/* impedisce che elementi nascosti riservino spazio */
.main [style*="display:none"],
.main [style*="display: none"]{
  min-height:0 !important;
}


/* V36.0 - sezioni reinserite nel contenitore principale */
#managementApp .main{
  display:block !important;
  width:calc(100% - 245px) !important;
  min-height:calc(100vh - var(--app-header-height,88px)) !important;
  height:auto !important;
  overflow:visible !important;
}

body.sidebar-collapsed #managementApp .main{
  width:calc(100% - 82px) !important;
}

#managementApp .main > .section{
  display:none !important;
  position:static !important;
  width:100% !important;
  max-width:none !important;
  min-height:0 !important;
  height:auto !important;
  margin:0 !important;
  padding:0 !important;
  transform:none !important;
}

#managementApp .main > .section.active{
  display:block !important;
}

#managementApp .main > .section.active > .topbar{
  margin-top:0 !important;
}

@media(max-width:900px){
  #managementApp .main,
  body.sidebar-collapsed #managementApp .main{
    width:100% !important;
  }
}

/* V36.1 - azioni Archivio Pratiche */
#archive .topbar .actions{
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  flex-wrap:wrap !important;
}

#archiveNewPracticeButton{
  white-space:nowrap;
}


/* V36.2 - Aspetto e personalizzazione ordinato */
#appearanceSettingsContent{
  width:100% !important;
  max-width:none !important;
  overflow:visible !important;
}

#appearanceSettingsContent .card,
#appearanceSettingsContent .panel,
.appearance-settings-content-fixed .card,
.appearance-settings-content-fixed .panel{
  width:100% !important;
  max-width:none !important;
  overflow:visible !important;
}

#appearanceSettingsContent .settings-grid,
#appearanceSettingsContent .login-logo-settings-grid,
#appearanceSettingsContent .login-branding-grid,
#appearanceSettingsContent .appearance-grid{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) !important;
  gap:18px !important;
  width:100% !important;
  max-width:none !important;
}

#appearanceSettingsContent .field,
#appearanceSettingsContent .form-group,
#appearanceSettingsContent label{
  min-width:0 !important;
}

#appearanceSettingsContent input,
#appearanceSettingsContent textarea,
#appearanceSettingsContent select{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
}

.login-title-settings-fixed,
.login-logo-settings-fixed{
  width:100% !important;
  max-width:none !important;
  overflow:visible !important;
}

.login-logo-settings-grid{
  display:grid !important;
  grid-template-columns:minmax(320px,.9fr) minmax(360px,1.1fr) !important;
  gap:24px !important;
  align-items:start !important;
  width:100% !important;
}

.login-logo-preview-box{
  min-height:260px !important;
  width:100% !important;
  max-width:none !important;
  padding:24px !important;
  overflow:visible !important;
  border-radius:18px !important;
}

.login-logo-preview-box img{
  max-width:100% !important;
  max-height:220px !important;
  object-fit:contain !important;
}

.login-logo-controls{
  width:100% !important;
  max-width:none !important;
  display:grid !important;
  gap:18px !important;
}

.login-logo-buttons{
  display:flex !important;
  gap:10px !important;
  flex-wrap:wrap !important;
}

.login-logo-slider{
  width:100% !important;
}

.login-logo-slider input[type="range"]{
  width:100% !important;
}

#appearanceSettingsContent .btn{
  white-space:normal !important;
  min-height:42px !important;
}

#appearanceSettingsContent h3,
#appearanceSettingsContent h4{
  margin-top:0 !important;
}

@media(max-width:1100px){
  .login-logo-settings-grid{
    grid-template-columns:1fr !important;
  }

  .login-logo-preview-box{
    min-height:220px !important;
  }
}

@media(max-width:700px){
  #appearanceSettingsContent{
    padding:0 !important;
  }

  .login-logo-preview-box{
    min-height:180px !important;
    padding:16px !important;
  }

  .login-logo-preview-box img{
    max-height:150px !important;
  }

  .login-logo-buttons{
    flex-direction:column !important;
  }

  .login-logo-buttons .btn{
    width:100% !important;
  }
}


/* V36.3b - correzione sicura Personalizzazione */
#appearanceSettingsContent{
  width:100% !important;
  max-width:none !important;
  overflow:visible !important;
}

#appearanceSettingsContent .field,
#appearanceSettingsContent .form-group,
#appearanceSettingsContent .setting-row{
  width:100% !important;
  max-width:none !important;
  min-width:0 !important;
}

#appearanceSettingsContent input[type="text"],
#appearanceSettingsContent input[type="email"],
#appearanceSettingsContent textarea,
#appearanceSettingsContent select{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}

#appearanceSettingsContent .btn{
  position:static !important;
  transform:none !important;
  white-space:normal !important;
}

#appearanceSettingsContent .settings-grid,
#appearanceSettingsContent .appearance-grid,
#appearanceSettingsContent .login-branding-grid{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) !important;
  gap:16px !important;
  width:100% !important;
}

#appearanceSettingsContent .login-logo-settings-grid{
  display:grid !important;
  grid-template-columns:minmax(300px,.9fr) minmax(340px,1.1fr) !important;
  gap:22px !important;
  align-items:start !important;
  width:100% !important;
}

#appearanceSettingsContent .login-logo-preview-box{
  width:100% !important;
  min-height:230px !important;
  overflow:visible !important;
}

@media(max-width:1000px){
  #appearanceSettingsContent .login-logo-settings-grid{
    grid-template-columns:1fr !important;
  }
}


/* V36.4 - struttura Impostazioni separata */
#appearanceSettingsAccordion,
#rolePermissionsAccordion,
#companySettingsAccordion{
  width:100% !important;
  margin-top:14px !important;
}

#appearanceSettingsContent,
#rolePermissionsContent,
#companySettingsContent{
  width:100% !important;
  max-width:none !important;
  overflow:visible !important;
  margin:0 0 14px !important;
}

#rolePermissionsContent[hidden],
#companySettingsContent[hidden]{
  display:none !important;
}

#rolePermissionsAccordion,
#companySettingsAccordion{
  cursor:pointer !important;
  position:relative !important;
  z-index:2 !important;
}

#appearanceSettingsContent{
  position:relative !important;
  z-index:1 !important;
}

#appearanceSettingsContent #rolePermissionsAccordion,
#appearanceSettingsContent #rolePermissionsContent,
#appearanceSettingsContent #companySettingsAccordion,
#appearanceSettingsContent #companySettingsContent{
  display:none !important;
}


/* V36.5 - Impostazioni riordinate e campi corretti */
#settings .settings-accordion,
#settings .standalone-settings-accordion{
  width:100% !important;
  margin:12px 0 0 !important;
  position:relative !important;
  z-index:2 !important;
  cursor:pointer !important;
}

#settings .settings-accordion-main{
  min-width:0 !important;
}

#settings .standalone-settings-content,
#appearanceSettingsContent,
#rolePermissionsContent,
#companySettingsContent,
#warehouseSettingsContent{
  width:100% !important;
  max-width:none !important;
  margin:0 0 14px !important;
  padding:18px !important;
  box-sizing:border-box !important;
  overflow:visible !important;
  position:relative !important;
  z-index:1 !important;
}

#settings [hidden]{
  display:none !important;
}

#managementPersonalizationContent{
  display:block;
}

#managementPersonalizationContent[hidden]{
  display:none !important;
}

#managementPersonalizationContent .management-field-row{
  display:grid !important;
  grid-template-columns:minmax(180px,.42fr) minmax(280px,1fr) minmax(130px,auto) !important;
  align-items:center !important;
  gap:14px !important;
  width:100% !important;
  max-width:none !important;
  min-width:0 !important;
  margin:0 0 14px !important;
  overflow:visible !important;
}

#managementPersonalizationContent .management-field-row input,
#managementPersonalizationContent .management-field-row textarea,
#managementPersonalizationContent .management-field-row select{
  width:100% !important;
  max-width:none !important;
  min-width:0 !important;
  height:46px !important;
  padding:10px 12px !important;
  box-sizing:border-box !important;
  position:relative !important;
  z-index:3 !important;
}

#managementPersonalizationContent .management-save-button{
  position:static !important;
  min-width:130px !important;
  width:auto !important;
  max-width:180px !important;
  white-space:normal !important;
  transform:none !important;
  z-index:1 !important;
}

#managementPersonalizationContent .login-logo-settings-grid,
#managementPersonalizationContent .login-branding-grid,
#managementPersonalizationContent .settings-grid{
  display:grid !important;
  grid-template-columns:minmax(320px,.9fr) minmax(360px,1.1fr) !important;
  gap:22px !important;
  width:100% !important;
  max-width:none !important;
  align-items:start !important;
}

#managementPersonalizationContent .login-logo-preview-box{
  width:100% !important;
  min-height:240px !important;
  overflow:visible !important;
}

#managementPersonalizationContent label,
#managementPersonalizationContent h3,
#managementPersonalizationContent h4{
  overflow:visible !important;
  white-space:normal !important;
}

@media(max-width:1000px){
  #managementPersonalizationContent .management-field-row{
    grid-template-columns:1fr !important;
    align-items:stretch !important;
  }

  #managementPersonalizationContent .management-save-button{
    width:100% !important;
    max-width:none !important;
  }

  #managementPersonalizationContent .login-logo-settings-grid,
  #managementPersonalizationContent .login-branding-grid,
  #managementPersonalizationContent .settings-grid{
    grid-template-columns:1fr !important;
  }
}


/* V36.6 - Impostazioni ricostruite */
#settings .clean-settings-accordion{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:14px !important;
  width:100% !important;
  min-height:72px !important;
  margin:12px 0 0 !important;
  padding:14px 16px !important;
  box-sizing:border-box !important;
  border:1px solid var(--border,#dfe6ee) !important;
  border-radius:16px !important;
  background:#fff !important;
  cursor:pointer !important;
  position:relative !important;
  z-index:2 !important;
}

#settings .clean-settings-accordion > :first-child{
  flex:1 1 auto !important;
  min-width:0 !important;
}

#settings .clean-settings-accordion strong,
#settings .clean-settings-accordion small{
  display:block !important;
  white-space:normal !important;
  overflow:visible !important;
}

#settings .clean-settings-arrow{
  flex:0 0 42px !important;
  width:42px !important;
  height:42px !important;
  min-width:42px !important;
  border-radius:12px !important;
  display:grid !important;
  place-items:center !important;
}

#settings .clean-settings-content{
  width:100% !important;
  max-width:none !important;
  margin:0 0 14px !important;
  padding:20px !important;
  box-sizing:border-box !important;
  border:1px solid var(--border,#dfe6ee) !important;
  border-top:0 !important;
  border-radius:0 0 16px 16px !important;
  background:#fff !important;
  position:relative !important;
  z-index:1 !important;
  overflow:visible !important;
}

#settings .clean-settings-content[hidden]{
  display:none !important;
}

#managementPersonalizationContent .clean-brand-row{
  display:grid !important;
  grid-template-columns:minmax(190px,.42fr) minmax(280px,1fr) minmax(140px,auto) !important;
  align-items:center !important;
  gap:14px !important;
  width:100% !important;
  margin:0 0 14px !important;
}

#managementPersonalizationContent .clean-brand-row label{
  font-weight:800 !important;
  line-height:1.25 !important;
  white-space:normal !important;
}

#managementPersonalizationContent .clean-brand-row input{
  width:100% !important;
  min-width:0 !important;
  max-width:none !important;
  height:46px !important;
  padding:10px 12px !important;
  box-sizing:border-box !important;
  position:static !important;
  transform:none !important;
}

#managementPersonalizationContent .clean-brand-save{
  position:static !important;
  width:auto !important;
  min-width:140px !important;
  max-width:190px !important;
  min-height:46px !important;
  transform:none !important;
  white-space:normal !important;
}

#managementPersonalizationContent .login-logo-settings-card{
  width:100% !important;
  max-width:none !important;
  margin:18px 0 0 !important;
  padding:18px !important;
  box-sizing:border-box !important;
  overflow:visible !important;
}

#managementPersonalizationContent .login-logo-settings-grid{
  display:grid !important;
  grid-template-columns:minmax(300px,.9fr) minmax(340px,1.1fr) !important;
  gap:22px !important;
  width:100% !important;
  align-items:start !important;
}

#managementPersonalizationContent .login-logo-preview-box{
  width:100% !important;
  min-height:230px !important;
  overflow:visible !important;
}

#managementPersonalizationContent .clean-saved-message{
  margin:8px 0 12px !important;
}

@media(max-width:1000px){
  #managementPersonalizationContent .clean-brand-row{
    grid-template-columns:1fr !important;
    align-items:stretch !important;
  }

  #managementPersonalizationContent .clean-brand-save{
    width:100% !important;
    max-width:none !important;
  }

  #managementPersonalizationContent .login-logo-settings-grid{
    grid-template-columns:1fr !important;
  }
}


/* V36.7 - ordine definitivo Impostazioni e pulsanti uniformi */
#settings .v367-settings-accordion{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:14px !important;
  width:100% !important;
  min-height:72px !important;
  margin:12px 0 0 !important;
  padding:14px 16px !important;
  box-sizing:border-box !important;
  border:1px solid var(--border,#dfe6ee) !important;
  border-radius:16px !important;
  background:#fff !important;
  cursor:pointer !important;
  position:relative !important;
  z-index:2 !important;
}
#settings .v367-settings-accordion > :first-child{flex:1 1 auto !important;min-width:0 !important;}
#settings .v367-settings-arrow{
  flex:0 0 42px !important;
  width:42px !important;height:42px !important;min-width:42px !important;max-width:42px !important;
  padding:0 !important;margin:0 !important;
  display:grid !important;place-items:center !important;
  border:1px solid rgba(15,76,129,.14) !important;
  border-radius:12px !important;
  background:#eef5fb !important;color:var(--theme-primary,#0f4c81) !important;
  font-size:24px !important;font-weight:800 !important;line-height:1 !important;
  box-shadow:none !important;transform:none !important;
}
#settings .v367-settings-accordion.open .v367-settings-arrow{background:var(--theme-primary,#0f4c81) !important;color:#fff !important;}
#settings .v367-settings-content{
  width:100% !important;max-width:none !important;margin:0 0 14px !important;padding:20px !important;
  box-sizing:border-box !important;border:1px solid var(--border,#dfe6ee) !important;border-top:0 !important;
  border-radius:0 0 16px 16px !important;background:#fff !important;overflow:visible !important;
}
#settings .v367-settings-content[hidden]{display:none !important;}


/* V36.8 - chiusura iniziale, divisori rimossi e sezione persistente */
#settings .settings-divider{
  display:none !important;
}

#appearanceSettingsContent[hidden],
#companySettingsContent[hidden],
#centersSettingsContent[hidden],
#rolePermissionsContent[hidden],
#thresholdSettingsContent[hidden],
#backupSettingsContent[hidden],
#warehouseSettingsContent[hidden]{
  display:none !important;
}


/* V36.9 - refresh senza lampeggio login */
html.auth-booting,
html.auth-booting body{
  background:#eef3f7 !important;
}

html.auth-booting #loginPage,
html.auth-booting #managementApp{
  visibility:hidden !important;
  opacity:0 !important;
  pointer-events:none !important;
}

html.auth-booting *,
html.auth-booting *::before,
html.auth-booting *::after{
  animation:none !important;
  transition:none !important;
}


/* V37.0 - login completo e compatibile con password manager */
#loginPage{
  min-height:100dvh !important;
  height:auto !important;
  max-height:none !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  align-items:center !important;
  padding:18px !important;
  box-sizing:border-box !important;
  scrollbar-width:none !important;
  -ms-overflow-style:none !important;
}

#loginPage::-webkit-scrollbar{
  width:0 !important;
  height:0 !important;
  display:none !important;
}

#loginPage .login-shell{
  min-height:min(760px,calc(100dvh - 36px)) !important;
  height:auto !important;
  max-height:none !important;
  width:min(1240px,100%) !important;
  margin:auto !important;
  overflow:visible !important;
}

#loginPage .login-panel,
#loginPage .login-card,
#loginPage .login-form{
  height:auto !important;
  max-height:none !important;
  overflow:visible !important;
}

#loginPage .login-card{
  padding-bottom:28px !important;
}

@media(max-height:820px){
  #loginPage{
    align-items:flex-start !important;
    padding-top:12px !important;
    padding-bottom:12px !important;
  }

  #loginPage .login-shell{
    min-height:auto !important;
    margin:0 auto !important;
  }

  #loginPage .login-visual{
    min-height:520px !important;
  }

  #loginPage .login-card{
    padding-top:24px !important;
    padding-bottom:24px !important;
  }
}

@media(max-height:700px){
  #loginPage .login-visual{
    min-height:460px !important;
  }

  #loginPage .login-card{
    transform:none !important;
  }

  #loginPage .login-card h1,
  #loginPage .login-card h2{
    margin-bottom:8px !important;
  }

  #loginPage .login-card .form-group{
    margin-bottom:12px !important;
  }
}

@media(max-width:900px){
  #loginPage{
    align-items:flex-start !important;
  }

  #loginPage .login-shell{
    grid-template-columns:1fr !important;
  }

  #loginPage .login-visual{
    min-height:360px !important;
  }
}


/* V37.1 - login rifinito */
#loginPage .login-shell{
  border-radius:28px !important;
  overflow:hidden !important;
}

#loginPage .login-panel,
#loginPage .login-card{
  border-radius:0 28px 28px 0 !important;
  overflow:hidden !important;
}

#loginPage .login-visual{
  border-radius:28px 0 0 28px !important;
  overflow:hidden !important;
}

#firstAccessHelpLink{
  cursor:pointer !important;
  text-decoration:none !important;
}

#firstAccessHelpLink:hover{
  text-decoration:underline !important;
}

.first-access-help-modal{
  align-items:center !important;
  justify-content:center !important;
  padding:20px !important;
  z-index:2147483000 !important;
}

.first-access-help-card{
  position:relative !important;
  width:min(520px,100%) !important;
  border-radius:22px !important;
  padding:28px !important;
  text-align:center !important;
}

.first-access-help-icon{
  width:58px !important;
  height:58px !important;
  margin:0 auto 16px !important;
  border-radius:18px !important;
  display:grid !important;
  place-items:center !important;
  background:#edf5fc !important;
  color:var(--theme-primary,#0f4c81) !important;
  font-size:30px !important;
  font-weight:900 !important;
}

.first-access-help-actions{
  display:flex !important;
  justify-content:center !important;
  gap:10px !important;
  margin-top:22px !important;
  flex-wrap:wrap !important;
}

@media(max-width:900px){
  #loginPage .login-panel,
  #loginPage .login-card{
    border-radius:0 0 28px 28px !important;
  }

  #loginPage .login-visual{
    border-radius:28px 28px 0 0 !important;
  }
}


/* V37.2 - intestazione brand nel login mobile */
.mobile-login-brand-header{
  display:none;
}

@media(max-width:900px){
  .mobile-login-brand-header{
    display:flex !important;
    align-items:center !important;
    gap:12px !important;
    width:100% !important;
    margin:0 0 18px !important;
    padding:12px 14px !important;
    box-sizing:border-box !important;
    border-radius:16px !important;
    background:linear-gradient(135deg,#0f3158,#154f7f) !important;
    color:#fff !important;
  }

  .mobile-login-logo-wrap{
    flex:0 0 auto !important;
    width:58px !important;
    height:58px !important;
    border-radius:14px !important;
    display:grid !important;
    place-items:center !important;
    overflow:hidden !important;
    background:rgba(255,255,255,.10) !important;
  }

  #mobileLoginBrandLogo{
    display:block !important;
    width:100% !important;
    height:100% !important;
    object-fit:contain !important;
  }

  .mobile-login-brand-text{
    min-width:0 !important;
    display:flex !important;
    flex-direction:column !important;
    gap:2px !important;
  }

  #mobileLoginBrandTitle{
    display:block !important;
    font-size:17px !important;
    line-height:1.15 !important;
    font-weight:900 !important;
    white-space:normal !important;
    overflow-wrap:anywhere !important;
  }

  #mobileLoginBrandSubtitle{
    display:block !important;
    font-size:12px !important;
    line-height:1.3 !important;
    color:rgba(255,255,255,.80) !important;
    white-space:normal !important;
  }

  #loginPage .login-card{
    padding-top:18px !important;
  }
}


/* V37.3 - login mobile senza scrollbar e logo sopra */
@media(max-width:900px){
  html,
  body{
    overflow-x:hidden !important;
  }

  #loginPage{
    overflow-y:auto !important;
    overflow-x:hidden !important;
    scrollbar-width:none !important;
    -ms-overflow-style:none !important;
  }

  #loginPage::-webkit-scrollbar,
  #loginPage *::-webkit-scrollbar{
    width:0 !important;
    height:0 !important;
    display:none !important;
  }

  .mobile-login-brand-header{
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    justify-content:center !important;
    gap:10px !important;
    text-align:center !important;
    width:100% !important;
    margin:0 0 18px !important;
    padding:16px !important;
    box-sizing:border-box !important;
    border-radius:18px !important;
    background:linear-gradient(135deg,#0f3158,#154f7f) !important;
    color:#fff !important;
  }

  .mobile-login-logo-wrap{
    width:96px !important;
    height:72px !important;
    border-radius:14px !important;
    display:grid !important;
    place-items:center !important;
    overflow:visible !important;
    background:transparent !important;
    flex:0 0 auto !important;
  }

  #mobileLoginBrandLogo{
    display:block !important;
    width:100% !important;
    height:100% !important;
    max-width:96px !important;
    max-height:72px !important;
    object-fit:contain !important;
  }

  .mobile-login-brand-text{
    width:100% !important;
    min-width:0 !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    gap:3px !important;
  }

  #mobileLoginBrandTitle{
    display:block !important;
    width:100% !important;
    font-size:18px !important;
    line-height:1.15 !important;
    font-weight:900 !important;
    text-align:center !important;
    white-space:normal !important;
    overflow-wrap:anywhere !important;
  }

  #mobileLoginBrandSubtitle{
    display:block !important;
    width:100% !important;
    font-size:12px !important;
    line-height:1.3 !important;
    color:rgba(255,255,255,.82) !important;
    text-align:center !important;
    white-space:normal !important;
  }

  #loginPage .login-shell,
  #loginPage .login-panel,
  #loginPage .login-card,
  #loginPage .login-form{
    overflow:visible !important;
  }
}


/* V37.4 - arrotondamento angoli superiori login mobile */
@media(max-width:900px){
  #loginPage .login-panel,
  #loginPage .login-card{
    border-radius:28px !important;
    overflow:hidden !important;
  }
}

/* V38.0 - Le finestre di primo accesso devono comparire sopra la pagina login. */
#firstOwnerModal,
#firstAccessHelpModal {
  z-index: 2147483646 !important;
}

#firstOwnerModal .modal-card,
#firstAccessHelpModal .modal-card {
  position: relative;
  z-index: 1;
}

/* V38.1 — Firebase bootstrap status (diagnostic only) */
.firebase-bootstrap-status{
  display:inline-block;
  margin-top:4px;
  font-size:10px;
  font-weight:750;
  opacity:.78;
}
.firebase-bootstrap-status[data-status="ready"]{color:#187347}
.firebase-bootstrap-status[data-status="error"]{color:#a11b1b}

/* V38.4 — Password reset modals must appear above the authentication page. */
#forgotPasswordModal,
#employeePasswordResetModal {
  z-index: 2147483646 !important;
}

#forgotPasswordModal .modal-card,
#employeePasswordResetModal .modal-card {
  position: relative;
  z-index: 1;
}


/* V39.5 Migration Center */
.migration-kpis{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:20px}
.migration-warning{display:grid;gap:5px;border-color:#f0d59a;background:#fffaf0;margin-bottom:20px}.migration-warning span{color:#72531b;font-size:13px}
.migration-toolbar{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}.migration-toolbar h2{margin:0 0 5px}.migration-toolbar p{margin:0;color:var(--muted)}
.migration-table{min-width:980px}.migration-status{display:inline-flex;padding:6px 9px;border-radius:999px;font-size:11px;font-weight:850}.migration-status.ok{background:#eaf8f0;color:#187347}.migration-status.warning{background:#fff5df;color:#946200}.migration-status.error{background:#fff0f0;color:#a11b1b}
.migration-result{margin-top:16px;padding:13px;border-radius:11px;background:#eef5fb;border:1px solid #c9deef;color:#28415c;font-weight:700}
.migration-key-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:15px}.migration-key-item{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:#f8fafc}.migration-key-item code{font-size:11px;overflow-wrap:anywhere}.migration-key-item span{white-space:nowrap;color:var(--muted);font-size:11px;font-weight:750}
@media(max-width:900px){.migration-kpis{grid-template-columns:repeat(2,1fr)}.migration-key-list{grid-template-columns:1fr}.migration-toolbar{align-items:stretch;flex-direction:column}.migration-toolbar .btn{width:100%}}

/* V39.9: il primo Titolare è già configurato; nasconde definitivamente il bootstrap pubblico. */
#firstOwnerSetup,
#firstAccessHelpLink,
#firstOwnerModal,
#firstAccessHelpModal{
  display:none !important;
}

.employee-centers-multiselect{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:10px;border:1px solid var(--border);border-radius:10px;background:#f8fafc;max-height:180px;overflow:auto}.employee-centers-multiselect label{display:flex;align-items:center;gap:8px;padding:8px;border-radius:8px;background:#fff;border:1px solid var(--border);cursor:pointer}.employee-centers-multiselect input{width:auto;margin:0}@media(max-width:760px){.employee-centers-multiselect{grid-template-columns:1fr}}

/* V39.9 - pratiche eliminate e centro personale */
#deletedPractices .filters{grid-template-columns:2fr 1fr}
.deleted-practice-meta{display:block;color:var(--muted);font-size:10px;margin-top:4px}
.audit-user-cell strong,.audit-user-cell small{display:block}.audit-user-cell small{color:var(--muted);margin-top:3px}
#employeePrimaryCenter:disabled{background:#f1f5f9;color:#64748b}
@media(max-width:760px){#deletedPractices .filters{grid-template-columns:1fr}}

/* V40.0: resolve the authorized center before showing the management UI. */
html.center-context-pending #managementApp{visibility:hidden!important;}
.center-context-boot-overlay{position:fixed;inset:0;z-index:99998;display:flex;align-items:center;justify-content:center;background:#eef3f8;padding:20px;}
.auth-login-visible .center-context-boot-overlay,.auth-locked .center-context-boot-overlay{display:none!important;}
.center-context-boot-card{display:grid;justify-items:center;gap:10px;max-width:390px;padding:28px 30px;border:1px solid #dce5ee;border-radius:18px;background:#fff;box-shadow:0 20px 55px rgba(22,32,51,.15);text-align:center;color:#162033;}
.center-context-boot-card strong{font-size:18px}.center-context-boot-card small{color:#6b778c}.center-context-spinner{width:34px;height:34px;border:4px solid #dbe7f1;border-top-color:var(--theme-primary,#0f4c81);border-radius:50%;animation:centerContextSpin .8s linear infinite;}
@keyframes centerContextSpin{to{transform:rotate(360deg)}}

/* V40.1 - eliminazione definitiva pratiche */
.deleted-practice-actions{display:flex;gap:6px;flex-wrap:wrap}
.permanent-delete-modal{z-index:120500!important}
.permanent-delete-card{width:min(590px,100%)}
.permanent-delete-warning{display:grid;gap:5px;margin-bottom:16px;padding:14px;border:1px solid #efb7b7;border-radius:12px;background:#fff0f0;color:#a11b1b}
.permanent-delete-warning strong{font-size:15px}.permanent-delete-warning span{font-size:13px;line-height:1.45}
#permanentDeleteConfirmInput{text-transform:uppercase;font-weight:850;letter-spacing:1px}
.audit-user-cell strong,.audit-user-cell small{display:block}.audit-user-cell small{margin-top:3px;color:var(--muted);font-size:10px}

/* V40.6 — responsive mobile edition */
html,body{max-width:100%;overflow-x:hidden}
body.mobile-menu-open{overflow:hidden}
.mobile-sidebar-backdrop{display:none}

@media (max-width:900px){
  :root{--app-header-height:72px}
  body{padding-bottom:env(safe-area-inset-bottom,0)}
  .app{display:block!important;min-height:100dvh;padding-top:calc(var(--app-header-height) + env(safe-area-inset-top,0px))!important}
  .app-fixed-header{
    height:calc(var(--app-header-height) + env(safe-area-inset-top,0px));
    padding:calc(8px + env(safe-area-inset-top,0px)) 12px 8px;
    grid-template-columns:minmax(0,1fr) auto!important;
    gap:8px!important;
  }
  .app-fixed-brand{gap:9px!important;min-width:0}
  .app-fixed-logo-box{width:auto!important;height:48px!important;max-width:52vw!important;flex:0 1 auto!important;overflow:hidden!important}
  .app-fixed-logo-box.has-logo img{width:auto!important;max-width:100%!important;height:48px!important;object-fit:contain!important}
  .app-fixed-brand-copy{min-width:0!important}
  .app-fixed-brand-copy strong{font-size:13px!important;line-height:1.15;white-space:normal!important;display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical}
  .app-fixed-brand-copy small{display:none!important}
  .app-fixed-header-center,.app-header-clock{display:none!important}
  .app-fixed-header-right{gap:0!important}
  .app-header-profile{grid-template-columns:42px!important;padding:4px!important;border-radius:14px!important}
  .app-header-avatar{width:42px!important;height:42px!important;font-size:13px!important}
  .app-header-user-copy{display:none!important}

  .sidebar{
    position:fixed!important;
    z-index:47000!important;
    inset:calc(var(--app-header-height) + env(safe-area-inset-top,0px)) auto 0 0!important;
    width:min(82vw,320px)!important;
    height:auto!important;
    padding:14px 12px calc(18px + env(safe-area-inset-bottom,0px))!important;
    overflow-y:auto!important;
    transform:translateX(-105%);
    transition:transform .24s ease!important;
    box-shadow:18px 0 40px rgba(5,20,38,.28)!important;
  }
  body.mobile-menu-open .sidebar{transform:translateX(0)}
  body.sidebar-collapsed .sidebar{width:min(82vw,320px)!important;transform:translateX(-105%)}
  body.sidebar-collapsed.mobile-menu-open .sidebar{transform:translateX(0)}
  .sidebar-toggle-btn{
    position:fixed!important;
    z-index:48010!important;
    left:12px!important;
    top:calc(var(--app-header-height) + env(safe-area-inset-top,0px) + 10px)!important;
    margin:0!important;
    width:48px!important;height:48px!important;
    background:#0f4c81!important;
    box-shadow:0 8px 24px rgba(7,36,66,.28)!important;
  }
  body.mobile-menu-open .sidebar-toggle-btn{position:sticky!important;top:0!important;left:auto!important;margin:0 0 12px auto!important}
  .sidebar-toggle-arrow{font-size:0!important}
  .sidebar-toggle-arrow::after{content:"☰";font-size:25px;line-height:1}
  body.mobile-menu-open .sidebar-toggle-arrow::after{content:"×";font-size:32px}
  .nav{display:grid!important;grid-template-columns:1fr!important;gap:7px!important;margin-top:0!important}
  .nav button,.nav-logout-button{
    width:100%!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;
    gap:12px!important;text-align:left!important;padding:12px 13px!important;font-size:14px!important;
  }
  body.sidebar-collapsed .nav button span:last-child{display:inline!important}
  body.sidebar-collapsed .nav button{justify-content:flex-start!important}
  .nav-icon{width:28px!important;min-width:28px!important}

  .mobile-sidebar-backdrop{
    position:fixed;z-index:46000;inset:calc(var(--app-header-height) + env(safe-area-inset-top,0px)) 0 0;
    background:rgba(6,20,35,.48);backdrop-filter:blur(2px);
  }
  body.mobile-menu-open .mobile-sidebar-backdrop{display:block}

  .main,body.sidebar-collapsed .main{
    width:100%!important;max-width:100%!important;margin:0!important;
    padding:76px 12px 22px!important;min-width:0!important;
  }
  .section,.card,.panel,.topbar{max-width:100%!important;min-width:0!important}
  .topbar{padding:16px!important;margin-bottom:14px!important;gap:14px!important;flex-direction:column!important;align-items:stretch!important}
  .topbar>div:first-child{min-width:0}
  h1{font-size:25px!important;line-height:1.15!important;overflow-wrap:anywhere}
  .subtitle{font-size:14px!important;line-height:1.4}
  .topbar-right,.actions{width:100%!important;display:grid!important;grid-template-columns:1fr!important;gap:10px!important}
  .center-switcher{width:100%!important;min-width:0!important}
  .center-switcher select,.topbar-right .btn,.actions .btn{width:100%!important;min-height:48px}
  .grid,.stats,.category-grid,.form-grid,.filters,.dashboard-summary{grid-template-columns:1fr!important}
  .card,.panel{border-radius:16px!important}
  .panel,.category,.stat{padding:16px!important}
  .stat{min-height:128px!important}
  .stat .value{font-size:32px!important}
  input,select,textarea,.btn{font-size:16px!important}
  .form-actions{display:grid!important;grid-template-columns:1fr!important}
  .form-actions .btn{width:100%!important;min-height:48px}
  .table-wrap{width:100%!important;max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch}
  table{min-width:760px!important}
  th,td{white-space:nowrap}
  .modal{padding:12px!important;align-items:flex-end!important}
  .modal-card{width:100%!important;max-width:100%!important;max-height:88dvh!important;overflow:auto!important;border-radius:20px 20px 0 0!important;padding:18px!important}
  .company-footer{margin-left:0!important;width:100%!important;padding-left:12px!important;padding-right:12px!important}
  .reliable-notice-container{left:12px!important;right:12px!important;width:auto!important;max-width:none!important}
}

@media (max-width:480px){
  :root{--app-header-height:68px}
  .app-fixed-header{padding-left:8px!important;padding-right:8px!important}
  .app-fixed-logo-box{height:44px!important;max-width:58vw!important}
  .app-fixed-logo-box.has-logo img{height:44px!important}
  .app-fixed-brand-copy strong{font-size:11px!important}
  .app-header-profile{grid-template-columns:38px!important}
  .app-header-avatar{width:38px!important;height:38px!important}
  .main{padding:72px 9px 18px!important}
  .topbar{padding:15px 13px!important}
  h1{font-size:23px!important}
  .sidebar-toggle-btn{left:9px!important;width:46px!important;height:46px!important}
}


/* V40.7 — pulsante menu mobile esterno alla sidebar */
.mobile-menu-trigger{display:none}
@media (max-width:900px){
  #sidebarToggleBtn{display:none!important}
  .mobile-menu-trigger{
    display:grid!important;
    place-items:center!important;
    position:fixed!important;
    z-index:48020!important;
    left:12px!important;
    top:calc(env(safe-area-inset-top,0px) + 12px)!important;
    width:48px!important;
    height:48px!important;
    margin:0!important;
    padding:0!important;
    border:1px solid rgba(255,255,255,.24)!important;
    border-radius:14px!important;
    background:#0f4c81!important;
    color:#fff!important;
    box-shadow:0 8px 24px rgba(7,36,66,.32)!important;
    cursor:pointer!important;
    touch-action:manipulation!important;
  }
  .mobile-menu-trigger span{font-size:25px!important;line-height:1!important;font-weight:700!important}
  body.mobile-menu-open .mobile-menu-trigger{
    left:min(calc(82vw - 60px),260px)!important;
    background:#123e68!important;
  }
  body.mobile-menu-open .mobile-menu-trigger span{font-size:32px!important;font-weight:400!important}
  .app-fixed-header{padding-left:72px!important}
}
@media (max-width:480px){
  .mobile-menu-trigger{left:9px!important;top:calc(env(safe-area-inset-top,0px) + 10px)!important;width:46px!important;height:46px!important}
  body.mobile-menu-open .mobile-menu-trigger{left:min(calc(82vw - 57px),257px)!important}
  .app-fixed-header{padding-left:64px!important}
}


/* V41.0 — timeline online della pratica */
.practice-timeline-card{margin-top:18px;overflow:hidden}
.practice-timeline-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:22px}
.practice-timeline-head h2{margin:3px 0 5px;font-size:25px;color:#15243d}
.practice-timeline-head p{margin:0;color:#697991}
.practice-timeline-kicker{font-size:12px;font-weight:900;letter-spacing:.14em;color:#1670aa}
.practice-timeline-badge{padding:8px 13px;border-radius:999px;background:#eaf5fc;color:#0b5f92;font-weight:800;white-space:nowrap}
.practice-timeline{display:flex;flex-direction:column}
.practice-timeline-item{display:grid;grid-template-columns:42px minmax(0,1fr);gap:14px;min-height:104px}
.practice-timeline-axis{position:relative;display:flex;justify-content:center}
.practice-timeline-icon{position:relative;z-index:2;width:38px;height:38px;display:grid;place-items:center;border-radius:50%;background:#e6f3fb;color:#0e6297;border:1px solid #c9e2f1;font-size:20px;font-weight:900}
.practice-timeline-item.practice_deleted .practice-timeline-icon,.practice-timeline-item.practice_permanently_deleted .practice-timeline-icon{background:#fff0f0;color:#b42318;border-color:#f7caca}
.practice-timeline-item.practice_restored .practice-timeline-icon{background:#ecf9f0;color:#177245;border-color:#c8ead4}
.practice-timeline-line{position:absolute;top:37px;bottom:-1px;width:2px;background:#dfe8f0}
.practice-timeline-content{padding:0 0 22px;border-bottom:1px solid #edf1f5;margin-bottom:18px;min-width:0}
.practice-timeline-item:last-child .practice-timeline-content{border-bottom:0;margin-bottom:0}
.practice-timeline-row{display:flex;justify-content:space-between;gap:14px;align-items:flex-start}
.practice-timeline-row strong{font-size:17px;color:#15243d}
.practice-timeline-row time{font-size:13px;color:#718096;white-space:nowrap}
.practice-timeline-content>p{margin:7px 0 11px;color:#4e5f75;line-height:1.5}
.practice-timeline-meta{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.practice-timeline-meta span{padding:5px 8px;border-radius:8px;background:#f4f7fa;color:#56677d;font-size:12px}
.practice-timeline-meta b{color:#283b52;margin-right:4px}
.practice-timeline-actor{display:flex;align-items:center;gap:9px}
.practice-timeline-avatar{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;background:#123f70;color:#fff;font-size:12px;font-weight:900}
.practice-timeline-actor>span:last-child{display:flex;flex-direction:column;min-width:0}
.practice-timeline-actor b{font-size:13px;color:#283b52}
.practice-timeline-actor small{font-size:12px;color:#7a8799}
@media(max-width:700px){
  .practice-timeline-card{margin-top:12px}
  .practice-timeline-head{flex-direction:column;gap:10px}
  .practice-timeline-head h2{font-size:21px}
  .practice-timeline-item{grid-template-columns:34px minmax(0,1fr);gap:10px}
  .practice-timeline-icon{width:32px;height:32px;font-size:17px}
  .practice-timeline-line{top:31px}
  .practice-timeline-row{flex-direction:column;gap:3px}
  .practice-timeline-row time{white-space:normal}
}


/* V41.1 — menu mobile con etichette sempre visibili */
@media (max-width:900px){
  body.mobile-menu-open #appSidebar{width:min(88vw,340px)!important}
  body.mobile-menu-open #appSidebar .nav button,
  body.mobile-menu-open #appSidebar .nav-logout-button{
    display:flex!important;grid-template-columns:none!important;justify-content:flex-start!important;align-items:center!important;
    width:100%!important;min-height:52px!important;padding:13px 16px!important;gap:14px!important;overflow:visible!important;
  }
  body.mobile-menu-open #appSidebar .nav button > span:not(.nav-icon),
  body.mobile-menu-open #appSidebar .nav-logout-button > .nav-label{
    display:inline-block!important;visibility:visible!important;opacity:1!important;
    width:auto!important;max-width:none!important;height:auto!important;overflow:visible!important;
    white-space:normal!important;font-size:15px!important;line-height:1.25!important;font-weight:750!important;color:#fff!important;
  }
  body.mobile-menu-open #appSidebar .nav-icon{display:grid!important;place-items:center!important;flex:0 0 30px!important;width:30px!important;min-width:30px!important}
  body.mobile-menu-open #appSidebar .nav button.active{background:rgba(255,255,255,.12)!important;border-color:rgba(255,255,255,.28)!important}
}


/* V41.3 - dettaglio professionale delle modifiche pratica */
.practice-timeline-changes{
  margin:2px 0 14px;
  padding:12px;
  border:1px solid #dbe7f1;
  border-radius:12px;
  background:#f8fbfd;
}
.practice-timeline-changes-title{
  display:block;
  margin-bottom:9px;
  color:#173b60;
  font-size:12px;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.practice-timeline-change{
  display:grid;
  grid-template-columns:minmax(110px,.8fr) minmax(0,1fr) 22px minmax(0,1fr);
  gap:8px;
  align-items:center;
  padding:8px 0;
  border-top:1px solid #e7eef4;
  font-size:13px;
}
.practice-timeline-change:first-of-type{border-top:0;padding-top:0}
.practice-timeline-change:last-child{padding-bottom:0}
.practice-timeline-change-label{font-weight:800;color:#263b53}
.practice-timeline-change-old{
  color:#9b2c2c;
  background:#fff0f0;
  border-radius:7px;
  padding:5px 7px;
  text-decoration:line-through;
  overflow-wrap:anywhere;
}
.practice-timeline-change-arrow{text-align:center;color:#6b7d91;font-weight:900}
.practice-timeline-change-new{
  color:#176b43;
  background:#eaf8f0;
  border-radius:7px;
  padding:5px 7px;
  font-weight:700;
  overflow-wrap:anywhere;
}
@media(max-width:600px){
  .practice-timeline-change{
    grid-template-columns:1fr 22px 1fr;
  }
  .practice-timeline-change-label{grid-column:1/-1}
}


/* V41.6 - Badge modifiche e cronologia rapida */
.practice-row-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.practice-history-badge{border:1px solid #b9d8ef;background:#edf6fd;color:#0f4c81;border-radius:999px;padding:6px 9px;display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:850;cursor:pointer;white-space:nowrap}
.practice-history-badge:hover{background:#dceefb;border-color:#8fc3e6}
.practice-history-badge b{min-width:21px;height:21px;padding:0 6px;border-radius:999px;background:#0f4c81;color:#fff;display:inline-grid;place-items:center;font-size:10px}
.practice-history-modal{z-index:120500}
.practice-history-modal-card{width:min(760px,100%);max-height:90vh;display:flex;flex-direction:column}
.practice-history-modal-card .practice-timeline{overflow:auto;padding-right:4px}
.practice-history-summary{display:flex;gap:10px;flex-wrap:wrap;margin:-4px 0 14px}
.practice-history-summary span{display:inline-flex;align-items:center;gap:5px;padding:8px 11px;border-radius:999px;background:#f1f5f9;color:#475569;font-size:12px;font-weight:750}
.practice-history-summary b{color:var(--theme-primary,#0f4c81);font-size:14px}
@media(max-width:760px){.practice-row-actions{align-items:stretch}.practice-history-badge{justify-content:center}.practice-history-modal{align-items:flex-end;padding:0}.practice-history-modal-card{width:100%;max-height:92vh;border-radius:20px 20px 0 0;padding-bottom:calc(18px + env(safe-area-inset-bottom))}}


/* V41.6 - Correzione sovrapposizioni cronologia pratica */
.practice-history-modal-card .practice-timeline{
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:2px 10px 8px 2px;
  scroll-padding:12px;
}
.practice-history-modal-card .practice-timeline-item{
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  gap:14px;
  min-height:0;
  height:auto;
  align-items:stretch;
  flex:0 0 auto;
  margin:0;
}
.practice-history-modal-card .practice-timeline-axis{
  position:relative;
  min-height:100%;
  align-self:stretch;
}
.practice-history-modal-card .practice-timeline-line{
  top:38px;
  bottom:-15px;
}
.practice-history-modal-card .practice-timeline-content{
  position:relative;
  min-width:0;
  height:auto;
  margin:0;
  padding:14px 16px;
  border:1px solid #dfe8f0;
  border-radius:14px;
  background:#fff;
  box-shadow:0 4px 14px rgba(21,36,61,.05);
  overflow:visible;
}
.practice-history-modal-card .practice-timeline-item:last-child .practice-timeline-content{
  border-bottom:1px solid #dfe8f0;
  margin-bottom:0;
}
.practice-history-modal-card .practice-timeline-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:start;
  gap:12px;
  margin:0 0 8px;
}
.practice-history-modal-card .practice-timeline-row strong{
  display:block;
  line-height:1.3;
  overflow-wrap:anywhere;
}
.practice-history-modal-card .practice-timeline-row time{
  display:block;
  line-height:1.3;
  text-align:right;
}
.practice-history-modal-card .practice-timeline-description{
  margin:0 0 12px;
  line-height:1.45;
  color:#4e5f75;
}
.practice-history-modal-card .practice-timeline-meta{
  margin:0 0 12px;
}
.practice-history-modal-card .practice-timeline-changes{
  display:block;
  width:100%;
  box-sizing:border-box;
  margin:0 0 14px;
}
.practice-history-modal-card .practice-timeline-change{
  position:relative;
  min-height:0;
  height:auto;
  overflow:visible;
}
.practice-history-modal-card .practice-timeline-actor{
  margin-top:12px;
  min-height:34px;
}
@media(max-width:760px){
  .practice-history-modal-card .practice-timeline{gap:12px;padding-right:4px}
  .practice-history-modal-card .practice-timeline-item{grid-template-columns:34px minmax(0,1fr);gap:9px}
  .practice-history-modal-card .practice-timeline-content{padding:12px;border-radius:12px}
  .practice-history-modal-card .practice-timeline-row{grid-template-columns:1fr;gap:3px}
  .practice-history-modal-card .practice-timeline-row time{text-align:left}
  .practice-history-modal-card .practice-timeline-line{top:32px;bottom:-13px}
}

/* V41.7 — rifiniture mobile, logout e branding login */
@media (max-width:900px){
  /* Quando il menu è aperto, il comando di chiusura resta dentro il pannello
     e sotto l'header, senza coprire logo o profilo. */
  body.mobile-menu-open .mobile-menu-trigger{
    top:calc(env(safe-area-inset-top,0px) + var(--app-header-height,76px) + 14px)!important;
    left:min(calc(88vw - 66px),274px)!important;
    width:48px!important;
    height:48px!important;
    border-radius:15px!important;
    background:rgba(9,48,87,.96)!important;
    box-shadow:0 10px 28px rgba(4,24,44,.35)!important;
  }
  body.mobile-menu-open #appSidebar .nav{
    padding-top:64px!important;
  }

  /* Notifiche realmente centrate nel viewport del gestionale. */
  .reliable-notice-container,
  body.sidebar-collapsed .reliable-notice-container{
    position:fixed!important;
    top:50%!important;
    left:50%!important;
    right:auto!important;
    bottom:auto!important;
    width:calc(100vw - 32px)!important;
    max-width:500px!important;
    transform:translate(-50%,-50%)!important;
    margin:0!important;
  }
  .reliable-notice{
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }

  /* Il logo orizzontale del login ha spazio sufficiente anche su iPhone. */
  .mobile-login-logo-wrap{
    width:min(270px,82vw)!important;
    height:112px!important;
    max-width:none!important;
  }
  #mobileLoginBrandLogo{
    width:100%!important;
    height:100%!important;
    max-width:none!important;
    max-height:none!important;
    object-fit:contain!important;
  }
  .mobile-login-brand-header{
    padding:18px 14px 20px!important;
    gap:8px!important;
  }
}
@media (max-width:480px){
  body.mobile-menu-open .mobile-menu-trigger{
    top:calc(env(safe-area-inset-top,0px) + var(--app-header-height,68px) + 12px)!important;
    left:calc(88vw - 62px)!important;
    width:46px!important;
    height:46px!important;
  }
  .mobile-login-logo-wrap{
    width:min(250px,82vw)!important;
    height:104px!important;
  }
}


/* V41.9 — disponibilità ricambi per centro */
.inventory-center-stock-field{grid-column:1/-1}
.inventory-center-stock-help{font-size:.9rem;color:var(--muted,#64748b);margin:-4px 0 10px}
.inventory-center-quantities{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px}
.inventory-center-quantity-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 14px;border:1px solid #dbe4ef;border-radius:14px;background:#f8fbff}
.inventory-center-quantity-row label{margin:0;font-weight:800;color:#173252}
.inventory-center-quantity-row input{width:92px;min-width:92px;text-align:center;font-weight:800}
.inventory-center-total{display:flex;justify-content:flex-end;align-items:center;gap:12px;margin-top:12px;padding:11px 14px;border-radius:12px;background:#eaf4ff;color:#0f4f86}
.inventory-center-total b{font-size:1.25rem}
.inventory-availability-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.inventory-availability-chip{display:inline-flex;gap:5px;align-items:center;padding:5px 8px;border-radius:999px;background:#edf6ff;color:#164f7c;font-size:.78rem;font-weight:800}
@media(max-width:700px){.inventory-center-quantities{grid-template-columns:1fr}.inventory-center-quantity-row input{width:86px}}

/* V42.2 — modali magazzino e disponibilità multi-centro */
.inventory-center-quantities{
  display:grid;
  gap:10px;
  margin-top:10px;
}
.inventory-center-quantity-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 120px;
  align-items:center;
  gap:14px;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#f8fafc;
}
.inventory-center-quantity-name{
  min-width:0;
  font-weight:800;
  color:var(--text);
  overflow-wrap:anywhere;
}
.inventory-center-quantity-row input{
  width:100%;
  min-height:44px;
  text-align:center;
  font-weight:850;
}
#useInventoryModal,
#restoreInventoryModal{
  align-items:flex-start!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  padding-top:calc(var(--app-header-height, 88px) + 18px)!important;
  padding-bottom:24px!important;
}
#useInventoryModal .modal-card,
#restoreInventoryModal .modal-card{
  width:min(620px,100%)!important;
  max-height:calc(100dvh - var(--app-header-height, 88px) - 42px)!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  margin:auto;
}
#useInventoryModal .modal-head,
#restoreInventoryModal .modal-head{
  position:sticky;
  top:-20px;
  z-index:2;
  padding-top:20px;
  background:#fff;
}
#useInventoryModal .modal-actions,
#restoreInventoryModal .modal-actions{
  position:sticky;
  bottom:-20px;
  z-index:2;
  margin:16px -20px -20px;
  padding:14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top:1px solid var(--border);
  background:#fff;
}
@media(max-width:760px){
  .inventory-center-quantity-row{grid-template-columns:minmax(0,1fr) 96px;padding:10px 12px}
  #useInventoryModal,
  #restoreInventoryModal{
    align-items:flex-end!important;
    padding:0!important;
  }
  #useInventoryModal .modal-card,
  #restoreInventoryModal .modal-card{
    width:100%!important;
    max-height:calc(92dvh - env(safe-area-inset-top))!important;
    margin-top:auto;
    border-radius:20px 20px 0 0!important;
  }
}

/* V42.2 — selettore compatto disponibilità per centro */
.inventory-center-picker{grid-column:1/-1;padding:14px;border:1px solid #d8e4f1;border-radius:16px;background:#f7fbff;margin-bottom:12px}
.inventory-center-picker-heading strong{display:block;color:#173252;font-size:15px}
.inventory-center-picker-heading small{display:block;color:#6b7c91;margin-top:3px}
.inventory-center-picker-controls{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:10px;margin-top:12px}
.inventory-center-picker-controls input{width:100%;min-width:0}
.inventory-selected-centers{display:grid;grid-template-columns:repeat(auto-fit,minmax(245px,1fr));gap:12px;grid-column:1/-1}
.inventory-center-quantity-controls{display:flex;align-items:center;gap:8px}
.inventory-center-remove{width:38px;height:38px;border:1px solid #f1b7b7;border-radius:10px;background:#fff2f2;color:#b42318;font-size:22px;line-height:1;cursor:pointer}
.inventory-center-remove:hover{background:#ffe3e3}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
@media(max-width:700px){
  .inventory-center-picker-controls{grid-template-columns:1fr}
  .inventory-selected-centers{grid-template-columns:1fr}
  .inventory-center-quantity-row{grid-template-columns:minmax(0,1fr) auto!important}
}
