/* V22.3 — compact, consistent dashboard sizing across admin/teacher/student */
html,body{max-width:100%;overflow-x:hidden}
.dashboard-shell,.dashboard-main,.dashboard-content,.management-page,.v22-page,.v21-page{min-width:0;box-sizing:border-box}
.dashboard-main{overflow-x:hidden}
.dashboard-content{max-width:1420px;padding:18px 2.4vw 34px}

/* Shared dashboard section headers */
.welcome-strip,.teacher-hero,.student-hero,.module-header{
  min-height:96px!important;
  margin-bottom:12px!important;
  padding:16px 20px!important;
  border-radius:16px!important;
}
.welcome-strip h2,.teacher-hero h2,.student-hero h2,.module-header h2{font-size:19px!important;margin:4px 0!important}
.welcome-strip p,.teacher-hero p,.student-hero p,.module-header p{font-size:9.5px!important;line-height:1.65!important}
.welcome-strip span,.teacher-hero span,.student-hero span,.module-header span{font-size:9px!important}
.header-count{min-width:82px!important;padding:8px 10px!important;border-radius:11px!important}
.header-count b{font-size:20px!important;line-height:1.1!important}
.header-count small{font-size:7.5px!important}

/* Shared cards */
.stats-grid{gap:9px!important;margin-bottom:12px!important}
.stat-card{padding:11px 12px!important;border-radius:13px!important;gap:9px!important;min-height:66px!important}
.stat-icon{width:36px!important;height:36px!important;border-radius:10px!important;font-size:12px!important;flex:0 0 auto}
.stat-card strong{font-size:18px!important}
.panel{padding:14px!important;border-radius:14px!important}
.panel-heading{margin-bottom:10px!important}
.panel-heading h3{font-size:13px!important}
.dashboard-grid{gap:11px!important;margin-bottom:11px!important}

/* Admin students (V22 real-data view): denser cards on desktop */
.v22-head{min-height:0!important;padding:15px 18px!important;margin-bottom:11px!important;border-radius:16px!important;gap:12px!important}
.v22-head h2{font-size:19px!important;margin:3px 0 4px!important}
.v22-head p{font-size:10px!important;line-height:1.6!important}
.v22-head span{font-size:9px!important}
.v22-head>b,.v22-head>button{padding:8px 11px!important;border-radius:10px!important;font-size:11px!important}
.v22-stats{gap:9px!important;margin-bottom:11px!important}
.v22-stat{padding:11px 12px!important;border-radius:13px!important}
.v22-stat b{font-size:18px!important;margin:2px 0!important}
.v22-stat small,.v22-stat span{font-size:9px!important}
.v22-student-admin{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px!important}
.v22-student-card{padding:13px!important;min-width:0!important}
.v22-student-card header{margin-bottom:8px!important;gap:8px!important}
.v22-student-card header>span{width:34px!important;height:34px!important;font-size:12px!important}
.v22-student-card header em{padding:4px 7px!important;font-size:9px!important}
.v22-group-checks{gap:6px!important;margin:8px 0!important}
.v22-group-checks label{padding:7px 8px!important;border-radius:10px!important}
.v22-group-checks small{font-size:9px!important}
.v22-pay-row,.v22-two,.v22-three,.v22-four,.v22-payment-methods{gap:7px!important}
.v22-student-card select,.v22-student-card input,.v22-progress-form select,.v22-apology select,.v22-pay-form select,.v22-pay-form input,.v22-settings-panel input,.v22-filters select,.v22-filters input{padding:7px 8px!important;min-height:34px!important;border-radius:9px!important}
.v22-student-card>button,.v22-progress-form>button,.v22-apology>button,.v22-pay-form>button,.v22-settings-panel>button{padding:9px 12px!important;margin-top:7px!important}

/* Student circle choice: three compact cards on wide screens */
.v22-circle-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:10px!important}
.v22-circle{gap:8px!important;padding:13px!important}
.v22-circle-top{gap:8px!important}
.v22-circle-top>img,.v22-circle-top>span{width:44px!important;height:44px!important;font-size:16px!important}
.v22-circle h3{font-size:14px!important}
.v22-circle small{font-size:9px!important;line-height:1.55!important}
.v22-circle label{font-size:10px!important}
.v22-circle select{max-width:120px!important;padding:6px 7px!important;font-size:10px!important}
.v22-circle button{padding:8px 10px!important;font-size:11px!important;border-radius:9px!important}

