/* AcademicKey V66 — canonical system consistency layer
   This is the final presentation layer for shared staff/student primitives.
   Keep page-specific feature styling in its own files; shared shell, spacing,
   responsive behavior and overflow policy belong here. */

:root{
  --ak-control-h:42px;
  --ak-radius-sm:10px;
  --ak-radius-md:14px;
  --ak-staff-rail-w:220px;
  --ak-staff-header-h:64px;
  --ak-staff-content-max:1540px;
  --ak-staff-gutter:clamp(12px,2vw,28px);
  --ak-staff-section-gap:14px;
  --ak-staff-panel-pad:clamp(12px,1.4vw,18px);
}

body.ak-staff-ui-v55 input:not([type="checkbox"]):not([type="radio"]),
body.ak-staff-ui-v55 select,
body.ak-staff-ui-v55 textarea,
.student-workspace input:not([type="checkbox"]):not([type="radio"]),
.student-workspace select,
.student-workspace textarea{
  min-height:var(--ak-control-h);
  border-radius:var(--ak-radius-sm);
}
body.ak-staff-ui-v55 textarea,.student-workspace textarea{min-height:96px}
body.ak-staff-ui-v55 form label,.student-workspace form label{opacity:1;line-height:1.35}
body.ak-staff-ui-v55 form small,.student-workspace form small{line-height:1.45}
.btn,button.btn,a.btn{
  min-height:40px;
  border-radius:var(--ak-radius-sm);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  line-height:1.15;
}
.btn.small,a.btn.small,button.btn.small{min-height:34px}
.card,.panel,.form-surface,.student-card,.student-panel,.student-course-card{border-radius:var(--ak-radius-md)}
table th{font-weight:750}
table td,table th{vertical-align:middle}
.pill,[class*="status-"]{white-space:nowrap;line-height:1.2}
.empty-state{min-height:110px;display:grid;place-items:center;text-align:center;padding:24px 16px}

body.ak-staff-ui-v55{
  --ak-admin-rail-width:var(--ak-staff-rail-w);
  --ak-admin-header-height:var(--ak-staff-header-h);
  overflow-x:visible!important;
}
body.ak-staff-ui-v55 #main-content,
body.ak-staff-ui-v55 .app-shell,
body.ak-staff-ui-v55 .admin-shell,
body.ak-staff-ui-v55 .content,
body.ak-staff-ui-v55 .main-content,
body.ak-staff-ui-v55 .workspace-inner{
  min-width:0!important;
  max-width:100%;
}
body.ak-staff-ui-v55 .workspace,
body.ak-staff-ui-v55 main.workspace,
body.ak-staff-ui-v55 main.modern-workspace{
  box-sizing:border-box;
  min-width:0!important;
  max-width:var(--ak-staff-content-max)!important;
  overflow-x:visible!important;
}

@media (min-width:901px){
  body.ak-staff-ui-v55 #main-content > main,
  body.ak-staff-ui-v55 #main-content > .task-shell{
    box-sizing:border-box!important;
    width:calc(100% - var(--ak-staff-rail-w))!important;
    max-width:calc(100% - var(--ak-staff-rail-w))!important;
    min-width:0!important;
    margin-inline-start:var(--ak-staff-rail-w)!important;
    margin-inline-end:0!important;
  }
  body.ak-staff-ui-v55 #main-content > main.workspace,
  body.ak-staff-ui-v55 #main-content > main.modern-workspace{
    inline-size:calc(100% - var(--ak-staff-rail-w))!important;
  }
  body.ak-staff-ui-v55 .staff-quicknav.ak-admin-rail-v55{
    width:var(--ak-staff-rail-w)!important;
    max-width:var(--ak-staff-rail-w)!important;
  }
  body.ak-staff-ui-v55 .workspace{padding-inline:var(--ak-staff-gutter)}
}

