:root{
  --bg:#f6f7fb;
  --surface:#ffffff;
  --surface-2:#f8f9fd;
  --ink:#182033;
  --muted:#727b91;
  --line:#e7eaf2;
  --primary:#635bff;
  --primary-rgb:99,91,255;
  --primary-2:#7c74ff;
  --primary-soft:#efefff;
  --cyan:#17a9c5;
  --cyan-soft:#e8f8fb;
  --pink:#e55388;
  --pink-soft:#fdebf2;
  --green:#28a56a;
  --green-soft:#e9f7f0;
  --orange:#ee8b37;
  --orange-soft:#fff0e3;
  --red:#db4d52;
  --red-soft:#fdecee;
  --nav:#151a2d;
  --nav-muted:#a7adc1;
  --shadow:0 14px 40px rgba(37,43,72,.08);
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--ink)}
body{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
.hidden{display:none!important}
svg.icon{width:18px;height:18px;display:block;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
h1,h2,h3,p{margin-top:0}

/* LOGIN */
.login-wrap{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 15% 15%,#7b75ff 0,#635bff 22%,#29254f 72%,#171a2d 100%)}
.login-card{width:min(460px,100%);background:rgba(255,255,255,.98);border-radius:28px;padding:32px;box-shadow:0 30px 100px rgba(10,12,30,.32)}
.logo-lockup{display:flex;align-items:center;gap:12px;min-width:0}
.logo-mark{width:48px;height:48px;border-radius:15px;background:linear-gradient(135deg,var(--primary),#9a55ff 55%,#ef5fa5);display:grid;place-items:center;box-shadow:0 10px 24px rgba(var(--primary-rgb),.28)}
.logo-mark svg{width:30px;height:30px;stroke:white;stroke-width:2.2}
.logo-name{font-weight:950;font-size:21px;letter-spacing:-.04em}
.logo-sub{font-size:10px;color:var(--muted);margin-top:2px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.login-card h1{font-size:30px;margin:26px 0 7px;letter-spacing:-.04em}
.login-card>p{color:var(--muted);margin-bottom:22px}

/* FORMS */
.field{display:grid;gap:7px;margin-bottom:13px;min-width:0}
.field label{font-size:10px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:#636b80}
.field input,.field select,.field textarea{width:100%;min-width:0;border:1px solid var(--line);background:white;border-radius:11px;padding:11px 12px;outline:none;color:var(--ink)}
.field textarea{min-height:82px;resize:vertical}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--primary-2);box-shadow:0 0 0 3px rgba(var(--primary-rgb),.10)}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.span-2{grid-column:1/-1}
.note{font-size:11px;color:var(--muted);padding:11px 12px;background:var(--surface-2);border:1px solid var(--line);border-radius:11px;line-height:1.5}

/* BUTTONS */
.btn{border:0;border-radius:10px;min-height:40px;padding:9px 13px;font-weight:850;display:inline-flex;align-items:center;justify-content:center;gap:7px}
.btn-primary{background:var(--primary);color:#fff;box-shadow:0 7px 16px rgba(var(--primary-rgb),.18)}
.btn-dark{background:var(--ink);color:#fff}
.btn-soft{background:var(--primary-soft);color:var(--primary)}
.btn-ghost{background:#f0f2f7;color:#465068}
.btn-success{background:var(--green);color:#fff}
.btn-danger{background:var(--red-soft);color:var(--red)}
.btn-orange{background:var(--orange-soft);color:#a45a19}
.full{width:100%}
.icon-btn{width:36px;height:36px;padding:0;border:0;border-radius:9px;background:#f0f2f7;color:#586177;display:grid;place-items:center}

/* LAYOUT */
.shell{min-height:100vh;display:grid;grid-template-columns:246px minmax(0,1fr)}
.sidebar{background:var(--nav);color:white;padding:20px 13px;display:flex;flex-direction:column;gap:18px}
.sidebar .logo-lockup{padding:0 8px}
.sidebar .logo-mark{width:42px;height:42px;border-radius:13px}
.sidebar .logo-name{font-size:18px}
.sidebar .logo-sub{color:#9199b5}
.school-chip{margin:2px 7px 0;padding:11px 12px;border-radius:12px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.06)}
.school-chip span{display:block;color:#8f98b5;font-size:9px;font-weight:900;letter-spacing:.09em;text-transform:uppercase;margin-bottom:4px}
.school-chip strong{font-size:12px}
.nav{display:grid;gap:4px}
.nav button{border:0;background:transparent;color:var(--nav-muted);border-radius:10px;padding:10px 11px;display:flex;align-items:center;gap:10px;text-align:left;font-weight:800}
.nav button:hover,.nav button.active{color:white;background:rgba(var(--primary-rgb),.19)}
.nav button.active{box-shadow:inset 3px 0 0 var(--primary-2)}
.nav-divider{height:1px;background:rgba(255,255,255,.07);margin:6px 8px}
.sidebar-bottom{margin-top:auto}
.user-box{background:rgba(255,255,255,.06);border-radius:12px;padding:11px}
.user-box strong{display:block;font-size:12px}
.user-box small{color:#98a1bd}
.logout{border:0;background:rgba(255,255,255,.07);color:#ccd1df;width:100%;border-radius:8px;padding:7px;margin-top:8px}

.main{min-width:0}
.topbar{height:64px;background:rgba(255,255,255,.93);backdrop-filter:blur(12px);border-bottom:1px solid var(--line);padding:0 24px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:20}
.topbar h2{font-size:18px;margin:0;letter-spacing:-.03em}
.role-badge{font-size:9px;text-transform:uppercase;letter-spacing:.08em;font-weight:900;padding:7px 9px;border-radius:999px;background:var(--primary-soft);color:var(--primary)}
.content{padding:24px}

/* DASHBOARD */
.hero{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:18px}
.hero h1{font-size:31px;letter-spacing:-.045em;margin:0 0 5px}
.hero p{color:var(--muted);margin:0}
.eyebrow{font-size:9px;font-weight:950;letter-spacing:.13em;text-transform:uppercase;color:var(--primary);margin-bottom:6px}
.kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px}
.kpi{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:16px;box-shadow:0 5px 18px rgba(32,38,64,.025)}
.kpi-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.kpi-icon{width:34px;height:34px;border-radius:10px;display:grid;place-items:center}
.kpi-icon.primary{background:var(--primary-soft);color:var(--primary)}
.kpi-icon.red{background:var(--red-soft);color:var(--red)}
.kpi-icon.green{background:var(--green-soft);color:var(--green)}
.kpi-icon.cyan{background:var(--cyan-soft);color:var(--cyan)}
.kpi-icon.pink{background:var(--pink-soft);color:var(--pink)}
.kpi-icon.orange{background:var(--orange-soft);color:var(--orange)}
.kpi span.label{font-size:9px;text-transform:uppercase;letter-spacing:.08em;font-weight:900;color:var(--muted)}
.kpi strong.value{display:block;font-size:25px;letter-spacing:-.04em;margin-top:11px}
.kpi small{display:block;color:var(--muted);margin-top:3px}
.kpi.alert{border-color:#f2c8ca;background:#fffafa}
.kpi.alert strong.value{color:var(--red)}

.grid-2{display:grid;grid-template-columns:1.35fr 1fr;gap:14px;margin-bottom:14px}
.grid-equal{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:14px}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:16px;overflow:hidden;box-shadow:0 6px 20px rgba(32,38,64,.025)}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px;border-bottom:1px solid var(--line)}
.panel-head h3{font-size:16px;margin:0;letter-spacing:-.025em}
.panel-body{padding:15px}
.panel-sub{font-size:11px;color:var(--muted);margin-top:2px}
.lesson-row,.money-row,.person-row{display:flex;align-items:center;gap:11px;padding:10px 0;border-bottom:1px solid #f0f2f6}
.lesson-row:last-child,.money-row:last-child,.person-row:last-child{border-bottom:0}
.time-pill{width:49px;padding:7px 5px;text-align:center;border-radius:9px;background:var(--primary-soft);color:var(--primary);font-weight:950;font-size:11px;flex:0 0 auto}
.grow{flex:1;min-width:0}
.grow strong{display:block;font-size:12px}
.grow small{display:block;color:var(--muted);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.amount{font-weight:950;white-space:nowrap}
.status{display:inline-flex;align-items:center;gap:4px;font-size:9px;font-weight:950;padding:5px 7px;border-radius:999px;white-space:nowrap}
.status.ok{background:var(--green-soft);color:var(--green)}
.status.warn{background:var(--orange-soft);color:#a45a19}
.status.bad{background:var(--red-soft);color:var(--red)}

.chart{width:100%;height:210px;display:block}
.chart text{font-family:Inter,system-ui,sans-serif;fill:#7b8497;font-size:9px}
.chart .grid{stroke:#edf0f5;stroke-width:1}
.chart .line1{stroke:var(--primary);stroke-width:3;fill:none}
.chart .line2{stroke:var(--cyan);stroke-width:3;fill:none}
.chart .bar1{fill:var(--primary)} .chart .bar2{fill:var(--cyan)} .chart .bar3{fill:var(--pink)} .chart .bar4{fill:var(--green)}
.legend{display:flex;gap:12px;flex-wrap:wrap;margin-top:6px;color:var(--muted);font-size:10px}
.legend i{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px}

/* TABLES/CARDS */
.toolbar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.toolbar input,.toolbar select{border:1px solid var(--line);border-radius:9px;background:white;padding:9px 10px;min-width:170px}
.table-wrap{background:white;border:1px solid var(--line);border-radius:15px;overflow:auto}
table{width:100%;border-collapse:collapse;min-width:800px}
th,td{padding:11px 12px;border-bottom:1px solid #eef0f5;text-align:left;font-size:12px;vertical-align:middle}
th{background:#fafbfe;color:#798196;font-size:9px;text-transform:uppercase;letter-spacing:.08em}
tr:last-child td{border-bottom:0}
.actions{display:flex;gap:6px;flex-wrap:wrap}
.card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.card{background:white;border:1px solid var(--line);border-radius:15px;padding:15px}
.card h3{font-size:16px;margin:0 0 5px}
.card p{font-size:11px;color:var(--muted);line-height:1.5;margin:0}
.card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.card-foot{border-top:1px solid var(--line);margin-top:13px;padding-top:12px;display:flex;align-items:center;justify-content:space-between;gap:8px}
.tags{display:flex;gap:5px;flex-wrap:wrap;margin-top:9px}
.tag{background:var(--primary-soft);color:var(--primary);border-radius:999px;padding:5px 7px;font-size:9px;font-weight:900}

/* OVERDUE */
.due-list{display:grid;gap:8px}
.due-card{border:1px solid #f0d2d4;background:#fffafa;border-radius:12px;padding:12px;display:grid;grid-template-columns:1fr auto;gap:10px}
.due-card strong{font-size:12px}
.due-card small{display:block;color:var(--muted);margin-top:3px}
.due-card .amount{color:var(--red);font-size:16px}
.due-actions{display:flex;gap:6px;margin-top:8px;flex-wrap:wrap}

/* MODAL */
.modal-backdrop{position:fixed;inset:0;background:rgba(17,22,36,.58);display:grid;place-items:center;padding:18px;z-index:100}
.modal{width:min(900px,100%);max-height:92vh;display:flex;flex-direction:column;background:white;border-radius:20px;box-shadow:0 35px 100px rgba(8,13,29,.25);overflow:hidden}
.modal-head{flex:0 0 auto;padding:15px 18px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:10px}
.modal-head strong{font-size:18px;letter-spacing:-.03em}
.modal-body{padding:17px 18px;overflow:auto}
.modal-foot{flex:0 0 auto;padding:13px 18px;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:flex-end;gap:8px;background:#fcfcfe}
.section-title{font-size:11px;font-weight:950;text-transform:uppercase;letter-spacing:.08em;color:var(--primary);margin:6px 0 10px}

/* Multi-course editor */
.enrollment-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.enrollment-card{border:1px solid var(--line);border-radius:12px;background:#fbfcff;padding:11px}
.enrollment-card.selected{border-color:#b9b5ff;background:#f7f6ff}
.enrollment-check{display:flex;align-items:flex-start;gap:9px}
.enrollment-check input{margin-top:3px;width:18px;height:18px;accent-color:var(--primary)}
.enrollment-name{font-weight:900;font-size:12px}
.enrollment-meta{font-size:10px;color:var(--muted);margin-top:2px}
.enrollment-price{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:9px}
.enrollment-price .field{margin:0}
.enrollment-price .field label{font-size:8px}
.enrollment-price input{padding:8px 9px}

/* Attendance */
.attendance-list{display:grid;gap:7px}
.attendance-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--line);border-radius:11px;padding:10px 11px;background:#fff}
.attendance-row strong{display:block;font-size:12px}
.attendance-row small{display:block;color:var(--muted);margin-top:3px}
.attendance-row input{width:24px;height:24px;accent-color:var(--green)}

/* Calendar */
.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:7px}
.calendar-day{min-height:115px;background:white;border:1px solid var(--line);border-radius:12px;padding:9px}
.calendar-day>strong{font-size:10px}
.calendar-event{margin-top:7px;border-radius:8px;background:var(--primary-soft);color:#5048d2;padding:7px;font-size:9px;line-height:1.45}

/* TEACHER MOBILE */
.teacher-app{max-width:760px;margin:0 auto;padding:0 15px 32px}
.teacher-head{display:flex;align-items:center;justify-content:space-between;padding:16px 0;border-bottom:1px solid var(--line)}
.teacher-welcome{padding:22px 0 14px}
.teacher-welcome h1{font-size:29px;margin:0 0 5px}
.teacher-welcome p{color:var(--muted);margin:0}
.teacher-course-stack{display:grid;gap:11px}
.teacher-course{background:white;border:1px solid var(--line);border-radius:16px;padding:15px}
.teacher-course h3{font-size:17px;margin:3px 0 5px}
.teacher-course p{color:var(--muted);font-size:11px;margin:0}
.teacher-course-top{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.teacher-count{min-width:70px;border-radius:11px;background:var(--green-soft);color:var(--green);text-align:center;padding:9px;font-size:18px;font-weight:950}
.teacher-count small{display:block;font-size:8px;text-transform:uppercase;margin-top:2px}

/* MOBILE */
.mobile-nav{display:none}
@media(max-width:1100px){
  .kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .grid-2,.grid-equal{grid-template-columns:1fr}
}
@media(max-width:780px){
  .shell{display:block}
  .sidebar{display:none}
  .topbar{height:58px;padding:0 13px}
  .content{padding:16px 12px 78px}
  .hero{align-items:flex-start;flex-direction:column}
  .hero h1{font-size:27px}
  .kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .kpi{padding:12px}
  .kpi strong.value{font-size:21px}
  .card-grid{grid-template-columns:1fr}
  .form-grid,.enrollment-grid{grid-template-columns:1fr}
  .span-2{grid-column:auto}
  .enrollment-price{grid-template-columns:1fr 1fr}
  .calendar-grid{grid-template-columns:1fr}
  .calendar-day{min-height:auto}
  .modal-backdrop{padding:7px}
  .modal{max-height:96vh;border-radius:15px}
  .modal-body{padding:13px}
  .modal-head,.modal-foot{padding:12px 13px}
  .mobile-nav{display:grid;position:fixed;left:0;right:0;bottom:0;height:64px;background:white;border-top:1px solid var(--line);grid-template-columns:repeat(5,1fr);z-index:50;padding-bottom:env(safe-area-inset-bottom)}
  .mobile-nav button{border:0;background:transparent;color:#8a91a3;font-size:8px;font-weight:900;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px}
  .mobile-nav button.active{color:var(--primary)}
  .mobile-nav svg{width:17px;height:17px}
}


/* V6.1 - fix definitivo scrolling modali */
.modal > form{
  display:flex;
  flex-direction:column;
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
}
.modal > form > .modal-body{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.modal > .modal-body{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.modal-foot{
  position:relative;
  z-index:2;
}

/* V6.4 - attività Segreteria visibili SOLO ad Admin */
.admin-activity-alert{
  margin:0 0 16px;
  border:1px solid #e5e8f1;
  background:#fff;
  border-radius:16px;
  overflow:hidden;
}
.admin-activity-alert.has-alert{
  border-color:#f3b9bf;
  box-shadow:0 8px 24px rgba(220,65,75,.08);
}
.activity-alert-head{display:flex;align-items:center;gap:12px;padding:14px 16px}
.admin-activity-alert.has-alert .activity-alert-head{background:#fff3f4}
.activity-alert-icon{width:40px;height:40px;border-radius:11px;background:#ffe2e5;color:#d63e4a;display:grid;place-items:center;flex:0 0 auto}
.activity-alert-head strong{display:block}
.activity-alert-head small,.activity-item small{display:block;color:var(--muted);margin-top:3px}
.activity-count{min-width:30px;height:30px;border-radius:999px;background:#d63e4a;color:#fff;display:grid;place-items:center;font-weight:900}
.activity-list{border-top:1px solid #eef0f5}
.activity-item{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid #eef0f5}
.activity-item.unread{border-left:4px solid #d63e4a;background:#fffafa}
.activity-foot{padding:10px 16px;text-align:right}
.activity-empty{padding:0 16px 14px;color:var(--muted)}

/* V6.5 - listino bloccato per Segreteria + quota iscrizione in evidenza */
.field-help{
  display:block;
  margin-top:5px;
  font-size:9px;
  color:var(--muted);
  line-height:1.35;
}
.field input[readonly]{
  background:#f1f3f8;
  color:#747d91;
  cursor:not-allowed;
}
.lock-note{
  color:#8a91a3;
  font-size:9px;
  font-weight:800;
}
.registration-alert{
  display:flex;
  align-items:center;
  gap:10px;
  margin:0 0 12px;
  padding:11px 12px;
  border:1px solid #f1b9bd;
  border-left:4px solid var(--red);
  border-radius:11px;
  background:#fff6f7;
  color:var(--red);
}
.registration-alert svg{flex:0 0 auto}
.registration-alert strong{display:block;font-size:12px}
.registration-alert small{display:block;color:#8f5559;margin-top:2px}
.status.bad svg,.status.ok svg{
  width:12px;height:12px;
}

/* V6.6 - totale da pagare automatico */
.due-calculation{
  border:1px solid #d9dcff;
  background:#f5f4ff;
  color:#5550a8;
  border-radius:11px;
  padding:11px 12px;
  font-size:11px;
  line-height:1.5;
}
.due-calculation strong{
  color:var(--primary);
}

/* V6.7 - dettaglio corso e presenze mensili */
.course-detail-modal{width:min(1180px,96vw)}
.course-detail-kpis{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:14px
}
.course-detail-kpi{
  background:#f8f9fd;border:1px solid var(--line);border-radius:12px;padding:12px
}
.course-detail-kpi span{display:block;font-size:9px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-weight:900}
.course-detail-kpi strong{display:block;font-size:22px;margin-top:5px}
.course-detail-kpi.ok{background:var(--green-soft);border-color:#cdebdc}
.course-detail-kpi.ok strong{color:var(--green)}
.course-detail-kpi.bad{background:var(--red-soft);border-color:#f2c5ca}
.course-detail-kpi.bad strong{color:var(--red)}
.attendance-legend{display:flex;gap:14px;flex-wrap:wrap;align-items:center;margin-bottom:10px;font-size:10px;color:var(--muted)}
.att-dot,.att-btn{
  width:28px;height:28px;border-radius:8px;display:inline-grid;place-items:center;font-weight:950
}
.att-dot.p,.att-btn.p{background:var(--green-soft);color:var(--green);border:1px solid #bfe5d2}
.att-dot.a,.att-btn.a{background:var(--red-soft);color:var(--red);border:1px solid #efc1c6}
.att-dot.empty,.att-btn.empty{background:#f1f3f8;color:#9097a8;border:1px solid #e1e4eb}
.att-dot.blocked,.att-btn.blocked{background:#2c3142;color:white;border:1px solid #2c3142}
.att-btn{cursor:pointer}
.att-btn.blocked{cursor:not-allowed;opacity:.75}
.course-detail-table-wrap{overflow:auto;border:1px solid var(--line);border-radius:13px}
.course-detail-table{min-width:900px}
.course-detail-table th,.course-detail-table td{text-align:center;white-space:nowrap}
.course-detail-table th:first-child,.course-detail-table td:first-child{text-align:left;position:sticky;left:0;background:white;z-index:2}
.blocked-row{background:#fff7f8}
.blocked-row td:first-child{background:#fff7f8}
.blocked-attendance{background:#fff5f6;border-color:#f1c8cc;opacity:.88}
.blocked-attendance strong{color:#9f3f47}
@media(max-width:780px){
  .course-detail-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .course-detail-modal{width:100%}
}


.course-top-tools{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  background:linear-gradient(180deg,#fcf7ff 0%,#f8f9fd 100%);
  border:1px solid #ead8ff;
  border-radius:14px;
  padding:12px 14px;
  margin:0 0 12px;
}
.course-top-tools strong{display:block;font-size:13px;color:#20263a}
.course-top-tools small{display:block;margin-top:4px;color:var(--muted);font-size:11px;line-height:1.45}
.course-top-tools-actions{display:flex;gap:10px;flex-wrap:wrap}
.course-top-tools-actions .btn{box-shadow:none}
.course-export-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:12px 0 0}
@media(max-width:780px){
  .course-top-tools{align-items:flex-start}
  .course-top-tools-actions{width:100%}
  .course-top-tools-actions .btn{flex:1 1 220px;justify-content:center}
}

/* V6.8 - cruscotto rinnovi Admin */
.renewal-dashboard{margin-bottom:14px}
.renewal-summary{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.renewal-total{font-weight:950;color:var(--red);font-size:15px}
.renewal-course-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.renewal-course-card{
  border:1px solid #f0c9cd;
  background:#fffafa;
  border-radius:13px;
  padding:12px;
}
.renewal-course-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
}
.renewal-course-head strong{display:block;font-size:12px}
.renewal-course-head small{display:block;color:var(--muted);margin-top:3px}
.renewal-money{
  font-size:18px;
  font-weight:950;
  color:var(--red);
  margin:11px 0 8px;
}
.renewal-money small{
  display:block;
  font-size:9px;
  color:var(--muted);
  font-weight:700;
  margin-top:2px;
}
.renewal-students{
  display:grid;
  gap:6px;
  margin-bottom:10px;
}
.renewal-student{
  width:100%;
  border:1px solid #f1d8da;
  background:white;
  border-radius:9px;
  padding:8px;
  display:flex;
  align-items:center;
  gap:8px;
  text-align:left;
  color:var(--ink);
}
.renewal-student>span:first-child{color:var(--red)}
.renewal-student strong{display:block;font-size:10px}
.renewal-student small{display:block;color:var(--muted);font-size:9px;margin-top:2px}
.renewal-ok{
  display:flex;align-items:center;gap:10px;
  background:var(--green-soft);color:var(--green);
  border-radius:11px;padding:12px
}
.renewal-ok strong{display:block}
.renewal-ok small{display:block;color:#5f7f6c;margin-top:2px}
@media(max-width:1100px){
  .renewal-course-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:780px){
  .renewal-course-grid{grid-template-columns:1fr}
}

/* V6.9 - situazione economica + andamento corsi */
.economic-overview,
.course-performance-dashboard{margin-bottom:14px}

.economic-percent{
  background:#eef0ff;
  color:var(--primary);
  border-radius:999px;
  padding:7px 10px;
  font-size:10px;
  font-weight:900;
}
.economic-kpis{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.economic-card{
  border:1px solid var(--line);
  border-radius:13px;
  padding:13px;
  background:#fafbfe;
}
.economic-card span{
  display:block;
  font-size:9px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.07em;
  color:var(--muted);
}
.economic-card strong{
  display:block;
  margin-top:6px;
  font-size:22px;
}
.economic-card.collected{
  background:var(--green-soft);
  border-color:#c9ead8;
}
.economic-card.collected strong{color:var(--green)}
.economic-card.outstanding{
  background:var(--red-soft);
  border-color:#f0c8cc;
}
.economic-card.outstanding strong{color:var(--red)}
.economic-card.expected strong{color:var(--primary)}

.economic-progress{
  height:12px;
  background:#f0d7da;
  border-radius:999px;
  overflow:hidden;
  margin-top:13px;
}
.economic-progress span{
  display:block;
  height:100%;
  background:var(--green);
  border-radius:999px;
}
.economic-progress-labels{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top:6px;
  color:var(--muted);
  font-size:9px;
  font-weight:800;
}

.performance-head-badges{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.performance-chart{
  display:grid;
  gap:8px;
}
.performance-row{
  display:grid;
  grid-template-columns:34px minmax(150px,1fr) minmax(280px,2fr) 34px;
  align-items:center;
  gap:10px;
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px;
  background:white;
  cursor:pointer;
  transition:.15s ease;
}
.performance-row:hover{
  border-color:#cfd2ff;
  box-shadow:0 5px 16px rgba(77,70,180,.07);
}
.performance-rank{
  width:28px;height:28px;
  display:grid;place-items:center;
  border-radius:8px;
  background:#f0efff;
  color:var(--primary);
  font-weight:950;
}
.performance-name strong{display:block;font-size:11px}
.performance-name small{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:9px;
}
.performance-bars{display:grid;gap:6px}
.metric-row{
  display:grid;
  grid-template-columns:54px minmax(100px,1fr) 38px;
  align-items:center;
  gap:7px;
  font-size:9px;
}
.metric-row>span{
  color:var(--muted);
  font-weight:800;
}
.metric-row>b{text-align:right;font-size:9px}
.metric-track{
  height:9px;
  background:#eef0f5;
  border-radius:999px;
  overflow:hidden;
}
.metric-fill{
  display:block;
  height:100%;
  border-radius:999px;
}
.metric-fill.renewal{background:var(--green)}
.metric-fill.attendance{background:var(--primary)}
.performance-note{
  margin-top:10px;
  padding:9px 10px;
  border-radius:10px;
  background:#f7f7fb;
  color:var(--muted);
  font-size:9px;
}
@media(max-width:900px){
  .performance-row{
    grid-template-columns:30px 1fr 34px;
  }
  .performance-bars{
    grid-column:2/4;
  }
}
@media(max-width:700px){
  .economic-kpis{grid-template-columns:1fr}
  .performance-head-badges{justify-content:flex-start}
  .performance-row{
    grid-template-columns:30px 1fr 34px;
  }
}

/* V6.10 - riorganizzazione Dashboard Admin */
.dashboard-section-label{
  font-size:8px;
  line-height:1;
  font-weight:950;
  letter-spacing:.12em;
  color:var(--primary);
  margin-bottom:5px;
}
.admin-quick-strip{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-bottom:12px;
}
.quick-item{
  display:flex;
  align-items:center;
  gap:9px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
}
.quick-item>span{
  width:31px;height:31px;
  display:grid;place-items:center;
  border-radius:9px;
  background:#f1f0ff;
  color:var(--primary);
  flex:0 0 auto;
}
.quick-item small{
  display:block;
  color:var(--muted);
  font-size:8px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.05em;
}
.quick-item strong{
  display:block;
  font-size:17px;
  line-height:1.15;
  margin-top:2px;
}
.quick-item.danger{
  border-color:#f0c9cd;
  background:#fff9fa;
}
.quick-item.danger>span{
  background:var(--red-soft);
  color:var(--red);
}
.quick-item.danger strong{color:var(--red)}

.admin-priority-panel{
  margin-bottom:12px;
}
.admin-priority-panel .panel-head{
  padding-top:13px;
  padding-bottom:10px;
}
.admin-priority-panel .panel-body{
  padding-top:10px;
}
.economic-card small{
  display:block;
  color:var(--muted);
  font-size:8px;
  margin-top:3px;
}
.renewal-course-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.renewal-course-card{
  padding:11px;
}
.performance-row{
  min-height:62px;
}
.admin-activity-alert{
  margin-bottom:12px;
}
@media(max-width:1050px){
  .admin-quick-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  .admin-quick-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
  .renewal-course-grid{grid-template-columns:1fr}
}
@media(max-width:460px){
  .admin-quick-strip{grid-template-columns:1fr 1fr}
  .quick-item{padding:9px}
}

/* V6.11 - notifiche Segreteria nuovamente in alto */
.admin-activity-alert{
  margin-top:0;
  margin-bottom:12px;
}
.admin-activity-alert.has-alert{
  border:2px solid #e35a65;
  box-shadow:0 8px 22px rgba(214,62,74,.12);
}
.admin-activity-alert.has-alert .activity-alert-head{
  background:#fff0f2;
}
.admin-activity-alert.has-alert .activity-alert-icon{
  background:#d63e4a;
  color:#fff;
}

/* V6.12 - Supabase online */
.login-live-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin:8px 0 2px;
  padding:6px 9px;
  border-radius:999px;
  background:var(--green-soft);
  color:var(--green);
  font-size:9px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.login-live-badge::before{
  content:"";
  width:7px;height:7px;
  border-radius:50%;
  background:currentColor;
}
.login-error{
  margin:10px 0;
  padding:10px 11px;
  border-radius:10px;
  background:var(--red-soft);
  color:var(--red);
  font-size:10px;
  font-weight:800;
}
.login-security{
  margin-top:12px;
  color:var(--muted);
  font-size:9px;
  text-align:center;
}
.topbar-right{
  display:flex;
  align-items:center;
  gap:7px;
}
.db-live-dot{
  width:7px;height:7px;border-radius:50%;
  background:var(--green);
  box-shadow:0 0 0 4px rgba(44,169,97,.10);
}
.db-live-text{
  color:var(--muted);
  font-size:9px;
  font-weight:850;
}

.attendance-choice{display:flex;gap:8px;align-items:center}
.attendance-choice .att-btn{cursor:pointer}
.attendance-choice .att-btn.selected{outline:3px solid rgba(var(--primary-rgb),.18);transform:scale(1.05)}

.schedule-box{border:1px solid var(--line,#e5e7eb);border-radius:14px;padding:14px;margin-bottom:12px;background:#fafbff}
.att-btn:disabled{cursor:not-allowed;opacity:.72}

.student-note-preview{margin-top:7px;padding:6px 8px;border-radius:8px;background:#fff7db;color:#6b5a12;font-size:12px;display:flex;gap:6px;align-items:flex-start;max-width:360px}
.student-note-preview svg{width:14px;height:14px;flex:0 0 auto;margin-top:1px}
.calendar-toolbar{display:flex;justify-content:space-between;gap:12px;align-items:center;margin:14px 0;flex-wrap:wrap}
.calendar-nav,.calendar-selectors{display:flex;gap:8px;align-items:center}
.calendar-selectors select{min-width:120px}
.month-calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border:1px solid #e4e7ef;border-radius:14px;overflow:hidden;background:#fff}
.month-weekday{padding:10px 8px;font-weight:800;font-size:12px;background:#f6f7fb;border-right:1px solid #e4e7ef}
.month-weekday:nth-child(7){border-right:0}
.month-day{min-height:118px;padding:8px;border-top:1px solid #e4e7ef;border-right:1px solid #e4e7ef;background:#fff}
.month-day:nth-child(7n){border-right:0}
.month-day.empty-cell{background:#fafbfe}
.month-day.today{box-shadow:inset 0 0 0 2px var(--primary)}
.month-day-number{font-weight:800;margin-bottom:6px}
.month-events{display:flex;flex-direction:column;gap:5px}
.month-event{padding:6px 7px;border-radius:8px;background:#f0efff;font-size:11px;line-height:1.25}
.month-event small{display:block;margin-top:2px;color:#667085}
@media(max-width:800px){
 .month-calendar{min-width:760px}
 .calendar-toolbar{align-items:flex-start}
 .month-calendar{overflow:visible}
}

.month-day:not(.empty-cell){cursor:pointer;transition:box-shadow .15s ease,transform .15s ease}
.month-day:not(.empty-cell):hover{box-shadow:inset 0 0 0 2px rgba(var(--primary-rgb),.18);background:#fbfbff}
.calendar-day-detail{display:flex;flex-direction:column;gap:10px}
.calendar-day-lesson{display:flex;gap:14px;align-items:center;padding:14px;border:1px solid #e5e7eb;border-radius:14px;background:#fff}
.calendar-day-time{font-weight:800;min-width:110px;color:var(--primary)}
.calendar-day-lesson small{display:block;margin-top:3px;color:#667085}
@media(max-width:700px){
 .calendar-day-lesson{align-items:flex-start;flex-wrap:wrap}
 .calendar-day-time{min-width:auto}
 .calendar-day-lesson .btn{width:100%}
}

.lesson-confirm-box{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-top:12px;padding:12px;border:1px solid #e5e7eb;border-radius:12px;background:#fff}
.lesson-confirm-box.confirmed{background:#f3fbf6}
.lesson-confirm-box small{display:block;margin-top:3px;color:#667085}
@media(max-width:700px){.lesson-confirm-box{align-items:flex-start;flex-direction:column}.lesson-confirm-box .btn{width:100%}}

.segmented{display:flex;gap:6px;flex-wrap:wrap}
.segmented button{border:1px solid #e4e7ef;background:#fff;border-radius:10px;padding:9px 12px;font-weight:700;cursor:pointer}
.segmented button.active{background:#635bff;color:#fff;border-color:var(--primary)}
.segmented button span{opacity:.75;margin-left:4px}
.teacher-inactive{opacity:.78;background:#fafafa}
.btn-danger{background:#fff0f0;color:#c33;border:1px solid #ffd1d1}
.btn-danger:hover{background:#ffe6e6}

.teacher-payroll-kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:16px}
.teacher-payroll-kpi{border:1px solid #e6e8ef;border-radius:14px;padding:14px;background:#fafbff}
.teacher-payroll-kpi span{display:block;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:#667085}
.teacher-payroll-kpi strong{display:block;font-size:24px;margin:5px 0}
.teacher-payroll-kpi small{color:#667085}
.teacher-payroll-kpi.paid{background:#f3fbf6;border-color:#d7f1df}
.teacher-payroll-kpi.due{background:#fff5f5;border-color:#ffd7d7}
.teacher-payroll-list{display:flex;flex-direction:column;gap:8px}
.teacher-payroll-row{display:flex;gap:12px;align-items:center;padding:12px;border:1px solid #e6e8ef;border-radius:12px;background:#fff}
.teacher-payroll-row small{display:block;margin-top:3px;color:#667085}
.teacher-payroll-values{display:grid;grid-template-columns:repeat(3,minmax(95px,1fr));gap:10px;text-align:right}
.teacher-payroll-values span{display:block;font-size:10px;text-transform:uppercase;color:var(--dm-muted);font-weight:700}
.teacher-payroll-values b{display:block;margin-top:2px}
.teacher-payroll-due b{color:#d64545}
@media(max-width:800px){
 .teacher-payroll-kpis{grid-template-columns:1fr}
 .teacher-payroll-row{align-items:flex-start;flex-wrap:wrap}
 .teacher-payroll-values{width:100%;grid-template-columns:repeat(3,1fr);text-align:left}
}

.teacher-payment-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.teacher-payment-summary>div{padding:12px;border:1px solid #e5e7eb;border-radius:12px;background:#fafbff}
.teacher-payment-summary span{display:block;font-size:11px;text-transform:uppercase;font-weight:800;color:#667085}
.teacher-payment-summary strong{display:block;font-size:20px;margin-top:4px}
.teacher-payment-summary .due{background:#fff5f5;border-color:#ffd7d7}
.teacher-payment-summary .due strong{color:#d64545}
.teacher-payment-history{display:flex;flex-direction:column;gap:9px}
.teacher-history-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid #e5e7eb;border-radius:12px}
.teacher-history-row small{display:block;color:#667085;margin-top:3px}
.teacher-history-row p{margin:6px 0 0;color:#667085;font-size:12px}
.teacher-payroll-actions{display:flex;gap:7px;align-items:center}
.btn:disabled,.icon-btn:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:800px){
 .teacher-payment-summary{grid-template-columns:1fr}
 .teacher-payroll-actions{width:100%;justify-content:flex-end}
}

.pending-comp{display:block;margin-top:5px;color:var(--primary);font-weight:700}

.compensation-field{transition:opacity .18s ease,filter .18s ease}
.comp-field-disabled{opacity:.38;filter:grayscale(.3)}
.comp-field-disabled input{background:#f2f4f7!important;color:var(--dm-muted)!important;cursor:not-allowed}
.comp-field-disabled label,.comp-field-disabled .field-help{color:var(--dm-muted)!important}



/* V6.44 - note allievo compatte e notifiche dashboard non invasive */
.student-note-preview{
  max-width:260px;
  min-width:0;
  overflow:hidden;
}
.student-note-preview span{
  min-width:0;
  overflow-wrap:anywhere;
  word-break:break-word;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  line-height:1.35;
}
.activity-list{
  max-height:none;
}
.activity-item{
  min-height:58px;
  padding:9px 14px;
}
.activity-copy{
  min-width:0;
}
.activity-copy strong,
.activity-message,
.activity-meta{
  overflow:hidden;
  text-overflow:ellipsis;
}
.activity-message{
  white-space:nowrap;
}
.activity-meta{
  font-size:10px;
}
.activity-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px 14px;
}
.activity-foot-left{
  display:flex;
  align-items:center;
}
@media(max-width:800px){
  .student-note-preview{max-width:220px}
  .activity-item{align-items:flex-start}
  .activity-message{
    white-space:normal;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
  }
  .activity-foot{
    align-items:stretch;
    flex-direction:column;
  }
  .activity-foot .btn{
    width:100%;
  }
}


/* V6.48 - conferma salvataggi */
.dm-success-toast{
  position:fixed;
  left:50%;
  bottom:28px;
  z-index:99999;
  transform:translate(-50%,18px);
  opacity:0;
  pointer-events:none;
  display:flex;
  align-items:center;
  gap:10px;
  max-width:min(92vw,440px);
  padding:12px 16px;
  border:1px solid #b9e7ce;
  border-radius:14px;
  background:#f0fff6;
  color:#157347;
  box-shadow:0 14px 40px rgba(25,90,55,.18);
  font-weight:800;
  font-size:13px;
  transition:opacity .2s ease,transform .2s ease;
}
.dm-success-toast.show{
  opacity:1;
  transform:translate(-50%,0);
}
.dm-success-toast-icon{
  width:25px;
  height:25px;
  border-radius:999px;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  background:#d7f6e4;
}
.dm-success-toast-icon svg{
  width:14px;
  height:14px;
}
@media(max-width:800px){
  .dm-success-toast{
    bottom:82px;
    width:calc(100vw - 28px);
    justify-content:center;
  }
}


/* V6.49 - Mobile navigation finale */
.mobile-more-backdrop{
  position:fixed;
  inset:0;
  z-index:1000;
  display:flex;
  align-items:flex-end;
  background:rgba(17,22,36,.38);
  opacity:0;
  transition:opacity .18s ease;
}
.mobile-more-backdrop.show{opacity:1}
.mobile-more-sheet{
  width:100%;
  max-height:82vh;
  padding:8px 14px calc(14px + env(safe-area-inset-bottom));
  border-radius:20px 20px 0 0;
  background:#fff;
  box-shadow:0 -20px 60px rgba(17,22,36,.18);
  transform:translateY(20px);
  transition:transform .18s ease;
}
.mobile-more-backdrop.show .mobile-more-sheet{transform:translateY(0)}
.mobile-more-handle{
  width:42px;
  height:4px;
  border-radius:999px;
  background:#d9dce5;
  margin:2px auto 10px;
}
.mobile-more-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.mobile-more-head strong{display:block;font-size:19px}
.mobile-more-head small{display:block;color:var(--muted);margin-top:2px}
.mobile-more-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;
}
.mobile-more-grid button{
  min-height:76px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fafbfe;
  color:var(--ink);
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:7px;
  padding:12px;
  font-weight:850;
  text-align:left;
}
.mobile-more-grid button svg{
  width:20px;
  height:20px;
  color:var(--primary);
}
.mobile-more-logout{
  width:100%;
  margin-top:10px;
  min-height:44px;
  border:0;
  border-radius:12px;
  background:#f1f3f7;
  color:#596174;
  font-weight:850;
}
@media(max-width:780px){
  body{overflow-x:hidden}
  .topbar{gap:8px}
  .topbar h2{
    min-width:0;
    max-width:55vw;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .topbar-right{gap:5px}
  .db-live-text{display:none}
  .role-badge{padding:6px 7px;font-size:8px}
  .content{overflow-x:hidden}
  .hero .btn{max-width:100%}
  .toolbar input,.toolbar select{
    min-width:0;
    flex:1 1 150px;
  }
  .table-wrap{
    max-width:100%;
    -webkit-overflow-scrolling:touch;
  }
  .panel-head{
    align-items:flex-start;
    flex-wrap:wrap;
  }
  .course-detail-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .teacher-head .logo-name{font-size:15px}
  .teacher-head .logo-sub{display:none}
  .teacher-course-top{flex-direction:column}
  .teacher-count{width:100%}
}


/* V6.50 - Branding scuola */
.school-chip-brand{display:flex;align-items:center;gap:9px;min-width:0}
.school-chip-brand>div{min-width:0}
.school-chip-brand strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.school-brand-logo{
  width:36px;height:36px;flex:0 0 auto;border-radius:10px;
  display:grid;place-items:center;overflow:hidden;
  background:#fff;border:1px solid rgba(255,255,255,.16)
}
.school-brand-logo img{width:100%;height:100%;object-fit:contain;background:#fff}
.school-brand-initials{background:linear-gradient(135deg,var(--primary),#e45bb7);color:#fff;font-size:11px;font-weight:950}
.school-brand-logo.sidebar-brand{width:34px;height:34px}
.mobile-school-brand{display:none}
.school-brand-editor{display:grid;gap:14px}
.school-brand-preview{
  display:flex;align-items:center;gap:12px;
  padding:14px;border:1px solid var(--line);border-radius:14px;background:#fafbfe
}
.school-brand-preview .settings-preview{width:54px;height:54px;border-radius:15px;border-color:var(--line)}
.school-brand-preview strong{display:block;font-size:16px}
.school-brand-preview small{display:block;color:var(--muted);margin-top:3px}

/* V6.50 - Calendario mobile: tutte le 7 colonne visibili */
@media(max-width:780px){
  .topbar{height:66px}
  .topbar>h2{display:none}
  .topbar-title-wrap>h2{display:none}
  .mobile-school-brand{
    display:flex;align-items:center;gap:8px;min-width:0;max-width:58vw
  }
  .mobile-school-brand .school-brand-logo{width:31px;height:31px;border-radius:9px;border-color:var(--line)}
  .mobile-school-brand>div{min-width:0}
  .mobile-school-brand strong{
    display:block;font-size:12px;line-height:1.15;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis
  }
  .mobile-school-brand small{
    display:block;font-size:10px;color:var(--muted);margin-top:2px;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis
  }

  .calendar-toolbar{gap:9px;margin:10px 0 12px}
  .calendar-nav{width:100%;justify-content:space-between}
  .calendar-nav strong{text-align:center;flex:1;font-size:18px}
  .calendar-selectors{width:100%;display:grid;grid-template-columns:1fr 1fr auto;gap:7px}
  .calendar-selectors select{min-width:0;width:100%;padding:8px 6px}
  .calendar-selectors .btn{padding-left:10px;padding-right:10px}

  .month-calendar{
    width:100%;
    min-width:0 !important;
    grid-template-columns:repeat(7,minmax(0,1fr));
    border-radius:12px;
    overflow:hidden !important;
  }
  .month-weekday{
    min-width:0;
    padding:8px 2px;
    text-align:center;
    font-size:10px;
  }
  .month-day{
    min-width:0;
    min-height:94px;
    padding:5px 3px;
    overflow:hidden;
  }
  .month-day-number{
    text-align:center;
    font-size:12px;
    margin-bottom:4px;
  }
  .month-events{gap:3px}
  .month-event{
    min-width:0;
    padding:4px 3px;
    border-radius:6px;
    font-size:8.5px;
    line-height:1.15;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
  }
  .month-event b{font-size:8px}
  .month-event small{
    display:none;
  }
}
@media(max-width:390px){
  .month-day{min-height:84px;padding:4px 2px}
  .month-weekday{font-size:9px}
  .month-event{font-size:7.5px;padding:3px 2px}
}


/* V6.58 - Dashboard Super Admin commerciale */
.super-kpi-grid{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:12px;
  margin-bottom:16px;
}
.super-mrr-summary{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin-top:14px;
}
.super-mrr-summary>div{
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fafbfe;
}
.super-mrr-summary span{
  display:block;
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:900;
  color:var(--muted);
}
.super-mrr-summary strong{
  display:block;
  margin-top:4px;
  font-size:20px;
}
.super-mrr-summary small{
  display:block;
  color:var(--muted);
  margin-top:2px;
}
@media(max-width:1200px){
  .super-kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:780px){
  .super-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .super-kpi-grid .kpi:last-child{grid-column:1/-1}
  .super-mrr-summary{grid-template-columns:1fr}
  .super-commercial-grid{grid-template-columns:1fr}
}


/* V6.59 - Super Admin leggibilità grafici e mobile */
.super-kpi-grid-v659{
  grid-template-columns:repeat(6,minmax(0,1fr));
}
.super-revenue-cards{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.super-revenue-card{
  padding:14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fafbfe;
}
.super-revenue-card span{
  display:block;
  font-size:9px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
}
.super-revenue-card strong{
  display:block;
  margin-top:5px;
  font-size:24px;
  letter-spacing:-.04em;
}
.super-revenue-card small{
  display:block;
  margin-top:3px;
  color:var(--muted);
}
.super-revenue-card.active{background:#f3fbf6;border-color:#d6efdf}
.super-revenue-card.trial{background:#f1fbfd;border-color:#d7f0f5}
.super-revenue-card.potential{background:#f5f4ff;border-color:#dddaff}
.super-revenue-card.arr{background:#faf7ff;border-color:#e7dbff}

.super-ratio-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.super-ratio-list>div{
  padding:13px;
  border:1px solid var(--line);
  border-radius:13px;
  background:#fff;
}
.super-ratio-list span{
  display:block;
  font-size:9px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted);
}
.super-ratio-list strong{
  display:block;
  font-size:23px;
  margin-top:5px;
}
.super-ratio-list small{
  display:block;
  color:var(--muted);
  margin-top:2px;
}
@media(max-width:1250px){
  .super-kpi-grid-v659{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:780px){
  .super-kpi-grid-v659{grid-template-columns:repeat(2,minmax(0,1fr))}
  .super-kpi-grid-v659 .kpi:last-child{grid-column:auto}
  .super-revenue-cards,.super-ratio-list{grid-template-columns:1fr}
  .super-school-row{align-items:flex-start;flex-wrap:wrap}
  .super-school-row .amount{width:100%;padding-left:45px}
  .super-hero .btn{width:100%}
}

.platform-open-balance{color:var(--red)}


/* V6.61 - scadenze canoni automatiche */
.platform-open-balance{color:var(--red)}
@media(max-width:780px){
  .content .grid-2 .table-wrap table{min-width:620px}
}


/* V6.64 - alert canoni dashboard Super Admin */
.super-billing-alert{
  margin:0 0 14px;
  border:1px solid rgba(245,158,11,.24);
}
.super-billing-alert-main{
  display:flex;
  align-items:center;
  gap:14px;
  padding:16px 18px;
}
.super-billing-alert-main strong{
  display:block;
  font-size:15px;
  margin-bottom:3px;
}
.super-billing-alert-main small{
  display:block;
  color:var(--muted);
  line-height:1.45;
}
.super-billing-alert.partial{
  border-color:rgba(6,182,212,.22);
}
@media(max-width:780px){
  .super-billing-alert-main{
    align-items:flex-start;
    flex-wrap:wrap;
  }
  .super-billing-alert-main .btn{
    width:100%;
  }
}


/* V6.65 - Dashboard operative Admin Scuola / Segreteria */
.ops-quick-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin:0 0 14px;
}
.ops-quick-card{
  appearance:none;
  border:1px solid var(--border);
  background:var(--card);
  border-radius:16px;
  padding:14px;
  display:flex;
  align-items:center;
  gap:12px;
  text-align:left;
  cursor:pointer;
  color:var(--text);
  box-shadow:var(--shadow-sm);
}
.ops-quick-card:hover{transform:translateY(-1px);box-shadow:var(--shadow)}
.ops-quick-card strong{display:block;font-size:14px;margin-bottom:2px}
.ops-quick-card small{display:block;color:var(--muted);font-size:11px;line-height:1.35}
.ops-main-grid{align-items:start}
.ops-priority-panel .due-card:first-child{border-color:rgba(239,68,68,.25)}
.admin-ops-kpis{margin-bottom:14px}
.admin-reminders-panel{margin-bottom:14px}

@media(max-width:900px){
  .ops-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:600px){
  .ops-quick-grid{grid-template-columns:1fr 1fr;gap:8px}
  .ops-quick-card{padding:11px;gap:9px;border-radius:14px}
  .ops-quick-card strong{font-size:13px}
  .ops-quick-card small{font-size:10px}
}


/* V6.67 - Cassa Smart */
.cash-toolbar{
  padding:12px;
  margin-bottom:14px;
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
}
.cash-search{
  flex:1;
  min-width:220px;
  height:44px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--card);
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 12px;
}
.cash-search svg{width:17px;height:17px;color:var(--muted)}
.cash-search input{
  width:100%;
  border:0;
  outline:0;
  background:transparent;
  color:var(--text);
  font:inherit;
}
.cash-filter-tabs{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}
.cash-filter-tabs button{
  border:1px solid var(--border);
  background:var(--card);
  color:var(--muted);
  border-radius:10px;
  padding:9px 11px;
  font-weight:800;
  cursor:pointer;
}
.cash-filter-tabs button.active{
  background:var(--primary-soft);
  border-color:rgba(var(--primary-rgb),.22);
  color:var(--primary);
}
.cash-filter-tabs button span{
  margin-left:4px;
  font-size:10px;
  opacity:.8;
}
.due-card-overdue{
  border-color:rgba(239,68,68,.28)!important;
  background:rgba(239,68,68,.035);
}
.due-card-title{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:2px;
}
.due-card-title .status{
  padding:3px 7px;
  font-size:9px;
}
.cash-grid{align-items:start}

@media(max-width:850px){
  .cash-toolbar{align-items:stretch;flex-direction:column}
  .cash-filter-tabs{width:100%}
  .cash-filter-tabs button{flex:1}
}
@media(max-width:600px){
  .cash-filter-tabs{display:grid;grid-template-columns:1fr 1fr}
  .cash-filter-tabs button{width:100%}
}


/* V6.68 - Allineamento scadenze e reset filtri */
.cash-toolbar #cashResetBtn{
  flex:0 0 auto;
  white-space:nowrap;
}
.cash-toolbar #cashResetBtn.hidden{display:none}
@media(max-width:850px){
  .cash-toolbar #cashResetBtn{width:100%}
}


/* V6.69 - distinzione In scadenza / Scaduta */
.due-card-soon{
  border-color:rgba(245,158,11,.24)!important;
  background:rgba(245,158,11,.035);
}
.cash-filter-tabs{
  gap:6px;
}
@media(max-width:600px){
  .cash-filter-tabs{grid-template-columns:1fr 1fr 1fr}
}


/* V6.70 - Scheda allievo completa */
.student-name-link{
  border:0;
  background:none;
  padding:0;
  margin:0;
  color:var(--text);
  font:inherit;
  font-weight:800;
  cursor:pointer;
  text-align:left;
}
.student-name-link:hover{color:var(--primary)}
.student-profile-modal{max-width:980px}
.student-profile-head{
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:14px;
}
.student-profile-avatar{
  width:58px;
  height:58px;
  border-radius:18px;
  display:grid;
  place-items:center;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:20px;
  font-weight:900;
  flex:0 0 auto;
}
.student-profile-head h2{margin:2px 0 3px;font-size:22px}
.student-profile-contact{color:var(--muted);font-size:12px}
.student-profile-head-actions{display:flex;gap:8px;flex-wrap:wrap}
.student-profile-kpis{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}
.student-profile-kpis>div{
  border:1px solid var(--border);
  background:var(--card);
  border-radius:14px;
  padding:12px 14px;
}
.student-profile-kpis small{display:block;color:var(--muted);font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.student-profile-kpis strong{display:block;margin-top:4px;font-size:18px}
.text-danger{color:var(--red)}
.text-success{color:var(--green)}
.student-profile-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-bottom:14px;
}
.profile-data-list>div,
.profile-course-row,
.profile-history-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:10px 0;
  border-bottom:1px solid var(--border);
}
.profile-data-list>div:last-child,
.profile-course-row:last-child,
.profile-history-row:last-child{border-bottom:0}
.profile-data-list span{color:var(--muted);font-size:11px}
.profile-data-list strong{text-align:right;font-size:12px}
.profile-course-row small,
.profile-history-row small{display:block;color:var(--muted);margin-top:2px;font-size:10px}
.profile-history-right{display:flex;align-items:center;gap:8px;white-space:nowrap}
.student-profile-notes{
  margin-top:12px;
  padding:12px;
  border-radius:12px;
  background:var(--surface-2);
}
.student-profile-notes p{margin:5px 0 0;color:var(--muted);white-space:pre-wrap}
@media(max-width:780px){
  .student-profile-head{align-items:flex-start;flex-wrap:wrap}
  .student-profile-head-actions{width:100%}
  .student-profile-head-actions .btn{flex:1}
  .student-profile-kpis{grid-template-columns:1fr 1fr}
  .student-profile-grid{grid-template-columns:1fr}
}
@media(max-width:480px){
  .student-profile-kpis{grid-template-columns:1fr}
}


/* V6.71 - Scheda allievo: più respiro nei box */
.student-profile-grid .panel,
.student-profile-modal > .panel{
  overflow:hidden;
}

.student-profile-grid .panel-head,
.student-profile-modal > .panel .panel-head{
  padding:16px 18px;
}

.student-profile-grid .panel-body,
.student-profile-modal > .panel .panel-body{
  padding:0 18px 16px;
}

.profile-data-list,
.profile-course-list,
.profile-history-list{
  padding:0 18px 14px;
}

.profile-data-list > div,
.profile-course-row,
.profile-history-row{
  padding:12px 0;
}

.profile-data-list > div:first-child,
.profile-course-row:first-child,
.profile-history-row:first-child{
  padding-top:14px;
}

.profile-data-list > div:last-child,
.profile-course-row:last-child,
.profile-history-row:last-child{
  padding-bottom:2px;
}

.student-profile-notes{
  margin:12px 18px 16px;
}

.student-profile-kpis > div{
  padding:14px 16px;
}

.student-profile-modal{
  padding-top:2px;
}

.student-profile-head{
  padding:4px 2px 2px;
}

@media(max-width:780px){
  .student-profile-grid .panel-head,
  .student-profile-modal > .panel .panel-head{
    padding:14px 15px;
  }

  .profile-data-list,
  .profile-course-list,
  .profile-history-list{
    padding:0 15px 12px;
  }

  .student-profile-notes{
    margin:10px 15px 14px;
  }
}


/* V6.74 - Scheda allievo economica e storico più leggibile */
.student-profile-state{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:3px;
  margin-left:auto;
}
.student-profile-state small{
  color:var(--muted);
  font-size:10px;
}
.student-profile-kpis-v674>div span{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:10px;
}
.student-economic-panel{
  margin-bottom:14px;
}
.student-economic-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:1px;
  background:var(--border);
  border-top:1px solid var(--border);
}
.student-economic-item{
  background:var(--card);
  padding:15px 18px;
}
.student-economic-item span{
  display:block;
  color:var(--muted);
  font-size:10px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.student-economic-item strong{
  display:block;
  margin:4px 0 2px;
  font-size:18px;
}
.student-economic-item small{
  color:var(--muted);
  font-size:10px;
}
.student-economic-item .eco-ok{color:var(--green);font-weight:800}
.student-economic-item .eco-warn{color:var(--orange);font-weight:800}
.student-open-dues-panel{
  margin-bottom:14px;
}
.profile-open-row{
  padding-left:2px;
  padding-right:2px;
}
.profile-open-overdue{
  background:rgba(239,68,68,.035);
}
.payment-history-row{
  align-items:center;
}
.payment-history-icon{
  width:34px;
  height:34px;
  border-radius:10px;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  background:var(--primary-soft);
  color:var(--primary);
}
.payment-history-icon svg{
  width:16px;
  height:16px;
}
.payment-history-amount{
  color:var(--green);
  white-space:nowrap;
}

@media(max-width:860px){
  .student-economic-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:780px){
  .student-profile-state{
    width:100%;
    order:3;
    align-items:flex-start;
    margin-left:72px;
  }
}
@media(max-width:520px){
  .student-economic-grid{grid-template-columns:1fr}
  .student-profile-state{margin-left:0}
}


/* V6.75 - Scheda allievo: sezioni cosa è scaduto / in scadenza */
.student-due-summary-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-bottom:14px;
}
.student-due-summary-panel .panel-head{
  align-items:flex-start;
}
.student-due-preview-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px 16px;
  border-bottom:1px solid var(--border);
}
.student-due-preview-row:last-child{
  border-bottom:0;
}
.student-due-preview-row.is-overdue{
  background:rgba(239,68,68,.035);
}
.student-due-preview-row strong{
  display:block;
}
.student-due-preview-row small{
  display:block;
  color:var(--muted);
  margin-top:3px;
}
.student-due-preview-right{
  display:flex;
  align-items:flex-end;
  flex-direction:column;
  gap:6px;
  white-space:nowrap;
}
.compact-history-list{
  gap:0;
}
.mini-note{
  padding:10px 16px 14px;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}
@media(max-width:860px){
  .student-due-summary-grid{grid-template-columns:1fr;}
}
@media(max-width:560px){
  .student-due-preview-row{flex-direction:column;align-items:flex-start;}
  .student-due-preview-right{align-items:flex-start;white-space:normal;}
}


/* V6.76 - Scheda insegnante completa */
.teacher-name-link{
  border:0;
  background:none;
  padding:0;
  margin:0;
  color:var(--text);
  font:inherit;
  font-weight:900;
  font-size:18px;
  cursor:pointer;
  text-align:left;
}
.teacher-name-link:hover{color:var(--primary)}
.teacher-profile-modal{max-width:980px}
.teacher-profile-head{
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:14px;
}
.teacher-profile-avatar{
  width:58px;
  height:58px;
  border-radius:18px;
  display:grid;
  place-items:center;
  background:rgba(236,72,153,.12);
  color:var(--pink);
  font-size:20px;
  font-weight:900;
  flex:0 0 auto;
}
.teacher-profile-head h2{margin:2px 0 3px;font-size:22px}
.teacher-profile-contact{color:var(--muted);font-size:12px}
.teacher-profile-actions{display:flex;gap:8px;flex-wrap:wrap}
.teacher-profile-kpis{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}
.teacher-profile-kpis>div{
  border:1px solid var(--border);
  background:var(--card);
  border-radius:14px;
  padding:14px 16px;
}
.teacher-profile-kpis small{
  display:block;
  color:var(--muted);
  font-size:10px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.teacher-profile-kpis strong{display:block;margin-top:4px;font-size:18px}
.teacher-profile-kpis span{display:block;margin-top:3px;color:var(--muted);font-size:10px}
.teacher-profile-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-bottom:14px;
}
.teacher-profile-course-list{padding:0 18px 14px}
.teacher-profile-course-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:12px 0;
  border-bottom:1px solid var(--border);
}
.teacher-profile-course-row:last-child{border-bottom:0}
.teacher-profile-course-row small{display:block;color:var(--muted);margin-top:2px;font-size:10px}
.teacher-profile-compensation{margin-bottom:14px}
.teacher-profile-comp-grid{
  display:grid;
  grid-template-columns:2fr 1fr 1fr 1fr;
  gap:1px;
  background:var(--border);
  border-top:1px solid var(--border);
}
.teacher-profile-comp-grid>div{
  background:var(--card);
  padding:15px 18px;
}
.teacher-profile-comp-grid span{
  display:block;
  color:var(--muted);
  font-size:10px;
  font-weight:800;
  text-transform:uppercase;
}
.teacher-profile-comp-grid strong{display:block;margin-top:4px}
.teacher-profile-comp-grid small{display:block;color:var(--muted);margin-top:3px;font-size:10px}

@media(max-width:860px){
  .teacher-profile-kpis{grid-template-columns:1fr 1fr}
  .teacher-profile-grid{grid-template-columns:1fr}
  .teacher-profile-comp-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:600px){
  .teacher-profile-head{align-items:flex-start;flex-wrap:wrap}
  .teacher-profile-actions{width:100%}
  .teacher-profile-actions .btn{flex:1}
  .teacher-profile-kpis{grid-template-columns:1fr}
  .teacher-profile-comp-grid{grid-template-columns:1fr}
}


/* V6.77 - Scheda Segreteria / Account staff */
.staff-name-link{
  border:0;
  background:none;
  padding:0;
  margin:0;
  color:var(--text);
  font:inherit;
  font-weight:900;
  cursor:pointer;
  text-align:left;
}
.staff-name-link:hover{color:var(--primary)}
.staff-profile-modal{max-width:940px}
.staff-profile-head{
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:14px;
}
.staff-profile-avatar{
  width:58px;
  height:58px;
  border-radius:18px;
  display:grid;
  place-items:center;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:20px;
  font-weight:900;
  flex:0 0 auto;
}
.staff-profile-head h2{margin:2px 0 3px;font-size:22px}
.staff-profile-contact{color:var(--muted);font-size:12px}
.staff-profile-state{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:3px;
}
.staff-profile-state small{color:var(--muted);font-size:10px}
.staff-profile-kpis{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}
.staff-profile-kpis>div{
  border:1px solid var(--border);
  background:var(--card);
  border-radius:14px;
  padding:14px 16px;
  min-width:0;
}
.staff-profile-kpis small{
  display:block;
  color:var(--muted);
  font-size:10px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.staff-profile-kpis strong{
  display:block;
  margin-top:4px;
  font-size:16px;
  overflow-wrap:anywhere;
}
.staff-profile-kpis span{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:10px;
}
.staff-profile-email{font-size:13px!important}
.staff-profile-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-bottom:14px;
}
.staff-permission-list{padding:0 18px 14px}
.staff-permission-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:12px 0;
  border-bottom:1px solid var(--border);
}
.staff-permission-row:last-child{border-bottom:0}
.staff-permission-row span{color:var(--muted);font-size:11px}
.permission-yes{color:var(--green)}
.permission-no{color:var(--red)}
.staff-linked-teacher-panel,
.staff-access-actions-panel{margin-bottom:14px}
.staff-linked-teacher-body{padding:0 18px 16px}
.staff-linked-teacher-main strong{display:block}
.staff-linked-teacher-main small{display:block;color:var(--muted);margin-top:3px}
.staff-linked-courses{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:12px;
}
.staff-linked-courses span{
  padding:7px 10px;
  border-radius:999px;
  background:var(--surface-2);
  color:var(--muted);
  font-size:10px;
  font-weight:800;
}
.staff-profile-actions{
  padding:0 18px 16px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

@media(max-width:820px){
  .staff-profile-kpis{grid-template-columns:1fr 1fr}
  .staff-profile-grid{grid-template-columns:1fr}
}
@media(max-width:600px){
  .staff-profile-head{align-items:flex-start;flex-wrap:wrap}
  .staff-profile-state{width:100%;align-items:flex-start;margin-left:72px}
  .staff-profile-kpis{grid-template-columns:1fr}
  .staff-profile-actions .btn{width:100%}
}


/* V6.78 - Ricerca Account staff + pulizia layout */
.account-toolbar{
  align-items:center;
  justify-content:space-between;
}
.account-toolbar input{
  min-width:280px;
  flex:1 1 320px;
}
.toolbar-counter{
  padding:9px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}
.staff-access-actions-panel .panel-head{
  padding:18px 22px 8px;
}
.staff-profile-actions{
  padding:8px 22px 22px;
}
.teacher-account .field-help{
  display:block;
  margin-top:6px;
}
@media(max-width:720px){
  .account-toolbar{
    flex-direction:column;
    align-items:stretch;
  }
  .toolbar-counter{
    width:100%;
    text-align:center;
  }
}


/* V6.79 - Presenze Admin + conferma manuale lezione + accesso docente */
.attendance-admin-date-panel{margin-bottom:14px}
.attendance-admin-date-body{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.attendance-admin-date-body>div{flex:1;min-width:240px}
.attendance-admin-date-body strong{display:block}
.attendance-admin-date-body small{display:block;color:var(--muted);margin-top:3px}
.attendance-admin-date-body input{
  border:1px solid var(--line);
  border-radius:10px;
  padding:10px 12px;
  background:#fff;
  color:var(--text);
}
.lesson-confirm-state{margin-top:6px}
.teacher-account-badge{margin-top:8px}
.teacher-account-badge .status svg{width:12px;height:12px}
.teacher-profile-access-state{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:3px;
  max-width:220px;
}
.teacher-profile-access-state small{
  color:var(--muted);
  font-size:10px;
  text-align:right;
}
@media(max-width:760px){
  .attendance-admin-date-body{align-items:stretch}
  .attendance-admin-date-body input,
  .attendance-admin-date-body .btn{width:100%}
  .teacher-profile-access-state{width:100%;max-width:none;align-items:flex-start}
  .teacher-profile-access-state small{text-align:left}
}


/* V6.80 - Ricevute pagamenti */
.money-row-right{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:5px;
}
.receipt-mini-btn{
  border:0;
  background:transparent;
  color:var(--primary);
  font-size:9px;
  font-weight:900;
  padding:3px 0;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:4px;
}
.receipt-mini-btn svg{width:12px;height:12px}
.receipt-mini-btn:hover{text-decoration:underline}
.payment-history-tools{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:5px;
}
.receipt-modal-body{padding:22px}
.payment-receipt{
  border:1px solid var(--border);
  border-radius:16px;
  padding:24px;
  background:#fff;
}
.receipt-head{
  display:flex;
  justify-content:space-between;
  gap:20px;
  border-bottom:2px solid var(--text);
  padding-bottom:16px;
}
.receipt-brand{font-size:22px;font-weight:900}
.receipt-school-meta{font-size:11px;color:var(--muted);margin-top:4px}
.receipt-number{text-align:right}
.receipt-number small,.receipt-section small,.receipt-payment small{
  display:block;
  font-size:9px;
  color:var(--muted);
  font-weight:900;
  letter-spacing:.08em;
}
.receipt-number strong{display:block;font-size:16px;margin:5px 0}
.receipt-number span{font-size:11px}
.receipt-section{
  padding:18px 0;
  border-bottom:1px solid var(--border);
}
.receipt-section strong{display:block;font-size:17px;margin:5px 0}
.receipt-section span{font-size:11px;color:var(--muted)}
.receipt-payment{
  display:grid;
  grid-template-columns:2fr 1fr 1fr;
  gap:14px;
  padding:20px 0;
  border-bottom:1px solid var(--border);
}
.receipt-payment strong{display:block;margin-top:5px}
.receipt-total{text-align:right}
.receipt-total strong{font-size:22px}
.receipt-note{padding:15px 0;color:var(--muted);font-size:11px}
.receipt-signature{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:30px;
  margin-top:18px;
  font-size:10px;
  color:var(--muted);
}
.receipt-sign-line{border-bottom:1px solid var(--text);margin-top:30px}
.receipt-signature strong{display:block;color:var(--text);margin-top:7px}
.payment-success-box{
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px;
  border-radius:14px;
  background:rgba(34,197,94,.08);
  color:var(--green);
}
.payment-success-box>svg{width:24px;height:24px}
.payment-success-box strong{display:block;color:var(--text)}
.payment-success-box small{display:block;color:var(--muted);margin-top:3px}
@media(max-width:650px){
  .receipt-head{flex-direction:column}
  .receipt-number{text-align:left}
  .receipt-payment{grid-template-columns:1fr}
  .receipt-total{text-align:left}
  .receipt-signature{grid-template-columns:1fr}
}


/* V6.81 - Anagrafica scuola */
.school-registry-panel{overflow:hidden}
.school-registry-grid{gap:14px}
.school-registry-preview{
  margin-top:16px;
  padding:16px 18px;
  border:1px dashed var(--line);
  border-radius:14px;
  background:#fafbff;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.school-registry-preview-title{
  font-size:9px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--primary);
  margin-bottom:3px;
}
.school-registry-preview strong{font-size:16px}
.school-registry-preview span{font-size:11px;color:var(--muted)}
@media(max-width:650px){
  .school-registry-grid .span-2{grid-column:auto}
}


/* V6.82 - KPI Dashboard Admin cliccabili */
.dashboard-kpi.clickable{
  cursor:pointer;
  position:relative;
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.dashboard-kpi.clickable:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 24px rgba(20,27,45,.08);
  border-color:rgba(var(--primary-rgb),.22);
}
.dashboard-kpi.clickable:focus{
  outline:2px solid rgba(var(--primary-rgb),.28);
  outline-offset:2px;
}
.dashboard-kpi-action{
  margin-top:10px;
  padding-top:9px;
  border-top:1px solid var(--line);
  color:var(--primary);
  font-size:10px;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.dashboard-kpi-action span{
  font-size:14px;
  line-height:1;
}


/* V6.83 - Logo ricevute + archivio ricevute */
.receipt-brand-wrap{
  display:flex;
  align-items:flex-start;
  gap:12px;
}
.receipt-logo{
  width:58px;
  height:58px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  padding:6px;
  display:grid;
  place-items:center;
  box-sizing:border-box;
  flex:0 0 auto;
}
.receipt-logo img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
}
.receipt-kpis{margin-bottom:14px}
.receipt-control-panel{margin-bottom:14px}
.receipt-controlbar{
  padding:14px;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.receipt-search{
  flex:1 1 320px;
}
.receipt-controlbar select{
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  padding:10px 12px;
  min-width:190px;
}
.receipt-table-wrap table{min-width:980px}
.receipt-table td strong{font-weight:900}
@media(max-width:700px){
  .receipt-controlbar{align-items:stretch}
  .receipt-controlbar select,
  .receipt-controlbar .toolbar-counter{width:100%}
  .receipt-brand-wrap{flex-direction:column}
}


/* V6.84 - Colore scuola realmente applicato al tema */
.school-chip,
.mobile-school-brand,
.school-brand-preview{
  --brand-primary:var(--primary);
}
.nav button.active,
.btn-primary,
.segmented button.active{
  transition:background-color .18s ease,border-color .18s ease,color .18s ease;
}


/* V6.85 - Nuovo brand Dance Manager */
.brand-logo-lockup{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  overflow:hidden;
}
.brand-logo-image{
  display:block;
  width:100%;
  max-width:205px;
  height:auto;
  object-fit:contain;
}
.sidebar>.brand-logo-lockup{
  padding:4px 2px 14px;
}
.login-card>.brand-logo-lockup{
  justify-content:center;
  margin-bottom:6px;
}
.login-card>.brand-logo-lockup .brand-logo-image{
  max-width:310px;
}
@media(max-width:900px){
  .brand-logo-image{max-width:180px}
}


/* V6.87 - Brand integrato, non più immagine rettangolare */
.brand-logo-lockup,
.brand-logo-image{
  display:none!important;
}

.dm-brand-lockup{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.dm-brand-mark{
  width:44px;
  height:44px;
  flex:0 0 44px;
  border-radius:13px;
  overflow:hidden;
  display:grid;
  place-items:center;
  background:#0b1030;
  box-shadow:0 8px 22px rgba(0,0,0,.22);
}
.dm-brand-mark img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.dm-brand-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}

.dm-brand-name{
  color:#fff;
  font-weight:950;
  font-size:17px;
  line-height:1;
  letter-spacing:-.035em;
  white-space:nowrap;
}
.dm-brand-name span{
  color:#fff;
}
.dm-brand-name strong{
  font:inherit;
  background:linear-gradient(90deg,#9b5cff 0%,#ef4fc4 48%,#22d3ee 100%);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}

.dm-brand-tagline{
  color:#aeb7d1;
  font-size:7px;
  line-height:1;
  letter-spacing:.24em;
  text-transform:uppercase;
  font-weight:800;
  white-space:nowrap;
}

/* Sidebar */
.sidebar>.dm-brand-lockup{
  padding:4px 2px 14px;
}
.sidebar>.dm-brand-lockup .dm-brand-mark{
  width:42px;
  height:42px;
  flex-basis:42px;
}
.sidebar>.dm-brand-lockup .dm-brand-name{
  font-size:15px;
}
.sidebar>.dm-brand-lockup .dm-brand-tagline{
  font-size:6px;
  letter-spacing:.18em;
}

/* Login: stesso brand ma più importante e perfettamente integrato */
.login-card>.dm-brand-lockup{
  justify-content:flex-start;
  gap:16px;
  margin:0 0 20px;
}
.login-card>.dm-brand-lockup .dm-brand-mark{
  width:72px;
  height:72px;
  flex-basis:72px;
  border-radius:19px;
  box-shadow:0 12px 30px rgba(99,91,255,.20);
}
.login-card>.dm-brand-lockup .dm-brand-name{
  font-size:28px;
  color:var(--ink);
}
.login-card>.dm-brand-lockup .dm-brand-name span{
  color:var(--ink);
}
.login-card>.dm-brand-lockup .dm-brand-tagline{
  color:var(--muted);
  font-size:9px;
  letter-spacing:.24em;
  margin-top:5px;
}

/* Login più armonico: il logo fa parte della card, non è una banner image */
.login-live-badge{
  margin-top:0;
}

@media(max-width:900px){
  .sidebar>.dm-brand-lockup .dm-brand-copy{
    display:none;
  }
  .sidebar>.dm-brand-lockup{
    justify-content:center;
  }
}

@media(max-width:520px){
  .login-card>.dm-brand-lockup{
    gap:12px;
  }
  .login-card>.dm-brand-lockup .dm-brand-mark{
    width:58px;
    height:58px;
    flex-basis:58px;
    border-radius:16px;
  }
  .login-card>.dm-brand-lockup .dm-brand-name{
    font-size:22px;
  }
  .login-card>.dm-brand-lockup .dm-brand-tagline{
    font-size:7px;
    letter-spacing:.18em;
  }
}


/* V6.88 - Logo più definito nella sidebar e nel programma */
.dm-brand-lockup{
  gap:12px;
}
.dm-brand-mark{
  width:48px;
  height:48px;
  flex:0 0 48px;
  border-radius:14px;
  background:#080c22;
  box-shadow:0 10px 26px rgba(0,0,0,.30), inset 0 0 0 1px rgba(255,255,255,.06);
}
.dm-brand-mark img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
  image-rendering:-webkit-optimize-contrast;
  image-rendering:crisp-edges;
  filter:contrast(1.08) saturate(1.08);
  transform:translateZ(0);
}
.dm-brand-name{
  letter-spacing:-.02em;
}
.dm-brand-tagline{
  letter-spacing:.20em;
}
.sidebar>.dm-brand-lockup{
  padding:6px 4px 16px;
  gap:12px;
}
.sidebar>.dm-brand-lockup .dm-brand-mark{
  width:50px;
  height:50px;
  flex-basis:50px;
  border-radius:15px;
}
.sidebar>.dm-brand-lockup .dm-brand-name{
  font-size:17px;
}
.sidebar>.dm-brand-lockup .dm-brand-tagline{
  font-size:7px;
  letter-spacing:.18em;
}
.login-card>.dm-brand-lockup .dm-brand-mark{
  background:#090d25;
}


/* V6.89 - Brand più pulito/piatto + brand anche nella testata interna */
.dm-brand-mark{
  background:linear-gradient(180deg,#12183e 0%, #0b1028 100%);
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 8px 20px rgba(7,10,28,.22), inset 0 1px 0 rgba(255,255,255,.05);
}
.dm-brand-mark img{
  padding:4px;
  object-fit:contain;
  filter:contrast(1.05) saturate(1.04);
}
.dm-brand-name{
  letter-spacing:-.025em;
}
.dm-brand-name strong{
  background:linear-gradient(90deg,#7e69ff 0%, #cf60ff 46%, #2cd8f7 100%);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.dm-brand-tagline{
  color:#b6bfd8;
}
.sidebar>.dm-brand-lockup{
  padding:8px 6px 18px;
}
.sidebar>.dm-brand-lockup .dm-brand-mark{
  width:54px;
  height:54px;
  flex-basis:54px;
  border-radius:16px;
}
.sidebar>.dm-brand-lockup .dm-brand-name{
  font-size:18px;
}
.sidebar>.dm-brand-lockup .dm-brand-tagline{
  font-size:7px;
}
.login-card>.dm-brand-lockup .dm-brand-mark{
  border-radius:20px;
}
.topbar{
  padding:0 20px;
  gap:12px;
}
.topbar-main{
  display:flex;
  align-items:center;
  gap:18px;
  min-width:0;
  flex:1;
}
.topbar-brand{
  display:flex;
  align-items:center;
  min-width:0;
  padding-right:16px;
  border-right:1px solid var(--line);
  flex:0 0 auto;
}
.topbar-brand .dm-brand-lockup{
  width:auto;
  gap:10px;
}
.topbar-brand .dm-brand-mark{
  width:34px;
  height:34px;
  flex-basis:34px;
  border-radius:11px;
  box-shadow:0 4px 12px rgba(7,10,28,.16);
}
.topbar-brand .dm-brand-mark img{
  padding:3px;
}
.topbar-brand .dm-brand-copy{
  gap:1px;
}
.topbar-brand .dm-brand-name{
  font-size:14px;
  color:var(--ink);
}
.topbar-brand .dm-brand-name span{
  color:var(--ink);
}
.topbar-brand .dm-brand-tagline{
  color:var(--muted);
  font-size:6px;
  letter-spacing:.17em;
}
.topbar-title-wrap{
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:2px;
}
.topbar-title-wrap h2{
  margin:0;
  font-size:17px;
  line-height:1.1;
}
@media(max-width:1100px){
  .topbar-brand .dm-brand-copy{
    display:none;
  }
  .topbar-brand{
    padding-right:12px;
  }
}
@media(max-width:900px){
  .topbar-brand{
    display:none;
  }
  .topbar-main{
    gap:0;
  }
}


/* V6.90 - Refinement sidebar + box scuola attiva */
.sidebar{
  background:
    radial-gradient(1200px 520px at -10% -10%, rgba(122,102,255,.22) 0%, rgba(122,102,255,0) 40%),
    linear-gradient(180deg,#0f1636 0%, #0b122d 52%, #0a1027 100%);
  box-shadow:inset -1px 0 0 rgba(255,255,255,.04);
  padding:18px 14px 16px;
  gap:16px;
}
.sidebar>.dm-brand-lockup{
  margin:0 4px;
  padding:10px 10px 14px;
  border-radius:18px;
  background:linear-gradient(180deg,rgba(255,255,255,.045),rgba(255,255,255,.018));
  border:1px solid rgba(255,255,255,.06);
}
.sidebar>.dm-brand-lockup .dm-brand-copy{
  gap:2px;
}
.sidebar>.dm-brand-lockup .dm-brand-name{
  font-size:17px;
}
.sidebar>.dm-brand-lockup .dm-brand-tagline{
  font-size:7px;
  letter-spacing:.18em;
  color:#a9b2cc;
}
.school-chip{
  margin:0 4px;
  padding:13px 13px;
  border-radius:16px;
  background:linear-gradient(180deg,rgba(255,255,255,.08),rgba(255,255,255,.045));
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 10px 20px rgba(3,7,20,.12);
}
.school-chip span{
  font-size:10px;
  letter-spacing:.18em;
  color:#9ea7c5;
  margin-bottom:5px;
}
.school-chip strong{
  font-size:14px;
  line-height:1.2;
  color:#ffffff;
}
.school-chip-brand{
  gap:11px;
}
.school-chip-brand > div{
  display:grid;
  gap:2px;
}
.school-brand-logo.sidebar-brand{
  width:42px;
  height:42px;
  border-radius:13px;
  background:#fff;
  box-shadow:0 8px 18px rgba(2,6,18,.26);
}
.nav{
  gap:6px;
}
.nav button{
  padding:11px 12px;
  border-radius:13px;
  color:#c6cee2;
  transition:background .16s ease,color .16s ease,transform .16s ease;
}
.nav button:hover{
  background:rgba(255,255,255,.06);
  color:#fff;
  transform:translateX(1px);
}
.nav button.active{
  background:linear-gradient(90deg,rgba(var(--primary-rgb),.32), rgba(var(--primary-rgb),.16));
  box-shadow:inset 3px 0 0 var(--primary-2), 0 10px 18px rgba(11,15,34,.14);
}
.nav-divider{
  margin:7px 8px;
  background:rgba(255,255,255,.08);
}
.sidebar-bottom{
  padding-top:2px;
}
.user-box{
  background:linear-gradient(180deg,rgba(255,255,255,.07),rgba(255,255,255,.04));
  border:1px solid rgba(255,255,255,.07);
  border-radius:16px;
  padding:13px;
  box-shadow:0 10px 20px rgba(4,8,22,.14);
}
.user-box strong{
  font-size:13px;
  color:#fff;
  margin-bottom:2px;
}
.user-box small{
  color:#aab3cb;
  font-size:12px;
}
.logout{
  border:1px solid rgba(255,255,255,.06);
  background:rgba(255,255,255,.075);
  color:#edf1ff;
  border-radius:10px;
  padding:9px 10px;
  font-weight:800;
  margin-top:10px;
}
.logout:hover{
  background:rgba(255,255,255,.11);
}
@media(max-width:780px){
  .sidebar>.dm-brand-lockup{
    margin:0;
    padding:0;
    background:transparent;
    border:0;
  }
  .school-chip{
    margin:0;
    padding:11px 12px;
  }
}


/* =========================================================
   V6.91 - Dashboard premium + schede/modali premium
   Nessuna modifica funzionale, solo refinements UI/UX
   ========================================================= */

/* ---------- DASHBOARD / PAGINE ---------- */
.content{
  padding:26px;
}

.hero{
  position:relative;
  padding:4px 2px 2px;
  margin-bottom:20px;
}
.hero h1{
  font-size:32px;
  letter-spacing:-.045em;
  line-height:1.06;
}
.hero p{
  font-size:14px;
  line-height:1.45;
  color:#758099;
}
.eyebrow{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:9px;
  letter-spacing:.16em;
  color:var(--primary);
  margin-bottom:8px;
}
.eyebrow::before{
  content:"";
  width:14px;
  height:2px;
  border-radius:999px;
  background:linear-gradient(90deg,var(--primary),var(--primary-2));
}

/* KPI */
.kpi-grid{
  gap:14px;
  margin-bottom:18px;
}
.kpi{
  position:relative;
  border-radius:18px;
  padding:17px 18px;
  border:1px solid rgba(219,224,234,.9);
  box-shadow:
    0 10px 28px rgba(24,31,54,.045),
    inset 0 1px 0 rgba(255,255,255,.8);
  transition:
    transform .16s ease,
    box-shadow .16s ease,
    border-color .16s ease;
}
.kpi::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  pointer-events:none;
  background:
    radial-gradient(220px 100px at 92% 0%,
      rgba(var(--primary-rgb),.045),
      rgba(var(--primary-rgb),0) 70%);
}
.kpi:hover{
  transform:translateY(-2px);
  box-shadow:
    0 14px 34px rgba(24,31,54,.07),
    inset 0 1px 0 rgba(255,255,255,.9);
}
.kpi-head{
  position:relative;
  z-index:1;
}
.kpi-icon{
  width:36px;
  height:36px;
  border-radius:11px;
}
.kpi span.label{
  font-size:9px;
  letter-spacing:.11em;
}
.kpi strong.value{
  position:relative;
  z-index:1;
  margin-top:12px;
  font-size:26px;
  line-height:1;
}
.kpi small{
  position:relative;
  z-index:1;
  margin-top:6px;
  line-height:1.3;
}
.kpi.alert{
  background:linear-gradient(180deg,#fffafa 0%,#fff 100%);
}

/* Clickable dashboard cards */
.dashboard-kpi.clickable .dashboard-kpi-action{
  margin-top:12px;
  padding-top:10px;
}
.dashboard-kpi.clickable:hover .dashboard-kpi-action span{
  transform:translateX(2px);
}
.dashboard-kpi-action span{
  transition:transform .16s ease;
}

/* Panels */
.panel{
  border-radius:18px;
  border:1px solid rgba(219,224,234,.92);
  box-shadow:
    0 10px 28px rgba(24,31,54,.04),
    inset 0 1px 0 rgba(255,255,255,.85);
}
.panel-head{
  padding:16px 18px;
  background:
    linear-gradient(180deg,rgba(250,251,254,.92),rgba(255,255,255,.98));
}
.panel-head h3{
  font-size:16px;
  letter-spacing:-.02em;
}
.panel-sub{
  margin-top:3px;
  font-size:11px;
  line-height:1.35;
}
.panel-body{
  padding:17px 18px;
}

/* Liste dentro i pannelli */
.lesson-row,
.money-row,
.person-row{
  padding:12px 0;
}
.lesson-row:hover,
.money-row:hover,
.person-row:hover{
  background:linear-gradient(90deg,rgba(var(--primary-rgb),.025),transparent);
}
.amount{
  font-size:13px;
}

/* ---------- SCHEDE E MODALI ---------- */
.modal-backdrop{
  background:
    radial-gradient(900px 500px at 50% 10%,rgba(var(--primary-rgb),.10),transparent 60%),
    rgba(13,18,34,.62);
  backdrop-filter:blur(7px);
  -webkit-backdrop-filter:blur(7px);
}
.modal{
  border:1px solid rgba(255,255,255,.7);
  border-radius:22px;
  box-shadow:
    0 34px 90px rgba(8,13,29,.28),
    0 0 0 1px rgba(32,39,63,.04);
}
.modal-head{
  padding:17px 20px;
  background:
    linear-gradient(180deg,#fff 0%,#fbfcff 100%);
}
.modal-head strong{
  font-size:18px;
  letter-spacing:-.025em;
}
.modal-head .icon-btn{
  width:38px;
  height:38px;
  border-radius:11px;
  background:#f3f5f9;
  transition:background .16s ease,transform .16s ease;
}
.modal-head .icon-btn:hover{
  background:#e9edf4;
  transform:scale(1.03);
}
.modal-body{
  padding:20px;
  background:#fff;
}
.modal-foot{
  padding:14px 20px;
  background:
    linear-gradient(180deg,#fbfcfe 0%,#f8f9fc 100%);
  box-shadow:0 -10px 24px rgba(30,38,60,.025);
}

/* Campi form più premium */
.field label{
  margin-bottom:7px;
  font-size:9px;
  letter-spacing:.09em;
  text-transform:uppercase;
  font-weight:900;
}
.field input,
.field select,
.field textarea{
  min-height:43px;
  border-radius:11px;
  border:1px solid #dce2ec;
  background:#fbfcfe;
  transition:
    border-color .16s ease,
    box-shadow .16s ease,
    background .16s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus{
  background:#fff;
  border-color:var(--primary);
  box-shadow:0 0 0 4px rgba(var(--primary-rgb),.09);
}

/* Bottoni modali */
.modal .btn{
  min-height:39px;
  border-radius:10px;
}
.modal .btn-primary{
  box-shadow:0 7px 16px rgba(var(--primary-rgb),.18);
}

/* Schede profilo */
.student-profile-modal,
.staff-profile-modal{
  background:#fff;
}
.student-profile-head,
.staff-profile-head{
  padding:2px 2px 4px;
}
.student-profile-avatar,
.staff-profile-avatar{
  box-shadow:
    0 8px 20px rgba(var(--primary-rgb),.11),
    inset 0 1px 0 rgba(255,255,255,.7);
}
.student-profile-kpis>div,
.staff-profile-kpis>div{
  border-radius:15px;
  background:
    linear-gradient(180deg,#fff 0%,#fbfcff 100%);
  box-shadow:0 7px 20px rgba(30,38,60,.03);
}
.student-profile-grid .panel,
.staff-profile-grid .panel,
.student-profile-modal > .panel{
  border-radius:16px;
}

/* Note / empty states */
.note{
  border-radius:12px;
  padding:12px 14px;
  background:#f8f9fc;
  border:1px solid #e7ebf2;
  color:var(--dm-muted);
}

/* Tabelle */
.table-wrap{
  border-radius:16px;
  overflow:hidden;
}
table thead th{
  background:#f8f9fc;
  color:#7c879f;
  font-size:9px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
table tbody tr{
  transition:background .14s ease;
}
table tbody tr:hover{
  background:#fbfcff;
}

/* Mobile */
@media(max-width:780px){
  .content{
    padding:18px 13px 90px;
  }
  .hero{
    margin-bottom:15px;
  }
  .hero h1{
    font-size:28px;
  }
  .kpi-grid{
    gap:9px;
  }
  .kpi{
    border-radius:15px;
    padding:13px;
  }
  .kpi strong.value{
    font-size:22px;
  }
  .panel{
    border-radius:15px;
  }
  .panel-head{
    padding:14px;
  }
  .panel-body{
    padding:14px;
  }
  .modal-backdrop{
    padding:6px;
  }
  .modal{
    border-radius:16px;
    max-height:96vh;
  }
  .modal-head,
  .modal-foot{
    padding:12px 13px;
  }
  .modal-body{
    padding:13px;
  }
}


/* =========================================================
   V6.92 - Testi e logo molto più nitidi
   - brand platform in SVG vettoriale
   - smoothing testi migliorato
   - logo sidebar/topbar/login più definito
   ========================================================= */

html{
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
}
body,
button,
input,
select,
textarea{
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
  font-feature-settings:"kern" 1, "liga" 1, "calt" 1;
}
h1,h2,h3,h4,h5,strong,.btn,.nav button,.menu button,.panel-head h3,.kpi strong.value{
  text-rendering:geometricPrecision;
}
.dm-brand-lockup,
.dm-brand-copy,
.dm-brand-name,
.dm-brand-tagline,
.sidebar,
.topbar{
  backface-visibility:hidden;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
.dm-brand-mark{
  width:52px;
  height:52px;
  flex:0 0 52px;
  border-radius:16px;
  overflow:hidden;
  background:linear-gradient(180deg,#10163a 0%,#0a1027 100%);
  border:1px solid rgba(255,255,255,.08);
  box-shadow:
    0 12px 28px rgba(7,10,28,.24),
    inset 0 1px 0 rgba(255,255,255,.06);
}
.dm-brand-mark img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  image-rendering:auto !important;
  filter:none !important;
  transform:none !important;
}
.dm-brand-name{
  font-size:18px;
  line-height:1;
  font-weight:950;
  letter-spacing:-.022em;
}
.dm-brand-name span{
  color:#f7f9ff;
}
.dm-brand-name strong{
  font:inherit;
  background:linear-gradient(90deg,#7E69FF 0%,#D45CFF 48%,#20D4EE 100%);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.dm-brand-tagline{
  font-size:8px;
  line-height:1.1;
  letter-spacing:.22em;
  color:#b6bfd8;
  text-transform:uppercase;
  font-weight:850;
}

/* Sidebar */
.sidebar>.dm-brand-lockup{
  gap:12px;
  padding:10px 10px 14px;
}
.sidebar>.dm-brand-lockup .dm-brand-mark{
  width:56px;
  height:56px;
  flex-basis:56px;
  border-radius:18px;
}
.sidebar>.dm-brand-lockup .dm-brand-name{
  font-size:19px;
}
.sidebar>.dm-brand-lockup .dm-brand-tagline{
  font-size:8px;
  letter-spacing:.20em;
}

/* Topbar */
.topbar-brand .dm-brand-mark{
  width:40px;
  height:40px;
  flex-basis:40px;
  border-radius:13px;
  box-shadow:0 8px 18px rgba(7,10,28,.16);
}
.topbar-brand .dm-brand-mark img{
  object-fit:cover;
}
.topbar-brand .dm-brand-name{
  font-size:15px;
  line-height:1;
}
.topbar-brand .dm-brand-name span{
  color:var(--ink);
}
.topbar-brand .dm-brand-tagline{
  font-size:7px;
  color:var(--muted);
  letter-spacing:.16em;
}

/* Login */
.login-card>.dm-brand-lockup{
  gap:16px;
}
.login-card>.dm-brand-lockup .dm-brand-mark{
  width:82px;
  height:82px;
  flex-basis:82px;
  border-radius:24px;
  box-shadow:
    0 16px 34px rgba(52,48,148,.16),
    inset 0 1px 0 rgba(255,255,255,.06);
}
.login-card>.dm-brand-lockup .dm-brand-name{
  font-size:30px;
  line-height:.98;
}
.login-card>.dm-brand-lockup .dm-brand-name span{
  color:var(--ink);
}
.login-card>.dm-brand-lockup .dm-brand-tagline{
  font-size:9px;
  letter-spacing:.22em;
  color:var(--muted);
  margin-top:6px;
}

/* Migliora leggibilità generale del menu e dei titoli */
.sidebar button,
.side-nav button,
.nav-item,
.menu-item{
  text-rendering:geometricPrecision;
}
.sidebar .nav button,
.sidebar .menu button{
  font-weight:800;
}
.hero h1,
.topbar-title-wrap h2,
.page-title{
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* Mobile */
@media(max-width:900px){
  .sidebar>.dm-brand-lockup .dm-brand-mark{
    width:52px;
    height:52px;
    flex-basis:52px;
  }
}
@media(max-width:520px){
  .login-card>.dm-brand-lockup .dm-brand-mark{
    width:68px;
    height:68px;
    flex-basis:68px;
    border-radius:20px;
  }
  .login-card>.dm-brand-lockup .dm-brand-name{
    font-size:24px;
  }
  .login-card>.dm-brand-lockup .dm-brand-tagline{
    font-size:8px;
  }
}


/* V6.93 - Solo nitidezza: dimensioni riportate a prima */
.dm-brand-mark{
  width:48px !important;
  height:48px !important;
  flex-basis:48px !important;
  border-radius:14px !important;
  overflow:hidden;
}
.dm-brand-mark img{
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
  padding:0 !important;
  image-rendering:auto !important;
  filter:none !important;
  transform:none !important;
}
.sidebar>.dm-brand-lockup{
  gap:12px !important;
  padding:8px 6px 18px !important;
}
.sidebar>.dm-brand-lockup .dm-brand-mark{
  width:50px !important;
  height:50px !important;
  flex-basis:50px !important;
  border-radius:15px !important;
}
.sidebar>.dm-brand-lockup .dm-brand-name{
  font-size:17px !important;
}
.sidebar>.dm-brand-lockup .dm-brand-tagline{
  font-size:7px !important;
  letter-spacing:.18em !important;
}
.topbar-brand .dm-brand-mark{
  width:34px !important;
  height:34px !important;
  flex-basis:34px !important;
  border-radius:11px !important;
}
.topbar-brand .dm-brand-name{
  font-size:14px !important;
}
.topbar-brand .dm-brand-tagline{
  font-size:6px !important;
  letter-spacing:.17em !important;
}
.login-card>.dm-brand-lockup .dm-brand-mark{
  width:72px !important;
  height:72px !important;
  flex-basis:72px !important;
  border-radius:19px !important;
}
.login-card>.dm-brand-lockup .dm-brand-name{
  font-size:28px !important;
}
.login-card>.dm-brand-lockup .dm-brand-tagline{
  font-size:9px !important;
  letter-spacing:.24em !important;
}


/* =========================================================
   V6.95 - Tipografia e spaziature uniformate
   Migliora definizione percepita senza aumentare dimensioni.
   ========================================================= */

:root{
  --font-ui: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html,body,button,input,select,textarea{
  font-family:var(--font-ui);
}

body{
  font-weight:400;
  letter-spacing:0;
}

/* Titoli */
h1,h2,h3,h4,h5,h6{
  font-family:var(--font-ui);
  font-weight:800;
  letter-spacing:-.025em;
  text-wrap:balance;
}
.hero h1{
  font-weight:850;
  letter-spacing:-.035em;
}
.topbar-title-wrap h2{
  font-weight:800;
  letter-spacing:-.02em;
}

/* Testi secondari */
.hero p,
.panel-sub,
.kpi small,
.field-help,
.note,
small{
  font-weight:450;
}

/* Etichette */
.eyebrow,
.kpi span.label,
.field label,
table thead th,
.status,
.role-badge{
  font-weight:800;
  letter-spacing:.085em;
}

/* KPI */
.kpi strong.value{
  font-weight:800;
  letter-spacing:-.025em;
}

/* Menu laterale */
.nav button{
  font-weight:750;
  letter-spacing:-.006em;
}
.user-box strong,
.school-chip strong{
  font-weight:800;
}

/* Brand */
.dm-brand-name{
  font-weight:850 !important;
  letter-spacing:-.018em !important;
}
.dm-brand-tagline{
  font-weight:750 !important;
  letter-spacing:.17em !important;
}

/* Pulsanti */
.btn,
button{
  font-weight:750;
}
.btn-primary{
  letter-spacing:-.006em;
}

/* Tabelle */
table td{
  font-weight:450;
}
table td strong{
  font-weight:750;
}

/* Modali */
.modal-head strong{
  font-weight:800;
  letter-spacing:-.02em;
}

/* Input */
.field input,
.field select,
.field textarea{
  font-weight:450;
}

/* Migliore resa su Windows/Chrome */
@supports (-webkit-font-smoothing: antialiased){
  body,
  button,
  input,
  select,
  textarea{
    -webkit-font-smoothing:antialiased;
  }
}

/* Mobile */
@media(max-width:780px){
  .hero h1{
    letter-spacing:-.03em;
  }
  .nav button{
    font-weight:750;
  }
}


/* =========================================================
   V6.97 - Incasso multiplo con ricevuta unica
   ========================================================= */
.multi-payment-list{
  display:grid;
  gap:9px;
  margin:8px 0 14px;
}
.multi-payment-row{
  position:relative;
  display:flex;
  align-items:center;
  gap:12px;
  padding:13px 14px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--surface);
  cursor:pointer;
  transition:.16s ease;
}
.multi-payment-row:hover{
  border-color:rgba(var(--primary-rgb),.35);
  background:var(--primary-soft);
}
.multi-payment-row input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.multi-payment-checkmark{
  width:21px;
  height:21px;
  border-radius:7px;
  border:1.5px solid #c9cfda;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  background:#fff;
}
.multi-payment-row input:checked + .multi-payment-checkmark{
  background:var(--primary);
  border-color:var(--primary);
}
.multi-payment-row input:checked + .multi-payment-checkmark:after{
  content:"✓";
  color:#fff;
  font-size:13px;
  font-weight:900;
}
.multi-payment-row small{
  display:block;
  margin-top:3px;
}
.multi-payment-total{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 16px;
  margin-bottom:16px;
  border-radius:14px;
  background:var(--primary-soft);
  border:1px solid rgba(var(--primary-rgb),.14);
}
.multi-payment-total span{
  font-weight:700;
}
.multi-payment-total strong{
  font-size:20px;
  color:var(--primary);
}
.receipt-items-block{
  padding:22px 0;
  border-bottom:1px solid #e6e8ef;
}
.receipt-items-title{
  display:flex;
  justify-content:space-between;
  align-items:end;
  gap:12px;
  margin-bottom:12px;
}
.receipt-items-title small,
.receipt-item-summary small{
  display:block;
  font-size:10px;
  font-weight:800;
  letter-spacing:.08em;
  color:#667085;
}
.receipt-item-row{
  display:flex;
  justify-content:space-between;
  gap:20px;
  padding:9px 0;
  border-bottom:1px dashed #e6e8ef;
}
.receipt-item-row:last-of-type{
  border-bottom:0;
}
.receipt-item-summary{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
  align-items:end;
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid #e6e8ef;
}
.receipt-item-summary .receipt-total{
  text-align:right;
}
.receipt-item-summary .receipt-total strong{
  display:block;
  margin-top:6px;
  font-size:24px;
}
@media(max-width:640px){
  .multi-payment-row{
    align-items:flex-start;
  }
}


/* =========================================================
   V6.98 - Dettaglio quote visibile anche negli elenchi incassi
   ========================================================= */
.payment-list-meta{
  display:flex !important;
  flex-direction:column;
  gap:4px;
  margin-top:3px;
}
.payment-multi-lines{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.payment-multi-lines>span{
  display:block;
  line-height:1.35;
}
.payment-method-date{
  display:block;
  color:var(--muted);
}
.receipt-table .payment-multi-lines{
  gap:3px;
}
.receipt-table .payment-multi-lines>span{
  white-space:normal;
}


/* =========================================================
   V6.99 - Storno incasso senza cancellare la ricevuta
   ========================================================= */
.receipt-status{
  display:inline-flex;
  align-items:center;
  padding:5px 8px;
  border-radius:999px;
  font-size:10px;
  font-weight:900;
  letter-spacing:.06em;
}
.receipt-status.active{
  color:#067647;
  background:#ecfdf3;
}
.receipt-status.voided{
  color:#b42318;
  background:#fef3f2;
}
.voided-amount{
  text-decoration:line-through;
  color:var(--dm-muted) !important;
}
.btn-danger-soft{
  color:#b42318;
  background:#fef3f2;
  border:1px solid #fecdca;
}
.btn-danger-soft:hover{
  background:#fee4e2;
}
.btn-danger{
  color:#fff;
  background:#d92d20;
  border:1px solid #d92d20;
}
.danger-note{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:13px 14px;
  border:1px solid #fecdca;
  border-radius:12px;
  background:#fef3f2;
  color:#b42318;
}
.receipt-void-banner{
  padding:10px 14px;
  margin-bottom:16px;
  border:2px solid #d92d20;
  color:#b42318;
  background:#fef3f2;
  border-radius:10px;
  font-size:12px;
  font-weight:900;
  text-align:center;
}
.receipt-voided{
  position:relative;
}


/* =========================================================
   V6.99.6 - Collegamento ricevuta stornata / sostitutiva
   ========================================================= */
.receipt-status-stack{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:5px;
}
.receipt-link-badge{
  display:inline-flex;
  align-items:center;
  padding:4px 7px;
  border-radius:999px;
  font-size:9px;
  line-height:1.2;
  font-weight:850;
  letter-spacing:.03em;
  white-space:nowrap;
}
.receipt-link-badge.replaced{
  color:#b42318;
  background:#fff4ed;
  border:1px solid #fed7aa;
}
.receipt-link-badge.replacement{
  color:#175cd3;
  background:#eff8ff;
  border:1px solid #b2ddff;
}
.receipt-relation-banner{
  display:flex;
  justify-content:center;
  margin:-4px 0 14px;
}
.receipt-relation-banner .receipt-link-badge{
  font-size:11px;
  padding:6px 10px;
}
.payment-list-meta .receipt-link-badge{
  margin-top:2px;
  width:max-content;
}


/* =========================================================
   V6.100 - Centro Notifiche Admin
   ========================================================= */
.topbar-notification-btn{
  position:relative;
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  color:#475467;
  cursor:pointer;
  transition:.16s ease;
}
.topbar-notification-btn:hover{
  border-color:rgba(var(--primary-rgb),.32);
  color:var(--primary);
  background:var(--primary-soft);
}
.topbar-notification-btn svg{
  width:18px;
  height:18px;
}
.topbar-notification-btn>span{
  position:absolute;
  right:-5px;
  top:-6px;
  min-width:18px;
  height:18px;
  padding:0 5px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:#e5484d;
  color:#fff;
  font-size:9px;
  font-weight:900;
  box-shadow:0 0 0 3px #fff;
}
.notification-page-head{
  align-items:flex-start;
}
.notification-kpis{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin-bottom:18px;
}
.notification-center-panel{
  overflow:hidden;
}
.notification-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:16px;
  border-bottom:1px solid var(--border);
}
.notification-search{
  flex:1;
  max-width:520px;
}
.notification-filters{
  flex:0 0 auto;
}
.notification-filters button{
  display:flex;
  align-items:center;
  gap:5px;
}
.notification-filters small{
  opacity:.75;
}
.notification-full-list{
  display:grid;
}
.notification-full-item{
  display:flex;
  gap:14px;
  padding:18px 20px;
  border-bottom:1px solid var(--border);
  background:#fff;
}
.notification-full-item:last-child{
  border-bottom:0;
}
.notification-full-item.unread{
  background:linear-gradient(90deg,var(--primary-soft),#fff 42%);
}
.notification-full-icon{
  width:40px;
  height:40px;
  flex:0 0 40px;
  display:grid;
  place-items:center;
  border-radius:12px;
  background:var(--primary-soft);
  color:var(--primary);
}
.notification-full-icon svg{
  width:18px;
  height:18px;
}
.notification-item-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}
.notification-item-top>div{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
}
.notification-item-top>small{
  white-space:nowrap;
  color:var(--muted);
}
.notification-type{
  display:inline-flex;
  padding:4px 7px;
  border-radius:999px;
  background:#f2f4f7;
  color:#475467;
  font-size:9px;
  font-weight:850;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.notification-full-item p{
  margin:7px 0 10px;
  color:#475467;
  line-height:1.5;
}
.notification-item-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.notification-item-foot>small{
  color:var(--muted);
}
@media(max-width:900px){
  .notification-kpis{
    grid-template-columns:1fr;
  }
  .notification-toolbar{
    align-items:stretch;
    flex-direction:column;
  }
  .notification-search{
    max-width:none;
  }
  .notification-filters{
    overflow:auto;
  }
}
@media(max-width:640px){
  .notification-full-item{
    padding:15px;
  }
  .notification-item-top{
    flex-direction:column;
    gap:5px;
  }
  .notification-item-foot{
    align-items:flex-start;
    flex-direction:column;
  }
}


/* =========================================================
   V6.100.1 - Fix layout Centro Notifiche
   ========================================================= */

/* Evita che il titolo pagina venga tagliato in alto */
.notification-page-head{
  padding-top:8px;
  margin-top:0;
}
.notification-page-head h1{
  margin-top:4px;
  line-height:1.08;
  overflow:visible;
}

/* Toolbar più equilibrata */
.notification-toolbar{
  display:grid;
  grid-template-columns:minmax(320px,1fr) auto;
  align-items:center;
  gap:18px;
}

/* Ricerca realmente larga e leggibile */
.notification-search{
  width:100%;
  max-width:none !important;
  min-width:0;
  display:flex;
  align-items:center;
  gap:10px;
}
.notification-search input{
  width:100% !important;
  min-width:0 !important;
  max-width:none !important;
  flex:1 1 auto;
  border:0;
  outline:0;
  background:transparent;
  font-size:14px;
}

/* Filtri senza comprimere la ricerca */
.notification-filters{
  justify-self:end;
  display:flex;
  gap:8px;
}
.notification-filters button{
  white-space:nowrap;
}

/* Lista più compatta e leggibile */
.notification-full-item{
  align-items:flex-start;
}
.notification-full-item p{
  margin-top:8px;
  margin-bottom:12px;
}

/* Desktop medio */
@media(max-width:1100px){
  .notification-toolbar{
    grid-template-columns:1fr;
  }
  .notification-filters{
    justify-self:start;
  }
}

/* Mobile */
@media(max-width:640px){
  .notification-page-head{
    padding-top:4px;
  }
  .notification-toolbar{
    display:flex;
    flex-direction:column;
    align-items:stretch;
  }
  .notification-filters{
    width:100%;
    overflow-x:auto;
  }
}


/* =========================================================
   V6.100.2 - Toggle letta / non letta singola notifica
   ========================================================= */
.notification-read-actions{
  display:flex;
  align-items:center;
  gap:8px;
}
.btn-compact{
  padding:6px 9px !important;
  min-height:auto !important;
  font-size:11px !important;
}


/* =========================================================
   V6.101 - Annullamento conferma lezione
   ========================================================= */
.lesson-confirm-state{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}


/* =========================================================
   V6.102 - Storico conferme lezione
   ========================================================= */
.lesson-history-panel{
  margin-top:18px;
  border:1px solid var(--border);
  border-radius:16px;
  overflow:hidden;
  background:#fff;
}
.lesson-history-panel .panel-head.compact{
  padding:14px 16px;
  border-bottom:1px solid var(--border);
}
.lesson-history-list{
  display:grid;
}
.lesson-history-row{
  display:flex;
  gap:14px;
  padding:14px 16px;
  border-bottom:1px solid var(--border);
}
.lesson-history-row:last-child{
  border-bottom:0;
}
.lesson-history-row.cancelled{
  background:#fff8f7;
}
.lesson-history-date{
  width:98px;
  flex:0 0 98px;
}
.lesson-history-date strong,
.lesson-history-date small{
  display:block;
}
.lesson-history-date small{
  margin-top:3px;
  color:var(--muted);
}
.lesson-history-title{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.lesson-history-reason{
  margin-top:8px;
  padding:8px 10px;
  border-radius:10px;
  background:#fef3f2;
  color:#912018;
  font-size:12px;
}
@media(max-width:640px){
  .lesson-history-row{
    flex-direction:column;
  }
  .lesson-history-date{
    width:auto;
    flex:auto;
  }
}


/* =========================================================
   V6.103 - Export CSV Incassi/Ricevute
   ========================================================= */
.receipt-controlbar .btn{
  white-space:nowrap;
}
@media(max-width:900px){
  .receipt-controlbar{
    flex-wrap:wrap;
  }
}


/* =========================================================
   V6.104 - Export/Stampa allievi per corso
   ========================================================= */
@media(max-width:640px){
  .modal-foot .btn{
    flex:1 1 100%;
  }
}


/* =========================================================
   V6.104.3 - Stampa elenco corso senza popup/iframe
   ========================================================= */
#dmCoursePrintArea{
  display:none;
}

@media print{
  body.dm-printing-course-list *{
    visibility:hidden !important;
  }

  body.dm-printing-course-list #dmCoursePrintArea,
  body.dm-printing-course-list #dmCoursePrintArea *{
    visibility:visible !important;
  }

  body.dm-printing-course-list #dmCoursePrintArea{
    display:block !important;
    position:absolute;
    inset:0;
    width:100%;
    background:#fff;
    color:#111827;
    padding:0;
    margin:0;
    z-index:999999;
    font-family:Arial,Helvetica,sans-serif;
  }

  .dm-print-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:20px;
    margin-bottom:20px;
  }

  .dm-print-brand{
    font-size:10px;
    font-weight:800;
    letter-spacing:.12em;
    text-transform:uppercase;
    color:#7c3aed;
    margin-bottom:6px;
  }

  .dm-print-school{
    font-size:15px;
    font-weight:700;
    margin-bottom:4px;
  }

  .dm-print-head h1{
    margin:0 0 6px;
    font-size:24px;
  }

  .dm-print-meta,
  .dm-print-date,
  .dm-print-footer{
    color:#667085;
    font-size:11px;
  }

  .dm-print-table{
    width:100%;
    border-collapse:collapse;
    margin-top:16px;
  }

  .dm-print-table th,
  .dm-print-table td{
    border:1px solid #cfd4dc;
    padding:8px 9px;
    text-align:left;
    font-size:11px;
  }

  .dm-print-table th{
    background:#f3f4f6 !important;
    font-size:10px;
    text-transform:uppercase;
    letter-spacing:.05em;
  }

  .dm-print-table th:first-child,
  .dm-print-table td:first-child{
    width:30px;
    text-align:center;
  }

  .dm-print-footer{
    margin-top:14px;
  }

  @page{
    size:A4 portrait;
    margin:14mm;
  }
}


/* =========================================================
   V6.105 - Stampa insoluti totali / per corso
   ========================================================= */
.cash-print-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.overdue-course-list{
  display:grid;
  gap:9px;
}
.overdue-course-row{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:13px;
  background:#fff;
}
.overdue-course-row small{
  display:block;
  margin-top:3px;
  color:var(--muted);
}
.overdue-course-row .amount{
  min-width:90px;
  text-align:right;
  color:var(--red);
}
#dmOverduePrintArea{
  display:none;
}
@media print{
  body.dm-printing-overdue-list *{
    visibility:hidden !important;
  }
  body.dm-printing-overdue-list #dmOverduePrintArea,
  body.dm-printing-overdue-list #dmOverduePrintArea *{
    visibility:visible !important;
  }
  body.dm-printing-overdue-list #dmOverduePrintArea{
    display:block !important;
    position:absolute;
    inset:0;
    width:100%;
    background:#fff;
    color:#111827;
    z-index:999999;
    font-family:Arial,Helvetica,sans-serif;
  }
  #dmOverduePrintArea .dm-print-table tfoot td{
    background:#f8fafc !important;
    font-weight:700;
  }
}
@media(max-width:900px){
  .cash-print-actions{
    width:100%;
  }
  .cash-print-actions .btn{
    flex:1 1 220px;
  }
}
@media(max-width:640px){
  .overdue-course-row{
    align-items:flex-start;
    flex-wrap:wrap;
  }
}


/* =========================================================
   V6.106 - Giorno scadenza mensilità configurabile
   ========================================================= */
.school-due-setting{
  margin-top:16px;
  padding-top:16px;
  border-top:1px solid var(--border);
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(220px,.8fr);
  gap:14px;
  align-items:end;
}
.due-day-preview{
  padding:13px 14px;
  border-radius:13px;
  border:1px solid rgba(var(--primary-rgb),.16);
  background:var(--primary-soft);
}
.due-day-preview span,
.due-day-preview small{
  display:block;
  color:var(--muted);
}
.due-day-preview span{
  font-size:10px;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.due-day-preview strong{
  display:block;
  margin:4px 0;
  font-size:20px;
  color:var(--primary);
}
@media(max-width:700px){
  .school-due-setting{
    grid-template-columns:1fr;
  }
}


/* =========================================================
   V6.107 - Registro presenze stampabile
   ========================================================= */
#dmAttendancePrintArea{
  display:none;
}
@media print{
  body.dm-printing-attendance-register *{
    visibility:hidden !important;
  }

  body.dm-printing-attendance-register #dmAttendancePrintArea,
  body.dm-printing-attendance-register #dmAttendancePrintArea *{
    visibility:visible !important;
  }

  body.dm-printing-attendance-register #dmAttendancePrintArea{
    display:block !important;
    position:absolute;
    inset:0;
    width:100%;
    background:#fff;
    color:#111827;
    z-index:999999;
    font-family:Arial,Helvetica,sans-serif;
  }

  .dm-attendance-print-table{
    width:100%;
    border-collapse:collapse;
    margin-top:14px;
    table-layout:fixed;
  }

  .dm-attendance-print-table th,
  .dm-attendance-print-table td{
    border:1px solid #cfd4dc;
    padding:6px 5px;
    text-align:center;
    font-size:9px;
  }

  .dm-attendance-print-table th{
    background:#f3f4f6 !important;
    font-size:8px;
    text-transform:uppercase;
    letter-spacing:.04em;
  }

  .dm-attendance-print-table .num{
    width:24px;
  }

  .dm-attendance-print-table .student{
    width:155px;
    text-align:left;
  }

  .dm-attendance-print-table .mark{
    font-size:11px;
    font-weight:800;
  }

  .dm-attendance-print-table .tot{
    width:42px;
    font-weight:800;
  }

  .dm-print-legend{
    display:flex;
    gap:16px;
    flex-wrap:wrap;
    margin-top:12px;
    font-size:9px;
    color:#667085;
  }

  .dm-signature-row{
    display:flex;
    justify-content:space-between;
    gap:30px;
    margin-top:28px;
    font-size:10px;
  }

  @page{
    size:A4 landscape;
    margin:10mm;
  }
}


/* =========================================================
   V6.108 - Registro presenze storico per mese
   ========================================================= */
.course-register-control{
  display:flex;
  align-items:center;
  gap:7px;
  padding:4px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
}
.course-register-control input[type="month"]{
  min-width:145px;
  border:0;
  background:transparent;
  outline:0;
  padding:7px 8px;
  font:inherit;
  font-size:11px;
  color:var(--text);
}
.course-register-control .btn{
  margin:0;
}
@media(max-width:780px){
  .course-register-control{
    width:100%;
    flex-wrap:wrap;
  }
  .course-register-control input[type="month"]{
    flex:1 1 140px;
  }
  .course-register-control .btn{
    flex:1 1 190px;
  }
}


/* =========================================================
   V6.109 - Report mensile scuola
   ========================================================= */
.monthly-report-panel{margin-bottom:14px}
.monthly-report-controls{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  padding:0 14px 14px;
}
.monthly-report-controls input[type="month"]{
  min-width:175px;
  border:1px solid var(--border);
  border-radius:11px;
  padding:9px 11px;
  background:#fff;
  color:var(--text);
  font:inherit;
  font-size:12px;
}
#dmMonthlyReportPrintArea{display:none}
@media print{
  body.dm-printing-monthly-report *{visibility:hidden !important}
  body.dm-printing-monthly-report #dmMonthlyReportPrintArea,
  body.dm-printing-monthly-report #dmMonthlyReportPrintArea *{visibility:visible !important}
  body.dm-printing-monthly-report #dmMonthlyReportPrintArea{
    display:block !important;
    position:absolute;
    inset:0;
    width:100%;
    background:#fff;
    color:#111827;
    z-index:999999;
    font-family:Arial,Helvetica,sans-serif;
  }
  .dm-month-report-kpis{
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:8px;
    margin:14px 0 18px;
  }
  .dm-month-report-kpis>div,
  .dm-month-report-summary>div{
    border:1px solid #d7dce5;
    border-radius:8px;
    padding:9px;
  }
  .dm-month-report-kpis span,
  .dm-month-report-summary span{
    display:block;
    font-size:8px;
    text-transform:uppercase;
    color:#667085;
  }
  .dm-month-report-kpis strong,
  .dm-month-report-summary strong{
    display:block;
    margin-top:4px;
    font-size:14px;
  }
  #dmMonthlyReportPrintArea h2{margin:18px 0 8px;font-size:15px}
  .dm-month-report-summary{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:8px;
    margin-top:14px;
  }
  @page{size:A4 landscape;margin:10mm}
}
@media(max-width:640px){
  .monthly-report-controls>*{flex:1 1 100%}
}


/* =========================================================
   V6.109.1 - Layout report + stampa compatta
   ========================================================= */
.monthly-report-panel{
  overflow:hidden;
}
.monthly-report-controls{
  display:flex;
  align-items:flex-end;
  gap:14px;
  flex-wrap:wrap;
  padding:14px 18px 18px;
  border-top:1px solid var(--border);
}
.monthly-report-field{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:180px;
}
.monthly-report-field label{
  font-size:10px;
  font-weight:800;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.05em;
}
.monthly-report-field input[type="month"]{
  min-width:180px;
  height:42px;
  border:1px solid var(--border);
  border-radius:11px;
  padding:0 12px;
  background:#fff;
  color:var(--text);
  font:inherit;
  font-size:12px;
}
.monthly-report-print-btn{
  height:42px;
  min-width:150px;
  justify-content:center;
}
@media(max-width:640px){
  .monthly-report-controls{
    align-items:stretch;
  }
  .monthly-report-field,
  .monthly-report-print-btn{
    width:100%;
  }
  .monthly-report-field input[type="month"]{
    width:100%;
  }
}

/* Print compaction: force report to stay within 1–2 landscape pages */
@media print{
  body.dm-printing-monthly-report{
    margin:0 !important;
    padding:0 !important;
  }

  body.dm-printing-monthly-report #dmMonthlyReportPrintArea{
    position:static !important;
    width:auto !important;
    min-height:0 !important;
    padding:0 !important;
    margin:0 !important;
    font-size:9px !important;
  }

  #dmMonthlyReportPrintArea .dm-print-head{
    margin-bottom:8px !important;
  }

  #dmMonthlyReportPrintArea .dm-print-head h1{
    font-size:18px !important;
    margin:0 0 2px !important;
  }

  #dmMonthlyReportPrintArea .dm-print-school{
    font-size:12px !important;
    margin-bottom:2px !important;
  }

  #dmMonthlyReportPrintArea .dm-print-meta,
  #dmMonthlyReportPrintArea .dm-print-date{
    font-size:9px !important;
  }

  #dmMonthlyReportPrintArea .dm-month-report-kpis{
    grid-template-columns:repeat(5,1fr) !important;
    gap:5px !important;
    margin:6px 0 8px !important;
    break-inside:avoid;
    page-break-inside:avoid;
  }

  #dmMonthlyReportPrintArea .dm-month-report-kpis>div{
    padding:5px 6px !important;
    border-radius:5px !important;
  }

  #dmMonthlyReportPrintArea .dm-month-report-kpis span,
  #dmMonthlyReportPrintArea .dm-month-report-summary span{
    font-size:6.5px !important;
  }

  #dmMonthlyReportPrintArea .dm-month-report-kpis strong,
  #dmMonthlyReportPrintArea .dm-month-report-summary strong{
    font-size:11px !important;
    margin-top:2px !important;
  }

  #dmMonthlyReportPrintArea h2{
    margin:8px 0 4px !important;
    font-size:11px !important;
    page-break-after:avoid;
  }

  #dmMonthlyReportPrintArea .dm-print-table{
    margin-top:4px !important;
    width:100% !important;
    table-layout:fixed !important;
    border-collapse:collapse !important;
  }

  #dmMonthlyReportPrintArea .dm-print-table th,
  #dmMonthlyReportPrintArea .dm-print-table td{
    padding:3px 4px !important;
    font-size:7.5px !important;
    line-height:1.15 !important;
  }

  #dmMonthlyReportPrintArea .dm-print-table th{
    font-size:6.5px !important;
  }

  #dmMonthlyReportPrintArea .dm-month-report-summary{
    grid-template-columns:repeat(4,1fr) !important;
    gap:5px !important;
    margin-top:7px !important;
    break-inside:avoid;
    page-break-inside:avoid;
  }

  #dmMonthlyReportPrintArea .dm-month-report-summary>div{
    padding:5px 6px !important;
    border-radius:5px !important;
  }

  #dmMonthlyReportPrintArea .dm-signature-row{
    margin-top:12px !important;
    font-size:8px !important;
    break-inside:avoid;
    page-break-inside:avoid;
  }

  #dmMonthlyReportPrintArea table,
  #dmMonthlyReportPrintArea tr,
  #dmMonthlyReportPrintArea td,
  #dmMonthlyReportPrintArea th{
    page-break-inside:avoid !important;
  }

  @page{
    size:A4 landscape;
    margin:7mm;
  }
}


/* =========================================================
   V6.109.2 - Registro presenze tools più estetici
   ========================================================= */
.course-top-tools{
  align-items:stretch;
}
.course-top-tools-actions{
  align-items:center;
}
.course-top-tools-actions .btn{
  min-height:44px;
  border-radius:14px;
}
.course-register-control{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border:1px solid #e8dcff;
  border-radius:16px;
  background:linear-gradient(180deg,#ffffff 0%,#fbf8ff 100%);
  box-shadow:0 10px 24px rgba(126,79,255,.08);
}
.course-register-month-wrap{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:3px;
  min-width:170px;
  padding:6px 12px;
  border:1px solid #efe6ff;
  border-radius:13px;
  background:#fff;
}
.course-register-month-label{
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--dm-muted);
  line-height:1;
}
.course-register-control input[type="month"]{
  min-width:150px;
  border:0;
  background:transparent;
  outline:0;
  padding:0;
  margin:0;
  font:inherit;
  font-size:13px;
  font-weight:700;
  color:var(--text);
  line-height:1.2;
}
.course-register-control input[type="month"]::-webkit-calendar-picker-indicator{
  cursor:pointer;
  opacity:.8;
}
.course-register-print-btn{
  min-height:52px;
  padding-inline:18px;
  white-space:nowrap;
  box-shadow:0 12px 24px rgba(95,87,255,.16);
}
@media(max-width:780px){
  .course-top-tools-actions{
    width:100%;
    align-items:stretch;
  }
  .course-top-tools-actions .btn{
    flex:1 1 220px;
    justify-content:center;
  }
  .course-register-control{
    width:100%;
    flex-wrap:wrap;
    padding:10px;
  }
  .course-register-month-wrap,
  .course-register-print-btn{
    width:100%;
  }
  .course-register-control input[type="month"]{
    width:100%;
    min-width:0;
  }
}


/* =========================================================
   V6.109.3 - Restyling report mensile + stampa pulita
   ========================================================= */
.monthly-report-panel{
  overflow:hidden;
}
.monthly-report-controls{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  padding:14px 18px 18px;
  border-top:1px solid var(--border);
}
.monthly-report-field{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:205px;
  padding:8px 12px;
  border:1px solid #eadfff;
  border-radius:16px;
  background:linear-gradient(180deg,#ffffff 0%,#fbf8ff 100%);
  box-shadow:0 10px 24px rgba(126,79,255,.08);
}
.monthly-report-field label{
  font-size:10px;
  font-weight:900;
  color:var(--dm-muted);
  text-transform:uppercase;
  letter-spacing:.08em;
  line-height:1;
}
.monthly-report-field input[type="month"]{
  min-width:180px;
  height:28px;
  border:0;
  border-radius:0;
  padding:0;
  background:transparent;
  color:var(--text);
  font:inherit;
  font-size:13px;
  font-weight:700;
  outline:0;
}
.monthly-report-field input[type="month"]::-webkit-calendar-picker-indicator{
  cursor:pointer;
  opacity:.85;
}
.monthly-report-print-btn{
  min-width:170px;
  height:52px;
  border-radius:15px;
  justify-content:center;
  box-shadow:0 12px 24px rgba(223,75,211,.18);
}
@media(max-width:640px){
  .monthly-report-controls{
    align-items:stretch;
  }
  .monthly-report-field,
  .monthly-report-print-btn{
    width:100%;
  }
  .monthly-report-field input[type="month"]{
    width:100%;
    min-width:0;
  }
}


/* =========================================================
   V6.110 - Report annuale scuola
   ========================================================= */
.annual-report-panel{margin-bottom:14px;overflow:hidden}
.annual-report-controls{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  padding:14px 18px 18px;
  border-top:1px solid var(--border);
}
.annual-report-field{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:205px;
  padding:8px 12px;
  border:1px solid #dfe8ff;
  border-radius:16px;
  background:linear-gradient(180deg,#fff 0%,#f7f9ff 100%);
  box-shadow:0 10px 24px rgba(72,102,255,.08);
}
.annual-report-field label{
  font-size:10px;
  font-weight:900;
  color:var(--dm-muted);
  text-transform:uppercase;
  letter-spacing:.08em;
  line-height:1;
}
.annual-report-field input{
  height:28px;
  border:0;
  background:transparent;
  outline:0;
  padding:0;
  font:inherit;
  font-size:13px;
  font-weight:700;
  color:var(--text);
}
.annual-report-print-btn{
  min-width:180px;
  height:52px;
  border-radius:15px;
  justify-content:center;
}
@media(max-width:640px){
  .annual-report-controls{align-items:stretch}
  .annual-report-field,.annual-report-print-btn{width:100%}
}


/* =========================================================
   V6.111 - Centro Report + card Dashboard
   ========================================================= */
.report-link-card{
  display:flex;
  align-items:center;
  gap:16px;
  margin-bottom:14px;
  padding:18px 20px;
  border:1px solid #eadfff;
  border-radius:18px;
  background:linear-gradient(135deg,#fff 0%,#fbf7ff 100%);
  box-shadow:0 12px 30px rgba(126,79,255,.07);
  cursor:pointer;
  transition:.18s ease;
}
.report-link-card:hover{
  transform:translateY(-1px);
  border-color:#d9c6ff;
  box-shadow:0 16px 34px rgba(126,79,255,.11);
}
.report-link-icon,
.report-hub-icon{
  width:48px;
  height:48px;
  flex:0 0 48px;
  border-radius:15px;
  display:grid;
  place-items:center;
  color:var(--primary);
  background:var(--primary-soft);
}
.report-link-card h3{margin:3px 0 4px;font-size:18px}
.report-link-card p{margin:0;color:var(--muted);font-size:11px}
.report-link-arrow{
  margin-left:auto;
  font-size:22px;
  font-weight:900;
  color:var(--primary);
}
.report-hub-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}
.report-hub-card{
  display:flex;
  gap:14px;
  padding:18px;
  align-items:flex-start;
}
.report-hub-card h3{margin:2px 0 4px}
.report-hub-controls,
.report-hub-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}
.report-hub-controls .monthly-report-field,
.report-hub-controls .annual-report-field{
  min-width:200px;
}
.report-hub-actions .btn{min-height:44px}
@media(max-width:900px){
  .report-hub-grid{grid-template-columns:1fr}
}
@media(max-width:640px){
  .report-link-card{align-items:flex-start}
  .report-link-arrow{display:none}
  .report-hub-controls>*,
  .report-hub-actions>*{flex:1 1 100%}
}


/* =========================================================
   V6.112 - Report menu Admin/Segreteria + spese insegnanti
   ========================================================= */
.teacher-expense-field{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:205px;
  padding:8px 12px;
  border:1px solid #e7def7;
  border-radius:16px;
  background:linear-gradient(180deg,#fff 0%,#faf8ff 100%);
  box-shadow:0 10px 24px rgba(95,72,160,.07);
}
.teacher-expense-field label{
  font-size:10px;
  font-weight:900;
  color:var(--dm-muted);
  text-transform:uppercase;
  letter-spacing:.08em;
  line-height:1;
}
.teacher-expense-field input[type="month"]{
  min-width:180px;
  height:28px;
  border:0;
  background:transparent;
  outline:0;
  padding:0;
  font:inherit;
  font-size:13px;
  font-weight:700;
  color:var(--text);
}
.teacher-expense-print-btn{
  min-width:170px;
  height:52px;
  border-radius:15px;
  justify-content:center;
}
@media(max-width:640px){
  .teacher-expense-field,
  .teacher-expense-print-btn{
    width:100%;
  }
  .teacher-expense-field input[type="month"]{
    width:100%;
    min-width:0;
  }
}


/* =========================================================
   V6.113 - Report insegnanti selezionabile
   ========================================================= */
.teacher-expense-controls{
  display:grid;
  grid-template-columns:minmax(190px,.8fr) minmax(240px,1.2fr) auto;
  gap:10px;
  align-items:end;
  margin-top:14px;
}
.teacher-expense-field select{
  width:100%;
  min-width:210px;
  height:30px;
  border:0;
  background:transparent;
  outline:0;
  padding:0;
  font:inherit;
  font-size:13px;
  font-weight:700;
  color:var(--text);
}
.teacher-expense-buttons{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}
.teacher-expense-buttons .btn{
  min-height:52px;
  border-radius:15px;
  justify-content:center;
}
.teacher-expense-all-btn{
  min-width:145px;
}
@media(max-width:980px){
  .teacher-expense-controls{
    grid-template-columns:1fr 1fr;
  }
  .teacher-expense-buttons{
    grid-column:1 / -1;
  }
}
@media(max-width:640px){
  .teacher-expense-controls{
    grid-template-columns:1fr;
  }
  .teacher-expense-buttons{
    grid-column:auto;
  }
  .teacher-expense-field,
  .teacher-expense-buttons,
  .teacher-expense-buttons .btn{
    width:100%;
  }
  .teacher-expense-field select{
    min-width:0;
  }
}


/* =========================================================
   V6.114 - Report Hub premium + permessi Segreteria
   ========================================================= */
.reports-page-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:24px;
}
.reports-page-head h1{
  margin:2px 0 5px;
  font-size:30px;
  line-height:1.05;
}
.reports-page-head p{
  margin:0;
  color:var(--muted);
  font-size:12px;
}
.reports-back-btn{
  min-height:42px;
  border-radius:12px;
}

.report-hub-grid-premium{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}
.report-hub-grid-premium .report-hub-card{
  min-height:220px;
  padding:24px 26px;
  border-radius:20px;
  border:1px solid #dfe4ee;
  background:linear-gradient(180deg,#fff 0%,#fdfdff 100%);
  box-shadow:0 10px 30px rgba(35,45,78,.045);
  overflow:hidden;
}
.report-hub-grid-premium .report-hub-card:hover{
  border-color:#d8c7ff;
  box-shadow:0 16px 34px rgba(88,69,170,.075);
}
.report-hub-grid-premium .report-hub-icon{
  width:54px;
  height:54px;
  flex:0 0 54px;
  border-radius:16px;
  color:#d93bd4;
  background:linear-gradient(135deg,#fff3ff 0%,#f8eaff 100%);
}
.report-card-content{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  min-height:170px;
}
.report-card-content h3{
  margin:3px 0 5px;
  font-size:18px;
  line-height:1.2;
}
.report-card-content .panel-sub{
  max-width:560px;
  line-height:1.45;
}

.report-hub-controls-spread{
  display:grid;
  grid-template-columns:minmax(220px,1fr) auto;
  gap:18px;
  align-items:end;
  width:100%;
  margin-top:22px;
}
.report-hub-grid-premium .monthly-report-field,
.report-hub-grid-premium .annual-report-field,
.report-hub-grid-premium .teacher-expense-field{
  min-width:0;
  width:100%;
  padding:10px 14px;
  border-radius:14px;
  background:#fff;
  border:1px solid #e1e5ee;
  box-shadow:0 4px 12px rgba(34,42,68,.035);
}
.report-hub-grid-premium .monthly-report-field input,
.report-hub-grid-premium .annual-report-field input,
.report-hub-grid-premium .teacher-expense-field input,
.report-hub-grid-premium .teacher-expense-field select{
  width:100%;
  min-width:0;
}
.report-hub-grid-premium .btn{
  border-radius:13px;
}
.report-hub-grid-premium .btn-primary{
  min-height:52px;
  padding-inline:22px;
  box-shadow:0 12px 24px rgba(215,55,207,.16);
}
.report-hub-grid-premium .btn-soft{
  min-height:46px;
  padding-inline:18px;
  background:linear-gradient(180deg,#fff5ff 0%,#fceeff 100%);
  color:#d93bd4;
  border-color:#f1dcf4;
}
.report-hub-grid-premium .report-hub-actions{
  margin-top:22px;
}

.teacher-expense-controls-premium{
  display:grid;
  grid-template-columns:minmax(190px,.9fr) minmax(220px,1.1fr);
  gap:12px;
  align-items:end;
  margin-top:18px;
}
.teacher-expense-controls-premium .teacher-expense-buttons{
  grid-column:1 / -1;
  display:grid;
  grid-template-columns:minmax(180px,1.2fr) minmax(150px,.8fr);
  gap:10px;
}
.teacher-expense-controls-premium .teacher-expense-buttons .btn{
  width:100%;
}
.teacher-expense-report-card{
  min-height:250px !important;
}

@media(max-width:1100px){
  .report-hub-grid-premium{
    grid-template-columns:1fr;
  }
}
@media(max-width:720px){
  .reports-page-head{
    flex-direction:column;
  }
  .reports-back-btn{
    width:100%;
  }
  .report-hub-grid-premium .report-hub-card{
    padding:18px;
    min-height:auto;
  }
  .report-hub-controls-spread{
    grid-template-columns:1fr;
    gap:10px;
  }
  .report-hub-controls-spread .btn{
    width:100%;
  }
  .teacher-expense-controls-premium{
    grid-template-columns:1fr;
  }
  .teacher-expense-controls-premium .teacher-expense-buttons{
    grid-column:auto;
    grid-template-columns:1fr;
  }
  .report-card-content{
    min-height:auto;
  }
}


/* =========================================================
   V6.115 - Export CSV Report
   ========================================================= */
.report-export-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.report-export-actions .btn{
  min-height:52px;
}
.teacher-expense-controls-premium .teacher-expense-buttons{
  grid-template-columns:repeat(3,minmax(150px,1fr));
}
@media(max-width:900px){
  .teacher-expense-controls-premium .teacher-expense-buttons{
    grid-template-columns:1fr;
  }
}
@media(max-width:720px){
  .report-export-actions{
    width:100%;
  }
  .report-export-actions .btn{
    width:100%;
  }
}


/* =========================================================
   V6.115.1 - Fix tabella Allievi su smartphone
   ========================================================= */
.students-table-wrap{
  overflow:auto;
  max-width:100%;
}
@media(max-width:780px){
  .students-table-wrap{
    overflow-x:auto !important;
    overflow-y:visible !important;
    max-width:100%;
    width:100%;
    border-radius:14px;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
    overscroll-behavior-x:contain;
    touch-action:pan-x pan-y;
  }

  .students-table-wrap table{
    min-width:920px;
    width:max-content;
    max-width:none;
  }

  .students-table-wrap th,
  .students-table-wrap td{
    white-space:nowrap;
  }

  .students-table-wrap td:nth-child(3){
    white-space:normal;
    min-width:220px;
  }

  .students-table-wrap td:first-child,
  .students-table-wrap th:first-child{
    position:sticky;
    left:0;
    z-index:2;
    background:#fff;
    min-width:160px;
  }

  .students-table-wrap thead th:first-child{
    background:#f8f9fc;
    z-index:3;
  }

  .students-table-wrap::after{
    content:"← scorri la tabella →";
    position:sticky;
    left:12px;
    display:block;
    width:max-content;
    margin:8px 0 10px 10px;
    padding:5px 9px;
    border-radius:999px;
    background:#f6efff;
    color:var(--primary);
    font-size:9px;
    font-weight:800;
    pointer-events:none;
  }

  /* lascia sempre spazio reale sotto l'ultima riga, sopra la nav mobile */
  .content:has(.students-table-wrap){
    padding-bottom:118px;
  }
}


/* =========================================================
   V6.115.2 - Colonna destra Allievi mobile più leggibile
   ========================================================= */
@media(max-width:780px){
  /* La colonna azioni a destra non deve risultare "tagliata" */
  .students-table-wrap th:last-child,
  .students-table-wrap td:last-child{
    min-width:120px;
    width:120px;
    padding-left:12px;
    padding-right:16px;
    background:#fff;
  }

  /* più respiro reale dopo l'ultima colonna durante lo swipe */
  .students-table-wrap table{
    padding-right:18px;
  }

  .students-table-wrap td:last-child .actions,
  .students-table-wrap td:last-child > div{
    display:flex;
    justify-content:flex-end;
    gap:8px;
    flex-wrap:nowrap;
  }

  .students-table-wrap td:last-child .icon-btn{
    flex:0 0 38px;
    width:38px;
    height:38px;
  }
}


/* =========================================================
   V6.116 - Aggiunta allievi esistenti direttamente dal corso
   ========================================================= */
.course-add-existing-btn{
  min-height:44px;
  white-space:nowrap;
}
.add-existing-students-modal{
  padding-top:16px;
}
.existing-student-toolbar{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  margin-bottom:14px;
}
.existing-student-search{
  flex:1 1 auto;
  min-width:240px;
}
.select-visible-students{
  display:flex;
  align-items:center;
  gap:7px;
  white-space:nowrap;
  font-size:11px;
  font-weight:800;
  color:var(--muted);
}
.existing-students-list{
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height:52vh;
  overflow:auto;
  padding-right:4px;
}
.existing-student-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 150px;
  gap:14px;
  align-items:center;
  padding:12px 14px;
  border:1px solid #e4e7ee;
  border-radius:14px;
  background:#fff;
  transition:.15s ease;
}
.existing-student-row:hover{
  border-color:#d9c8ff;
  background:#fdfbff;
}
.existing-student-check{
  display:flex;
  gap:11px;
  align-items:flex-start;
  min-width:0;
  cursor:pointer;
}
.existing-student-check input{
  width:18px;
  height:18px;
  margin-top:2px;
  flex:0 0 auto;
}
.existing-student-person{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.existing-student-person strong{
  font-size:13px;
}
.existing-student-person small{
  margin-top:3px;
  color:var(--muted);
  overflow:hidden;
  text-overflow:ellipsis;
}
.existing-student-courses{
  color:var(--primary)!important;
  font-weight:700;
}
.existing-student-price label{
  display:block;
  margin-bottom:5px;
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:var(--muted);
  font-weight:900;
}
.price-input-wrap{
  display:flex;
  align-items:center;
  gap:6px;
  height:38px;
  padding:0 10px;
  border:1px solid #dfe3eb;
  border-radius:11px;
  background:#fff;
}
.price-input-wrap span{
  color:var(--muted);
  font-weight:800;
}
.price-input-wrap input{
  width:100%;
  min-width:0;
  padding:0;
  border:0;
  outline:0;
  background:transparent;
  font-weight:800;
}
@media(max-width:700px){
  .existing-student-toolbar{
    flex-direction:column;
    align-items:stretch;
  }
  .existing-student-search{
    min-width:0;
    width:100%;
  }
  .existing-student-row{
    grid-template-columns:1fr;
    gap:10px;
  }
  .existing-student-price{
    padding-left:29px;
  }
  .course-top-tools-actions{
    align-items:stretch;
  }
  .course-add-existing-btn{
    width:100%;
  }
}


/* =========================================================
   V6.118 - Report allievi bloccati Area Insegnante
   ========================================================= */
.teacher-blocked-card{
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:16px;
  padding:17px 18px;
  border:1px solid #eadcff;
  border-radius:18px;
  background:linear-gradient(135deg,#fff 0%,#fcf8ff 100%);
  box-shadow:0 12px 28px rgba(87,67,145,.06);
}
.teacher-blocked-card.has-blocked{
  border-color:#f0d7e8;
  background:linear-gradient(135deg,#fff 0%,#fff8fc 100%);
}
.teacher-blocked-card-icon{
  width:48px;
  height:48px;
  flex:0 0 48px;
  display:grid;
  place-items:center;
  border-radius:15px;
  background:#f7efff;
  color:var(--primary);
}
.teacher-blocked-card.has-blocked .teacher-blocked-card-icon{
  background:#fff0f5;
  color:#d8467b;
}
.teacher-blocked-card-copy{
  flex:1 1 auto;
  min-width:0;
}
.teacher-blocked-card-copy h3{
  margin:3px 0 4px;
  font-size:17px;
}
.teacher-blocked-card-copy p{
  margin:0;
  color:var(--muted);
  font-size:11px;
  line-height:1.4;
}
.teacher-blocked-card-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.teacher-blocked-report-window{
  max-width:860px;
}
.teacher-blocked-summary{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:14px 15px;
  margin-bottom:12px;
  border:1px solid #ebe5f6;
  border-radius:15px;
  background:#fcfaff;
}
.teacher-blocked-summary>div{
  display:flex;
  align-items:baseline;
  gap:8px;
}
.teacher-blocked-summary span,
.teacher-blocked-summary small{
  color:var(--muted);
  font-size:10px;
}
.teacher-blocked-summary strong{
  font-size:22px;
  color:var(--text);
}
.teacher-blocked-list{
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height:52vh;
  overflow:auto;
  padding-right:3px;
}
.teacher-blocked-row{
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(150px,.8fr) auto;
  gap:12px;
  align-items:center;
  padding:12px 14px;
  border:1px solid #e5e8ef;
  border-radius:14px;
  background:#fff;
}
.teacher-blocked-person{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.teacher-blocked-person strong{
  font-size:13px;
}
.teacher-blocked-person small{
  margin-top:3px;
  color:var(--muted);
}
.teacher-blocked-course span{
  display:inline-flex;
  padding:5px 9px;
  border-radius:999px;
  background:#f6f0ff;
  color:var(--primary);
  font-size:10px;
  font-weight:800;
}
.teacher-blocked-empty{
  display:flex;
  align-items:center;
  gap:10px;
  padding:18px;
  border:1px solid #dbeee4;
  border-radius:14px;
  background:#f8fffb;
}
.teacher-blocked-empty svg{
  color:#2d9b67;
}
.teacher-blocked-empty div{
  display:flex;
  flex-direction:column;
}
.teacher-blocked-empty small{
  margin-top:3px;
  color:var(--muted);
}
@media(max-width:700px){
  .teacher-blocked-card{
    align-items:flex-start;
    flex-wrap:wrap;
  }
  .teacher-blocked-card-copy{
    flex:1 1 calc(100% - 64px);
  }
  .teacher-blocked-card-actions{
    width:100%;
  }
  .teacher-blocked-card-actions .btn{
    flex:1 1 0;
  }
  .teacher-blocked-summary{
    align-items:flex-start;
    flex-direction:column;
  }
  .teacher-blocked-summary .btn{
    width:100%;
  }
  .teacher-blocked-row{
    grid-template-columns:1fr auto;
  }
  .teacher-blocked-course{
    grid-column:1 / -1;
  }
}


/* =========================================================
   V6.120 - Stato blocco visibile anche nel corso Insegnante
   ========================================================= */
.teacher-student-course-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}
@media(max-width:640px){
  .teacher-student-course-actions{
    width:100%;
    justify-content:flex-start;
    margin-top:8px;
  }
  .teacher-student-course-actions .btn{
    margin-left:auto;
  }
}


/* =========================================================
   V6.122 - Periodo personalizzato Ricevute
   ========================================================= */
.receipt-period-panel{
  padding:18px;
}
.receipt-period-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  margin-bottom:14px;
}
.receipt-period-head h3{
  margin:0 0 4px;
}
.receipt-controlbar-period{
  display:grid;
  grid-template-columns:minmax(260px,1.5fr) minmax(170px,.8fr) minmax(150px,.7fr) minmax(150px,.7fr) auto;
  gap:10px;
  align-items:end;
}
.receipt-period-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.receipt-period-field label{
  font-size:9px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.07em;
  color:var(--muted);
}
.receipt-period-field select,
.receipt-period-field input{
  width:100%;
  height:42px;
  border:1px solid #dfe3eb;
  border-radius:12px;
  background:#fff;
  padding:0 11px;
  color:var(--text);
  font:inherit;
  font-size:12px;
  outline:none;
}
.receipt-reset-btn{
  height:42px;
}
.receipt-period-actions{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid #edf0f5;
}
.receipt-period-selected{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.receipt-period-selected span{
  font-size:9px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.07em;
  color:var(--muted);
}
.receipt-period-selected strong{
  font-size:13px;
}
.receipt-period-actions .actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
@media(max-width:1050px){
  .receipt-controlbar-period{
    grid-template-columns:1fr 1fr;
  }
  .receipt-search{
    grid-column:1 / -1;
  }
}
@media(max-width:650px){
  .receipt-period-head,
  .receipt-period-actions{
    flex-direction:column;
    align-items:stretch;
  }
  .receipt-controlbar-period{
    grid-template-columns:1fr;
  }
  .receipt-search{
    grid-column:auto;
  }
  .receipt-period-actions .actions{
    width:100%;
  }
  .receipt-period-actions .actions .btn{
    width:100%;
  }
  .receipt-reset-btn{
    width:100%;
  }
}


/* =========================================================
   V6.122.1 - Fix Ricevute smartphone: scroll orizzontale
   ========================================================= */
@media(max-width:780px){
  .receipt-mobile-scroll{
    width:100%;
    max-width:100%;
    overflow-x:auto !important;
    overflow-y:visible !important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain;
    touch-action:pan-x pan-y;
    border-radius:14px;
  }

  .receipt-mobile-scroll .receipt-table{
    width:max-content;
    min-width:1080px;
    max-width:none;
  }

  .receipt-mobile-scroll .receipt-table th,
  .receipt-mobile-scroll .receipt-table td{
    white-space:nowrap;
  }

  .receipt-mobile-scroll .receipt-table td:nth-child(4){
    white-space:normal;
    min-width:240px;
    max-width:320px;
  }

  /* Numero ricevuta resta visibile mentre scorri */
  .receipt-mobile-scroll .receipt-table th:first-child,
  .receipt-mobile-scroll .receipt-table td:first-child{
    position:sticky;
    left:0;
    z-index:2;
    min-width:105px;
    background:#fff;
  }

  .receipt-mobile-scroll .receipt-table thead th:first-child{
    z-index:3;
    background:#f8f9fc;
  }

  .receipt-mobile-scroll .actions{
    flex-wrap:nowrap;
    min-width:max-content;
  }

  .receipt-mobile-scroll::after{
    content:"← scorri le ricevute →";
    position:sticky;
    left:12px;
    display:block;
    width:max-content;
    margin:8px 0 10px 10px;
    padding:5px 9px;
    border-radius:999px;
    background:#f6efff;
    color:var(--primary);
    font-size:9px;
    font-weight:800;
    pointer-events:none;
  }

  /* evita che la nav mobile copra le ultime righe */
  .content:has(.receipt-mobile-scroll){
    padding-bottom:118px;
  }
}


/* =========================================================
   V6.123 - Sedi multiple + ricevute su richiesta
   ========================================================= */
.location-filter{
  display:flex;
  align-items:center;
  gap:10px;
  margin:0 0 14px;
  padding:10px 12px;
  background:#fff;
  border:1px solid #e8ebf2;
  border-radius:14px;
  width:max-content;
  max-width:100%;
}
.location-filter label{
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:var(--muted);
}
.location-filter select{
  min-width:180px;
  height:38px;
  border:1px solid #dde2ec;
  border-radius:10px;
  background:#fff;
  padding:0 10px;
}
.locations-list{display:flex;flex-direction:column;gap:9px}
.location-row{
  display:flex;
  align-items:center;
  gap:12px;
  border:1px solid #e7eaf1;
  border-radius:14px;
  padding:12px 14px;
  background:#fff;
}
.location-row.inactive{opacity:.62;background:#f8f9fb}
.location-mark{
  width:38px;height:38px;border-radius:12px;
  display:grid;place-items:center;
  background:var(--primary-soft);
  color:var(--primary);
  flex:0 0 auto;
}
.location-title{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.location-row small{display:block;margin-top:3px;color:var(--muted)}
.check-line{display:flex;align-items:center;gap:9px;font-weight:700}
.receipt-mini-btn.pending{
  border-style:dashed;
  background:#fff8e7;
  color:#9a6700;
}
.receipt-location{padding-top:14px;padding-bottom:14px}
@media(max-width:680px){
  .location-filter{width:100%;box-sizing:border-box}
  .location-filter select{min-width:0;flex:1}
  .location-row{align-items:flex-start;flex-wrap:wrap}
  .location-row .actions{width:100%;justify-content:flex-end}
}


/* =========================================================
   V6.124 - Permessi Segreteria per sede
   ========================================================= */
.staff-location-checks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:12px}
.staff-location-checks.compact{margin-top:4px}
.staff-location-check{display:flex;align-items:flex-start;gap:10px;padding:11px 12px;border:1px solid #e2e6ef;border-radius:13px;background:#fff;cursor:pointer}
.staff-location-check:has(input:checked){border-color:var(--primary);background:var(--primary-soft)}
.staff-location-check input{margin-top:3px}
.staff-location-check span{display:flex;flex-direction:column;gap:2px}
.staff-location-check small{color:var(--muted)}
.staff-location-summary{display:block;max-width:260px;white-space:normal;line-height:1.35}
@media(max-width:700px){.staff-location-checks{grid-template-columns:1fr}}


/* =========================================================
   V6.125 - Vista gestionale Admin per sede
   ========================================================= */
.admin-scope-bar{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  margin:0 0 16px;padding:12px 14px;border:1px solid #e3e7ef;border-radius:16px;
  background:linear-gradient(135deg,#fff,#f8f9ff);box-shadow:0 8px 24px rgba(17,24,39,.04)
}
.admin-scope-copy{display:flex;align-items:center;gap:10px;min-width:0}
.admin-scope-copy div{display:flex;flex-direction:column;gap:1px;min-width:0}
.admin-scope-copy small{font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.09em;color:var(--muted)}
.admin-scope-copy strong{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.admin-scope-dot{width:10px;height:10px;border-radius:999px;background:var(--primary);box-shadow:0 0 0 5px var(--primary-soft)}
.admin-scope-bar select{height:40px;min-width:210px;border:1px solid #dfe4ed;border-radius:11px;background:#fff;padding:0 34px 0 11px;font-weight:800;color:var(--text)}
.topbar-scope-chip{display:flex;align-items:center;gap:6px;min-width:0;padding:7px 10px;border:1px solid #e3e7ef;border-radius:12px;background:#fff;color:var(--text)}
.topbar-scope-chip>span{display:grid;place-items:center;color:var(--primary)}
.topbar-scope-chip small{font-size:9px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:900}
.topbar-scope-chip strong{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px}
@media(max-width:820px){
 .topbar-scope-chip small{display:none}
 .topbar-scope-chip strong{max-width:95px}
 .admin-scope-bar{align-items:stretch;flex-direction:column}
 .admin-scope-bar select{width:100%;min-width:0}
}


/* =========================================================
   V6.126 - Identità sede e contesto Segreteria
   ========================================================= */
.secretary-location-context{
  margin-top:11px;
  padding-top:11px;
  border-top:1px solid rgba(255,255,255,.10);
  display:flex;
  gap:9px;
  align-items:center;
  min-width:0;
}
.secretary-location-context > div:last-child{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.secretary-location-context span:not(.location-brand-logo):not(.secretary-location-icon){
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.08em;
  opacity:.72;
  font-weight:800;
}
.secretary-location-context strong{
  font-size:12px;
  line-height:1.25;
  white-space:normal;
  word-break:break-word;
}
.secretary-location-icon{
  width:30px;height:30px;border-radius:9px;
  display:grid;place-items:center;
  background:rgba(255,255,255,.09);
  flex:0 0 auto;
}
.location-brand-logo{
  width:36px;height:36px;border-radius:11px;
  display:inline-grid;place-items:center;
  overflow:hidden;background:#fff;
  border:1px solid rgba(15,23,42,.08);
  flex:0 0 auto;
}
.location-brand-logo img{
  width:100%;height:100%;
  object-fit:contain;
  padding:3px;
  box-sizing:border-box;
}
.location-brand-initials{
  font-size:11px;font-weight:900;color:var(--primary);
  background:var(--primary-soft);
}
.sidebar-location-logo{width:32px;height:32px;border-radius:9px}
.topbar-location-logo{width:28px;height:28px;border-radius:9px}
.topbar-location-icon{
  width:28px;height:28px;border-radius:9px;
  display:grid;place-items:center;
  background:var(--primary-soft);color:var(--primary);
}
.secretary-scope-chip{max-width:300px}
.secretary-scope-chip strong{
  max-width:175px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.location-mark.branded{
  background:transparent;
  width:42px;height:42px;
}
.location-list-logo{width:42px;height:42px;border-radius:12px}
.location-logo-editor{
  display:flex;align-items:center;gap:14px;
  padding:12px;border:1px solid #e5e8ef;border-radius:14px;background:#f9fafc;
}
.settings-location-logo{width:64px;height:64px;border-radius:16px}
.location-logo-actions{
  display:flex;align-items:flex-start;gap:8px;flex-wrap:wrap;flex:1;
}
.location-logo-actions small{width:100%;color:var(--muted)}
.file-btn{cursor:pointer}
@media(max-width:700px){
  .location-logo-editor{align-items:flex-start}
  .secretary-scope-chip{max-width:210px}
  .secretary-scope-chip strong{max-width:105px}
}

/* =========================================================
   V6.127 - Ricevute per sede
   ========================================================= */
.receipt-location-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:4px 0 2px}
.receipt-location-head strong{font-size:15px;color:#252b3b}
.receipt-location-head span,.location-code-badge{display:inline-flex;align-items:center;min-height:22px;padding:2px 7px;border-radius:999px;background:#eef1ff;color:#5148d8;font-size:10px;font-weight:900;letter-spacing:.06em}


/* =========================================================
   V6.128 PREMIUM UI
   Restyling visuale: desktop + mobile, nessuna modifica dati
   ========================================================= */

:root{
  --bg:#f4f6fa;
  --surface:#ffffff;
  --surface-2:#f7f8fb;
  --ink:#101828;
  --muted:#667085;
  --line:#e6eaf0;
  --nav:#11172a;
  --shadow-soft:0 8px 30px rgba(16,24,40,.055);
  --shadow-card:0 2px 7px rgba(16,24,40,.035),0 14px 35px rgba(16,24,40,.035);
  --radius-card:20px;
  --radius-control:13px;
}

html{scroll-behavior:smooth}
body{
  background:
    radial-gradient(circle at 82% -10%,rgba(var(--primary-rgb),.07),transparent 30rem),
    var(--bg);
  font-size:14px;
  line-height:1.45;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

/* struttura generale */
.shell{grid-template-columns:264px minmax(0,1fr)}
.sidebar{
  padding:22px 14px 16px;
  gap:17px;
  border-right:1px solid rgba(255,255,255,.045);
  box-shadow:12px 0 34px rgba(16,24,40,.035);
  background:
    radial-gradient(circle at 40% 0%,rgba(var(--primary-rgb),.14),transparent 220px),
    linear-gradient(180deg,#131a30 0%,#101526 100%);
}
.main{min-width:0;background:transparent}
.content{
  width:100%;
  max-width:1510px;
  margin:0 auto;
  padding:30px 32px 42px;
}

/* brand / contesto scuola */
.sidebar .logo-lockup{padding:0 10px 2px}
.sidebar .logo-mark{
  width:44px;height:44px;border-radius:14px;
  box-shadow:0 8px 22px rgba(var(--primary-rgb),.22);
}
.sidebar .logo-name{font-size:18px;letter-spacing:-.025em}
.school-chip{
  margin:0 5px;
  padding:13px;
  border-radius:17px;
  background:linear-gradient(180deg,rgba(255,255,255,.075),rgba(255,255,255,.045));
  border:1px solid rgba(255,255,255,.08);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}
.school-chip span{font-size:9px;letter-spacing:.12em;color:#9ea7c2}
.school-chip strong{font-size:13px;letter-spacing:-.01em;color:#fff}
.school-chip-brand{gap:11px}
.school-chip-brand img,.sidebar-brand{
  width:42px!important;height:42px!important;border-radius:13px!important;
  object-fit:cover;
  box-shadow:0 5px 14px rgba(0,0,0,.18);
}
.secretary-location-context{
  margin-top:11px!important;
  padding-top:11px!important;
  border-top:1px solid rgba(255,255,255,.08)!important;
}
.secretary-location-context strong{font-size:12px!important}

/* sidebar nav */
.nav{gap:3px;padding:0 2px}
.nav button{
  min-height:43px;
  border-radius:12px;
  padding:10px 12px;
  gap:11px;
  font-size:12px;
  font-weight:760;
  letter-spacing:-.005em;
  transition:background .18s ease,color .18s ease,transform .18s ease;
}
.nav button svg{width:17px;height:17px}
.nav button:hover{
  color:#fff;
  background:rgba(255,255,255,.075);
  transform:translateX(2px);
}
.nav button.active{
  color:#fff;
  background:linear-gradient(90deg,rgba(var(--primary-rgb),.27),rgba(var(--primary-rgb),.12));
  box-shadow:inset 3px 0 0 var(--primary-2),0 5px 16px rgba(0,0,0,.06);
}
.nav-divider{margin:8px 10px}

/* profilo utente sidebar */
.user-box{
  padding:13px;
  border-radius:16px;
  background:rgba(255,255,255,.055);
  border:1px solid rgba(255,255,255,.065);
}
.user-box strong{font-size:12.5px}
.user-box small{font-size:10px}
.logout{
  min-height:34px;
  border-radius:10px;
  background:rgba(255,255,255,.075);
  transition:.18s ease;
}
.logout:hover{background:rgba(255,255,255,.13);color:#fff}

/* topbar */
.topbar{
  height:72px;
  padding:0 32px;
  background:rgba(255,255,255,.84);
  border-bottom:1px solid rgba(220,225,234,.82);
  backdrop-filter:blur(18px) saturate(145%);
  -webkit-backdrop-filter:blur(18px) saturate(145%);
  box-shadow:0 3px 14px rgba(16,24,40,.025);
}
.topbar h2{
  font-size:19px;
  font-weight:860;
  letter-spacing:-.035em;
}
.topbar-right{gap:9px!important}
.topbar-scope-chip{
  min-height:38px;
  border-radius:12px!important;
  border:1px solid var(--line)!important;
  background:#fff!important;
  box-shadow:0 3px 10px rgba(16,24,40,.035)!important;
}
.topbar-notification-btn{
  border-radius:12px!important;
  box-shadow:none!important;
  border:1px solid var(--line)!important;
  background:#fff!important;
}
.db-live-dot{box-shadow:0 0 0 4px rgba(40,165,106,.09)}
.role-badge{
  padding:7px 10px;
  background:rgba(var(--primary-rgb),.08);
  border:1px solid rgba(var(--primary-rgb),.10);
}

/* titoli */
.hero{
  align-items:center;
  margin-bottom:23px;
  min-height:54px;
}
.hero>div:first-child{max-width:760px}
.hero h1{
  font-size:34px;
  line-height:1.08;
  letter-spacing:-.052em;
  margin-bottom:7px;
  font-weight:900;
}
.hero p{
  max-width:720px;
  font-size:13px;
  line-height:1.55;
}
.eyebrow{
  margin-bottom:7px;
  font-size:9px;
  letter-spacing:.145em;
}

/* pulsanti */
.btn{
  min-height:42px;
  border-radius:12px;
  padding:9px 15px;
  font-size:12px;
  font-weight:820;
  transition:transform .16s ease,box-shadow .16s ease,background .16s ease;
}
.btn:hover{transform:translateY(-1px)}
.btn-primary{
  box-shadow:0 7px 18px rgba(var(--primary-rgb),.18);
  background:linear-gradient(135deg,var(--primary),var(--primary-2));
}
.btn-primary:hover{box-shadow:0 10px 23px rgba(var(--primary-rgb),.22)}
.btn-soft{background:rgba(var(--primary-rgb),.085)}
.btn-ghost{background:#f3f5f8}
.icon-btn{
  width:38px;height:38px;border-radius:11px;
  transition:.16s ease;
}
.icon-btn:hover{background:#e9edf3;transform:translateY(-1px)}

/* controlli */
.field{gap:8px;margin-bottom:15px}
.field label{
  font-size:9px;
  letter-spacing:.115em;
  color:#5f687c;
}
.field input,.field select,.field textarea,
.toolbar input,.toolbar select,
.location-filter select{
  border-color:#e1e5ec;
  border-radius:var(--radius-control);
  background:#fff;
  min-height:44px;
  padding:11px 13px;
  box-shadow:0 1px 2px rgba(16,24,40,.018);
  transition:border .16s ease,box-shadow .16s ease,background .16s ease;
}
.field textarea{min-height:92px}
.field input:hover,.field select:hover,.field textarea:hover,
.toolbar input:hover,.toolbar select:hover{border-color:#d5dae4}
.field input:focus,.field select:focus,.field textarea:focus,
.toolbar input:focus,.toolbar select:focus{
  border-color:rgba(var(--primary-rgb),.55);
  box-shadow:0 0 0 4px rgba(var(--primary-rgb),.085);
}
.note{
  border-radius:14px;
  padding:12px 14px;
  background:#f8f9fb;
  border-color:#e8ebf0;
}

/* KPI */
.kpi-grid{gap:14px;margin-bottom:18px}
.kpi{
  min-height:138px;
  border-radius:var(--radius-card);
  padding:18px;
  border-color:#e7eaf0;
  box-shadow:var(--shadow-card);
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
.kpi:hover{
  transform:translateY(-2px);
  box-shadow:0 8px 28px rgba(16,24,40,.075);
  border-color:#dde2ea;
}
.kpi-head{align-items:flex-start}
.kpi-icon{
  width:38px;height:38px;border-radius:12px;
}
.kpi span.label{font-size:9px;letter-spacing:.11em}
.kpi strong.value{
  margin-top:15px;
  font-size:28px;
  line-height:1;
  font-weight:900;
}
.kpi small{margin-top:7px;font-size:10.5px;line-height:1.4}

/* panels/cards */
.panel{
  border-radius:var(--radius-card);
  border-color:#e6eaf0;
  box-shadow:var(--shadow-card);
  background:rgba(255,255,255,.98);
}
.panel-head{
  min-height:66px;
  padding:16px 19px;
  border-bottom-color:#edf0f4;
}
.panel-head h3{
  font-size:16px;
  font-weight:870;
  letter-spacing:-.025em;
}
.panel-sub{font-size:10.5px;margin-top:3px;line-height:1.4}
.panel-body{padding:18px 19px}
.grid-2,.grid-equal{gap:16px;margin-bottom:16px}
.card-grid{gap:15px}
.card{
  border-radius:18px;
  padding:17px;
  border-color:#e6eaf0;
  box-shadow:0 5px 18px rgba(16,24,40,.035);
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
.card:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 28px rgba(16,24,40,.065);
  border-color:#dfe4eb;
}
.card h3{font-size:16px;letter-spacing:-.02em}
.card p{font-size:11px;line-height:1.55}

/* righe */
.lesson-row,.money-row,.person-row{
  min-height:55px;
  padding:11px 0;
  border-bottom-color:#f0f2f5;
}
.time-pill{
  width:54px;
  border-radius:11px;
  padding:8px 6px;
}
.grow strong{font-size:12.5px}
.grow small{font-size:10.5px;margin-top:4px}

/* tabelle */
.toolbar{
  align-items:center;
  gap:9px;
  margin-bottom:14px;
}
.table-wrap{
  border-radius:18px;
  border-color:#e4e8ef;
  box-shadow:0 6px 20px rgba(16,24,40,.03);
  background:#fff;
}
table{min-width:820px}
th{
  height:42px;
  padding:11px 14px;
  font-size:8.5px;
  letter-spacing:.115em;
  background:#f8f9fb;
  color:#6f7788;
  border-bottom-color:#e8ebf0;
}
td{
  height:52px;
  padding:12px 14px;
  font-size:11.5px;
  border-bottom-color:#f0f2f5;
}
tbody tr{transition:background .15s ease}
tbody tr:hover{background:#fafbfc}

/* status/tag */
.status,.tag{
  border-radius:999px;
  font-size:8.5px;
  letter-spacing:.02em;
}
.status{padding:5px 8px}
.tag{padding:5px 8px}

/* modali */
.modal-backdrop{
  background:rgba(11,17,29,.58);
  backdrop-filter:blur(7px);
  -webkit-backdrop-filter:blur(7px);
}
.modal{
  border-radius:24px;
  border:1px solid rgba(255,255,255,.75);
  box-shadow:0 34px 100px rgba(6,12,26,.28);
}
.modal-head{
  min-height:68px;
  padding:17px 21px;
  background:linear-gradient(180deg,#fff,#fdfdfe);
}
.modal-head strong{
  font-size:19px;
  font-weight:900;
  letter-spacing:-.035em;
}
.modal-body{padding:20px 21px}
.modal-foot{
  min-height:66px;
  padding:13px 21px;
  background:#fbfcfd;
}
.section-title{
  margin:10px 0 12px;
  font-size:9px;
  letter-spacing:.13em;
}

/* filtri sede */
.location-filter{
  padding:9px 11px!important;
  border-radius:15px!important;
  box-shadow:0 5px 16px rgba(16,24,40,.03);
}
.location-filter label{font-size:8.5px!important}

/* ricevute/report */
.report-card,.report-hub-card{
  border-radius:20px!important;
  box-shadow:var(--shadow-card)!important;
}
.receipt-document{
  border-radius:18px!important;
}

/* piccoli effetti */
.panel,.kpi,.card,.table-wrap,.school-chip,.user-box,.btn,.topbar-scope-chip{
  will-change:transform;
}

/* responsive */
@media(max-width:1200px){
  .content{padding:26px 24px 38px}
  .hero h1{font-size:31px}
}
@media(max-width:780px){
  body{
    background:
      radial-gradient(circle at 100% -5%,rgba(var(--primary-rgb),.08),transparent 18rem),
      #f5f7fa;
  }
  .topbar{
    height:66px;
    padding:0 14px;
    background:rgba(255,255,255,.91);
  }
  .topbar-title-wrap h2{display:none}
  .mobile-school-brand{display:flex!important;align-items:center;gap:9px}
  .mobile-school-brand strong{
    display:block;
    max-width:180px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:12.5px;
  }
  .mobile-school-brand small{font-size:9px;color:var(--muted)}
  .content{
    max-width:none;
    padding:18px 12px calc(88px + env(safe-area-inset-bottom));
  }
  .hero{
    gap:13px;
    margin-bottom:17px;
    min-height:0;
  }
  .hero h1{
    font-size:27px;
    letter-spacing:-.045em;
    margin-bottom:5px;
  }
  .hero p{font-size:11.5px;line-height:1.5}
  .hero>.btn,.hero>div:last-child .btn{width:100%}
  .kpi-grid{gap:9px}
  .kpi{
    min-height:126px;
    padding:14px;
    border-radius:17px;
  }
  .kpi:hover,.card:hover,.btn:hover{transform:none}
  .kpi strong.value{font-size:23px;margin-top:13px}
  .kpi small{font-size:9.5px}
  .panel{
    border-radius:18px;
    box-shadow:0 4px 18px rgba(16,24,40,.035);
  }
  .panel-head{
    min-height:60px;
    padding:14px 15px;
  }
  .panel-head h3{font-size:15px}
  .panel-body{padding:14px 15px}
  .grid-2,.grid-equal{gap:12px;margin-bottom:12px}
  .card{border-radius:17px;padding:15px}
  .toolbar{
    gap:7px;
  }
  .toolbar input,.toolbar select{
    min-width:0;
    width:100%;
  }
  .table-wrap{
    margin-left:-2px;
    margin-right:-2px;
    border-radius:15px;
  }
  th,td{padding-left:12px;padding-right:12px}
  .modal-backdrop{padding:7px}
  .modal{
    width:100%;
    max-height:97vh;
    border-radius:20px;
  }
  .modal-head{min-height:61px;padding:14px 15px}
  .modal-head strong{font-size:17px}
  .modal-body{padding:15px}
  .modal-foot{
    min-height:62px;
    padding:11px 14px calc(11px + env(safe-area-inset-bottom));
    gap:7px;
  }
  .modal-foot .btn{flex:1}
  .mobile-nav{
    left:9px!important;
    right:9px!important;
    bottom:9px!important;
    height:62px!important;
    border:1px solid rgba(223,227,235,.95)!important;
    border-radius:19px!important;
    box-shadow:0 14px 40px rgba(16,24,40,.15)!important;
    overflow:hidden;
    padding-bottom:0!important;
    background:rgba(255,255,255,.94)!important;
    backdrop-filter:blur(16px);
    -webkit-backdrop-filter:blur(16px);
  }
  .mobile-nav button{
    border-radius:13px;
    font-size:8px;
    transition:.15s ease;
  }
  .mobile-nav button.active{
    background:rgba(var(--primary-rgb),.075);
  }
  .topbar-right .role-badge,.db-live-text{display:none!important}
}
@media(max-width:430px){
  .content{padding-left:10px;padding-right:10px}
  .topbar{padding-left:11px;padding-right:11px}
  .kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .kpi{padding:13px;min-height:120px}
  .kpi-icon{width:34px;height:34px}
  .kpi strong.value{font-size:21px}
  .hero h1{font-size:25px}
}


/* =========================================================
   V6.129 — PREMIUM DESIGN SYSTEM
   Base neutra + brand glow + motion + iconografia coerente
   ========================================================= */

:root{
  --dm-bg:#f4f5f8;
  --dm-bg-2:#f8f8fb;
  --dm-surface:rgba(255,255,255,.92);
  --dm-surface-solid:#fff;
  --dm-ink:#121826;
  --dm-ink-2:#344054;
  --dm-muted:#7b8497;
  --dm-border:#e6e8ee;
  --dm-border-strong:#d9dee8;
  --dm-ease:cubic-bezier(.22,1,.36,1);
  --dm-shadow:0 10px 32px rgba(19,27,45,.055);
  --dm-shadow-hover:0 18px 46px rgba(19,27,45,.085);
  --dm-glow:0 0 0 1px rgba(var(--primary-rgb),.11),0 12px 36px rgba(var(--primary-rgb),.08);
}

/* Base premium: il colore scuola diventa accento, non sfondo dominante */
body{
  color:var(--dm-ink);
  background:
    radial-gradient(900px 460px at 78% -10%,rgba(var(--primary-rgb),.07),transparent 66%),
    radial-gradient(700px 420px at -8% 38%,rgba(var(--primary-rgb),.035),transparent 72%),
    linear-gradient(180deg,#f7f8fb 0%,#f2f4f7 100%);
}

/* Iconografia: stesso tratto ovunque */
.icon{
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.85;
  stroke-linecap:round;
  stroke-linejoin:round;
  vector-effect:non-scaling-stroke;
  flex:0 0 auto;
}
.btn .icon,.icon-btn .icon,.status .icon,.tag .icon{transition:transform .24s var(--dm-ease)}
.btn:hover .icon{transform:translateX(1px)}
.icon-btn:hover .icon{transform:scale(1.06)}

/* Motion system */
.btn,.icon-btn,.card,.panel,.kpi,.teacher-course,.attendance-row,
.nav button,.topbar-scope-chip,.school-chip,.location-row,.report-card,
.report-hub-card,.teacher-edit-action{
  transition:
    transform .28s var(--dm-ease),
    box-shadow .28s var(--dm-ease),
    border-color .28s var(--dm-ease),
    background-color .28s var(--dm-ease),
    color .2s ease,
    opacity .2s ease;
}
.btn:active,.icon-btn:active,.teacher-edit-action:active{
  transform:translateY(1px) scale(.985)!important;
  transition-duration:.08s!important;
}
@media(hover:hover){
  .btn:hover,.icon-btn:hover{transform:translateY(-1px)}
}

/* Superfici neutre */
.panel,.card,.kpi,.table-wrap,.report-card,.report-hub-card,
.teacher-course,.location-row{
  background:var(--dm-surface);
  border-color:var(--dm-border);
  box-shadow:var(--dm-shadow);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
@media(hover:hover){
  .card:hover,.kpi:hover,.teacher-course:hover,.report-card:hover,.report-hub-card:hover{
    transform:translateY(-2px);
    box-shadow:var(--dm-shadow-hover);
    border-color:rgba(var(--primary-rgb),.18);
  }
}

/* Brand glow: sottile, solo elementi chiave */
.btn-primary{
  position:relative;
  overflow:hidden;
  border:1px solid rgba(var(--primary-rgb),.24);
  box-shadow:
    0 8px 22px rgba(var(--primary-rgb),.18),
    inset 0 1px 0 rgba(255,255,255,.2);
}
.btn-primary::after{
  content:"";
  position:absolute;
  inset:-1px;
  pointer-events:none;
  background:linear-gradient(110deg,transparent 25%,rgba(255,255,255,.18) 45%,transparent 65%);
  transform:translateX(-130%);
  transition:transform .65s var(--dm-ease);
}
@media(hover:hover){
  .btn-primary:hover::after{transform:translateX(130%)}
  .btn-primary:hover{
    box-shadow:
      0 12px 30px rgba(var(--primary-rgb),.23),
      0 0 0 4px rgba(var(--primary-rgb),.055);
  }
}
.nav button.active,
.mobile-nav button.active{
  box-shadow:inset 0 0 0 1px rgba(var(--primary-rgb),.16),0 6px 20px rgba(var(--primary-rgb),.08);
}
.kpi-icon.primary,.teacher-modal-icon{
  box-shadow:0 8px 22px rgba(var(--primary-rgb),.10);
}

/* Sidebar più executive */
.sidebar{
  background:
    radial-gradient(420px 260px at 10% -5%,rgba(var(--primary-rgb),.14),transparent 70%),
    linear-gradient(180deg,#151a2d 0%,#101525 100%);
}
.sidebar .logo-lockup{
  border-radius:18px;
}
.school-chip{
  background:linear-gradient(180deg,rgba(255,255,255,.075),rgba(255,255,255,.035));
  border-color:rgba(255,255,255,.09);
}
.school-chip-brand img,.sidebar-brand{
  box-shadow:0 6px 18px rgba(0,0,0,.20),0 0 0 1px rgba(255,255,255,.08);
}

/* Header: più equilibrato */
.topbar{
  background:rgba(252,253,255,.86);
  border-bottom-color:rgba(222,226,234,.9);
}
.topbar-scope-chip{
  border-color:var(--dm-border)!important;
}
.topbar-scope-chip:hover{
  border-color:rgba(var(--primary-rgb),.24)!important;
  box-shadow:0 7px 20px rgba(var(--primary-rgb),.055)!important;
}

/* Testi: gerarchia più premium */
.hero h1,.teacher-welcome h1,.modal-head strong,.panel-head h3,.card h3{
  color:var(--dm-ink);
}
.hero p,.panel-sub,.field-help,.grow small,.card p{
  color:var(--dm-muted);
}
.eyebrow{
  color:var(--primary);
  font-weight:900;
}

/* Tabelle: più leggere e allineate */
.table-wrap{
  overflow:hidden;
}
th{
  background:#f8f9fb;
  color:#758096;
  font-weight:850;
}
td{color:#2f3748}
tbody tr:hover{background:rgba(var(--primary-rgb),.025)}

/* Report: meno spazio vuoto, più ritmo */
.report-grid,.reports-grid{
  gap:14px!important;
}
.report-card,.report-hub-card{
  min-height:0!important;
}
.report-card .panel-body,.report-hub-card .panel-body{
  padding-top:16px!important;
  padding-bottom:16px!important;
}
.report-card .btn,.report-hub-card .btn{
  min-height:40px;
}

/* Modali */
.modal{
  animation:dmModalIn .34s var(--dm-ease) both;
}
.modal-backdrop{
  animation:dmBackdropIn .24s ease both;
}
@keyframes dmModalIn{
  from{opacity:0;transform:translateY(12px) scale(.985)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
@keyframes dmBackdropIn{
  from{opacity:0}
  to{opacity:1}
}

/* Feedback di focus premium */
.field input:focus,.field select:focus,.field textarea:focus,
.toolbar input:focus,.toolbar select:focus,
.teacher-search-wrap input:focus{
  border-color:rgba(var(--primary-rgb),.5)!important;
  box-shadow:
    0 0 0 4px rgba(var(--primary-rgb),.075),
    0 8px 20px rgba(var(--primary-rgb),.045)!important;
}

/* ================= TEACHER APP PREMIUM ================= */
.teacher-app{
  max-width:920px;
  margin:0 auto;
  padding:0 18px 34px;
}
.teacher-head{
  position:sticky;
  top:0;
  z-index:20;
  background:rgba(248,249,252,.88);
  backdrop-filter:blur(16px) saturate(140%);
  -webkit-backdrop-filter:blur(16px) saturate(140%);
  border-bottom:1px solid var(--dm-border);
}
.teacher-welcome{
  position:relative;
  padding:28px 0 18px;
}
.teacher-welcome::before{
  content:"";
  position:absolute;
  width:180px;height:90px;
  right:0;top:8px;
  background:radial-gradient(circle,rgba(var(--primary-rgb),.10),transparent 68%);
  pointer-events:none;
}
.teacher-payroll-kpis{
  gap:10px;
}
.teacher-payroll-kpi{
  border-radius:18px;
  background:rgba(255,255,255,.9);
  border:1px solid var(--dm-border);
  box-shadow:0 8px 24px rgba(19,27,45,.045);
}
.teacher-payroll-kpi.paid{
  background:linear-gradient(180deg,#f9fffb,#f1fbf5);
}
.teacher-payroll-kpi.due{
  background:linear-gradient(180deg,#fffafa,#fff3f4);
}
.teacher-course{
  border-radius:20px;
  padding:17px;
}
.teacher-count{
  border-radius:14px;
  background:rgba(var(--primary-rgb),.075);
  color:var(--primary);
  border:1px solid rgba(var(--primary-rgb),.09);
}

/* Teacher list modal */
.teacher-students-head{
  padding:15px 17px!important;
}
.teacher-modal-title{
  display:flex;
  align-items:center;
  gap:11px;
  min-width:0;
}
.teacher-modal-title>div:last-child{
  min-width:0;
}
.teacher-modal-title strong{
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.teacher-modal-icon{
  width:40px;height:40px;
  border-radius:13px;
  display:grid;place-items:center;
  color:var(--primary);
  background:rgba(var(--primary-rgb),.08);
  border:1px solid rgba(var(--primary-rgb),.10);
}
.teacher-modal-meta{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
  margin-top:4px;
  font-size:9px;
  font-weight:800;
  color:var(--dm-muted);
}
.teacher-meta-ok{color:#139a5a}
.teacher-meta-bad{color:#d84853}
.teacher-students-body{
  padding:12px 15px 16px!important;
}
.teacher-students-toolbar{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:11px;
}
.teacher-search-wrap{
  flex:1;
  min-width:0;
  display:flex;
  align-items:center;
  gap:8px;
  height:42px;
  padding:0 11px;
  border:1px solid var(--dm-border);
  border-radius:13px;
  background:#f8f9fb;
  color:#8a93a5;
}
.teacher-search-wrap input{
  width:100%;
  border:0;
  outline:0;
  background:transparent;
  color:var(--dm-ink);
  font:inherit;
}
.teacher-list-hint{
  font-size:9.5px;
  color:var(--dm-muted);
}
.teacher-student-list{
  display:flex;
  flex-direction:column;
  gap:7px;
}
.teacher-student-row{
  min-height:68px!important;
  padding:9px 10px!important;
  gap:10px!important;
  border:1px solid var(--dm-border)!important;
  border-radius:15px!important;
  background:#fff!important;
}
.teacher-student-row:hover{
  border-color:rgba(var(--primary-rgb),.17)!important;
  box-shadow:0 8px 22px rgba(19,27,45,.045);
}
.teacher-student-row.blocked-attendance{
  background:#fffafa!important;
  border-color:#f3d0d4!important;
}
.teacher-student-avatar{
  width:38px;height:38px;
  flex:0 0 38px;
  display:grid;place-items:center;
  border-radius:12px;
  background:linear-gradient(145deg,rgba(var(--primary-rgb),.13),rgba(var(--primary-rgb),.055));
  color:var(--primary);
  font-weight:950;
  font-size:12px;
}
.teacher-student-copy{
  min-width:0;
}
.teacher-student-name-line{
  display:flex;
  align-items:center;
  gap:7px;
  min-width:0;
}
.teacher-student-name-line strong{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:12.5px;
}
.teacher-student-copy small{
  display:block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  margin-top:3px;
}
.teacher-edit-action{
  min-height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:8px 10px;
  border:1px solid var(--dm-border);
  border-radius:11px;
  background:#f6f7f9;
  color:#4e5870;
  font-weight:850;
  font-size:10px;
  cursor:pointer;
}
.teacher-edit-action:hover{
  color:var(--primary);
  border-color:rgba(var(--primary-rgb),.20);
  background:rgba(var(--primary-rgb),.055);
}

/* Stati sempre comprensibili */
.status.ok{
  color:#118b52;
  background:#eaf8f0;
  border:1px solid #d6f0e1;
}
.status.bad{
  color:#c93b48;
  background:#fff0f2;
  border:1px solid #f6d8dc;
}
.status.warn{
  color:#a56117;
  background:#fff7e8;
  border:1px solid #f5e3bd;
}

/* Mobile */
@media(max-width:780px){
  .teacher-app{
    padding:0 10px 26px;
  }
  .teacher-head{
    margin:0 -10px;
    padding-left:12px!important;
    padding-right:12px!important;
  }
  .teacher-welcome{
    padding-top:22px;
  }
  .teacher-payroll-kpis{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:7px!important;
  }
  .teacher-payroll-kpi{
    padding:11px 9px!important;
    border-radius:15px;
  }
  .teacher-payroll-kpi span{
    font-size:8px!important;
    letter-spacing:.07em;
  }
  .teacher-payroll-kpi strong{
    font-size:20px!important;
  }
  .teacher-payroll-kpi small{
    font-size:8.5px!important;
    line-height:1.25;
  }
  .teacher-students-toolbar{
    display:block;
  }
  .teacher-list-hint{
    display:none;
  }
  .teacher-student-row{
    min-height:62px!important;
    padding:8px!important;
  }
  .teacher-student-avatar{
    width:34px;height:34px;flex-basis:34px;
    border-radius:11px;
    font-size:11px;
  }
  .teacher-student-name-line{
    display:block;
  }
  .teacher-student-name-line .status{
    display:inline-flex;
    margin-top:3px;
  }
  .teacher-student-copy small{
    font-size:9px;
    max-width:180px;
  }
  .teacher-edit-action{
    width:38px;
    height:38px;
    min-height:38px;
    padding:0;
    border-radius:12px;
  }
  .teacher-edit-action span{
    display:none;
  }

  /* dashboard mobile: più compatta e precisa */
  .kpi{
    box-shadow:0 7px 24px rgba(19,27,45,.05);
  }
  .hero .btn-primary{
    box-shadow:0 10px 24px rgba(var(--primary-rgb),.16);
  }
}

/* Accessibilità motion */
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{
    scroll-behavior:auto!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
  }
}


/* =========================================================
   V6.130 — CALM PREMIUM UI
   Brand non invasivo + azioni rapide + notifiche + history nav
   ========================================================= */

:root{
  --dm-brand-solid:color-mix(in srgb,var(--primary) 62%,#5f6b7d 38%);
  --dm-brand-soft:color-mix(in srgb,var(--primary) 7%,#ffffff 93%);
  --dm-brand-soft-2:color-mix(in srgb,var(--primary) 11%,#f7f8fb 89%);
  --dm-brand-border:color-mix(in srgb,var(--primary) 16%,#e6e8ee 84%);
  --dm-danger:#cf5962;
  --dm-danger-soft:#fff4f5;
  --dm-warning:#bd7a37;
  --dm-warning-soft:#fff8ef;
  --dm-success:#27966a;
  --dm-success-soft:#eff9f4;
}

/* Il brand colora accenti, non superfici grandi */
.btn-primary{
  background:linear-gradient(135deg,
    color-mix(in srgb,var(--primary) 70%,#687386 30%),
    color-mix(in srgb,var(--primary-2) 66%,#667085 34%)
  )!important;
  border-color:var(--dm-brand-border)!important;
  box-shadow:0 7px 20px color-mix(in srgb,var(--primary) 13%,transparent 87%)!important;
}
.btn-primary:hover{
  box-shadow:0 10px 25px color-mix(in srgb,var(--primary) 16%,transparent 84%)!important;
}
.kpi.alert{
  border-color:#eedcdf!important;
  background:linear-gradient(180deg,#fff,#fffbfb)!important;
}
.kpi.alert .value{color:var(--dm-danger)!important}
.kpi-icon.red{
  color:var(--dm-danger)!important;
  background:var(--dm-danger-soft)!important;
}
.kpi-icon.orange{
  color:var(--dm-warning)!important;
  background:var(--dm-warning-soft)!important;
}
.kpi-icon.green{
  color:var(--dm-success)!important;
  background:var(--dm-success-soft)!important;
}
.kpi-icon.cyan{
  color:#3c8aa0!important;
  background:#eff8fa!important;
}
.kpi-icon.primary,.kpi-icon.pink,.report-link-icon,
.notification-full-icon,.activity-alert-icon{
  color:var(--dm-brand-solid)!important;
  background:var(--dm-brand-soft)!important;
  border-color:var(--dm-brand-border)!important;
  box-shadow:none!important;
}
.tag,.status{
  box-shadow:none!important;
}
.tag{
  color:var(--dm-brand-solid)!important;
  background:var(--dm-brand-soft)!important;
  border-color:var(--dm-brand-border)!important;
}
.status.bad{
  color:var(--dm-danger)!important;
  background:var(--dm-danger-soft)!important;
  border-color:#f0dadd!important;
}
.status.warn{
  color:var(--dm-warning)!important;
  background:var(--dm-warning-soft)!important;
  border-color:#f0e1cc!important;
}
.status.ok{
  color:var(--dm-success)!important;
  background:var(--dm-success-soft)!important;
  border-color:#d9eee4!important;
}

/* Pulsanti: meno ingombranti */
.btn{
  min-height:36px!important;
  padding:7px 11px!important;
  border-radius:10px!important;
  font-size:10.5px!important;
  gap:6px!important;
}
.btn .icon{width:15px;height:15px}
.btn-compact{
  min-height:32px!important;
  padding:6px 9px!important;
  font-size:9.5px!important;
}
.hero>.btn,.hero>div>.btn{
  min-height:39px!important;
  padding:8px 13px!important;
}
.card .btn,.teacher-card .btn,.report-card .btn,.report-hub-card .btn{
  min-height:35px!important;
  padding:7px 10px!important;
}
.teacher-actions,.actions{gap:6px!important}

/* Colore scuola: menu attivo sì, resto calmo */
.nav button.active{
  background:linear-gradient(90deg,
    color-mix(in srgb,var(--primary) 24%,transparent 76%),
    color-mix(in srgb,var(--primary) 10%,transparent 90%)
  )!important;
  box-shadow:inset 2px 0 0 color-mix(in srgb,var(--primary) 72%,#fff 28%)!important;
}
.mobile-nav button.active{
  color:var(--dm-brand-solid)!important;
  background:var(--dm-brand-soft)!important;
}

/* Browser-like navigation */
.dm-browser-nav{
  display:flex;
  align-items:center;
  gap:4px;
  margin-right:10px;
  padding-right:10px;
  border-right:1px solid var(--dm-border);
}
.dm-browser-nav button{
  width:32px;
  height:32px;
  padding:0;
  display:grid;
  place-items:center;
  border:1px solid transparent;
  border-radius:9px;
  background:transparent;
  color:#596276;
  cursor:pointer;
  transition:.2s var(--dm-ease);
}
.dm-browser-nav button .icon{width:16px;height:16px}
.dm-browser-nav button:hover:not(:disabled){
  background:#f2f4f7;
  border-color:#e7eaf0;
  color:var(--dm-ink);
  transform:translateY(-1px);
}
.dm-browser-nav button:active:not(:disabled){transform:scale(.94)}
.dm-browser-nav button:disabled{opacity:.28;cursor:default}

/* Quick actions: tasti piccoli e chiari, non card giganti */
.home-quick-actions{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin:-3px 0 16px;
}
.home-quick-actions button{
  min-height:42px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 11px 7px 8px;
  border:1px solid var(--dm-border);
  border-radius:12px;
  background:rgba(255,255,255,.86);
  color:var(--dm-ink-2);
  box-shadow:0 4px 14px rgba(19,27,45,.028);
  cursor:pointer;
  transition:.22s var(--dm-ease);
}
.home-quick-actions button>span{
  width:28px;height:28px;
  display:grid;place-items:center;
  border-radius:9px;
  background:var(--dm-brand-soft);
  color:var(--dm-brand-solid);
}
.home-quick-actions button .icon{width:15px;height:15px}
.home-quick-actions button strong{
  font-size:10.5px;
  font-weight:850;
  white-space:nowrap;
}
.home-quick-actions button:hover{
  transform:translateY(-1px);
  border-color:var(--dm-brand-border);
  background:#fff;
  box-shadow:0 8px 20px rgba(19,27,45,.05);
}

/* Admin notifications: immediatamente visibili ma calme */
.admin-notice-spotlight{
  margin:-2px 0 14px;
  border:1px solid var(--dm-border);
  border-radius:16px;
  background:rgba(255,255,255,.9);
  box-shadow:0 7px 22px rgba(19,27,45,.035);
  overflow:hidden;
}
.admin-notice-spotlight.has-unread{
  border-color:#eadfe4;
  box-shadow:0 7px 22px rgba(19,27,45,.035),inset 3px 0 0 #d68a9f;
}
.admin-notice-head{
  min-height:55px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
}
.admin-notice-symbol{
  width:34px;height:34px;
  flex:0 0 34px;
  display:grid;place-items:center;
  border-radius:10px;
  color:#9a6573;
  background:#faf1f4;
}
.admin-notice-symbol .icon{width:17px;height:17px}
.admin-notice-head strong{display:block;font-size:12px}
.admin-notice-head small{display:block;margin-top:2px;font-size:9.5px;color:var(--dm-muted)}
.admin-notice-items{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  border-top:1px solid #eef0f3;
}
.admin-notice-item{
  min-width:0;
  display:flex;
  align-items:center;
  gap:8px;
  padding:9px 11px;
  border:0;
  border-right:1px solid #eef0f3;
  background:#fbfcfd;
  text-align:left;
  color:inherit;
  cursor:pointer;
}
.admin-notice-item:last-child{border-right:0}
.admin-notice-item:hover{background:#f7f8fa}
.admin-notice-dot{
  width:6px;height:6px;
  border-radius:50%;
  background:#c9ced8;
}
.admin-notice-item.unread .admin-notice-dot{background:#cf6d83}
.admin-notice-item strong{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:9.8px;
}
.admin-notice-item small{font-size:8.5px;color:var(--dm-muted)}
.admin-notice-arrow{color:#98a0af;font-size:12px}
.admin-notice-spotlight.is-clear .admin-notice-symbol{
  color:var(--dm-success);
  background:var(--dm-success-soft);
}

/* Scope bar and report link less dominant */
.admin-scope-bar,.report-link-card{
  box-shadow:0 5px 18px rgba(19,27,45,.025)!important;
  border-color:var(--dm-border)!important;
}
.report-link-card{
  background:rgba(255,255,255,.72)!important;
}
.report-link-card:hover{
  border-color:var(--dm-brand-border)!important;
  background:#fff!important;
}

/* Reports: CTA compatti */
.report-card .btn-primary,.report-hub-card .btn-primary{
  min-width:0!important;
  box-shadow:none!important;
}
.report-card,.report-hub-card{
  border-color:var(--dm-border)!important;
}

/* Teacher cards: azioni più discrete */
.teacher-card .btn-primary,.teacher-card .btn-soft,
.teacher-course .btn-primary,.teacher-course .btn-soft{
  box-shadow:none!important;
}
.teacher-card .btn-danger,.btn-danger{
  background:#f8e8ea!important;
  border-color:#efd6da!important;
  color:#b94c57!important;
  box-shadow:none!important;
}

/* Mobile */
@media(max-width:780px){
  .dm-browser-nav{
    gap:2px;
    margin-right:5px;
    padding-right:5px;
  }
  .dm-browser-nav button{
    width:29px;height:29px;
  }
  .dm-browser-nav button:nth-child(2){display:none}
  .topbar-brand{display:none!important}
  .home-quick-actions{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:6px;
    margin-bottom:13px;
  }
  .home-quick-actions button{
    min-width:0;
    min-height:58px;
    padding:7px 4px;
    flex-direction:column;
    justify-content:center;
    gap:4px;
    border-radius:13px;
  }
  .home-quick-actions button>span{width:27px;height:27px}
  .home-quick-actions button strong{
    width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    font-size:8.5px;
    text-align:center;
  }
  .admin-notice-items{
    display:none;
  }
  .admin-notice-head{
    min-height:58px;
  }
  .admin-notice-head .btn{
    white-space:nowrap;
  }
  .btn{
    min-height:35px!important;
  }
}
@media(max-width:430px){
  .home-quick-actions{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
  .topbar-main{min-width:0}
  .dm-browser-nav{flex:0 0 auto}
}

/* V6.131 alignment + premium calendar */
.empty-state{min-height:110px;display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:22px!important;text-align:center;color:var(--dm-muted)}
.empty-state strong{display:block;color:var(--dm-ink);font-size:12px}.empty-state small{display:block;font-size:10px}
.notification-center-panel .notification-toolbar{min-height:62px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px!important}
.course-list{display:flex;flex-direction:column;gap:9px}.course-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px;min-height:72px;padding:12px 14px;border:1px solid var(--dm-border);border-radius:14px;background:#fff}.course-row-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}.lesson-confirm-state{margin-top:7px}
.field input[type="checkbox"],.field input[type="radio"]{min-height:0!important;width:17px!important;height:17px!important;padding:0!important;box-shadow:none!important;accent-color:var(--dm-brand-solid)}
.teacher-course-choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.teacher-course-choice{min-height:54px;display:flex;align-items:center;gap:9px;padding:9px 11px;border:1px solid var(--dm-border);border-radius:13px;background:#fff;cursor:pointer}.teacher-course-choice.selected{border-color:var(--dm-brand-border);background:var(--dm-brand-soft)}.teacher-course-choice input{position:absolute;opacity:0}.teacher-course-check{width:28px;height:28px;display:grid;place-items:center;border-radius:9px;border:1px solid var(--dm-border);color:transparent;background:#f7f8fa}.teacher-course-choice.selected .teacher-course-check{color:var(--dm-brand-solid);border-color:var(--dm-brand-border);background:#fff}.teacher-course-choice strong{display:block;font-size:11px}.teacher-course-choice small{display:block;margin-top:2px;font-size:9px;color:var(--dm-muted)}
.calendar-hero{margin-bottom:14px!important}.calendar-premium-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:13px;padding:11px 12px;border:1px solid var(--dm-border);border-radius:16px;background:rgba(255,255,255,.88);box-shadow:0 6px 18px rgba(19,27,45,.03)}.calendar-period-block{display:flex;align-items:center;gap:18px}.calendar-nav>div{min-width:145px;text-align:center}.calendar-nav small{display:block;font-size:8px;font-weight:900;letter-spacing:.12em;color:var(--dm-muted)}.calendar-nav strong{display:block;margin-top:2px;font-size:14px}.calendar-arrow{width:31px;height:31px;display:grid;place-items:center;border:1px solid var(--dm-border);border-radius:9px;background:#f8f9fb;color:#5e6677;cursor:pointer;font-size:17px}.calendar-summary{display:flex;gap:10px;color:var(--dm-muted)}.calendar-summary span{display:inline-flex;align-items:center;gap:5px;font-size:9.5px}.calendar-summary .icon{width:14px;height:14px}.calendar-toolbar-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px}.calendar-toolbar-actions .location-filter{margin:0!important;padding:4px 7px!important;min-height:36px;box-shadow:none!important}.calendar-toolbar-actions select{height:36px;min-width:104px;padding:0 30px 0 10px;border:1px solid var(--dm-border);border-radius:10px;background:#fff}
.calendar-scroll-shell{border-radius:18px;box-shadow:0 10px 30px rgba(19,27,45,.04)}.premium-month-calendar{border-radius:18px!important;border-color:var(--dm-border)!important;overflow:hidden}.premium-month-calendar .month-weekday{min-height:38px;display:flex;align-items:center;padding:0 10px;background:#f6f7f9;color:#687184;font-size:9px;letter-spacing:.08em;text-transform:uppercase}.premium-month-calendar .month-day{min-height:128px;padding:8px;background:#fff}.premium-month-calendar .month-day.today{box-shadow:inset 0 0 0 1px var(--dm-brand-border)!important;background:linear-gradient(180deg,var(--dm-brand-soft),#fff 28%)!important}.month-day-top{min-height:25px;display:flex;justify-content:space-between}.month-day-number{width:25px;height:25px;display:grid;place-items:center;margin:0!important;border-radius:8px;font-size:10px;font-weight:900}.month-day.today .month-day-number{color:#fff;background:var(--dm-brand-solid)}.month-day-count{min-width:18px;height:18px;padding:0 5px;display:grid;place-items:center;border-radius:999px;background:#f1f3f6;color:#737c8e;font-size:8px;font-weight:900}
.month-event{position:relative;display:flex;align-items:center;gap:5px;min-height:42px;padding:6px 6px 6px 8px!important;border:1px solid #eceef2;border-left:2px solid var(--dm-brand-border);border-radius:10px!important;background:#fafbfc!important}.month-event.has-override{background:#fffaf3!important;border-color:#f0e2cd!important}.month-event-copy{min-width:0;flex:1}.month-event-copy>div{display:flex;align-items:center;gap:5px}.month-event b{font-size:8.5px;color:var(--dm-brand-solid)}.month-event strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px}.month-event small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:8px!important}.month-event-edit{width:25px;height:25px;display:grid;place-items:center;border:0;border-radius:8px;background:transparent;color:#8c94a3;cursor:pointer;opacity:.25}.month-event:hover .month-event-edit{opacity:1;background:#f0f2f5}.month-event-edit .icon{width:13px;height:13px}
.calendar-day-lesson{min-height:76px;padding:11px 12px!important;border-color:var(--dm-border)!important}.calendar-day-lesson.has-override{border-color:#eadcc8!important;background:#fffdf9!important}.calendar-day-time{min-width:75px!important;color:var(--dm-brand-solid)!important}.calendar-day-time span{display:block;font-size:14px;font-weight:900}.calendar-day-time small{font-size:9px!important}.calendar-lesson-title-line{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.calendar-day-actions{display:flex;gap:6px}
.lesson-edit-summary{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:15px}.lesson-edit-summary>div{padding:11px 12px;border:1px solid var(--dm-border);border-radius:12px;background:#f9fafb}.lesson-edit-summary small{display:block;font-size:8px;font-weight:900;letter-spacing:.09em;color:var(--dm-muted)}.lesson-edit-summary strong{display:block;margin-top:4px;font-size:12px}.lesson-edit-note{display:flex;align-items:flex-start;gap:7px}
@media(max-width:900px){.calendar-premium-toolbar{align-items:flex-start;flex-direction:column}.calendar-toolbar-actions{width:100%;justify-content:flex-start;flex-wrap:wrap}.calendar-scroll-shell{overflow-x:auto;border:1px solid var(--dm-border)}.premium-month-calendar{min-width:780px}}
@media(max-width:700px){.course-row{grid-template-columns:1fr}.course-row-actions{justify-content:flex-start}.teacher-course-choice-grid{grid-template-columns:1fr}.calendar-summary{display:none}.calendar-day-actions{width:100%}.calendar-day-actions .btn{flex:1}.lesson-edit-summary{grid-template-columns:1fr}}


/* =========================================================
   V6.132 — Lesson scope + notification labels
   ========================================================= */

.lesson-apply-scope{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
  margin-bottom:15px;
}
.lesson-scope-option{
  position:relative;
  min-height:76px;
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:11px 12px;
  border:1px solid var(--dm-border);
  border-radius:14px;
  background:#fff;
  cursor:pointer;
  transition:.2s var(--dm-ease);
}
.lesson-scope-option:hover{
  border-color:var(--dm-brand-border);
  background:#fcfcfd;
}
.lesson-scope-option.selected{
  border-color:var(--dm-brand-border);
  background:var(--dm-brand-soft);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 4%,transparent 96%);
}
.lesson-scope-option input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.lesson-scope-icon{
  width:34px;
  height:34px;
  flex:0 0 34px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:#f3f5f8;
  color:#6d7687;
}
.lesson-scope-option.selected .lesson-scope-icon{
  background:#fff;
  color:var(--dm-brand-solid);
}
.lesson-scope-icon .icon{width:16px;height:16px}
.lesson-scope-option strong{
  display:block;
  font-size:11px;
  color:var(--dm-ink);
}
.lesson-scope-option small{
  display:block;
  margin-top:3px;
  font-size:9px;
  line-height:1.4;
  color:var(--dm-muted);
}
.month-event.has-series-change{
  background:#f8fafc!important;
  border-left-color:#7c8798!important;
}
.status.primary{
  color:var(--dm-brand-solid);
  background:var(--dm-brand-soft);
  border:1px solid var(--dm-brand-border);
}

@media(max-width:700px){
  .lesson-apply-scope{grid-template-columns:1fr}
}


/* V6.133 — Spostamento data lezione */
.month-event.is-moved,
.calendar-day-lesson.is-moved{
  border-color:#dce4ee!important;
  background:#f8fbff!important;
}
.lesson-edit-summary strong{
  line-height:1.35;
}
#lessonQuickDate{
  font-variant-numeric:tabular-nums;
}


/* =========================================================
   V6.134 — PREMIUM FINAL VISUAL SYSTEM
   White-label school identity + Dance Manager signature
   ========================================================= */

:root{
  --dm-navy:#10182d;
  --dm-navy-2:#141f3b;
  --dm-canvas:#f5f7fb;
  --dm-card:#ffffff;
  --dm-text:#111a31;
  --dm-text-soft:#66718a;
  --dm-hairline:#e6eaf1;
  --dm-radius-xl:22px;
  --dm-radius-lg:18px;
  --dm-shadow-premium:0 10px 34px rgba(18,31,55,.055);
}

/* Main canvas */
body{
  background:
    radial-gradient(900px 480px at 86% -12%,rgba(var(--primary-rgb),.055),transparent 66%),
    linear-gradient(180deg,#f8f9fc 0%,#f2f5f9 100%)!important;
  color:var(--dm-text);
}
.content{
  max-width:1540px!important;
  padding-top:26px!important;
}

/* PLATFORM BRAND — cleaner / premium */
.dm-brand-lockup{
  display:flex;
  align-items:center;
  gap:10px;
}
.dm-brand-mark{
  width:42px!important;
  height:42px!important;
  padding:0!important;
  border:0!important;
  border-radius:12px!important;
  background:transparent!important;
  box-shadow:none!important;
}
.dm-brand-mark img{
  width:100%!important;
  height:100%!important;
  object-fit:contain!important;
  border-radius:0!important;
}
.dm-brand-copy{line-height:1}
.dm-brand-name{
  font-size:16px!important;
  font-weight:900!important;
  letter-spacing:-.035em!important;
  color:#fff;
}
.dm-brand-name span{color:inherit}
.dm-brand-name strong{
  font-weight:900!important;
  background:linear-gradient(90deg,#ef4ce8,#8d5cff,#44a4ff);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent!important;
}
.dm-brand-tagline{
  margin-top:4px!important;
  font-size:6.8px!important;
  font-weight:800!important;
  letter-spacing:.22em!important;
  color:rgba(255,255,255,.65)!important;
  text-transform:uppercase;
}
.dm-brand-topbar .dm-brand-name{color:var(--dm-text)}
.dm-brand-topbar .dm-brand-tagline{color:#8790a2!important}

/* SIDEBAR */
.shell{grid-template-columns:270px minmax(0,1fr)!important}
.sidebar{
  padding:18px 14px 15px!important;
  background:
    radial-gradient(400px 330px at 10% -8%,rgba(110,77,255,.20),transparent 62%),
    radial-gradient(260px 360px at 96% 100%,rgba(var(--primary-rgb),.12),transparent 72%),
    linear-gradient(180deg,#171d36 0%,#0f1930 100%)!important;
  border-right:0!important;
  box-shadow:12px 0 38px rgba(13,23,43,.07)!important;
}
.sidebar>.dm-brand-lockup{
  min-height:64px;
  padding:8px 12px 14px!important;
}
.school-chip{
  margin:0 4px 12px!important;
  padding:12px!important;
  border-radius:18px!important;
  background:linear-gradient(145deg,rgba(255,255,255,.09),rgba(255,255,255,.045))!important;
  border:1px solid rgba(255,255,255,.09)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035)!important;
}
.school-chip-brand{align-items:center!important;gap:11px!important}
.sidebar-brand{
  width:48px!important;
  height:48px!important;
  border-radius:14px!important;
  border:1px solid rgba(255,255,255,.13)!important;
  background:#fff!important;
}
.school-chip-school-copy{min-width:0}
.school-chip-school-copy>span{
  font-size:8px!important;
  letter-spacing:.12em!important;
  color:#aeb8d0!important;
  text-transform:uppercase;
  font-weight:850;
}
.school-chip-school-copy>strong{
  display:block;
  margin-top:3px;
  max-width:155px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:13.5px!important;
  color:#fff!important;
}
.school-chip-school-copy>small{
  display:block;
  margin-top:4px;
  max-width:158px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#8fa0c4!important;
  font-size:8.5px!important;
}
.secretary-location-context{
  margin-top:10px!important;
  padding-top:10px!important;
}

/* Navigation */
.nav{gap:2px!important}
.nav button{
  min-height:42px!important;
  padding:9px 11px!important;
  border-radius:11px!important;
  font-size:11px!important;
  color:#cbd4e7!important;
}
.nav button .icon{width:18px!important;height:18px!important}
.nav button:hover{
  background:rgba(255,255,255,.055)!important;
  color:#fff!important;
}
.nav button.active{
  background:linear-gradient(90deg,
    rgba(var(--primary-rgb),.34),
    rgba(var(--primary-rgb),.17)
  )!important;
  color:#fff!important;
  box-shadow:
    inset 2px 0 0 color-mix(in srgb,var(--primary) 72%,#fff 28%),
    0 7px 22px rgba(var(--primary-rgb),.08)!important;
}
.sidebar-bottom .user-box{
  border-radius:14px!important;
  background:rgba(255,255,255,.05)!important;
}

/* TOPBAR — white label first */
.topbar{
  height:68px!important;
  padding:0 24px!important;
  background:rgba(255,255,255,.92)!important;
  border-bottom:1px solid #e7eaf0!important;
  box-shadow:0 3px 16px rgba(15,25,45,.025)!important;
}
.topbar-main{gap:8px}
.topbar-brand{
  padding-right:14px;
  border-right:1px solid var(--dm-hairline);
}
.school-topbar-identity{
  display:flex;
  align-items:center;
  gap:9px;
  min-width:0;
}
.school-topbar-logo{
  width:34px!important;
  height:34px!important;
  flex:0 0 34px;
  border-radius:10px!important;
  border:1px solid #e7eaf0;
  background:#fff;
  box-shadow:0 3px 10px rgba(14,23,42,.04);
}
.school-topbar-copy{min-width:0}
.school-topbar-copy strong{
  display:block;
  max-width:175px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:12px;
  color:var(--dm-text);
}
.school-topbar-copy small{
  display:block;
  margin-top:2px;
  font-size:7.5px;
  color:#8a94a8;
  white-space:nowrap;
}
.school-topbar-copy small span{
  font-weight:850;
  color:#68738b;
}
.topbar-title-wrap h2{
  font-size:17px!important;
  letter-spacing:-.03em!important;
}
.topbar-right{gap:7px!important}
.role-badge{
  padding:7px 10px!important;
  border-radius:999px!important;
  font-size:9px!important;
  background:var(--dm-brand-soft)!important;
  border-color:var(--dm-brand-border)!important;
  color:var(--dm-brand-solid)!important;
}

/* HERO — page icon + school logo watermark */
.hero{
  position:relative;
  overflow:hidden;
  min-height:126px!important;
  align-items:center!important;
  margin-bottom:15px!important;
  padding:24px 28px!important;
  border:1px solid rgba(224,228,237,.8);
  border-radius:22px;
  background:
    radial-gradient(520px 180px at 88% 35%,rgba(var(--primary-rgb),.07),transparent 72%),
    linear-gradient(135deg,rgba(255,255,255,.98),rgba(248,249,253,.94));
  box-shadow:0 8px 28px rgba(16,28,49,.035);
}
.hero>div:first-child{
  position:relative;
  z-index:2;
  max-width:720px!important;
}
.hero h1{
  font-size:38px!important;
  font-weight:950!important;
  letter-spacing:-.055em!important;
  color:#111a31!important;
}
.hero p{
  margin-top:3px!important;
  font-size:12px!important;
  color:#71809a!important;
}
.hero .eyebrow{
  margin-bottom:8px!important;
  font-size:8.5px!important;
  letter-spacing:.15em!important;
}
.premium-hero-visual{
  position:absolute;
  inset:0 0 0 auto;
  width:44%;
  pointer-events:none;
  overflow:hidden;
}
.premium-school-watermark{
  position:absolute;
  right:26px;
  top:50%;
  width:min(250px,54%);
  height:min(150px,75%);
  object-fit:contain;
  transform:translateY(-50%) rotate(-2deg);
  opacity:.075;
  filter:saturate(.85) contrast(.85);
}
.premium-page-icon{
  position:absolute;
  right:36px;
  top:50%;
  width:74px;
  height:74px;
  display:grid;
  place-items:center;
  transform:translateY(-50%);
  border-radius:24px;
  color:color-mix(in srgb,var(--primary) 60%,#778399 40%);
  background:rgba(255,255,255,.42);
  border:1px solid rgba(255,255,255,.65);
  box-shadow:0 14px 36px rgba(18,28,49,.04);
  backdrop-filter:blur(10px);
}
.premium-page-icon .icon{width:31px;height:31px}

/* QUICK ACTIONS */
.premium-quick-actions{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:10px!important;
  margin:0 0 14px!important;
}
.premium-quick-actions button{
  position:relative;
  min-height:72px!important;
  padding:10px 13px!important;
  flex-direction:row!important;
  justify-content:flex-start!important;
  gap:10px!important;
  border-radius:16px!important;
  background:#fff!important;
  border:1px solid var(--dm-hairline)!important;
  box-shadow:0 6px 20px rgba(17,29,51,.035)!important;
  text-align:left;
}
.premium-quick-actions button>span{
  width:40px!important;
  height:40px!important;
  flex:0 0 40px;
  border-radius:12px!important;
}
.premium-quick-actions button>div{min-width:0}
.premium-quick-actions button strong{
  display:block;
  font-size:11px!important;
  color:var(--dm-text);
}
.premium-quick-actions button small{
  display:block;
  margin-top:2px;
  max-width:150px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:8.8px;
  color:var(--dm-muted);
}
.premium-quick-actions button>.icon{
  position:absolute;
  right:11px;
  width:14px!important;
  height:14px!important;
  color:#7b879a;
}
.qa-student>span{color:#bd3fd2!important;background:#fbecff!important}
.qa-payment>span{color:#168b68!important;background:#eaf9f3!important}
.qa-receipt>span{color:#c47421!important;background:#fff4e8!important}
.qa-calendar>span,.qa-attendance>span{color:#7650cd!important;background:#f2edff!important}
.qa-students>span{color:#3a86a0!important;background:#edf8fb!important}
.premium-quick-actions button:hover{
  transform:translateY(-2px)!important;
  box-shadow:0 12px 28px rgba(17,29,51,.06)!important;
}

/* ADMIN NOTIFICATION SPOTLIGHT */
.admin-notice-spotlight{
  border-radius:16px!important;
  background:#fff!important;
  border-color:var(--dm-hairline)!important;
  box-shadow:0 6px 20px rgba(17,29,51,.03)!important;
}
.admin-notice-spotlight.has-unread{
  border-color:color-mix(in srgb,var(--primary) 14%,#e5e8ef 86%)!important;
  box-shadow:inset 2px 0 0 color-mix(in srgb,var(--primary) 46%,#fff 54%),0 6px 20px rgba(17,29,51,.03)!important;
}

/* CARDS / PANELS */
.panel,.card,.kpi,.report-card,.report-hub-card,.teacher-course,.table-wrap{
  border:1px solid var(--dm-hairline)!important;
  background:rgba(255,255,255,.97)!important;
  border-radius:18px!important;
  box-shadow:var(--dm-shadow-premium)!important;
}
.kpi{
  min-height:150px!important;
  padding:17px!important;
  overflow:hidden;
  position:relative;
}
.kpi::after{
  content:"";
  position:absolute;
  width:150px;
  height:80px;
  right:-20px;
  top:20px;
  border-radius:50%;
  opacity:.55;
  background:radial-gradient(circle at center,rgba(var(--primary-rgb),.06),transparent 68%);
  pointer-events:none;
}
.kpi strong.value{
  font-size:28px!important;
  letter-spacing:-.04em!important;
}
.dashboard-kpi-action{
  margin-top:auto!important;
  padding-top:10px!important;
  border-top:1px solid #eef0f4;
  font-size:9.5px!important;
}
.panel-head{
  min-height:64px!important;
  padding:14px 17px!important;
}
.panel-head h3{font-size:15px!important}
.panel-body{padding:16px 17px!important}

/* REPORT HUB */
.report-link-card{
  min-height:76px!important;
  border-radius:17px!important;
  background:linear-gradient(135deg,#fff,rgba(var(--primary-rgb),.025))!important;
}
.report-link-icon{
  width:42px!important;
  height:42px!important;
  border-radius:13px!important;
}
.report-link-card h3{font-size:15px!important}

/* FORMS */
.field input,.field select,.field textarea,
.toolbar input,.toolbar select,.calendar-toolbar-actions select{
  border-color:#dfe4ec!important;
  border-radius:12px!important;
  background:#fff!important;
  box-shadow:0 1px 2px rgba(14,24,43,.015)!important;
}
.field input:focus,.field select:focus,.field textarea:focus{
  border-color:color-mix(in srgb,var(--primary) 34%,#d9dee7 66%)!important;
  box-shadow:0 0 0 4px rgba(var(--primary-rgb),.055)!important;
}

/* BUTTONS */
.btn{
  min-height:36px!important;
  border-radius:10px!important;
  font-size:10px!important;
  font-weight:850!important;
}
.btn-primary{
  background:linear-gradient(135deg,
    color-mix(in srgb,var(--primary) 72%,#8158c9 28%),
    color-mix(in srgb,var(--primary) 60%,#7b71e7 40%)
  )!important;
  box-shadow:0 8px 18px rgba(var(--primary-rgb),.14)!important;
}
.btn-soft{
  background:var(--dm-brand-soft)!important;
  color:var(--dm-brand-solid)!important;
  border-color:var(--dm-brand-border)!important;
}
.btn-ghost{
  background:#f5f7fa!important;
  color:#556178!important;
  border-color:#edf0f4!important;
}

/* TABLES */
.table-wrap{overflow:hidden}
th{
  height:40px!important;
  background:#f7f8fb!important;
  color:#748098!important;
}
td{height:50px!important}
tbody tr:hover{background:#fafbfc!important}

/* PREMIUM CALENDAR finishing */
.calendar-premium-toolbar{
  border-radius:16px!important;
  background:#fff!important;
}
.premium-month-calendar .month-day{
  min-height:122px!important;
}
.month-event{
  border-radius:9px!important;
  background:#fafbfc!important;
}
.month-event:hover{
  border-color:var(--dm-brand-border)!important;
  background:#fff!important;
}

/* MODALS */
.modal{
  border-radius:22px!important;
  box-shadow:0 34px 90px rgba(8,17,33,.24)!important;
}
.modal-head{
  min-height:66px!important;
}
.modal-foot{
  background:#fbfcfd!important;
  border-top:1px solid #edf0f4!important;
}

/* TEACHER APP / MOBILE SCHOOL FIRST */
.teacher-head .dm-brand-lockup{
  transform:scale(.94);
  transform-origin:left center;
}
.teacher-course{
  border-radius:18px!important;
}
.teacher-student-row{
  box-shadow:0 5px 16px rgba(16,28,48,.035)!important;
}

/* MOBILE */
@media(max-width:780px){
  .shell{display:block!important}
  .topbar{
    height:68px!important;
    padding:0 11px!important;
  }
  .topbar-brand{display:none!important}
  .mobile-school-brand{
    display:flex!important;
    align-items:center;
    gap:8px;
    max-width:180px;
  }
  .mobile-school-brand .school-brand-logo{
    width:34px!important;height:34px!important;border-radius:10px!important;
  }
  .mobile-school-brand strong{
    max-width:130px!important;
    font-size:11px!important;
  }
  .mobile-school-brand small{
    font-size:7.5px!important;
    color:#8390a5!important;
  }
  .content{
    padding:14px 10px calc(88px + env(safe-area-inset-bottom))!important;
  }
  .hero{
    min-height:116px!important;
    padding:18px 16px!important;
    border-radius:18px!important;
  }
  .hero h1{font-size:28px!important}
  .hero p{font-size:10.5px!important;max-width:74%}
  .premium-hero-visual{width:42%}
  .premium-school-watermark{
    right:4px;
    width:95%;
    height:75%;
    opacity:.055;
  }
  .premium-page-icon{
    right:12px;
    width:48px;height:48px;border-radius:16px;
  }
  .premium-page-icon .icon{width:22px;height:22px}
  .premium-quick-actions{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
  }
  .premium-quick-actions button{
    min-height:65px!important;
    padding:9px!important;
  }
  .premium-quick-actions button>span{
    width:34px!important;height:34px!important;flex-basis:34px;
  }
  .premium-quick-actions button strong{font-size:9.5px!important}
  .premium-quick-actions button small{font-size:7.8px!important;max-width:112px}
  .premium-quick-actions button>.icon{right:7px}
  .kpi{min-height:126px!important}
  .mobile-nav{
    border-radius:18px!important;
    box-shadow:0 14px 38px rgba(11,22,42,.14)!important;
  }
}

@media(max-width:430px){
  .hero h1{font-size:26px!important}
  .hero p{max-width:70%}
  .premium-page-icon{display:none}
  .premium-school-watermark{width:90%;opacity:.045}
}


/* =========================================================
   V6.135 — CONCEPT PARITY
   Target: match approved concept as closely as possible
   ========================================================= */

:root{
  --cp-navy:#111a31;
  --cp-sidebar:#111b34;
  --cp-surface:#ffffff;
  --cp-bg:#f6f8fc;
  --cp-line:#e7ebf2;
  --cp-soft:#f8f9fc;
  --cp-text:#11192d;
  --cp-muted:#73809a;
  --cp-pink:#d946ef;
  --cp-purple:#7c3aed;
  --cp-shadow:0 8px 26px rgba(20,32,56,.055);
}

/* shell proportions closer to concept */
.shell{grid-template-columns:230px minmax(0,1fr)!important}
.sidebar{
  padding:12px 10px 14px!important;
  background:
    radial-gradient(300px 280px at 8% -5%,rgba(124,58,237,.18),transparent 65%),
    radial-gradient(200px 260px at 100% 100%,rgba(217,70,239,.12),transparent 72%),
    linear-gradient(180deg,#151d38 0%,#0f1930 100%)!important;
}
.main{background:transparent!important}
.content{
  max-width:none!important;
  padding:18px 20px 34px!important;
}

/* logo / sidebar */
.sidebar>.dm-brand-lockup{
  min-height:54px!important;
  padding:4px 8px 10px!important;
}
.sidebar .dm-brand-mark{width:34px!important;height:34px!important}
.sidebar .dm-brand-name{font-size:13px!important}
.sidebar .dm-brand-tagline{font-size:5.7px!important}
.school-chip{
  margin:0 3px 10px!important;
  padding:10px!important;
  border-radius:14px!important;
}
.sidebar-brand{
  width:42px!important;height:42px!important;border-radius:12px!important;
}
.school-chip-school-copy>strong{font-size:12px!important}
.school-chip-school-copy>small{font-size:7.8px!important}

.nav{gap:0!important;padding:0 2px!important}
.nav button{
  min-height:38px!important;
  padding:8px 10px!important;
  border-radius:9px!important;
  font-size:10.5px!important;
  gap:10px!important;
}
.nav button .icon{width:17px!important;height:17px!important;stroke-width:1.8}
.nav button.active{
  background:linear-gradient(90deg,rgba(var(--primary-rgb),.34),rgba(111,64,184,.28))!important;
  box-shadow:inset 2px 0 0 #ef4fe7,0 7px 18px rgba(74,40,137,.14)!important;
}
.nav-divider{margin:8px 8px!important}

/* topbar exactly more like concept */
.topbar{
  height:54px!important;
  padding:0 18px!important;
  background:rgba(255,255,255,.95)!important;
  border-bottom:1px solid #e9ecf2!important;
  box-shadow:0 2px 10px rgba(16,26,47,.025)!important;
}
.dm-browser-nav{gap:2px!important;margin-right:8px!important;padding-right:8px!important}
.dm-browser-nav button{width:28px!important;height:28px!important;border-radius:8px!important}
.topbar-brand{padding-right:12px!important}
.dm-brand-topbar .dm-brand-mark{width:31px!important;height:31px!important}
.dm-brand-topbar .dm-brand-name{font-size:12.5px!important}
.dm-brand-topbar .dm-brand-tagline{display:none!important}
.topbar-title-wrap h2{font-size:16px!important}
.topbar-right{gap:6px!important}
.topbar-scope-chip{
  min-height:32px!important;
  padding:5px 9px!important;
  border-radius:9px!important;
  box-shadow:none!important;
}
.topbar-notification-btn{width:32px!important;height:32px!important;border-radius:9px!important}
.role-badge{padding:6px 9px!important;font-size:8.5px!important}

/* page top: concept uses an open hero, not a card */
.hero{
  min-height:104px!important;
  margin:0 0 10px!important;
  padding:22px 12px 14px!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  overflow:visible!important;
}
.hero h1{
  font-size:34px!important;
  line-height:1!important;
  letter-spacing:-.055em!important;
  margin-bottom:6px!important;
}
.hero p{font-size:11.5px!important;color:#6f7d97!important}
.hero .eyebrow{font-size:8px!important;margin-bottom:7px!important}
.premium-hero-visual{
  width:38%!important;
  height:110px!important;
  top:0!important;
  right:0!important;
  overflow:hidden!important;
}
.premium-school-watermark{
  right:20px!important;
  width:230px!important;
  height:110px!important;
  opacity:.055!important;
  filter:saturate(.7) contrast(.8)!important;
}
.premium-page-icon{
  width:50px!important;height:50px!important;
  right:26px!important;border-radius:16px!important;
  opacity:.9;
}
.premium-page-icon .icon{width:22px!important;height:22px!important}

/* quick actions */
.premium-quick-actions{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:8px!important;
  margin:0 0 9px!important;
}
.premium-quick-actions button{
  min-height:58px!important;
  padding:8px 10px!important;
  border-radius:12px!important;
  box-shadow:0 4px 14px rgba(20,32,56,.035)!important;
}
.premium-quick-actions button>span{
  width:34px!important;height:34px!important;flex-basis:34px!important;
  border-radius:10px!important;
}
.premium-quick-actions button strong{font-size:10px!important}
.premium-quick-actions button small{font-size:8px!important}
.premium-quick-actions button>.icon{width:12px!important;height:12px!important}

/* notification strip */
.admin-notice-spotlight{
  margin:0 0 9px!important;
  border-radius:12px!important;
  box-shadow:none!important;
}
.admin-notice-head{
  min-height:48px!important;
  padding:8px 10px!important;
}
.admin-notice-symbol{
  width:32px!important;height:32px!important;flex-basis:32px!important;border-radius:9px!important;
}
.admin-notice-head strong{font-size:10.5px!important}
.admin-notice-head small{font-size:8px!important}

/* scope bar */
.admin-scope-bar{
  min-height:50px!important;
  margin-bottom:9px!important;
  padding:8px 10px!important;
  border-radius:12px!important;
  background:#fff!important;
}
.admin-scope-bar select{height:34px!important;border-radius:9px!important}

/* KPI row like concept */
.admin-ops-kpis{
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:8px!important;
  margin-bottom:9px!important;
}
.kpi{
  min-height:135px!important;
  padding:13px!important;
  border-radius:13px!important;
  box-shadow:0 5px 16px rgba(20,32,56,.04)!important;
}
.kpi-head .label{font-size:8px!important}
.kpi-icon{width:32px!important;height:32px!important;border-radius:10px!important}
.kpi-icon .icon{width:16px!important;height:16px!important}
.kpi strong.value{font-size:25px!important;margin-top:12px!important}
.kpi small{font-size:8.5px!important}
.dashboard-kpi-action{
  padding-top:8px!important;
  font-size:8.5px!important;
}

/* report center compact grid like concept */
.report-link-card{
  min-height:70px!important;
  margin-bottom:10px!important;
  padding:10px 12px!important;
  border-radius:14px!important;
}
.report-link-icon{width:36px!important;height:36px!important;border-radius:11px!important}
.report-link-card h3{font-size:14px!important;margin:0!important}
.report-link-card p{font-size:8.5px!important;margin-top:2px!important}
.report-link-card .eyebrow{font-size:7px!important}
.report-link-arrow{font-size:16px!important}

/* lower dashboard sections visually quieter */
.admin-quick-strip{display:none!important}
.grid-2,.grid-equal{gap:10px!important;margin-bottom:10px!important}
.panel{border-radius:14px!important;box-shadow:0 5px 16px rgba(20,32,56,.035)!important}
.panel-head{min-height:52px!important;padding:11px 13px!important}
.panel-head h3{font-size:13px!important}
.panel-sub{font-size:8.5px!important}
.panel-body{padding:12px 13px!important}

/* student page */
.toolbar{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  margin-bottom:10px!important;
}
.toolbar input,.toolbar select{
  min-height:38px!important;
  height:38px!important;
  border-radius:10px!important;
  font-size:10px!important;
}
.toolbar input{max-width:300px!important}
.toolbar select{max-width:180px!important}
.students-table-wrap{
  border-radius:13px!important;
  box-shadow:0 5px 16px rgba(20,32,56,.035)!important;
}
.students-table-wrap table{min-width:1020px!important}
.students-table-wrap th{
  height:36px!important;
  font-size:7.3px!important;
  letter-spacing:.08em!important;
  padding:9px 11px!important;
}
.students-table-wrap td{
  height:54px!important;
  padding:9px 11px!important;
  font-size:9.5px!important;
}
.student-table-person{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:150px;
}
.student-table-avatar{
  width:32px;height:32px;flex:0 0 32px;
  display:grid;place-items:center;
  border-radius:50%;
  background:linear-gradient(145deg,#f9e6fb,#f1f5ff);
  color:#b83bd2;
  font-size:9px;
  font-weight:900;
}
.student-name-link{
  font-size:9.7px!important;
  font-weight:850!important;
}
.student-table-person small{display:block;margin-top:2px;font-size:7.5px!important}
.amount-ok{color:#169765}.amount-due{color:#df4855}
.concept-row-actions{gap:4px!important}
.concept-row-actions .icon-btn{
  width:28px!important;height:28px!important;border-radius:8px!important;
}
.concept-row-actions .icon-btn .icon{width:14px!important;height:14px!important}
.tag,.status{font-size:7.5px!important;padding:4px 6px!important}

/* reports */
.report-card,.report-hub-card{
  border-radius:14px!important;
  min-height:180px!important;
}
.report-card .panel-head,.report-hub-card .panel-head{padding:12px 14px!important}
.report-card .panel-body,.report-hub-card .panel-body{padding:12px 14px!important}
.report-card .btn,.report-hub-card .btn{min-height:34px!important}

/* calendar like concept */
.calendar-hero{min-height:92px!important}
.calendar-premium-toolbar{
  min-height:50px!important;
  margin-bottom:8px!important;
  padding:7px 8px!important;
  border-radius:12px!important;
}
.calendar-nav>div{min-width:120px!important}
.calendar-nav strong{font-size:11.5px!important}
.calendar-arrow{width:28px!important;height:28px!important}
.calendar-toolbar-actions select{height:32px!important;min-width:94px!important;font-size:9px!important}
.premium-month-calendar{
  border-radius:12px!important;
}
.premium-month-calendar .month-weekday{
  min-height:32px!important;
  font-size:7.5px!important;
}
.premium-month-calendar .month-day{
  min-height:104px!important;
  padding:6px!important;
}
.month-day-number{width:21px!important;height:21px!important;font-size:8.5px!important}
.month-event{
  min-height:34px!important;
  padding:5px 5px 5px 6px!important;
  border-radius:7px!important;
}
.month-event b{font-size:7.5px!important}
.month-event strong{font-size:8px!important}
.month-event small{font-size:7px!important}

/* side sheet editor exactly like concept */
.modal.concept-side-sheet{
  position:fixed!important;
  top:68px!important;
  right:12px!important;
  bottom:12px!important;
  width:min(390px,calc(100vw - 24px))!important;
  max-width:none!important;
  max-height:none!important;
  border-radius:18px!important;
  margin:0!important;
  display:flex!important;
  flex-direction:column!important;
  animation:conceptSheetIn .28s cubic-bezier(.22,1,.36,1) both!important;
}
.modal.concept-side-sheet .modal-head{
  flex:0 0 auto;
  padding:13px 15px!important;
}
.modal.concept-side-sheet .modal-body{
  flex:1 1 auto;
  overflow:auto;
  padding:14px 15px!important;
}
.modal.concept-side-sheet .modal-foot{
  flex:0 0 auto;
  padding:10px 14px!important;
}
.modal.concept-side-sheet .lesson-edit-summary{
  grid-template-columns:1fr!important;
  gap:6px!important;
}
.modal.concept-side-sheet .lesson-apply-scope{
  grid-template-columns:1fr!important;
  gap:7px!important;
}
.modal.concept-side-sheet .lesson-scope-option{
  min-height:60px!important;
  padding:9px 10px!important;
}
.modal.concept-side-sheet .form-grid{grid-template-columns:1fr!important}
.modal.concept-side-sheet .field.span-2{grid-column:auto!important}
@keyframes conceptSheetIn{
  from{opacity:0;transform:translateX(24px)}
  to{opacity:1;transform:translateX(0)}
}

/* all modals / submenus closer to concept */
.modal{
  border-radius:16px!important;
  border:1px solid #edf0f5!important;
}
.modal-head{
  min-height:56px!important;
  padding:12px 14px!important;
}
.modal-head strong{font-size:15px!important}
.modal-body{padding:14px!important}
.modal-foot{min-height:54px!important;padding:9px 13px!important}

/* buttons / controls */
.btn{
  min-height:32px!important;
  padding:6px 9px!important;
  border-radius:9px!important;
  font-size:9px!important;
}
.btn .icon{width:13px!important;height:13px!important}
.icon-btn{width:30px!important;height:30px!important;border-radius:9px!important}

/* mobile teacher / course list like concept */
.teacher-student-row{
  min-height:58px!important;
  border-radius:12px!important;
  padding:7px 8px!important;
  box-shadow:0 3px 12px rgba(20,32,56,.035)!important;
}
.teacher-student-avatar{
  width:33px!important;height:33px!important;flex-basis:33px!important;border-radius:10px!important;
}
.teacher-student-name-line strong{font-size:11px!important}
.teacher-edit-action{width:32px!important;height:32px!important;min-height:32px!important;border-radius:9px!important}

/* mobile */
@media(max-width:780px){
  .content{padding:12px 8px calc(78px + env(safe-area-inset-bottom))!important}
  .topbar{height:58px!important;padding:0 9px!important}
  .hero{
    min-height:94px!important;
    padding:16px 10px 10px!important;
  }
  .hero h1{font-size:26px!important}
  .hero p{font-size:9.5px!important;max-width:78%!important}
  .premium-page-icon{display:none!important}
  .premium-school-watermark{width:150px!important;height:85px!important;right:2px!important;opacity:.04!important}

  .premium-quick-actions{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:6px!important;
  }
  .premium-quick-actions button{
    min-height:56px!important;
  }

  .admin-ops-kpis{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .kpi{min-height:116px!important}

  .modal.concept-side-sheet{
    top:58px!important;
    right:5px!important;
    bottom:5px!important;
    width:calc(100vw - 10px)!important;
    border-radius:16px!important;
  }

  .mobile-nav{
    left:8px!important;right:8px!important;bottom:8px!important;
    height:58px!important;border-radius:17px!important;
  }
}

/* prevent over-coloring: school color is accent only */
.card,.panel,.table-wrap,.report-card,.report-hub-card,.teacher-course,.modal{
  background:#fff!important;
}


/* =========================================================
   V6.136 — FULL CONCEPT IMPLEMENTATION
   ========================================================= */

/* visible wave hero, not washed out */
.hero,
.page-head{
  position:relative;
}
.hero::before,
.notification-hero::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(340px 110px at 72% 22%,rgba(233,91,236,.12),transparent 70%),
    radial-gradient(360px 130px at 88% 36%,rgba(87,147,255,.11),transparent 72%),
    linear-gradient(140deg,transparent 52%,rgba(172,119,255,.05) 53%,transparent 69%);
  opacity:1;
}
.premium-school-watermark{
  opacity:.13!important;
  filter:saturate(.9) contrast(.95)!important;
}
.premium-page-icon{
  opacity:1!important;
  background:rgba(255,255,255,.82)!important;
  box-shadow:0 10px 26px rgba(33,47,72,.08)!important;
}

/* date card dashboard */
.dashboard-date-card{
  position:relative;
  z-index:3;
  min-width:190px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid #e8ebf2;
  border-radius:14px;
  background:rgba(255,255,255,.86);
  box-shadow:0 7px 20px rgba(20,32,56,.045);
}
.dashboard-date-card>.icon{
  width:28px;height:28px;
  padding:6px;
  border-radius:9px;
  color:#cf2bc7;
  background:#fcedfb;
}
.dashboard-date-card small{
  display:block;
  text-transform:capitalize;
  font-size:8px;
  color:#78859b;
}
.dashboard-date-card strong{
  display:block;
  margin-top:2px;
  text-transform:capitalize;
  font-size:11px;
}

/* notification page */
.concept-notification-kpis{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin:0 0 10px;
}
.notification-kpi-card{
  min-height:112px;
  display:flex;
  align-items:center;
  gap:14px;
  padding:14px 16px;
  border:1px solid #e6eaf1;
  border-radius:15px;
  background:#fff;
  box-shadow:0 6px 18px rgba(20,32,56,.04);
}
.notification-kpi-card>.icon{
  width:44px;height:44px;
  padding:11px;
  border-radius:13px;
}
.notification-kpi-card.pink>.icon{color:#d82ac8;background:#fcedfb}
.notification-kpi-card.orange>.icon{color:#df7617;background:#fff3e7}
.notification-kpi-card.green>.icon{color:#159768;background:#eaf9f3}
.notification-kpi-card small{display:block;font-size:7.5px;letter-spacing:.12em;font-weight:900;color:#71809a}
.notification-kpi-card strong{display:block;font-size:25px;line-height:1;margin-top:5px}
.notification-kpi-card span{display:block;margin-top:4px;font-size:8.5px;color:#7b879d}
.concept-notification-toolbar{
  display:grid!important;
  grid-template-columns:minmax(280px,1fr) auto!important;
  gap:10px!important;
  padding:0!important;
  margin-bottom:10px;
  background:transparent!important;
}
.notification-search{
  min-height:42px;
  border:1px solid #e3e7ef;
  border-radius:11px;
  background:#fff;
}
.notification-search input{height:40px!important;border:0!important;box-shadow:none!important}
.notification-filters{
  display:flex!important;
  gap:6px!important;
  background:transparent!important;
}
.notification-filters button{
  min-height:40px!important;
  padding:7px 12px!important;
  border:1px solid #e3e7ef!important;
  border-radius:11px!important;
  background:#fff!important;
  font-size:9px!important;
}
.notification-filters button.active{
  border-color:#eb49d4!important;
  background:#fff5fd!important;
  color:#c82abb!important;
  box-shadow:0 0 0 2px rgba(232,73,211,.05);
}
.concept-notification-list{
  display:flex!important;
  flex-direction:column;
  gap:6px;
  min-height:100px;
}
.notification-full-item{
  min-height:62px!important;
  display:grid!important;
  grid-template-columns:40px 8px minmax(0,1fr) 18px!important;
  align-items:center!important;
  gap:10px!important;
  padding:9px 12px!important;
  border:1px solid #e6eaf1!important;
  border-radius:12px!important;
  background:#fff!important;
}
.notification-full-item.unread{
  background:linear-gradient(90deg,#fff8fd,#fff)!important;
  border-color:#efd8ea!important;
}
.notification-full-icon{
  width:38px!important;height:38px!important;
  border-radius:11px!important;
}
.notification-dot{width:7px;height:7px;border-radius:50%;background:#bcc5d6}
.notification-dot.unread{background:#ee2b99}
.notification-item-top{align-items:flex-start!important}
.notification-item-top strong{font-size:10.5px!important}
.notification-item-top p{margin:2px 0 0!important;font-size:8.5px!important;color:#6f7c93!important}
.notification-item-top small{font-size:8px!important}
.notification-item-foot{margin-top:4px!important}
.notification-origin{
  display:inline-flex;
  padding:4px 8px;
  border-radius:999px;
  font-size:7.5px;
  color:#7a3de8;
  background:#f4efff;
}
.notification-chevron .icon{width:13px;height:13px;color:#8090a8}

/* students */
.student-summary-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:9px;
  margin-bottom:10px;
}
.student-summary-card{
  min-height:74px;
  display:flex;
  align-items:center;
  gap:11px;
  padding:11px 13px;
  border:1px solid #e5e9f0;
  border-radius:13px;
  background:#fff;
  box-shadow:0 5px 15px rgba(20,32,56,.035);
}
.student-summary-card>.icon{
  width:34px;height:34px;padding:8px;border-radius:10px;
}
.student-summary-card.violet>.icon{color:#7b43e2;background:#f2edff}
.student-summary-card.green>.icon{color:#159768;background:#eaf9f3}
.student-summary-card.orange>.icon{color:#d77518;background:#fff1e3}
.student-summary-card.red>.icon{color:#dc3a5f;background:#fff0f4}
.student-summary-card strong{display:block;font-size:19px;line-height:1}
.student-summary-card small{display:block;margin-top:4px;font-size:8.5px;color:#738098}
.students-toolbar{
  display:grid!important;
  grid-template-columns:minmax(260px,1.3fr) minmax(140px,.6fr) minmax(140px,.6fr) auto!important;
}
.search-box{
  display:flex;
  align-items:center;
  gap:7px;
  padding:0 10px;
  border:1px solid #e0e5ed;
  border-radius:10px;
  background:#fff;
}
.search-box>.icon{width:16px;height:16px;color:#75839b}
.search-box input{
  width:100%!important;
  max-width:none!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
.students-clear-filters{white-space:nowrap}
.students-table-wrap td{vertical-align:middle!important}
.student-table-footer{
  display:flex;
  justify-content:space-between;
  padding:8px 4px;
  font-size:8.5px;
  color:var(--dm-muted);
}

/* course cards */
.course-location-filter{max-width:320px;margin-bottom:10px}
.concept-course-grid{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:10px!important;
}
.concept-course-card{
  position:relative;
  overflow:hidden;
  min-height:250px;
  padding:14px!important;
  border-radius:15px!important;
}
.concept-course-card-head{
  display:flex;
  align-items:center;
  gap:10px;
  position:relative;
  z-index:2;
}
.course-discipline-icon{
  width:50px;height:50px;
  display:grid;place-items:center;
  border-radius:13px;
}
.course-discipline-icon .icon{width:25px;height:25px}
.concept-course-card h3{font-size:17px!important;margin:0!important}
.concept-course-card-head p{margin:2px 0 0!important;font-size:9px!important}
.course-art-wave{
  position:absolute;
  right:-18px;top:74px;
  width:180px;height:75px;
  border-radius:50%;
  opacity:.55;
  filter:blur(1px);
}
.tone-violet .course-discipline-icon{color:#8544e9;background:#f2ebff}
.tone-violet .course-art-wave{background:radial-gradient(circle at 20% 50%,#ead9ff,transparent 70%)}
.tone-orange .course-discipline-icon{color:#e4761c;background:#fff0e5}
.tone-orange .course-art-wave{background:radial-gradient(circle at 20% 50%,#ffe1c8,transparent 70%)}
.tone-green .course-discipline-icon{color:#15a77a;background:#e9fbf5}
.tone-green .course-art-wave{background:radial-gradient(circle at 20% 50%,#caf7e9,transparent 70%)}
.tone-blue .course-discipline-icon{color:#3d8ee7;background:#ebf5ff}
.tone-blue .course-art-wave{background:radial-gradient(circle at 20% 50%,#d3e9ff,transparent 70%)}
.tone-pink .course-discipline-icon{color:#df2f9f;background:#fdebf7}
.tone-pink .course-art-wave{background:radial-gradient(circle at 20% 50%,#f9d5ec,transparent 70%)}
.course-card-meta{
  position:relative;
  z-index:2;
  display:grid;
  gap:9px;
  margin-top:18px;
}
.course-card-meta>div{
  display:flex;
  align-items:center;
  gap:8px;
}
.course-card-meta .icon{width:15px;height:15px;color:#c52cc4}
.course-card-meta strong{display:block;font-size:9.8px}
.course-card-meta small{display:block;font-size:8px;color:#768399;margin-top:1px}
.course-card-students{
  position:absolute!important;
  right:6px;bottom:0;
  display:grid!important;
  grid-template-columns:18px auto!important;
  gap:2px 6px!important;
}
.course-card-students strong{font-size:20px!important}
.course-card-students small{grid-column:2;font-size:7.5px!important}
.course-card-actions{
  position:absolute;
  left:14px;right:14px;bottom:12px;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:6px;
}
.course-card-actions .btn{justify-content:center}

/* attendance */
.attendance-date-card{
  min-height:72px;
  display:grid;
  grid-template-columns:44px minmax(0,1fr) 170px auto;
  align-items:center;
  gap:12px;
  padding:11px 14px;
  margin-bottom:10px;
  border:1px solid #e5e9f0;
  border-radius:14px;
  background:#fff;
  box-shadow:0 5px 15px rgba(20,32,56,.035);
}
.attendance-date-icon{
  width:42px;height:42px;display:grid;place-items:center;border-radius:12px;
  color:#d52ac6;background:#fcedfb;
}
.attendance-date-icon .icon{width:20px;height:20px}
.attendance-date-card strong{display:block;font-size:12px}
.attendance-date-card small{display:block;margin-top:2px;font-size:8.5px;color:#728099}
.attendance-date-card input{
  min-height:38px;border:1px solid #dfe4ec;border-radius:10px;padding:0 10px;
}
.attendance-lessons-card{
  padding:14px;
  border:1px solid #e5e9f0;
  border-radius:14px;
  background:#fff;
  box-shadow:0 5px 15px rgba(20,32,56,.035);
}
.attendance-lessons-head{
  display:flex;align-items:center;gap:10px;margin-bottom:10px;
}
.attendance-lessons-head>.icon{
  width:38px;height:38px;padding:9px;border-radius:11px;color:#8245e6;background:#f2edff;
}
.attendance-lessons-head h3{margin:0;font-size:14px}
.attendance-lessons-head small{font-size:8.5px;color:var(--dm-muted)}
.attendance-course-list{display:flex;flex-direction:column;gap:7px}
.attendance-course-row{
  min-height:72px;
  display:grid;
  grid-template-columns:44px minmax(200px,1fr) auto auto;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  border:1px solid #e7eaf0;
  border-radius:12px;
  background:#fff;
}
.attendance-course-icon{
  width:42px;height:42px;display:grid;place-items:center;border-radius:12px;
  color:#d72bbf;background:#fdecf9;
}
.attendance-course-meta{
  display:flex;align-items:center;gap:7px;margin-top:4px;font-size:8.5px;color:#6f7d95;
}
.attendance-course-meta .icon{width:13px;height:13px}
.attendance-course-meta span{width:1px;height:14px;background:#e3e7ed}

/* calendar refinements */
.calendar-premium-toolbar{
  min-height:64px!important;
  padding:9px 12px!important;
}
.calendar-period-block{gap:14px!important}
.calendar-summary{gap:14px!important}
.premium-month-calendar .month-day{min-height:112px!important}
.month-event{
  border-left:3px solid #ec3aa7!important;
  background:#fff!important;
}
.month-event b{color:#df2d93!important}
.month-day.today{
  background:linear-gradient(180deg,#fff4fb,#fff 35%)!important;
}
.month-day.today .month-day-number{
  background:#c7298f!important;
}

/* Sidebar closer to approved concept */
.sidebar{
  background:
    radial-gradient(330px 300px at 0% -8%,rgba(70,90,255,.16),transparent 60%),
    radial-gradient(240px 380px at 100% 100%,rgba(127,34,242,.30),transparent 68%),
    linear-gradient(180deg,#111a34 0%,#101a32 100%)!important;
}
.nav button .icon{
  color:#d8a0ff;
}
.nav button.active .icon{color:#fff}
.nav button.active{
  background:linear-gradient(90deg,#bc08e7 0%,#6d268d 58%,rgba(95,64,151,.75) 100%)!important;
  box-shadow:0 8px 24px rgba(160,30,211,.20)!important;
}

/* Mobile */
@media(max-width:980px){
  .concept-course-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:780px){
  .dashboard-date-card{display:none}
  .concept-notification-kpis{grid-template-columns:1fr!important}
  .concept-notification-toolbar{grid-template-columns:1fr!important}
  .notification-filters{overflow-x:auto}
  .student-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .students-toolbar{grid-template-columns:1fr 1fr!important}
  .students-toolbar .search-box{grid-column:1/-1}
  .students-clear-filters{grid-column:1/-1}
  .concept-course-grid{grid-template-columns:1fr!important}
  .attendance-date-card{grid-template-columns:42px 1fr!important}
  .attendance-date-card input,.attendance-date-card .btn{grid-column:2}
  .attendance-course-row{grid-template-columns:40px 1fr!important}
  .attendance-course-row>.status,.attendance-course-row>.course-row-actions{grid-column:2}
}


/* =========================================================
   V6.137 — FINAL ALIGNMENT PASS
   Exact header rhythm + page consistency
   ========================================================= */

/* Main content width and left alignment */
.main{
  min-width:0;
}
.content{
  width:100%!important;
  padding-left:24px!important;
  padding-right:24px!important;
}

/* Every top page header follows the same baseline */
.concept-page-header{
  min-height:126px!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:18px!important;
  padding:24px 18px 18px!important;
  margin-bottom:12px!important;
}

.concept-page-header>div:first-child{
  min-width:0;
  max-width:780px!important;
  padding-left:0!important;
}

.concept-page-header .eyebrow{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  margin:0 0 8px!important;
  line-height:1!important;
}

.concept-page-header .eyebrow::before{
  content:"";
  width:14px;
  height:2px;
  flex:0 0 14px;
  border-radius:999px;
  background:linear-gradient(90deg,#ff2fa4,#b63cff);
}

.concept-page-header h1{
  margin:0!important;
  line-height:.98!important;
}

.concept-page-header p{
  margin:8px 0 0!important;
  line-height:1.45!important;
  max-width:760px;
}

.concept-header-actions,
.hero-actions{
  position:relative!important;
  z-index:4!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:8px!important;
  align-self:center!important;
  margin:0!important;
}

.concept-header-actions .btn,
.hero-actions .btn{
  min-height:42px!important;
  padding:9px 14px!important;
  border-radius:11px!important;
  white-space:nowrap;
}

.concept-header-actions .icon-btn,
.hero-actions .icon-btn{
  width:42px!important;
  height:42px!important;
  border-radius:11px!important;
}

/* Watermark/icon must never overlap actions */
.premium-hero-visual{
  z-index:0!important;
  width:45%!important;
}
.premium-school-watermark{
  right:88px!important;
  width:220px!important;
  opacity:.095!important;
}
.premium-page-icon{
  right:18px!important;
  top:50%!important;
  z-index:1!important;
}

/* On pages with a right CTA, leave protected room */
.concept-page-header:has(.concept-header-actions) .premium-page-icon,
.concept-page-header:has(.hero-actions) .premium-page-icon{
  right:200px!important;
}
.concept-page-header:has(.concept-header-actions) .premium-school-watermark,
.concept-page-header:has(.hero-actions) .premium-school-watermark{
  right:250px!important;
}

/* Dashboard date card aligned exactly with title block */
.dashboard-hero .dashboard-date-card{
  align-self:center!important;
  margin:0!important;
}

/* Allievi / Corsi / Calendario hero actions */
.students-hero,
.courses-hero,
.calendar-hero{
  grid-template-columns:minmax(0,1fr) auto!important;
}
.students-hero .hero-actions,
.courses-hero>button,
.calendar-hero>button{
  justify-self:end!important;
}

/* Controls under header start on same x-coordinate */
.students-toolbar,
.student-summary-grid,
.concept-notification-kpis,
.concept-notification-toolbar,
.course-location-filter,
.calendar-premium-toolbar,
.attendance-date-card{
  margin-left:0!important;
  margin-right:0!important;
}

/* Allievi */
.student-summary-grid{
  align-items:stretch;
}
.student-summary-card{
  min-height:78px!important;
}
.students-toolbar{
  min-height:44px;
  align-items:center!important;
}
.students-toolbar select,
.students-toolbar .search-box{
  height:42px!important;
}
.students-toolbar .students-clear-filters{
  justify-self:end!important;
}
.students-table-wrap{
  margin-top:0!important;
}

/* Corsi */
.concept-under-header-filter{
  display:flex;
  align-items:center;
  min-height:54px;
  max-width:330px!important;
  margin-bottom:14px!important;
}
.concept-under-header-filter .location-filter{
  width:100%!important;
  margin:0!important;
}
.concept-course-grid{
  align-items:stretch;
}
.concept-course-card{
  height:100%;
}

/* Presenze */
.attendance-hero{
  margin-bottom:10px!important;
}
.attendance-date-card{
  margin-top:0!important;
}
.attendance-lessons-card{
  margin-top:10px!important;
}

/* Calendario */
.calendar-hero{
  margin-bottom:10px!important;
}
.calendar-premium-toolbar{
  min-height:66px!important;
  margin-top:0!important;
}
.calendar-period-block{
  min-width:0;
}
.calendar-toolbar-actions{
  margin-left:auto;
}
.calendar-toolbar-actions>*{
  flex:0 0 auto;
}

/* Notifiche */
.notification-hero{
  margin-bottom:10px!important;
}
.concept-notification-kpis{
  margin-top:0!important;
}
.notification-full-item{
  grid-template-columns:40px 8px minmax(0,1fr) auto 18px!important;
}
.notification-item-top{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:10px!important;
}
.notification-item-foot{
  min-height:26px;
  align-items:center!important;
}

/* Sidebar logo cards: same vertical rhythm */
.sidebar>.dm-brand-lockup{
  margin-bottom:4px!important;
}
.school-chip{
  margin-top:0!important;
}
.nav{
  margin-top:7px!important;
}

/* Topbar alignment */
.topbar{
  display:flex!important;
  align-items:center!important;
}
.topbar-main,
.topbar-right{
  height:100%;
  display:flex!important;
  align-items:center!important;
}
.topbar-title-wrap{
  display:flex!important;
  align-items:center!important;
  min-width:0;
}
.topbar-title-wrap h2{
  margin:0!important;
}
.topbar-brand{
  display:flex!important;
  align-items:center!important;
}

/* Avoid oversized empty right spaces on low-data pages */
.concept-course-grid:has(.concept-course-card:only-child){
  grid-template-columns:minmax(360px,420px)!important;
}
.concept-course-grid:has(.concept-course-card:nth-child(2)){
  grid-template-columns:repeat(2,minmax(320px,1fr))!important;
}

/* Better scaling around 1366/1536 screens */
@media(max-width:1450px){
  .content{
    padding-left:20px!important;
    padding-right:20px!important;
  }
  .concept-page-header{
    padding-left:12px!important;
    padding-right:12px!important;
  }
  .concept-page-header h1{
    font-size:32px!important;
  }
  .premium-school-watermark{
    width:185px!important;
  }
  .concept-page-header:has(.concept-header-actions) .premium-page-icon,
  .concept-page-header:has(.hero-actions) .premium-page-icon{
    right:160px!important;
  }
  .concept-page-header:has(.concept-header-actions) .premium-school-watermark,
  .concept-page-header:has(.hero-actions) .premium-school-watermark{
    right:205px!important;
  }
}

/* Tablet/mobile */
@media(max-width:900px){
  .concept-page-header{
    grid-template-columns:1fr!important;
    min-height:auto!important;
    gap:10px!important;
  }
  .concept-header-actions,
  .hero-actions{
    justify-content:flex-start!important;
  }
  .premium-hero-visual{
    width:40%!important;
  }
  .concept-page-header:has(.concept-header-actions) .premium-page-icon,
  .concept-page-header:has(.hero-actions) .premium-page-icon{
    right:16px!important;
  }
  .concept-page-header:has(.concept-header-actions) .premium-school-watermark,
  .concept-page-header:has(.hero-actions) .premium-school-watermark{
    right:44px!important;
  }
}

@media(max-width:780px){
  .content{
    padding-left:10px!important;
    padding-right:10px!important;
  }
  .concept-page-header{
    padding:16px 10px 12px!important;
  }
  .concept-page-header h1{
    font-size:28px!important;
  }
  .concept-page-header p{
    max-width:80%!important;
  }
  .premium-hero-visual{
    width:48%!important;
  }
  .premium-school-watermark{
    right:0!important;
    width:135px!important;
    opacity:.055!important;
  }
  .premium-page-icon{
    display:none!important;
  }
  .students-toolbar{
    grid-template-columns:1fr!important;
  }
  .students-toolbar>*{
    width:100%!important;
    max-width:none!important;
  }
  .students-clear-filters{
    justify-self:stretch!important;
  }
  .concept-course-grid:has(.concept-course-card:only-child),
  .concept-course-grid:has(.concept-course-card:nth-child(2)){
    grid-template-columns:1fr!important;
  }
}


/* V6.138 — remove decorative header iconography */
.premium-page-icon{display:none!important}
.premium-hero-visual{width:38%!important}
.premium-school-watermark{
  right:26px!important;
  width:230px!important;
  opacity:.10!important;
}
.concept-page-header:has(.concept-header-actions) .premium-school-watermark,
.concept-page-header:has(.hero-actions) .premium-school-watermark{
  right:28px!important;
}
@media(max-width:1450px){
  .premium-school-watermark{right:18px!important;width:195px!important}
  .concept-page-header:has(.concept-header-actions) .premium-school-watermark,
  .concept-page-header:has(.hero-actions) .premium-school-watermark{
    right:18px!important;
  }
}
@media(max-width:780px){
  .premium-school-watermark{right:2px!important;width:135px!important;opacity:.055!important}
}


/* =========================================================
   V6.139 — COURSES + TEACHER PREMIUM
   No AI photos: initials, typography and CSS only.
   ========================================================= */

/* Global readability */
body{font-size:15px!important}
.hero p{font-size:12.5px!important}
.panel-sub,.card p,.grow small{font-size:10.5px!important}
.field label{font-size:9.5px!important}
th{font-size:9px!important}
td{font-size:11.5px!important}
.btn{font-size:10.5px!important}
.tag,.status{font-size:8.5px!important}

/* ----- Premium Courses ----- */
.concept-course-grid{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:14px!important;
}
.premium-course-card{
  position:relative;
  min-height:326px!important;
  overflow:hidden;
  padding:17px!important;
  border-radius:20px!important;
  isolation:isolate;
  box-shadow:0 12px 34px rgba(20,32,56,.065)!important;
  transition:transform .28s var(--dm-ease),box-shadow .28s var(--dm-ease),border-color .28s ease!important;
}
.premium-course-card:hover{
  transform:translateY(-4px)!important;
  box-shadow:0 20px 46px rgba(20,32,56,.10)!important;
}
.course-card-glow{
  position:absolute;
  width:260px;height:220px;
  right:-85px;top:-75px;
  border-radius:50%;
  filter:blur(5px);
  opacity:.42;
  z-index:-1;
}
.premium-course-card::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:-2;
  background:linear-gradient(145deg,rgba(255,255,255,.99),rgba(249,250,253,.93));
}
.tone-violet .course-card-glow{background:radial-gradient(circle,#d8c0ff 0%,transparent 68%)}
.tone-orange .course-card-glow{background:radial-gradient(circle,#ffd6b5 0%,transparent 68%)}
.tone-green .course-card-glow{background:radial-gradient(circle,#bcefdc 0%,transparent 68%)}
.tone-blue .course-card-glow{background:radial-gradient(circle,#c5e1ff 0%,transparent 68%)}
.tone-pink .course-card-glow{background:radial-gradient(circle,#f4c5e4 0%,transparent 68%)}
.tone-coral .course-card-glow{background:radial-gradient(circle,#ffc9c2 0%,transparent 68%)}

.premium-course-head{
  display:flex;
  align-items:center;
  gap:13px;
}
.premium-course-initials{
  width:58px;height:58px;
  flex:0 0 58px;
  display:grid;
  place-items:center;
  border-radius:17px;
  font-size:22px;
  font-weight:950;
  letter-spacing:-.06em;
  border:1px solid rgba(255,255,255,.75);
  box-shadow:0 12px 24px rgba(20,32,56,.08),inset 0 1px 0 rgba(255,255,255,.7);
}
.tone-violet .premium-course-initials{color:#7740d7;background:linear-gradient(145deg,#f6f0ff,#e8ddff)}
.tone-orange .premium-course-initials{color:#d9701e;background:linear-gradient(145deg,#fff7ed,#ffe5ce)}
.tone-green .premium-course-initials{color:#168c69;background:linear-gradient(145deg,#effcf7,#d6f7ea)}
.tone-blue .premium-course-initials{color:#3986d7;background:linear-gradient(145deg,#f0f8ff,#ddecff)}
.tone-pink .premium-course-initials{color:#c93893;background:linear-gradient(145deg,#fff1fa,#f8dcec)}
.tone-coral .premium-course-initials{color:#d95b56;background:linear-gradient(145deg,#fff4f2,#ffddd9)}

.premium-course-title .eyebrow{margin-bottom:4px!important;font-size:8px!important}
.premium-course-title h3{
  margin:0!important;
  font-size:19px!important;
  letter-spacing:-.035em!important;
}
.premium-course-title p{margin:4px 0 0!important;font-size:10.5px!important;color:var(--dm-muted)!important}
.premium-course-more{align-self:flex-start}

.premium-course-info{
  position:relative;
  display:grid;
  gap:11px;
  margin-top:20px;
  padding:15px 0 14px;
  border-top:1px solid #edf0f4;
  border-bottom:1px solid #edf0f4;
}
.premium-course-info-row{
  display:flex;
  align-items:center;
  gap:10px;
}
.course-info-icon{
  width:32px;height:32px;
  display:grid;place-items:center;
  flex:0 0 32px;
  border-radius:10px;
  background:#f4f6f9;
  color:#69768e;
}
.course-info-icon .icon{width:15px;height:15px}
.premium-course-info-row small{
  display:block;
  font-size:7.5px;
  letter-spacing:.11em;
  font-weight:900;
  color:#8a94a6;
}
.premium-course-info-row strong{
  display:block;
  margin-top:2px;
  font-size:11.5px;
  color:#1b2439;
}
.premium-course-info-row em{
  display:block;
  margin-top:2px;
  font-size:9px;
  font-style:normal;
  color:var(--dm-muted);
}
.premium-course-enrolled{
  position:absolute;
  right:0;top:18px;
  display:flex;
  align-items:center;
  gap:8px;
}
.premium-course-enrolled>div{text-align:right}
.premium-course-enrolled strong{display:block;font-size:24px;line-height:1;color:#1c263d}
.premium-course-enrolled small{display:block;margin-top:3px;font-size:7.5px;font-weight:900;letter-spacing:.1em;color:#8a94a6}

.premium-course-price{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  margin-top:13px;
}
.premium-course-price>span{
  font-size:20px;
  font-weight:900;
  letter-spacing:-.04em;
}
.premium-course-price>span small{font-size:9px;font-weight:700;color:#8490a3}
.premium-course-price em{font-size:8.5px;font-style:normal;color:#7c889b}

.premium-course-actions{
  display:grid!important;
  grid-template-columns:repeat(3,1fr);
  gap:7px!important;
  margin-top:14px;
}
.premium-course-actions .btn{
  justify-content:center!important;
  min-height:38px!important;
}

/* ----- Premium Teacher App ----- */
.premium-teacher-app{
  min-height:100vh;
  max-width:980px!important;
  margin:0 auto;
  padding:0 18px 92px!important;
  background:
    radial-gradient(650px 280px at 92% -4%,rgba(var(--primary-rgb),.08),transparent 70%),
    linear-gradient(180deg,#f7f9fc 0%,#f2f5f9 100%);
}
.premium-teacher-head{
  height:66px;
  margin:0 -18px!important;
  padding:0 18px!important;
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:rgba(255,255,255,.90)!important;
  border-bottom:1px solid #e5e9f0!important;
  backdrop-filter:blur(18px);
  position:sticky!important;
  top:0;
  z-index:30;
}
.teacher-school-brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.teacher-school-logo{
  width:40px!important;height:40px!important;border-radius:12px!important;
  background:#fff;border:1px solid #e4e8ef;
}
.teacher-school-brand strong{
  display:block;
  max-width:220px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  font-size:12.5px;
}
.teacher-school-brand small{display:block;margin-top:2px;font-size:8px;color:#8390a5}
.teacher-head-actions{display:flex;align-items:center;gap:8px}
.teacher-sync{
  display:flex;align-items:center;gap:7px;
  font-size:8.5px;font-weight:800;color:#77849a;
}
.teacher-logout{
  width:34px;height:34px;display:grid;place-items:center;
  border:1px solid #e5e9f0;border-radius:10px;background:#fff;color:#69758b;
}
.teacher-logout .icon{width:15px;height:15px}

.premium-teacher-hero{
  min-height:145px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:28px 22px!important;
  margin:16px 0 12px!important;
  border:1px solid #e5e9f0;
  border-radius:22px;
  background:
    radial-gradient(270px 150px at 87% 50%,rgba(var(--primary-rgb),.10),transparent 68%),
    linear-gradient(135deg,#fff,#fafbfe);
  box-shadow:0 10px 28px rgba(20,32,56,.045);
}
.premium-teacher-hero h1{margin:0;font-size:30px!important;letter-spacing:-.045em}
.premium-teacher-hero p{margin:7px 0 0;font-size:11px!important;color:#71809a}
.teacher-hero-badge{
  min-width:132px;
  display:grid;
  grid-template-columns:30px auto;
  align-items:center;
  gap:0 8px;
  padding:12px 14px;
  border-radius:16px;
  background:#fff;
  border:1px solid #e6eaf1;
  box-shadow:0 7px 20px rgba(20,32,56,.04);
}
.teacher-hero-badge>.icon{
  grid-row:1/3;
  width:30px;height:30px;padding:7px;
  border-radius:10px;color:#168d69;background:#eaf9f3;
}
.teacher-hero-badge span{font-size:18px;font-weight:950}
.teacher-hero-badge small{font-size:7.5px;color:#7d899c}

.premium-teacher-kpis{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:9px!important;
  margin-bottom:13px!important;
}
.premium-teacher-kpis .teacher-payroll-kpi{
  min-height:106px;
  padding:14px!important;
  border-radius:17px!important;
  border:1px solid #e5e9f0;
  background:#fff!important;
  box-shadow:0 7px 20px rgba(20,32,56,.035);
}
.premium-teacher-kpis .teacher-payroll-kpi>span{
  display:flex;align-items:center;gap:6px;
  font-size:8.5px!important;font-weight:850;color:#6f7d93;
}
.premium-teacher-kpis .teacher-payroll-kpi>span .icon{width:14px;height:14px}
.premium-teacher-kpis .teacher-payroll-kpi strong{font-size:26px!important;margin-top:8px!important}
.premium-teacher-kpis .teacher-payroll-kpi small{font-size:8.5px!important}

.teacher-premium-section{
  margin-top:13px;
  padding:15px;
  border:1px solid #e5e9f0;
  border-radius:20px;
  background:#fff;
  box-shadow:0 8px 24px rgba(20,32,56,.04);
}
.teacher-section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  margin-bottom:11px;
}
.teacher-section-head h2{margin:2px 0 0;font-size:17px;letter-spacing:-.025em}
.teacher-section-head p{margin:3px 0 0;font-size:9px;color:#7c899d}

.premium-teacher-course-stack{display:flex;flex-direction:column;gap:8px}
.premium-teacher-lesson{
  position:relative;
  display:grid;
  grid-template-columns:50px minmax(0,1fr) auto;
  gap:11px;
  align-items:center;
  min-height:98px;
  padding:12px;
  overflow:hidden;
  border:1px solid #e7eaf0;
  border-radius:16px;
  background:linear-gradient(135deg,#fff,#fafbfc);
}
.premium-teacher-lesson::after{
  content:"";position:absolute;right:-25px;top:-55px;width:180px;height:150px;border-radius:50%;opacity:.28;pointer-events:none;
}
.premium-teacher-lesson.tone-violet::after{background:radial-gradient(circle,#dac5ff,transparent 68%)}
.premium-teacher-lesson.tone-orange::after{background:radial-gradient(circle,#ffd4b3,transparent 68%)}
.premium-teacher-lesson.tone-green::after{background:radial-gradient(circle,#bcebd9,transparent 68%)}
.premium-teacher-lesson.tone-blue::after{background:radial-gradient(circle,#c6e1ff,transparent 68%)}
.premium-teacher-lesson.tone-pink::after{background:radial-gradient(circle,#f1c5e2,transparent 68%)}
.premium-teacher-lesson.tone-coral::after{background:radial-gradient(circle,#ffc8c2,transparent 68%)}
.teacher-lesson-initial{
  width:48px;height:48px;display:grid;place-items:center;border-radius:14px;
  font-size:17px;font-weight:950;color:#7840d4;background:#f2ecff;z-index:1;
}
.teacher-lesson-main,.teacher-lesson-state,.teacher-lesson-actions{z-index:1}
.teacher-lesson-topline{display:flex;gap:8px;font-size:8px;font-weight:850;color:#7d899b}
.teacher-lesson-main h3{margin:4px 0 0;font-size:14px}
.teacher-lesson-main p{display:flex;align-items:center;gap:5px;margin:4px 0 0;font-size:8.5px;color:#758197}
.teacher-lesson-main p .icon{width:12px;height:12px}
.teacher-lesson-state{align-self:start}
.teacher-lesson-actions{
  grid-column:2/4;
  display:flex;
  justify-content:flex-start;
  gap:6px;
}
.teacher-lesson-actions .btn{min-height:34px!important}

.premium-renewal-card{
  margin-top:13px!important;
  border-radius:20px!important;
  box-shadow:0 8px 24px rgba(20,32,56,.04)!important;
}
.teacher-own-courses-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.teacher-own-course{
  display:grid;
  grid-template-columns:42px minmax(0,1fr) auto;
  align-items:center;
  gap:9px;
  min-height:78px;
  padding:10px;
  border:1px solid #e7eaf0;
  border-radius:14px;
  background:#fbfcfd;
}
.teacher-own-course-initial{
  width:40px;height:40px;display:grid;place-items:center;border-radius:12px;
  font-weight:950;color:#7945d2;background:#f0ebff;
}
.teacher-own-course h3{margin:0;font-size:11.5px}
.teacher-own-course p{margin:2px 0;font-size:8px;color:var(--dm-muted)}
.teacher-own-course span{display:flex;align-items:center;gap:4px;font-size:8px;color:var(--dm-muted)}
.teacher-own-course span .icon{width:11px;height:11px}
.teacher-own-course-actions{display:flex;gap:4px}

.teacher-empty-premium{
  min-height:100px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;
  color:#7f8b9f;
}
.teacher-empty-premium>.icon{width:22px;height:22px}
.teacher-empty-premium strong{font-size:11px}
.teacher-empty-premium small{font-size:8.5px}

.teacher-bottom-nav{
  position:fixed;
  z-index:40;
  left:50%;
  bottom:10px;
  width:min(520px,calc(100vw - 20px));
  height:62px;
  transform:translateX(-50%);
  display:grid;
  grid-template-columns:repeat(4,1fr);
  padding:5px;
  border:1px solid rgba(223,227,235,.94);
  border-radius:20px;
  background:rgba(255,255,255,.94);
  backdrop-filter:blur(18px);
  box-shadow:0 14px 42px rgba(18,29,50,.16);
}
.teacher-bottom-nav button{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  border:0;border-radius:14px;background:transparent;color:#748095;font-size:7.5px;font-weight:850;
}
.teacher-bottom-nav button:hover{background:var(--dm-brand-soft);color:var(--dm-brand-solid)}
.teacher-bottom-nav .icon{width:17px;height:17px}

/* responsive */
@media(max-width:1100px){
  .concept-course-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:720px){
  body{font-size:14px!important}
  .concept-course-grid{grid-template-columns:1fr!important}
  .premium-course-card{min-height:310px!important}
  .premium-teacher-app{padding:0 10px 84px!important}
  .premium-teacher-head{margin:0 -10px!important;padding:0 11px!important}
  .teacher-school-brand strong{max-width:145px;font-size:11px}
  .teacher-sync{display:none}
  .premium-teacher-hero{
    min-height:132px;
    margin-top:10px!important;
    padding:20px 15px!important;
  }
  .premium-teacher-hero h1{font-size:25px!important}
  .teacher-hero-badge{min-width:100px;padding:9px}
  .premium-teacher-kpis{gap:6px!important}
  .premium-teacher-kpis .teacher-payroll-kpi{min-height:94px;padding:11px!important}
  .premium-teacher-kpis .teacher-payroll-kpi strong{font-size:21px!important}
  .premium-teacher-lesson{
    grid-template-columns:42px minmax(0,1fr)!important;
    padding:10px;
  }
  .teacher-lesson-initial{width:40px;height:40px;border-radius:12px;font-size:14px}
  .teacher-lesson-state{grid-column:2;justify-self:start}
  .teacher-lesson-actions{grid-column:1/3;width:100%}
  .teacher-lesson-actions .btn{flex:1;padding-left:6px!important;padding-right:6px!important}
  .teacher-own-courses-grid{grid-template-columns:1fr}
}


/* =========================================================
   V6.141 — Vercel Ready Final UI Fix
   - card corsi allineate
   - calendario più leggibile
   - app insegnante ricentrata
   ========================================================= */

body{
  overflow-x:hidden !important;
}

/* CORSI */
.concept-course-grid{
  align-items:stretch !important;
}

.premium-course-card{
  display:flex !important;
  flex-direction:column !important;
  height:100% !important;
  min-height:340px !important;
}

.premium-course-head{
  align-items:flex-start !important;
}

.premium-course-title{
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-width:0;
}

.premium-course-title h3{
  line-height:1.08 !important;
}

.premium-course-info{
  flex:1 1 auto !important;
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  grid-template-areas:
    "row1 enrolled"
    "row2 enrolled" !important;
  column-gap:14px !important;
  row-gap:12px !important;
}

.premium-course-info-row:nth-of-type(1){grid-area:row1}
.premium-course-info-row:nth-of-type(2){grid-area:row2}

.premium-course-enrolled{
  position:static !important;
  grid-area:enrolled !important;
  align-self:stretch !important;
  justify-self:end !important;
  display:flex !important;
  flex-direction:column !important;
  justify-content:center !important;
  gap:6px !important;
  min-width:86px !important;
  padding:4px 0 4px 12px !important;
  border-left:1px solid #edf0f4 !important;
}

.premium-course-enrolled .course-info-icon{
  margin-left:auto !important;
}

.premium-course-enrolled > div{
  text-align:right !important;
}

.premium-course-price{
  margin-top:14px !important;
  padding-top:12px !important;
  border-top:1px solid #edf0f4 !important;
}

.premium-course-actions{
  margin-top:12px !important;
}

.premium-course-actions .btn{
  white-space:nowrap !important;
}

/* CALENDARIO */
.premium-month-calendar .month-day{
  min-height:140px !important;
  padding:10px !important;
}

.month-day-number{
  width:28px !important;
  height:28px !important;
  font-size:12px !important;
}

.month-event{
  min-height:50px !important;
  padding:8px 8px 8px 10px !important;
  gap:7px !important;
}

.month-event b{
  font-size:10.5px !important;
  font-weight:900 !important;
}

.month-event strong{
  font-size:11.5px !important;
  line-height:1.18 !important;
}

.month-event small{
  font-size:9px !important;
  line-height:1.25 !important;
}

/* APP INSEGNANTE */
.premium-teacher-app{
  max-width:1120px !important;
  width:min(1120px,100%) !important;
  margin:0 auto !important;
  padding:0 24px 96px !important;
}

.premium-teacher-head{
  min-height:74px !important;
  height:auto !important;
  margin:0 -24px !important;
  padding:10px 24px !important;
  top:0 !important;
}

.teacher-school-brand{
  flex:1 1 auto !important;
  min-width:0 !important;
}

.teacher-school-brand > div{
  min-width:0 !important;
}

.teacher-school-brand strong{
  max-width:none !important;
  font-size:13px !important;
  line-height:1.15 !important;
}

.teacher-school-brand small{
  font-size:8.5px !important;
  line-height:1.2 !important;
}

.teacher-head-actions{
  flex:0 0 auto !important;
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
}

.teacher-sync{
  white-space:nowrap !important;
}

.teacher-bottom-nav{
  bottom:max(10px,env(safe-area-inset-bottom)) !important;
}

.premium-teacher-hero,
.teacher-premium-section,
.premium-renewal-card,
.premium-teacher-kpis{
  margin-left:auto !important;
  margin-right:auto !important;
}

@media(max-width:900px){
  .premium-course-info{
    grid-template-columns:1fr !important;
    grid-template-areas:
      "row1"
      "row2"
      "enrolled" !important;
  }

  .premium-course-enrolled{
    justify-self:start !important;
    flex-direction:row !important;
    align-items:center !important;
    min-width:0 !important;
    padding:10px 0 0 !important;
    border-left:0 !important;
    border-top:1px solid #edf0f4 !important;
  }

  .premium-course-enrolled .course-info-icon{
    margin-left:0 !important;
  }

  .premium-course-enrolled > div{
    text-align:left !important;
  }

  .premium-teacher-app{
    padding:0 16px 90px !important;
  }

  .premium-teacher-head{
    margin:0 -16px !important;
    padding:10px 16px !important;
  }
}

@media(max-width:720px){
  .premium-course-card{
    min-height:auto !important;
  }

  .premium-course-actions{
    grid-template-columns:1fr !important;
  }

  .premium-teacher-app{
    padding:0 12px 90px !important;
  }

  .premium-teacher-head{
    margin:0 -12px !important;
    padding:10px 12px !important;
    min-height:70px !important;
  }

  .teacher-school-brand strong{
    font-size:12px !important;
    white-space:normal !important;
  }

  .teacher-school-brand small{
    font-size:8px !important;
  }

  .premium-teacher-hero{
    flex-direction:column !important;
    align-items:flex-start !important;
  }

  .teacher-hero-badge{
    width:100% !important;
    max-width:220px !important;
  }

  .teacher-bottom-nav{
    width:min(520px,calc(100vw - 16px)) !important;
  }
}

@media(max-width:560px){
  .premium-teacher-head{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important;
    align-items:center !important;
    column-gap:10px !important;
  }

  .teacher-sync{
    display:none !important;
  }
}


/* V6.142 — Header Branding Editor */
.premium-school-watermark{
  width:280px !important;
  max-width:44% !important;
  height:160px !important;
  opacity:var(--school-header-logo-opacity,.16) !important;
  transform:
    translate(var(--school-header-logo-x,0px),var(--school-header-logo-y,0px))
    scale(var(--school-header-logo-scale,1.4)) !important;
  transform-origin:center center !important;
  transition:opacity .2s ease,transform .2s ease !important;
}
.teacher-logout{
  width:auto !important;
  min-width:74px !important;
  height:36px !important;
  padding:0 11px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px !important;
  font-size:9.5px !important;
  font-weight:850 !important;
}
.teacher-logout span{display:inline!important}
.school-header-branding-panel{margin-bottom:14px}
.header-branding-editor{
  display:grid;
  grid-template-columns:minmax(0,1.25fr) minmax(300px,.75fr);
  gap:18px;
  align-items:start;
}
.header-branding-preview{
  position:relative;
  min-height:220px;
  overflow:hidden;
  border:1px solid #e4e8ef;
  border-radius:18px;
  background:radial-gradient(440px 180px at 86% 40%,rgba(var(--primary-rgb),.08),transparent 72%),linear-gradient(135deg,#fff,#f8f9fc);
}
.header-branding-preview-copy{position:relative;z-index:2;max-width:58%;padding:30px}
.header-branding-preview-copy h3{margin:4px 0 8px;font-size:24px;letter-spacing:-.04em}
.header-branding-preview-copy p{margin:0;font-size:10px;line-height:1.5;color:#77849a}
.header-branding-preview-stage{position:absolute;inset:0 0 0 43%;display:grid;place-items:center;overflow:hidden}
.header-branding-preview-stage img{width:240px;max-width:80%;max-height:145px;object-fit:contain;opacity:.16;transform-origin:center center;transition:opacity .15s ease,transform .15s ease}
.header-logo-empty{padding:12px 14px;border:1px dashed #d8dde7;border-radius:12px;color:#8a94a6;font-size:9px;background:#fff}
.header-branding-controls{display:grid;gap:13px}
.header-branding-toggle{min-height:45px;display:flex;align-items:center;gap:9px;padding:10px 12px;border:1px solid #e4e8ef;border-radius:12px;background:#fafbfc;font-size:10px;font-weight:800}
.header-branding-toggle input{width:18px;height:18px;accent-color:var(--primary)}
.header-branding-control{padding:10px 12px;border:1px solid #e8ebf0;border-radius:12px;background:#fff}
.header-branding-control>div{display:flex;justify-content:space-between;gap:10px;margin-bottom:8px}
.header-branding-control label{font-size:9px;font-weight:850;color:#626e84}
.header-branding-control strong{font-size:9px;color:var(--primary)}
.header-branding-control input[type="range"]{width:100%;accent-color:var(--primary)}
.header-branding-presets{display:flex;flex-wrap:wrap;gap:6px}
@media(max-width:900px){.header-branding-editor{grid-template-columns:1fr}.header-branding-preview{min-height:190px}}
@media(max-width:600px){.premium-school-watermark{width:195px!important;max-width:54%!important}.header-branding-preview-copy{max-width:64%;padding:20px}.header-branding-preview-copy h3{font-size:19px}.teacher-logout{min-width:64px!important;padding:0 9px!important}}


/* =========================================================
   V6.142 CLEAN — header semplificata
   - nessun logo scuola nella testata
   - nessuna personalizzazione logo testata
   - data centrata nel box di destra
   ========================================================= */

.premium-hero-visual,
.premium-school-watermark,
.school-header-watermark-frame,
.school-header-watermark-img,
.teacher-hero-watermark-wrap,
.teacher-hero-watermark{
  display:none !important;
}

/* Date card: content perfectly centered */
.dashboard-date-card{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  text-align:center !important;
  gap:10px !important;
}

.dashboard-date-card > div{
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  text-align:center !important;
  min-width:0 !important;
}

.dashboard-date-card small,
.dashboard-date-card strong{
  width:100% !important;
  text-align:center !important;
}

.dashboard-date-card > .icon{
  flex:0 0 auto !important;
}

/* Remove obsolete customization panel if any stale markup survives */
.school-header-branding-panel{
  display:none !important;
}


/* =========================================================
   V6.143 — Premium Polish
   Visual refinement only: Dashboard + Mobile + Teacher App.
   No business logic/database changes.
   ========================================================= */

/* ---------- GLOBAL POLISH ---------- */
:root{
  --dm-shadow-soft:0 10px 26px rgba(18,28,45,.055);
  --dm-shadow-hover:0 14px 34px rgba(18,28,45,.085);
  --dm-radius-card:16px;
  --dm-radius-lg:20px;
}

.panel,
.card,
.kpi,
.dashboard-kpi,
.teacher-payroll-kpi,
.teacher-premium-section,
.teacher-blocked-card{
  box-shadow:var(--dm-shadow-soft);
}

.btn,
button{
  transition:transform .14s ease,box-shadow .14s ease,background .14s ease,border-color .14s ease;
}
.btn:active,
button:active{
  transform:scale(.985);
}

/* ---------- DASHBOARD DESKTOP ---------- */
.dashboard-date-card{
  min-width:190px;
  min-height:64px;
  border-radius:16px !important;
  box-shadow:0 10px 24px rgba(20,31,52,.06) !important;
}

.dashboard-date-card > div{
  min-width:110px;
}

.dashboard-date-card small{
  font-size:8.5px !important;
  letter-spacing:.02em;
}

.dashboard-date-card strong{
  font-size:12px !important;
  line-height:1.2;
}

/* KPI visual hierarchy */
.kpi-grid{
  gap:12px !important;
}

.kpi,
.dashboard-kpi{
  position:relative;
  overflow:hidden;
  border-radius:16px !important;
  min-height:130px;
}

.kpi::after,
.dashboard-kpi::after{
  content:"";
  position:absolute;
  inset:auto -36px -40px auto;
  width:110px;
  height:110px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(var(--primary-rgb),.07),transparent 68%);
  pointer-events:none;
}

.kpi strong,
.dashboard-kpi strong{
  letter-spacing:-.035em;
}

.kpi small,
.dashboard-kpi small{
  line-height:1.35;
}

/* Quick actions cleaner */
.quick-actions,
.dashboard-quick-actions{
  gap:10px !important;
}

.quick-actions button,
.dashboard-quick-actions button{
  border-radius:14px !important;
  box-shadow:0 7px 20px rgba(20,31,52,.035);
}

.quick-actions button:hover,
.dashboard-quick-actions button:hover{
  transform:translateY(-1px);
  box-shadow:var(--dm-shadow-hover);
}

/* Recent activity more legible */
.activity-list,
.recent-activity{
  border-radius:16px !important;
}

.activity-list strong,
.recent-activity strong{
  font-weight:800;
}

/* ---------- TEACHER APP DESKTOP ---------- */
.premium-teacher-head{
  border-bottom:1px solid #e9edf3 !important;
  box-shadow:0 6px 18px rgba(18,28,45,.035);
}

.premium-teacher-hero{
  border-radius:22px !important;
  box-shadow:0 12px 28px rgba(20,31,52,.055);
}

.teacher-hero-copy h1{
  letter-spacing:-.04em;
}

.teacher-hero-badge{
  border-radius:16px !important;
  box-shadow:0 8px 20px rgba(20,31,52,.05);
}

.teacher-payroll-kpis{
  gap:10px !important;
}

.teacher-payroll-kpi{
  border-radius:16px !important;
}

.teacher-premium-section{
  border-radius:20px !important;
}

/* ---------- MOBILE ADMIN ---------- */
@media(max-width:700px){

  body{
    background:#f6f8fb !important;
  }

  .topbar{
    min-height:72px !important;
    padding:10px 14px !important;
    gap:10px !important;
    box-shadow:0 4px 16px rgba(17,24,39,.045);
  }

  .topbar-main{
    gap:10px !important;
  }

  .topbar-title-wrap{
    min-width:0 !important;
  }

  .mobile-school-brand{
    min-width:0 !important;
    gap:9px !important;
  }

  .mobile-school-brand strong{
    display:block;
    font-size:14px !important;
    line-height:1.1;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    max-width:180px;
  }

  .mobile-school-brand small{
    font-size:9px !important;
    line-height:1.2;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    max-width:190px;
  }

  #content{
    padding-left:14px !important;
    padding-right:14px !important;
    padding-bottom:110px !important;
  }

  #content .hero,
  .concept-page-header{
    margin-bottom:14px !important;
  }

  #content .hero h1,
  .concept-page-header h1{
    font-size:30px !important;
    line-height:1.03 !important;
    letter-spacing:-.045em !important;
  }

  #content .hero p,
  .concept-page-header p{
    font-size:12px !important;
    line-height:1.45 !important;
  }

  .dashboard-date-card{
    width:100% !important;
    min-width:0 !important;
    min-height:58px !important;
    padding:10px 12px !important;
    margin-top:12px !important;
    justify-content:center !important;
    gap:10px !important;
  }

  .dashboard-date-card > .icon{
    width:34px !important;
    height:34px !important;
    padding:7px !important;
  }

  .dashboard-date-card small{
    font-size:9px !important;
  }

  .dashboard-date-card strong{
    font-size:15px !important;
  }

  /* dashboard quick actions */
  .quick-actions,
  .dashboard-quick-actions{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:10px !important;
  }

  .quick-actions button,
  .dashboard-quick-actions button{
    min-height:92px !important;
    padding:13px !important;
    border-radius:16px !important;
  }

  .quick-actions button strong,
  .dashboard-quick-actions button strong{
    font-size:13px !important;
  }

  .quick-actions button small,
  .dashboard-quick-actions button small{
    font-size:9px !important;
    line-height:1.3 !important;
  }

  /* KPI cards */
  .kpi-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:10px !important;
  }

  .kpi,
  .dashboard-kpi{
    min-height:150px !important;
    padding:16px 14px !important;
    border-radius:18px !important;
  }

  .kpi strong,
  .dashboard-kpi strong{
    font-size:27px !important;
    line-height:1.05 !important;
  }

  .kpi small,
  .dashboard-kpi small{
    font-size:9.5px !important;
  }

  /* management location box */
  .location-filter,
  .dashboard-location-filter{
    border-radius:16px !important;
  }

  /* Bottom nav */
  .mobile-nav{
    left:12px !important;
    right:12px !important;
    bottom:calc(10px + env(safe-area-inset-bottom)) !important;
    width:auto !important;
    border-radius:22px !important;
    padding:8px 6px calc(8px + env(safe-area-inset-bottom)) !important;
    box-shadow:0 16px 40px rgba(17,24,39,.15) !important;
    border:1px solid rgba(225,230,238,.9);
    background:rgba(255,255,255,.96) !important;
    backdrop-filter:blur(16px);
  }

  .mobile-nav button{
    min-width:0 !important;
    border-radius:16px !important;
    padding:8px 4px !important;
  }

  .mobile-nav button .icon{
    width:21px !important;
    height:21px !important;
  }

  .mobile-nav button span{
    font-size:9px !important;
    margin-top:4px !important;
  }
}

/* ---------- TEACHER APP MOBILE ---------- */
@media(max-width:700px){

  .premium-teacher-app{
    padding-bottom:108px !important;
  }

  .premium-teacher-head{
    padding:14px 16px !important;
    min-height:72px !important;
    gap:10px !important;
  }

  .teacher-school-brand{
    gap:10px !important;
    min-width:0 !important;
  }

  .teacher-school-logo{
    width:46px !important;
    height:46px !important;
    min-width:46px !important;
  }

  .teacher-school-brand strong{
    font-size:14px !important;
    max-width:165px !important;
  }

  .teacher-school-brand small{
    font-size:9px !important;
  }

  .teacher-logout{
    min-width:72px !important;
    height:40px !important;
    padding:0 10px !important;
    border-radius:12px !important;
  }

  .premium-teacher-hero{
    margin:14px 14px 12px !important;
    padding:20px 18px !important;
    border-radius:20px !important;
    min-height:0 !important;
  }

  .teacher-hero-copy{
    max-width:100% !important;
  }

  .teacher-hero-copy h1{
    font-size:27px !important;
    line-height:1.03 !important;
    margin:7px 0 8px !important;
    white-space:normal !important;
  }

  .teacher-hero-copy p{
    font-size:12px !important;
    line-height:1.4 !important;
  }

  .teacher-hero-badge{
    margin-top:14px !important;
    width:100% !important;
    min-height:58px !important;
    padding:11px 13px !important;
    border-radius:16px !important;
    gap:10px !important;
  }

  .teacher-hero-badge span{
    font-size:18px !important;
  }

  .teacher-hero-badge small{
    font-size:9px !important;
  }

  .premium-teacher-kpis,
  .teacher-payroll-kpis{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:8px !important;
    padding:0 14px !important;
  }

  .teacher-payroll-kpi{
    min-height:122px !important;
    padding:12px 9px !important;
    border-radius:16px !important;
  }

  .teacher-payroll-kpi span{
    font-size:7.5px !important;
    line-height:1.25 !important;
  }

  .teacher-payroll-kpi strong{
    font-size:26px !important;
    line-height:1 !important;
    margin:10px 0 7px !important;
  }

  .teacher-payroll-kpi small{
    font-size:8.3px !important;
    line-height:1.2 !important;
  }

  .teacher-premium-section,
  .teacher-blocked-card{
    margin-left:14px !important;
    margin-right:14px !important;
  }

  .teacher-premium-section{
    padding:18px 16px !important;
    border-radius:20px !important;
  }

  .teacher-section-head h2{
    font-size:22px !important;
    line-height:1.05 !important;
  }

  .teacher-section-head p{
    font-size:10px !important;
    line-height:1.4 !important;
  }

  .premium-teacher-bottom-nav,
  .teacher-bottom-nav{
    left:12px !important;
    right:12px !important;
    width:auto !important;
    bottom:calc(10px + env(safe-area-inset-bottom)) !important;
    border-radius:22px !important;
    padding:8px 6px calc(8px + env(safe-area-inset-bottom)) !important;
    box-shadow:0 16px 40px rgba(17,24,39,.15) !important;
    background:rgba(255,255,255,.96) !important;
    backdrop-filter:blur(16px);
  }
}

/* ---------- TABLET / NARROW DESKTOP ---------- */
@media(min-width:701px) and (max-width:1100px){
  .kpi-grid{
    gap:10px !important;
  }
  .kpi,
  .dashboard-kpi{
    min-height:125px;
  }
}


/* =========================================================
   V6.144 — Allievi + Corsi Premium Polish
   UI refinement only. No business logic/database changes.
   ========================================================= */

.toolbar,.table-toolbar,.list-toolbar,.filters-bar,.search-bar{gap:10px!important}

.toolbar input,.table-toolbar input,.list-toolbar input,.filters-bar input,.search-bar input,
.toolbar select,.table-toolbar select,.list-toolbar select,.filters-bar select{
  min-height:40px;
  border-radius:11px!important;
  border-color:#e4e9f1!important;
  background:#fff!important;
  box-shadow:0 3px 10px rgba(18,28,45,.025)
}

.toolbar input:focus,.table-toolbar input:focus,.list-toolbar input:focus,
.filters-bar input:focus,.search-bar input:focus{
  outline:none!important;
  border-color:rgba(var(--primary-rgb),.45)!important;
  box-shadow:0 0 0 3px rgba(var(--primary-rgb),.08)!important
}

.students-table,.student-table,.students-list,.student-list{
  border-radius:18px!important;
  overflow:hidden;
  box-shadow:0 10px 28px rgba(18,28,45,.045)
}

.students-table table,.student-table table{
  border-collapse:separate!important;
  border-spacing:0!important
}

.students-table thead th,.student-table thead th{
  position:sticky;
  top:0;
  z-index:2;
  background:#f8fafc!important;
  color:#758096!important;
  font-size:8px!important;
  font-weight:900!important;
  letter-spacing:.09em!important;
  text-transform:uppercase;
  border-bottom:1px solid #e8edf3!important
}

.students-table tbody tr,.student-table tbody tr{
  transition:background .14s ease
}

.students-table tbody tr:hover,.student-table tbody tr:hover{
  background:#fbfcff!important
}

.students-table tbody td,.student-table tbody td{
  vertical-align:middle!important;
  border-bottom-color:#eef1f5!important
}

.students-table td strong,.student-table td strong,.student-list strong,.students-list strong{
  font-weight:850!important;
  color:#172137!important
}

.students-table td small,.student-table td small,.student-list small,.students-list small{
  color:#8290a6!important;
  line-height:1.35!important
}

.courses-grid{gap:14px!important}

.course-card{
  position:relative;
  overflow:hidden;
  border-radius:18px!important;
  border:1px solid #e7ebf1!important;
  background:#fff!important;
  box-shadow:0 10px 24px rgba(18,28,45,.045)!important;
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease
}

.course-card:hover{
  transform:translateY(-2px);
  box-shadow:0 16px 34px rgba(18,28,45,.075)!important;
  border-color:rgba(var(--primary-rgb),.18)!important
}

.course-card::after{
  content:"";
  position:absolute;
  width:130px;
  height:130px;
  right:-55px;
  top:-55px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(var(--primary-rgb),.07),transparent 68%);
  pointer-events:none
}

.course-card h3,.course-card h4{
  color:#172137!important;
  font-weight:900!important;
  letter-spacing:-.025em!important
}

.course-card p,.course-card small{
  color:#7c899f!important;
  line-height:1.4!important
}

.course-card .btn{border-radius:10px!important}

.course-initial,.course-initials,.course-avatar,[class*="course-initial"]{
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.28),0 6px 16px rgba(18,28,45,.07)
}

.empty-state,.empty,.teacher-empty-premium{
  border-radius:16px!important;
  background:linear-gradient(180deg,#fff,#fafbfe)!important;
  border:1px dashed #dfe5ee!important
}

.status,.badge{font-weight:800!important}

.toast,.notification-toast,.success-toast{
  border-radius:14px!important;
  box-shadow:0 18px 40px rgba(18,28,45,.13)!important
}

@media(max-width:700px){
  .toolbar,.table-toolbar,.list-toolbar,.filters-bar,.search-bar{gap:8px!important}

  .toolbar input,.table-toolbar input,.list-toolbar input,.filters-bar input,.search-bar input,
  .toolbar select,.table-toolbar select,.list-toolbar select,.filters-bar select{
    min-height:44px!important;
    font-size:13px!important
  }

  .courses-grid{
    grid-template-columns:1fr!important;
    gap:10px!important
  }

  .course-card{
    border-radius:17px!important;
    padding:15px!important
  }

  .course-card h3,.course-card h4{
    font-size:17px!important;
    line-height:1.15!important
  }

  .course-card p,.course-card small{
    font-size:10px!important
  }

  .students-table,.student-table{
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch;
    border-radius:16px!important
  }

  .students-table table,.student-table table{
    min-width:680px!important
  }

  .students-table th,.student-table th,
  .students-table td,.student-table td{
    white-space:nowrap!important
  }
}

/* V175: compact student filters, pagination and document history. */
.dm-student-chips{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 14px}
.dm-student-chips .btn{min-height:36px;padding:7px 12px;font-size:12px}
.dm-student-chips .selected{background:var(--primary,#635bff);color:#fff;border-color:transparent}
.dm-student-pagination{display:flex;align-items:center;gap:10px;font-size:12px}
.dm-student-pagination .btn{min-height:34px;padding:7px 10px}
.student-table-footer{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap}
.dm-doc-actions{flex-wrap:wrap;gap:6px}
.dm-doc-actions .btn{font-size:12px;padding:7px 10px;min-height:34px}
.dm-doc-archive{margin-top:12px;border-top:1px solid var(--line,#dce1ec);padding-top:12px}
.dm-doc-archive>summary{cursor:pointer;font-weight:600;padding:10px 0;margin-bottom:8px}
.dm-doc-edit{padding:14px;border:1px solid var(--line,#dce1ec);border-radius:16px}
#dmDocReplacementHint:empty{display:none}
#dmDocReplacementHint{font-size:13px;line-height:1.5}
@media(max-width:640px){.dm-doc-row{align-items:start}.dm-doc-row .dm-doc-actions{grid-column:1/-1;width:100%;justify-content:flex-start}.dm-student-chips{gap:6px}.dm-student-chips .btn{font-size:11px;padding:7px 9px}.student-table-footer{font-size:12px}}
.dm-trial-row{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:16px 0;border-bottom:1px solid var(--line)}.dm-trial-row p{margin:6px 0;overflow-wrap:anywhere}.dm-trial-row select{padding:9px;border-radius:10px;background:var(--surface);color:var(--ink)}@media(max-width:700px){.dm-trial-row{align-items:flex-start;flex-direction:column}.dm-trial-row .actions{flex-wrap:wrap}}
.dm-trial-row .actions{flex-wrap:wrap;justify-content:flex-end}.dm-trial-row>div:first-child{min-width:0;flex:1}.dm-trial-due{border-left:3px solid var(--orange);padding-left:14px}.dm-trial-note{white-space:pre-wrap;max-width:650px;color:var(--muted);font-size:13px;max-height:90px;overflow:auto}.dm-trial-follow-label{font-size:12px;font-weight:600;color:var(--ink)}@media(max-width:700px){.dm-trial-row .actions{justify-content:flex-start}}
.dm-super-primary{grid-template-columns:repeat(4,minmax(0,1fr));margin:20px 0}.dm-super-extra{margin-bottom:20px}.dm-super-extra summary{cursor:pointer;font-weight:600}.dm-super-inbox{display:flex;justify-content:space-between;gap:28px;padding:28px;background:var(--surface);border:1px solid var(--line);border-radius:22px}.dm-super-inbox h2{font-size:24px;letter-spacing:-.7px;margin:10px 0}.dm-super-inbox p{font-size:13px;color:var(--muted);margin:0}.dm-super-inbox-actions{display:flex;gap:10px}.dm-super-inbox-actions button{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:9px;min-width:135px;border:1px solid var(--line);border-radius:15px;background:var(--surface-2);color:var(--ink);padding:18px}.dm-super-inbox-actions strong{font-size:29px}.dm-super-inbox-actions span{font-size:12px}.dm-super-bell{position:relative}.dm-super-bell span{position:absolute;right:-5px;top:-5px;border-radius:20px;background:var(--primary);color:#fff;font-size:10px;min-width:17px;padding:3px}.dm-support-modal{width:min(900px,95vw)}.dm-super-center>.actions{margin-bottom:20px}.dm-super-center .dm-trial-row{align-items:flex-start}.dm-support-schools{display:grid;gap:8px}.dm-support-schools button{justify-content:space-between;text-align:left;white-space:normal}.dm-support-thread{max-height:42vh;overflow:auto;display:flex;flex-direction:column;gap:12px;padding:15px 0;margin-bottom:20px}.dm-support-thread article{padding:15px;border-radius:15px;background:var(--surface-2);border:1px solid var(--line);max-width:88%;align-self:flex-start}.dm-support-thread article.own{align-self:flex-end;background:var(--primary-soft)}.dm-support-thread p{white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0 0}.dm-support-thread small{color:var(--muted)}#dmSupportText{width:100%;margin-top:8px;padding:12px;border-radius:12px;background:var(--surface);color:var(--ink);border:1px solid var(--line);font-size:16px}@media(max-width:1050px){.dm-super-inbox{flex-direction:column}.dm-super-inbox-actions button{flex:1}}@media(max-width:650px){.dm-super-primary{grid-template-columns:repeat(2,minmax(0,1fr))}.dm-super-inbox{padding:20px}.dm-super-inbox-actions{flex-wrap:wrap}.dm-super-inbox-actions button{min-width:100px;padding:13px}.dm-super-inbox-actions strong{font-size:24px}}
/* V188 — casella messaggi a tre colonne */
.dm-mail-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:24px}.dm-mail-heading h1{font-size:32px;letter-spacing:-1px;margin:10px 0}.dm-mail-heading p{font-size:13px;color:var(--muted);margin:0}.dm-mail-layout{display:grid;grid-template-columns:175px 300px minmax(0,1fr);height:min(760px,calc(100dvh - 230px));min-height:490px;border:1px solid var(--line);border-radius:20px;background:var(--surface);overflow:hidden}.dm-mail-folders{padding:20px 12px;background:var(--surface-2);border-right:1px solid var(--line);display:flex;flex-direction:column;gap:7px}.dm-mail-folders button{display:flex;justify-content:space-between;gap:8px;text-align:left;padding:12px;border:0;border-radius:10px;background:transparent;color:var(--ink);font-size:13px}.dm-mail-folders button.active{background:var(--primary-soft);color:var(--primary);font-weight:700}.dm-mail-folders p{font-size:11px;color:var(--muted);line-height:1.6;margin:24px 10px}.dm-mail-list-pane{display:flex;flex-direction:column;min-height:0;border-right:1px solid var(--line)}.dm-mail-search{font-size:11px;color:var(--muted);padding:20px 16px 12px}.dm-mail-search input{display:block;width:100%;min-width:0;margin-top:8px;padding:12px;border:1px solid var(--line);background:var(--surface-2);color:var(--ink);border-radius:10px;font-size:16px}.dm-mail-list{overflow:auto;flex:1;min-height:0}.dm-mail-item{display:block;width:100%;border:0;border-bottom:1px solid var(--line);background:transparent;text-align:left;color:var(--ink);padding:18px 16px}.dm-mail-item.selected{background:var(--primary-soft);box-shadow:inset 3px 0 var(--primary)}.dm-mail-item-top{display:flex;justify-content:space-between;gap:10px}.dm-mail-item-top strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dm-mail-item-top small{font-size:10px;color:var(--muted);white-space:nowrap}.dm-mail-preview{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:12px;margin-top:8px}.dm-mail-dot{display:inline-block;color:var(--primary);font-size:10px;font-weight:700;margin-top:8px}.dm-mail-limit{font-size:10px;color:var(--muted);padding:12px 16px;border-top:1px solid var(--line)}.dm-mail-reader{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:auto}.dm-mail-read-head{padding:24px;border-bottom:1px solid var(--line)}.dm-mail-read-head h2{font-size:23px;letter-spacing:-.5px;margin:10px 0}.dm-mail-read-head p,.dm-mail-read-head small{font-size:12px;color:var(--muted);margin:5px 0;overflow-wrap:anywhere}.dm-mail-thread{flex:1;overflow:auto;min-height:120px;padding:20px 24px;display:flex;flex-direction:column;gap:16px}.dm-mail-thread article{border:1px solid var(--line);background:var(--surface-2);padding:16px;border-radius:12px}.dm-mail-thread article.outgoing{background:var(--primary-soft)}.dm-mail-thread header{display:flex;justify-content:space-between;gap:10px;font-size:12px}.dm-mail-thread small{color:var(--muted);font-size:10px}.dm-mail-thread p{font-size:14px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere;margin:12px 0 0}.dm-mail-compose{padding:18px 24px;border-top:1px solid var(--line)}.dm-mail-compose label{font-weight:600;font-size:12px}.dm-mail-compose textarea{width:100%;resize:vertical;min-height:100px;max-height:240px;padding:12px;border-radius:10px;margin:8px 0;border:1px solid var(--line);background:var(--surface);color:var(--ink);font-size:16px}.dm-mail-compose p{font-size:12px;color:var(--muted);margin:0 0 10px}.dm-mail-welcome,.dm-mail-empty{padding:35px 25px;color:var(--muted)}.dm-mail-welcome{margin:auto;max-width:420px;text-align:center}.dm-mail-welcome h2{color:var(--ink);font-size:25px;margin:18px 0}.dm-mail-welcome p,.dm-mail-empty p{font-size:13px;line-height:1.7}.dm-mail-back{display:none}.dm-mail-error{padding:18px 20px;border:1px solid var(--line);background:var(--surface);border-radius:14px;margin-bottom:18px;color:var(--ink)}.dm-mail-error p{font-size:12px;color:var(--muted);margin:8px 0;overflow-wrap:anywhere}.dm-mail-error small{font-size:12px;line-height:1.6}.dm-mail-lead-body{padding:25px}.dm-mail-note{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7}.dm-mail-lead-body .actions{flex-wrap:wrap}.dm-settings-grid{margin-top:20px;gap:14px}.dm-settings-grid>button{min-height:100px}@media(max-width:1200px){.dm-mail-layout{grid-template-columns:140px 250px minmax(0,1fr)}}@media(max-width:1000px){.dm-mail-layout{grid-template-columns:260px minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);height:calc(100dvh - 240px)}.dm-mail-folders{grid-column:1/-1;flex-direction:row;flex-wrap:wrap;border-right:0;border-bottom:1px solid var(--line);padding:10px}.dm-mail-folders p{display:none}.dm-mail-heading{align-items:flex-start}.dm-mail-heading .actions{flex-wrap:wrap}}@media(max-width:700px){.dm-mail-heading{flex-direction:column;gap:15px}.dm-mail-heading h1{font-size:27px}.dm-mail-layout{display:flex;flex-direction:column;height:calc(100dvh - 280px);min-height:470px}.dm-mail-folders{flex:0 0 auto}.dm-mail-folders button{padding:10px;font-size:12px}.dm-mail-list-pane{flex:1;border-right:0}.dm-mail-reader{display:none}.dm-mail-layout.reading .dm-mail-list-pane{display:none}.dm-mail-layout.reading .dm-mail-reader{display:flex;flex:1}.dm-mail-back{display:flex;align-self:flex-start;margin:10px 14px 0}.dm-mail-read-head,.dm-mail-thread,.dm-mail-compose{padding:18px}.dm-settings-grid>button{min-height:85px}}
.dm-home-support{display:flex;align-items:center;gap:12px;padding:12px 16px;border:1px solid var(--line);border-radius:15px;background:var(--surface);color:var(--ink);text-align:left;transition:background .2s,border-color .2s}.dm-home-support:hover{background:var(--primary-soft);border-color:var(--primary)}.dm-home-support-icon{display:grid;place-items:center;width:35px;height:35px;flex-shrink:0;background:var(--primary-soft);color:var(--primary);border-radius:11px}.dm-home-support strong,.dm-home-support small{display:block}.dm-home-support strong{font-size:13px}.dm-home-support small{font-size:11px;margin-top:4px;color:var(--muted)}.dm-home-support>.icon{margin-left:auto}@media(max-width:700px){.admin-dashboard-head-actions .dm-home-support{display:flex;width:100%;margin-top:10px}.admin-dashboard-head-actions:has(.dm-home-support){flex-wrap:wrap}.dm-home-support{padding:12px}}@media(prefers-reduced-motion:reduce){.dm-home-support{transition:none}}
.dm-support-incoming{position:fixed;z-index:1100;right:22px;bottom:24px;width:min(420px,calc(100vw - 32px));display:flex;align-items:flex-start;gap:13px;padding:20px;border:1px solid var(--line);border-radius:20px;background:var(--surface);color:var(--ink);box-shadow:0 15px 60px #0003}.dm-support-incoming>div{flex:1;min-width:0}.dm-support-incoming strong{font-size:14px}.dm-support-incoming p{font-size:12px;line-height:1.6;color:var(--muted);margin:8px 0 12px;overflow-wrap:anywhere}.dm-support-incoming .btn{font-size:12px}.dm-support-incoming>.icon-btn{flex-shrink:0}@media(max-width:700px){.dm-support-incoming{right:16px;bottom:calc(95px + env(safe-area-inset-bottom));padding:16px}}
.dm-sidebar-support{gap:9px}.dm-sidebar-support-count{margin-left:auto!important;padding:2px 6px;background:#ffffff25;color:inherit!important;border-radius:8px;font-size:10px!important}.dm-support-notifications{margin:15px 0;border:1px solid var(--line);background:var(--surface);border-radius:16px;padding:16px}.dm-support-notice-row{display:flex;align-items:flex-start;gap:12px;width:100%;text-align:left;padding:14px;border:0;border-radius:12px;background:var(--surface-2);color:var(--ink);margin-top:10px}.dm-support-notice-row.unread{background:var(--primary-soft)}.dm-support-notice-row>span:nth-child(2){flex:1;min-width:0}.dm-support-notice-row strong{font-size:13px}.dm-support-notice-row p{font-size:12px;line-height:1.6;overflow-wrap:anywhere;margin:7px 0}.dm-support-notice-row small{font-size:10px;color:var(--muted)}.dm-support-notice-row>.icon{flex-shrink:0}
.dm-menu-badge-host{position:relative!important}.dm-menu-count{position:absolute!important;right:8px;top:5px;display:grid;place-items:center;min-width:19px;height:19px;padding:0 5px;border-radius:20px;background:#e64660;color:#fff!important;font-size:10px!important;font-weight:750;line-height:1;box-shadow:0 0 0 2px var(--nav)}.dm-menu-count.hidden{display:none!important}.nav .dm-menu-badge-host{padding-right:35px}.mobile-more-grid .dm-menu-count{box-shadow:0 0 0 2px var(--surface)}.mobile-nav .dm-menu-count{right:12%;top:3px;box-shadow:0 0 0 2px var(--surface)}.teacher-nav-message-count{background:#e64660!important;color:#fff!important;border-radius:20px!important;min-width:19px;font-size:10px!important}.dm-sidebar-support .dm-menu-count{right:7px;top:4px}
.mobile-nav>button{position:relative}.dm-menu-count{font-variant-numeric:tabular-nums}.dm-message-alert.dm-support-incoming{left:auto!important;top:auto!important;right:22px!important;bottom:24px!important;transform:none!important;border-radius:20px!important;padding:20px!important;background:var(--surface)!important;color:var(--ink)!important;box-shadow:0 15px 60px #0003!important;max-width:420px!important}.dm-message-alert.dm-support-incoming .dm-message-alert-copy{flex:1;min-width:0}.dm-message-alert.dm-support-incoming .dm-message-alert-copy strong{color:var(--ink)!important;font-size:14px!important}.dm-message-alert.dm-support-incoming .dm-message-alert-copy p{color:var(--muted)!important}body:has(#dmSupportIncoming) #dmMessageAlert{bottom:225px!important}@media(max-width:700px){.dm-message-alert.dm-support-incoming{right:16px!important;bottom:calc(95px + env(safe-area-inset-bottom))!important;width:calc(100vw - 32px)!important;padding:16px!important}body:has(#dmSupportIncoming) #dmMessageAlert{bottom:calc(295px + env(safe-area-inset-bottom))!important}}
.dm-access-preference{display:flex;flex-direction:column;gap:6px}.dm-access-preference label{display:flex;align-items:center;gap:9px;cursor:pointer;color:var(--ink);font-size:13px;font-weight:600}.dm-access-preference input{width:18px;height:18px;accent-color:var(--primary);margin:0}.dm-access-preference small{font-size:11px;color:var(--muted);line-height:1.5}@media(max-width:700px){.dm-access-foot{flex-wrap:wrap;gap:16px}.dm-access-preference{width:100%}}