/* Existing/legacy circle cards if they are shown */
.student-circle-grid{gap:10px!important}
.student-circle-card{border-radius:15px!important;box-shadow:none!important}
.student-circle-content{padding:13px!important}
.student-circle-content h3{font-size:1rem!important;margin-bottom:5px!important}
.student-circle-content p{font-size:.78rem!important;margin:6px 0 10px!important}
.student-circle-content button{padding:9px 10px!important;font-size:.8rem!important}

/* Teachers: reduce photo/card footprint */
.teacher-admin-grid{gap:11px!important}
.teacher-admin-card{grid-template-columns:118px minmax(0,1fr)!important;min-height:178px!important;border-radius:14px!important}
.teacher-admin-card>div{padding:13px!important}
.teacher-admin-card h3{margin:8px 0 4px!important;font-size:1rem!important}
.teacher-admin-card p{font-size:.76rem!important;margin-bottom:6px!important}
.teacher-admin-card strong{font-size:.76rem!important}
.teacher-status{padding:4px 7px!important;font-size:.68rem!important}
.teacher-card-actions{padding-top:10px!important;gap:6px!important}
.teacher-card-actions button{padding:7px!important;font-size:.72rem!important}

/* Groups: keep each row on one line and make delete action coherent */
.management-columns{gap:11px!important;grid-template-columns:minmax(0,.88fr) minmax(0,1.12fr)!important}
.group-create-form{gap:8px!important;padding:14px!important;min-width:0!important}
.group-create-form select,.group-create-form input{height:35px!important;padding:6px 8px!important}
.group-registry{padding:14px!important;min-width:0!important}
.group-registry article{grid-template-columns:52px minmax(0,1fr) auto auto!important;gap:8px!important;padding:9px 0!important;min-width:0!important}
.group-time{width:48px!important;height:40px!important;border-radius:9px!important;font-size:9px!important}
.group-registry article>div{min-width:0!important}
.group-registry strong{font-size:10px!important}
.group-registry small,.group-registry b{font-size:7.5px!important}
.group-registry em{font-size:7.5px!important;padding:4px 6px!important;white-space:nowrap!important}
.group-delete-v20{display:inline-flex!important;align-items:center!important;justify-content:center!important;white-space:nowrap!important;width:auto!important;min-width:78px!important;min-height:31px!important;margin:0!important;padding:6px 9px!important;border:1px solid #dfaaa3!important;border-radius:9px!important;background:#fff7f5!important;color:#a74840!important;font-size:9px!important;font-weight:900!important;line-height:1!important}

/* Schedules, rooms, attendance, payments, messages */
.schedule-board,.teacher-assignment-grid,.v22-schedule-grid,.v22-room-grid{gap:10px!important}
.schedule-card{padding:12px!important;gap:11px!important;grid-template-columns:64px minmax(0,1fr) auto!important}
.schedule-clock{height:50px!important;border-radius:11px!important;font-size:.9rem!important}
.schedule-card h3{font-size:.9rem!important;margin:3px 0!important}
.schedule-card p{font-size:.75rem!important}
.v22-schedule,.v22-room,.v22-teacher-group,.v22-progress-card{padding:12px!important;border-radius:13px!important}
.v22-filters{gap:8px!important}
.v22-filters label{min-width:130px!important;font-size:10px!important}
.v22-table-wrap th,.v22-table-wrap td{padding:8px!important;font-size:10.5px!important}
.v22-att-groups summary{padding:9px!important}
.v22-att-roster{padding:6px 9px 9px!important}
.v22-att-roster article{padding:7px 0!important}
.v21-page{padding:16px!important;gap:11px!important}
.v21-head{padding:14px 17px!important;border-radius:15px!important;gap:11px!important}
.v21-head h2{font-size:19px!important}
.v21-head p{font-size:10px!important}
.v21-stats{gap:8px!important}
.v21-stats article{padding:11px!important;border-radius:12px!important}
.v21-block,.v21-upload{padding:12px!important}
.v21-message-layout{gap:9px!important}

/* Prevent a wide child from pushing navigation/content sideways */
.management-columns>* ,.teacher-admin-grid>* ,.student-management-list>* ,.v22-student-admin>* ,.v22-circle-grid>* ,.v22-schedule-grid>* ,.v22-room-grid>*{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}

@media(max-width:1180px){
  .management-columns{grid-template-columns:1fr!important}
  .v22-circle-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .v22-student-admin{grid-template-columns:1fr!important}
}
@media(max-width:780px){
  .dashboard-content{padding:11px 10px 78px!important}
  .welcome-strip,.teacher-hero,.student-hero,.module-header{min-height:0!important;padding:13px 14px!important;margin-bottom:9px!important;align-items:flex-start!important}
  .welcome-strip h2,.teacher-hero h2,.student-hero h2,.module-header h2{font-size:17px!important}
  .module-header .header-count{align-self:auto!important;min-width:68px!important;padding:6px 8px!important}
  .stats-grid,.stats-grid.three{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  .stat-card{min-height:58px!important;padding:9px!important}
  .panel{padding:11px!important}
  .teacher-admin-card{grid-template-columns:88px minmax(0,1fr)!important;min-height:150px!important}
  .teacher-admin-card .teacher-portrait{min-height:150px!important}
  .teacher-admin-card>div{padding:10px!important}
  .teacher-card-actions{flex-direction:row!important}
  .teacher-card-actions button{font-size:.66rem!important;padding:6px!important}
  .v22-circle-grid{grid-template-columns:1fr!important}
  .v22-circle{padding:11px!important}
  .v22-head{padding:12px 13px!important;flex-direction:row!important;align-items:center!important}
  .v22-head>div{min-width:0!important}
  .v22-head h2{font-size:17px!important}
  .v22-head p{font-size:9px!important}
  .group-registry article{grid-template-columns:46px minmax(0,1fr) auto!important;gap:6px!important}
  .group-registry article>em{grid-column:3!important;grid-row:1!important}
  .group-registry .group-delete-v20{grid-column:2/4!important;grid-row:2!important;justify-self:start!important;min-width:88px!important;margin-top:2px!important}
  .schedule-card{grid-template-columns:55px minmax(0,1fr)!important}
  .schedule-meta{grid-column:2!important}
  .v21-page{padding:10px!important}
  .v21-head{padding:12px!important}
}
@media(max-width:430px){
  .stats-grid,.stats-grid.three,.v22-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .stat-icon{width:32px!important;height:32px!important}
  .stat-card strong,.v22-stat b{font-size:16px!important}
  .teacher-admin-card{grid-template-columns:78px minmax(0,1fr)!important}
  .teacher-admin-card .teacher-portrait{min-height:138px!important}
  .teacher-card-actions{flex-direction:column!important}
}


/* V22.4 — dashboard one-row stats + centered schedule delete */
@media (min-width:1181px){
  .v22-admin-overview-stats{
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    gap:7px!important;
  }
  .v22-admin-overview-stats .v22-stat{
    min-height:58px!important;
    padding:8px 9px!important;
    border-radius:11px!important;
  }
  .v22-admin-overview-stats .v22-stat small,
  .v22-admin-overview-stats .v22-stat span{
    font-size:8px!important;
    line-height:1.35!important;
  }
  .v22-admin-overview-stats .v22-stat b{
    font-size:17px!important;
    line-height:1.05!important;
    margin:2px 0!important;
  }
}
@media (min-width:781px) and (max-width:1180px){
  .v22-admin-overview-stats{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important}
}

/* Keep delete action centered inside every schedule card */
.schedule-card-v13{
  padding-bottom:46px!important;
}
.schedule-card-v13 .schedule-delete{
  position:absolute!important;
  left:50%!important;
  right:auto!important;
  bottom:9px!important;
  transform:translateX(-50%)!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:78px!important;
  min-height:29px!important;
  margin:0!important;
  white-space:nowrap!important;
  line-height:1!important;
  text-align:center!important;
}
@media(max-width:760px){
  .schedule-card-v13{padding-bottom:12px!important}
  .schedule-card-v13 .schedule-delete{
    position:static!important;
    grid-column:1/-1!important;
    justify-self:center!important;
    transform:none!important;
    margin-top:5px!important;
  }
}