body.ak-staff-ui-v55 .modern-topbar{min-width:0}
body.ak-staff-ui-v55 .top-search{min-width:0;max-width:620px}
body.ak-staff-ui-v55 .header-account-actions{min-width:0}
body.ak-staff-ui-v55 .user-chip{min-width:0;max-width:230px}
body.ak-staff-ui-v55 .user-chip>div:last-child{min-width:0}
body.ak-staff-ui-v55 .user-chip b,
body.ak-staff-ui-v55 .user-chip small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

body.ak-staff-ui-v55 .panel,
body.ak-staff-ui-v55 .data-surface,
body.ak-staff-ui-v55 .form-surface,
body.ak-staff-ui-v55 .summary-card,
body.ak-staff-ui-v55 .metric{min-width:0;max-width:100%}
body.ak-staff-ui-v55 .two-col{align-items:start}
body.ak-staff-ui-v55 .section-title-row{flex-wrap:wrap}
body.ak-staff-ui-v55 .toolbar{min-width:0;flex-wrap:wrap}
body.ak-staff-ui-v55 .toolbar input,
body.ak-staff-ui-v55 .toolbar select{min-width:0}
body.ak-staff-ui-v55 img,
body.ak-staff-ui-v55 svg{max-width:100%}

body.ak-staff-ui-v55 .table-wrap,
body.ak-staff-ui-v55 .table-scroll,
body.ak-staff-ui-v55 .ak-table-host-v56{
  box-sizing:border-box;
  width:100%;
  max-width:100%;
  min-width:0;
  overflow-x:auto!important;
  overflow-y:auto;
  overscroll-behavior-inline:contain;
  -webkit-overflow-scrolling:touch;
}
body.ak-staff-ui-v55 table{max-width:none;font-size:max(12px,1em)}
body.ak-staff-ui-v55 table th,
body.ak-staff-ui-v55 table td{line-height:1.4}
body.ak-staff-ui-v55 td .btn,
body.ak-staff-ui-v55 td button.btn,
body.ak-staff-ui-v55 td .icon-link{flex-shrink:0}
body.ak-staff-ui-v55 .ak-admin-table-v56 .ak-action-cell-v56,
body.ak-staff-ui-v55 .table-wrap td:last-child,
body.ak-staff-ui-v55 .table-scroll td:last-child{min-width:120px}
body.ak-staff-ui-v55 .ak-admin-table-v56 .ak-action-cell-v56>form,
body.ak-staff-ui-v55 .ak-admin-table-v56 .ak-action-cell-v56>.row-actions,
body.ak-staff-ui-v55 td .row-actions{display:flex;flex-wrap:wrap;gap:6px;align-items:center}

body.ak-staff-ui-v55 .ak-reports-v65 table{font-size:12px!important}
body.ak-staff-ui-v55 .ak-reports-v65 th,
body.ak-staff-ui-v55 .ak-reports-v65 td{font-size:12px!important}
body.ak-staff-ui-v55 .ak-attendance-group-v65 .session-card b{font-size:12px!important}
body.ak-staff-ui-v55 .ak-attendance-group-v65 .session-card small,
body.ak-staff-ui-v55 .ak-attendance-group-v65 .session-state{font-size:11px!important}

body.ak-staff-ui-v55 .ak-owner-dashboard-v57,
body.ak-staff-ui-v55 .ak-dashboard-v55{width:100%!important;max-width:100%!important;min-width:0!important}
body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .hero-dashboard>*{min-width:0}
body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .today-cards,
body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .modern-metrics,
body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .metric-grid,
body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .dashboard-kpis{width:100%;min-width:0}
body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .dashboard-columns,
body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .dashboard-main-grid,
body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .owner-grid,
body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .ak-owner-focus-v57,
body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .ak-owner-lists-v57{min-width:0}

/* Big staff consolidation block: hierarchy, density and common page behavior. */
body.ak-staff-ui-v55 .page-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  padding-block:16px 12px;
}
body.ak-staff-ui-v55 .page-head h1{margin:0;line-height:1.12}
body.ak-staff-ui-v55 .page-head p{margin:5px 0 0;max-width:760px;line-height:1.5}
body.ak-staff-ui-v55 .summary-grid,
body.ak-staff-ui-v55 .modern-metrics,
body.ak-staff-ui-v55 .today-cards{align-items:stretch}
body.ak-staff-ui-v55 .summary-card,
body.ak-staff-ui-v55 .metric,
body.ak-staff-ui-v55 .dark-panel,
body.ak-staff-ui-v55 .data-surface,
body.ak-staff-ui-v55 .form-surface,
body.ak-staff-ui-v55 .profile-panel{box-sizing:border-box}
body.ak-staff-ui-v55 .data-surface,
body.ak-staff-ui-v55 .form-surface,
body.ak-staff-ui-v55 .profile-panel{padding:var(--ak-staff-panel-pad)}
body.ak-staff-ui-v55 .summary-card,
body.ak-staff-ui-v55 .metric{min-height:88px}
body.ak-staff-ui-v55 .summary-card b,
body.ak-staff-ui-v55 .metric b{line-height:1.05}
body.ak-staff-ui-v55 .summary-card small,
body.ak-staff-ui-v55 .metric small{line-height:1.35}

body.ak-staff-ui-v55 .toolbar,
body.ak-staff-ui-v55 .ak-filter-bar-v56,
body.ak-staff-ui-v55 .report-filter-bar{
  gap:8px;
  align-items:end;
}
body.ak-staff-ui-v55 .toolbar label,
body.ak-staff-ui-v55 .ak-filter-bar-v56 label,
body.ak-staff-ui-v55 .report-filter-bar label{min-width:0}
body.ak-staff-ui-v55 .toolbar input:not([type="checkbox"]):not([type="radio"]),
body.ak-staff-ui-v55 .toolbar select,
body.ak-staff-ui-v55 .report-filter-bar input,
body.ak-staff-ui-v55 .report-filter-bar select{max-width:100%}
body.ak-staff-ui-v55 .toolbar .btn,
body.ak-staff-ui-v55 .ak-filter-bar-v56 .btn,
body.ak-staff-ui-v55 .report-filter-bar .btn{white-space:nowrap}

body.ak-staff-ui-v55 table thead th{position:sticky;top:0;z-index:1}
body.ak-staff-ui-v55 table tbody tr{transition:background .12s ease}
body.ak-staff-ui-v55 table td{overflow-wrap:anywhere}
body.ak-staff-ui-v55 table td small{line-height:1.4}
body.ak-staff-ui-v55 .table-wrap .btn.small,
body.ak-staff-ui-v55 .table-scroll .btn.small{min-height:32px}

/* CRM / student / course / enrollment pages share compact directory behavior. */
body.ak-staff-ui-v55 [class*="crm-"] .summary-grid,
body.ak-staff-ui-v55 [class*="lead-"] .summary-grid,
body.ak-staff-ui-v55 [class*="student-"] .summary-grid,
body.ak-staff-ui-v55 [class*="course-"] .summary-grid{gap:10px}
body.ak-staff-ui-v55 [class*="directory"]{min-width:0;max-width:100%}
body.ak-staff-ui-v55 [class*="directory"] .table-wrap{margin-top:8px}
body.ak-staff-ui-v55 .ak-enrollment-directory-v60,
body.ak-staff-ui-v55 .ak-free-sessions-directory-v60{width:100%;max-width:100%;box-sizing:border-box}

/* My Tasks: keep the Jira-like list useful without squeezing columns under the rail. */
body.ak-staff-ui-v55 .ops-shell{box-sizing:border-box;width:100%;max-width:1480px;margin-inline:auto;padding:18px var(--ak-staff-gutter) 56px}
body.ak-staff-ui-v55 .ops-hero{min-width:0;padding:20px 22px}
body.ak-staff-ui-v55 .ops-hero__copy{min-width:0}
body.ak-staff-ui-v55 .ops-hero h1{font-size:clamp(1.75rem,2.5vw,2.65rem)}
body.ak-staff-ui-v55 .ops-hero p{font-size:.92rem}
body.ak-staff-ui-v55 .ops-metrics{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
body.ak-staff-ui-v55 .ops-metric{min-height:82px;padding:12px 14px}
body.ak-staff-ui-v55 .ops-metric strong{font-size:clamp(1.7rem,2.4vw,2.2rem)}
body.ak-staff-ui-v55 .ops-toolbar{gap:10px;flex-wrap:wrap}
body.ak-staff-ui-v55 .ops-toolbar__main{flex:1 1 420px}
body.ak-staff-ui-v55 .ops-search{max-width:520px;width:100%}
body.ak-staff-ui-v55 .ops-nav{margin-block:14px 12px}
body.ak-staff-ui-v55 .ops-section{margin-bottom:10px}
body.ak-staff-ui-v55 .ops-section__head{padding:13px 14px 10px}
body.ak-staff-ui-v55 .ops-card-list{padding:8px;gap:7px}
body.ak-staff-ui-v55 .ops-card__body{padding:9px 11px 8px}

/* Prevent over-tall empty cards/panels and large dead areas. */
body.ak-staff-ui-v55 .dark-panel:has(> .empty-state:only-child),
body.ak-staff-ui-v55 .data-surface:has(> .empty-state:only-child){min-height:0}
body.ak-staff-ui-v55 .dark-panel > .empty-state:only-child,
body.ak-staff-ui-v55 .data-surface > .empty-state:only-child{min-height:86px}

/* RTL/LTR: keep logical spacing and action groups predictable. */
body.ak-staff-ui-v55 .row-actions,
body.ak-staff-ui-v55 .toolbar,
body.ak-staff-ui-v55 .section-title-row{direction:inherit}
body.ak-staff-ui-v55 .row-actions{justify-content:flex-start}
body.ak-staff-ui-v55 [dir="rtl"] .row-actions{justify-content:flex-start}

@media (max-width:1200px){
  body.ak-staff-ui-v55 .modern-topbar{flex-wrap:wrap}
  body.ak-staff-ui-v55 .top-search{order:3;flex:1 1 100%;max-width:none;width:100%}
  body.ak-staff-ui-v55 .header-account-actions{margin-inline-start:auto}
  body.ak-staff-ui-v55 .two-col{grid-template-columns:1fr!important}
  body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .dashboard-columns,
  body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .dashboard-main-grid,
  body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .owner-grid,
  body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .ak-owner-focus-v57{grid-template-columns:1fr!important}
  body.ak-staff-ui-v55 .ops-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  body.ak-staff-ui-v55 .ops-flow{grid-template-columns:1fr!important}
  body.ak-staff-ui-v55 .ops-flow .ops-section{grid-column:1!important;grid-row:auto!important}
}

@media (max-width:900px){
  body.ak-staff-ui-v55{--ak-admin-rail-width:0px;font-size:14px}
  body.ak-staff-ui-v55 #main-content > main,
  body.ak-staff-ui-v55 #main-content > .task-shell,
  body.ak-staff-ui-v55 #main-content > main.workspace,
  body.ak-staff-ui-v55 #main-content > main.modern-workspace{
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    inline-size:100%!important;
    margin-inline:0!important;
    padding-inline:12px;
    min-width:0!important;
  }
  body.ak-staff-ui-v55 .workspace{width:100%!important;max-width:100%!important;padding-inline:12px}
  body.ak-staff-ui-v55 .header-settings b,
  body.ak-staff-ui-v55 .header-language b,
  body.ak-staff-ui-v55 .header-logout-label,
  body.ak-staff-ui-v55 .user-chip>div:last-child{display:none}
  body.ak-staff-ui-v55 .user-chip{min-width:auto}
  body.ak-staff-ui-v55 .toolbar{align-items:stretch}
  body.ak-staff-ui-v55 .toolbar>*{flex:1 1 calc(50% - 8px);min-width:150px}
  body.ak-staff-ui-v55 .ak-filter-bar-v56>*{min-width:0}
  body.ak-staff-ui-v55 .ak-admin-table-v56,
  body.ak-staff-ui-v55 .ak-enrollment-table-v60,
  body.ak-staff-ui-v55 .ak-free-sessions-table-v60{width:max-content;min-width:100%}
  body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .today-cards,
  body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .modern-metrics,
  body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .metric-grid,
  body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .dashboard-kpis,
  body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .ak-owner-lists-v57{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.ak-staff-ui-v55 .ops-shell{padding:12px 12px 48px}
  body.ak-staff-ui-v55 .ops-hero{align-items:flex-start;flex-direction:column;gap:14px;padding:16px}
  body.ak-staff-ui-v55 .ops-toolbar__main{flex-basis:100%;width:100%}
  body.ak-staff-ui-v55 .ops-scope{max-width:100%;overflow-x:auto}
}

@media (max-width:600px){
  body.ak-staff-ui-v55 .modern-topbar{padding-inline:10px;gap:8px}
  body.ak-staff-ui-v55 .modern-brand span{display:none}
  body.ak-staff-ui-v55 .top-search{min-width:0;width:100%}
  body.ak-staff-ui-v55 .page-head{align-items:flex-start;padding-block:12px 8px}
  body.ak-staff-ui-v55 .page-head h1{font-size:clamp(22px,7vw,26px)}
  body.ak-staff-ui-v55 .toolbar,
  body.ak-staff-ui-v55 .report-filter-bar{display:grid!important;grid-template-columns:1fr!important}
  body.ak-staff-ui-v55 .toolbar>*,
  body.ak-staff-ui-v55 .report-filter-bar>*{width:100%!important;min-width:0!important}
  body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .today-cards,
  body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .modern-metrics,
  body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .metric-grid,
  body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .dashboard-kpis,
  body.ak-staff-ui-v55 .ak-owner-dashboard-v57 .ak-owner-lists-v57,
  body.ak-staff-ui-v55 .summary-grid,
  body.ak-staff-ui-v55 .session-cards,
  body.ak-staff-ui-v55 .finance-control-center .fcc-summary,
  body.ak-staff-ui-v55 .finance-control-center .fcc-balance-grid,
  body.ak-staff-ui-v55 .expense-center .current-balance-grid,
  body.ak-staff-ui-v55 .expense-center .expense-summary{grid-template-columns:1fr!important}
  body.ak-staff-ui-v55 .data-surface,
  body.ak-staff-ui-v55 .form-surface,
  body.ak-staff-ui-v55 .profile-panel{padding-inline:12px}
  body.ak-staff-ui-v55 .table-wrap,
  body.ak-staff-ui-v55 .table-scroll,
  body.ak-staff-ui-v55 .ak-table-host-v56{margin-inline:0;border-radius:10px}
  body.ak-staff-ui-v55 table{font-size:12px}
  body.ak-staff-ui-v55 table th,
  body.ak-staff-ui-v55 table td{padding:8px!important}
  body.ak-staff-ui-v55 .ak-admin-table-v56 .ak-action-cell-v56,
  body.ak-staff-ui-v55 .table-wrap td:last-child,
  body.ak-staff-ui-v55 .table-scroll td:last-child{min-width:108px}
  body.ak-staff-ui-v55 .btn{min-height:42px}
  body.ak-staff-ui-v55 .ops-metrics{grid-template-columns:1fr}
  body.ak-staff-ui-v55 .ops-metric{min-height:72px}
  body.ak-staff-ui-v55 .ops-hero h1{font-size:1.65rem}
  body.ak-staff-ui-v55 .ops-hero p{font-size:.86rem;line-height:1.55}
  body.ak-staff-ui-v55 .ops-nav{width:100%;border-radius:11px}
  body.ak-staff-ui-v55 .ops-nav a{padding:9px 12px}
}

@media(max-width:720px){
  .student-workspace{padding-bottom:calc(94px + env(safe-area-inset-bottom,0px))!important}
  .student-workspace .card,.student-workspace .panel,.student-workspace .student-card{margin-bottom:12px}
  .student-workspace h1{line-height:1.2}
  .student-workspace .btn{min-height:42px}
  .student-workspace .empty-state{min-height:88px;padding:18px 12px}
}
