/* AI Tutoriz — Public Styles */
:root {
    --ait-primary: #2563eb;
    --ait-primary-dark: #1d4ed8;
    --ait-success: #16a34a;
    --ait-warning: #d97706;
    --ait-error: #dc2626;
    --ait-bg: #f8fafc;
    --ait-card: #ffffff;
    --ait-border: #e2e8f0;
    --ait-text: #1e293b;
    --ait-muted: #64748b;
    --ait-radius: 10px;
    --ait-shadow: 0 2px 12px rgba(0,0,0,.08);
}

/* ── RESET & BASE ── */
.ait-dashboard *, .ait-login-wrap * { box-sizing: border-box; }

/* ── FULL-SCREEN LOGIN ── */
.ait-fullscreen-login {
    display: flex;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: -20px;  /* override theme padding */
}

/* Left brand panel */
.ait-login-brand {
    flex: 0 0 42%;
    background: linear-gradient(145deg, #1e40af 0%, #2563eb 40%, #3b82f6 70%, #0ea5e9 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 48px 32px;
    position: relative;
    overflow: hidden;
}
.ait-login-brand::before {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: rgba(255,255,255,.07);
}
.ait-login-brand::after {
    content: '';
    position: absolute;
    bottom: -60px; left: -60px;
    width: 240px; height: 240px;
    border-radius: 50%;
    background: rgba(255,255,255,.05);
}
.ait-brand-content { position: relative; z-index: 1; }
.ait-brand-logo {
    width: 64px; height: 64px;
    background: rgba(255,255,255,.15);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}
.ait-brand-logo svg { width: 40px; height: 40px; }
.ait-brand-logo img { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; }
.ait-brand-title {
    font-size: 32px; font-weight: 800; color: #fff;
    margin: 0 0 10px; line-height: 1.2;
}
.ait-brand-tagline {
    font-size: 15px; color: rgba(255,255,255,.75);
    margin: 0 0 40px; line-height: 1.6;
}
.ait-brand-features { display: flex; flex-direction: column; gap: 16px; }
.ait-feature-item {
    display: flex; align-items: center; gap: 14px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 12px; padding: 14px 18px;
    color: #fff; font-size: 14px; font-weight: 500;
    backdrop-filter: blur(4px);
}
.ait-feature-icon { font-size: 20px; flex-shrink: 0; }
.ait-brand-footer {
    position: relative; z-index: 1;
    color: rgba(255,255,255,.5); font-size: 13px;
}

/* Right form panel */
.ait-login-form-panel {
    flex: 1;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}
.ait-login-form-wrap {
    width: 100%;
    max-width: 420px;
}
.ait-form-header { margin-bottom: 28px; }
.ait-form-header h2 {
    font-size: 28px; font-weight: 800; color: #0f172a;
    margin: 0 0 6px;
}
.ait-form-header p { color: #64748b; font-size: 15px; margin: 0; }

/* Fields */
.ait-form .ait-field { margin-bottom: 20px; }
.ait-form .ait-field label {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: #374151;
    margin-bottom: 7px;
}
.ait-field-icon { font-size: 14px; }
.ait-form .ait-field input {
    width: 100%; padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px; font-size: 15px; color: #0f172a;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.ait-form .ait-field input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
    outline: none;
}
.ait-password-wrap { position: relative; }
.ait-password-wrap input { padding-right: 48px; }
.ait-toggle-pw {
    position: absolute; right: 14px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    font-size: 16px; padding: 0; line-height: 1;
    color: #94a3b8;
}

/* Remember + forgot row */
.ait-form-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
}
.ait-checkbox-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: #374151; cursor: pointer;
}
.ait-checkbox-label input[type=checkbox] { width: 16px; height: 16px; accent-color: #2563eb; }
.ait-forgot-link { font-size: 13px; color: #2563eb; text-decoration: none; font-weight: 500; }
.ait-forgot-link:hover { text-decoration: underline; }

/* Submit button */
.ait-btn-login {
    height: 52px; font-size: 16px; font-weight: 700;
    border-radius: 10px; letter-spacing: .01em;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-top: 4px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 4px 14px rgba(37,99,235,.35);
    transition: transform .15s, box-shadow .15s;
}
.ait-btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37,99,235,.4);
}
.ait-btn-arrow { font-size: 18px; }

/* Footer + role badges */
.ait-form-footer { text-align: center; margin-top: 20px; font-size: 14px; color: #64748b; }
.ait-link-primary { color: #2563eb; font-weight: 600; text-decoration: none; }
.ait-link-primary:hover { text-decoration: underline; }
.ait-login-roles {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-top: 24px; padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}
.ait-role-badge {
    padding: 5px 14px; border-radius: 20px;
    font-size: 13px; font-weight: 600;
}
.ait-role-student { background: #eff6ff; color: #1d4ed8; }
.ait-role-teacher { background: #f0fdf4; color: #15803d; }
.ait-role-divider { color: #cbd5e1; font-size: 18px; }

/* Old simple login wrap (keep as fallback) */
.ait-login-wrap {
    display: flex; align-items: center; justify-content: center;
    min-height: 60vh; padding: 20px;
}
.ait-login-card {
    background: var(--ait-card); border-radius: var(--ait-radius);
    box-shadow: var(--ait-shadow); padding: 40px; width: 100%; max-width: 400px;
}
.ait-register-card { max-width: 600px; }
.ait-login-logo { text-align: center; margin-bottom: 28px; }
.ait-login-logo svg { display: block; margin: 0 auto 10px; }
.ait-login-logo h2 { margin: 0; font-size: 22px; color: var(--ait-text); }
.ait-login-footer { text-align: center; margin: 16px 0 0; font-size: 13px; color: var(--ait-muted); }
.ait-login-footer a { color: var(--ait-primary); text-decoration: none; font-weight: 600; }

/* Responsive */
@media (max-width: 800px) {
    .ait-fullscreen-login { flex-direction: column; margin: 0; min-height: auto; }
    .ait-login-brand { flex: none; padding: 32px 24px; border-radius: 0; }
    .ait-brand-features { display: none; }
    .ait-brand-title { font-size: 24px; }
    .ait-login-form-panel { padding: 32px 20px; }
}

/* ── BUTTONS ── */
.ait-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border-radius: 7px; font-size: 14px; font-weight: 600;
    cursor: pointer; text-decoration: none; border: 1.5px solid var(--ait-border);
    background: var(--ait-card); color: var(--ait-text); transition: all .15s;
}
.ait-btn:hover { background: var(--ait-bg); }
.ait-btn-primary { background: var(--ait-primary); color: #fff; border-color: var(--ait-primary); }
.ait-btn-primary:hover { background: var(--ait-primary-dark); border-color: var(--ait-primary-dark); }
.ait-btn-full { width: 100%; margin-top: 8px; padding: 12px; font-size: 15px; }
.ait-btn-sm { padding: 6px 14px; font-size: 13px; }

/* ── ALERTS ── */
.ait-alert {
    padding: 12px 16px; border-radius: 7px; margin-bottom: 16px;
    font-size: 14px; font-weight: 500;
}
.ait-alert-error   { background: #fef2f2; color: var(--ait-error);   border: 1px solid #fca5a5; }
.ait-alert-success { background: #f0fdf4; color: var(--ait-success);  border: 1px solid #86efac; }
.ait-alert-info    { background: #eff6ff; color: var(--ait-primary);  border: 1px solid #93c5fd; }

/* ── DASHBOARD ── */
.ait-dashboard { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--ait-text); }
.ait-dash-header {
    background: var(--ait-primary); color: #fff;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px; border-radius: var(--ait-radius) var(--ait-radius) 0 0;
}
.ait-dash-title strong { font-size: 18px; display: block; }
.ait-dash-title span  { font-size: 12px; opacity: .8; }
.ait-dash-user { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.ait-logout-btn {
    background: rgba(255,255,255,.15); color: #fff; padding: 6px 14px;
    border-radius: 6px; text-decoration: none; font-size: 13px; font-weight: 600;
    transition: background .15s;
}
.ait-logout-btn:hover { background: rgba(255,255,255,.25); color: #fff; }

/* ── TABS ── */
.ait-tabs {
    display: flex; background: var(--ait-card);
    border-bottom: 2px solid var(--ait-border); padding: 0 16px;
}
.ait-tab {
    padding: 14px 18px; font-size: 14px; font-weight: 600;
    color: var(--ait-muted); text-decoration: none; border-bottom: 2px solid transparent;
    margin-bottom: -2px; transition: color .15s, border-color .15s;
}
.ait-tab:hover { color: var(--ait-primary); }
.ait-tab-active { color: var(--ait-primary) !important; border-bottom-color: var(--ait-primary); }

/* ── CONTENT AREA ── */
.ait-dash-content {
    background: var(--ait-card); border-radius: 0 0 var(--ait-radius) var(--ait-radius);
    padding: 28px; min-height: 300px;
}
.ait-dash-content h2 { margin-top: 0; font-size: 20px; }
.ait-dash-content h3 { font-size: 16px; color: var(--ait-text); margin: 20px 0 10px; }

/* ── STATS GRID ── */
.ait-stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px; margin: 20px 0;
}
.ait-stat-card {
    background: var(--ait-bg); border: 1px solid var(--ait-border);
    border-radius: var(--ait-radius); padding: 18px; text-align: center;
}
.ait-stat-label { display: block; font-size: 12px; color: var(--ait-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.ait-stat-value { display: block; font-size: 28px; font-weight: 700; color: var(--ait-primary); }

/* ── TABLE ── */
.ait-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ait-table th { background: var(--ait-bg); padding: 10px 14px; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ait-muted); border-bottom: 2px solid var(--ait-border); }
.ait-table td { padding: 10px 14px; border-bottom: 1px solid var(--ait-border); }
.ait-table tr:last-child td { border-bottom: none; }
.ait-table tr:hover td { background: var(--ait-bg); }

/* ── CARDS LIST ── */
.ait-cards-list { display: flex; flex-direction: column; gap: 10px; }
.ait-resource-card, .ait-quiz-card {
    display: flex; align-items: center; gap: 14px;
    background: var(--ait-bg); border: 1px solid var(--ait-border);
    border-radius: var(--ait-radius); padding: 14px 18px;
}
.ait-resource-type {
    padding: 4px 10px; border-radius: 5px; font-size: 11px; font-weight: 700;
    letter-spacing: .05em; white-space: nowrap; flex-shrink: 0;
}
.ait-type-link     { background: #dbeafe; color: #1d4ed8; }
.ait-type-video    { background: #fce7f3; color: #be185d; }
.ait-type-pdf      { background: #fee2e2; color: #b91c1c; }
.ait-type-document { background: #ede9fe; color: #6d28d9; }
.ait-resource-info { flex: 1; }
.ait-resource-info strong { display: block; margin-bottom: 3px; }
.ait-resource-info p { margin: 0; font-size: 13px; color: var(--ait-muted); }
.ait-resource-info small { font-size: 12px; color: var(--ait-muted); }
.ait-quiz-card { justify-content: space-between; }
.ait-quiz-info strong { display: block; margin-bottom: 3px; }
.ait-quiz-info small { font-size: 12px; color: var(--ait-muted); }
.ait-quiz-done { opacity: .75; }

/* ── BADGES ── */
.ait-badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
}
.ait-badge-success, .ait-score-pass { background: #dcfce7; color: #166534; }
.ait-score-mid    { background: #fef9c3; color: #854d0e; }
.ait-score-fail   { background: #fee2e2; color: #991b1b; }

/* ── QUIZ TAKE ── */
.ait-quiz-take { max-width: 750px; }
.ait-quiz-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.ait-quiz-header h2 { margin: 0; }
.ait-timer {
    background: var(--ait-primary); color: #fff; padding: 8px 18px;
    border-radius: 8px; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums;
}
.ait-timer.warning { background: var(--ait-warning); }
.ait-timer.danger  { background: var(--ait-error); }
.ait-question { background: var(--ait-bg); border: 1px solid var(--ait-border); border-radius: var(--ait-radius); padding: 20px; margin-bottom: 16px; }
.ait-q-num { margin: 0 0 6px; font-size: 12px; color: var(--ait-muted); text-transform: uppercase; letter-spacing: .05em; }
.ait-points { background: #eff6ff; color: var(--ait-primary); padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.ait-q-text { margin: 0 0 14px; font-weight: 600; font-size: 15px; }
.ait-answers { display: flex; flex-direction: column; gap: 8px; }
.ait-answer-option {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; background: var(--ait-card); border: 2px solid var(--ait-border);
    border-radius: 8px; cursor: pointer; transition: border-color .15s, background .15s;
}
.ait-answer-option:hover { border-color: var(--ait-primary); background: #eff6ff; }
.ait-answer-option input { display: none; }
.ait-answer-option.selected { border-color: var(--ait-primary); background: #eff6ff; }
.ait-answer-label { font-weight: 700; color: var(--ait-primary); min-width: 20px; }
.ait-answer-text { flex: 1; }
.ait-quiz-footer { display: flex; gap: 12px; margin-top: 20px; }

/* ── QUIZ RESULT ── */
.ait-quiz-result { max-width: 700px; }
.ait-result-score { text-align: center; margin: 24px 0; }
.ait-result-circle {
    width: 110px; height: 110px; border-radius: 50%; margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 700; color: #fff;
}
.ait-result-circle.pass { background: var(--ait-success); }
.ait-result-circle.mid  { background: var(--ait-warning); }
.ait-result-circle.fail { background: var(--ait-error); }
.ait-review-item { padding: 14px 18px; border-radius: 8px; margin-bottom: 10px; border: 1px solid; }
.ait-review-item.correct { background: #f0fdf4; border-color: #86efac; }
.ait-review-item.wrong   { background: #fef2f2; border-color: #fca5a5; }
.ait-review-item p { margin: 0 0 4px; font-size: 14px; }
.ait-explanation { font-style: italic; color: var(--ait-muted); margin-top: 6px !important; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
    .ait-dash-header { flex-direction: column; gap: 10px; align-items: flex-start; }
    .ait-tabs { overflow-x: auto; }
    .ait-field-row { grid-template-columns: 1fr; }
    .ait-stats-grid { grid-template-columns: 1fr 1fr; }
    .ait-dash-content { padding: 16px; }
}

/* ── Quiz media display ── */
.ait-media-img { margin: 10px 0; }
.ait-media-img img {
    max-width: 100%; max-height: 320px; border-radius: 8px;
    border: 1px solid var(--ait-border); display: block;
}
.ait-media-video { margin: 10px 0; position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 8px; }
.ait-media-video iframe,
.ait-media-video video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 8px; border: none; }
.ait-media-audio { margin: 10px 0; }
.ait-media-audio audio { width: 100%; max-width: 480px; }
.ait-media-pdf, .ait-media-link { margin: 8px 0; }
.ait-media-embed { margin: 10px 0; border-radius: 8px; overflow: hidden; }

/* Answer with media */
.ait-answer-content { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ait-answer-content .ait-media-img img { max-height: 160px; }
.ait-answer-option { align-items: flex-start; }


/* ═══════════════════════════════════════════════════════════════
   AI TUTORIZ — PROFESSIONAL DASHBOARD STYLES
   Appended to existing public.css — does not modify original rules
   ═══════════════════════════════════════════════════════════════ */

/* Tabler icons loaded via wp_enqueue_style in class-shortcodes.php */

:root {
  --ait-teacher: #2563eb;
  --ait-teacher-dark: #1d4ed8;
  --ait-student: #1d9e75;
  --ait-student-dark: #0f6e56;
  --ait-sidebar-bg: #1a2744;
  --ait-muted: #64748b;
  --ait-border: #e2e8f0;
  --ait-bg: #f4f6fb;
  --ait-card: #ffffff;
  --ait-text: #1e293b;
  --ait-radius: 10px;
}

/* ── Wrapper layout ── */
.ait-pro-wrap {
  display: flex;
  min-height: 100vh;
  background: var(--ait-bg);
  /* Use negative margin to break out of theme content padding */
  margin: -20px calc(-50vw + 50%) 0;
  width: 100vw;
  max-width: 100vw;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-sizing: border-box;
  overflow-x: hidden;
}
/* When body has no padding the wrap should just be full width */
.ait-dashboard-page .ait-pro-wrap {
  margin: 0;
  width: 100%;
}

/* When WP admin bar is present, offset the sticky sidebar */
.admin-bar .ait-pro-sidebar {
  top: 32px;
  height: calc(100vh - 32px);
}
@media (max-width: 782px) {
  .admin-bar .ait-pro-sidebar {
    top: 46px;
    height: calc(100vh - 46px);
  }
}

/* ── Sidebar ── */
.ait-pro-sidebar {
  width: 200px;
  min-height: 100vh;
  background: var(--ait-sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width .2s ease;
}

/* ── Logo ── */
.ait-pro-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.ait-pro-logo-icon {
  width: 34px; height: 34px;
  background: var(--ait-teacher);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; flex-shrink: 0;
}
.ait-logo-student { background: var(--ait-student) !important; }
.ait-pro-logo-name { color: #fff; font-size: 15px; font-weight: 700; line-height: 1.2; }
.ait-pro-logo-sub  { color: rgba(255,255,255,.45); font-size: 10px; }

/* ── Nav ── */
.ait-pro-nav { padding: 10px 8px; flex: 1; }
.ait-pro-nav-section {
  color: rgba(255,255,255,.3);
  font-size: 10px; font-weight: 600; letter-spacing: 1px;
  padding: 8px 8px 4px; text-transform: uppercase;
}
.ait-pro-nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 7px;
  color: rgba(255,255,255,.65); font-size: 13px;
  text-decoration: none; margin-bottom: 2px;
  transition: all .15s;
}
.ait-pro-nav-item:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.ait-pro-nav-item.active       { background: var(--ait-teacher); color: #fff; }
.ait-pro-nav-item.active-student { background: var(--ait-student); color: #fff; }
.ait-pro-nav-item i { font-size: 16px; width: 16px; text-align: center; }

/* ── Sidebar footer ── */
.ait-pro-sidebar-footer { padding: 10px; border-top: 1px solid rgba(255,255,255,.1); }
.ait-pro-user { display: flex; align-items: center; gap: 8px; }
.ait-pro-user-info { flex: 1; min-width: 0; }
.ait-pro-user-name { color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ait-pro-user-role { color: rgba(255,255,255,.4); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ait-pro-signout { color: rgba(255,255,255,.4); font-size: 16px; text-decoration: none; flex-shrink: 0; padding: 4px; transition: color .15s; }
.ait-pro-signout:hover { color: #fff; }

/* ── Avatar ── */
.ait-pro-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.ait-av-teacher { background: var(--ait-teacher); }
.ait-av-student { background: var(--ait-student); }

/* ── Main content ── */
/* ait-pro-main defined below */

/* ── Topbar ── */
.ait-pro-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; gap: 16px;
}
.ait-pro-page-title { font-size: 22px; font-weight: 700; color: var(--ait-text); margin: 0; }
.ait-pro-page-sub { font-size: 12px; color: var(--ait-muted); margin: 3px 0 0; }

/* ── Buttons ── */
.ait-pro-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; text-decoration: none; white-space: nowrap;
  transition: all .15s;
}
.ait-btn-teacher { background: var(--ait-teacher); color: #fff; }
.ait-btn-teacher:hover { background: var(--ait-teacher-dark); color: #fff; text-decoration: none; }
.ait-btn-student { background: var(--ait-student); color: #fff; }
.ait-btn-student:hover { background: var(--ait-student-dark); color: #fff; text-decoration: none; }
.ait-pro-btn-sm {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 500;
  text-decoration: none; border: none; cursor: pointer; white-space: nowrap; transition: all .15s;
}
.ait-btn-outline { background: var(--ait-card); color: var(--ait-text); border: 1px solid var(--ait-border); }
.ait-btn-outline:hover { background: var(--ait-bg); text-decoration: none; }
.ait-btn-student-sm { background: var(--ait-student); color: #fff; }
.ait-btn-student-sm:hover { background: var(--ait-student-dark); color: #fff; text-decoration: none; }

/* ── Stat cards ── */
.ait-pro-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.ait-pro-stat {
  background: var(--ait-card);
  border-radius: 11px;
  border: 1px solid var(--ait-border);
  padding: 14px 16px;
}
.ait-pro-stat-icon {
  float: right;
  width: 34px; height: 34px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.ait-pro-stat-label { font-size: 11px; color: var(--ait-muted); font-weight: 500; margin-bottom: 6px; clear: right; }
.ait-pro-stat-val { font-size: 26px; font-weight: 700; color: var(--ait-text); }

/* ── Cards ── */
.ait-pro-card {
  background: var(--ait-card);
  border-radius: 11px;
  border: 1px solid var(--ait-border);
  margin-bottom: 18px;
  overflow: hidden;
}
.ait-pro-card-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--ait-border);
  display: flex; align-items: center; justify-content: space-between;
}
.ait-pro-card-title { font-size: 14px; font-weight: 600; color: var(--ait-text); }
.ait-pro-card-body { padding: 16px; }
.ait-pro-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ── Table ── */
.ait-pro-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ait-pro-table th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--ait-muted);
  text-transform: uppercase; letter-spacing: .5px;
  padding: 8px 14px; border-bottom: 1px solid var(--ait-border);
}
.ait-pro-table td { padding: 10px 14px; border-bottom: 1px solid var(--ait-border); color: var(--ait-text); vertical-align: middle; }
.ait-pro-table tr:last-child td { border-bottom: none; }
.ait-pro-table tr:hover td { background: #f8fafc; }
.ait-pro-empty { text-align: center; color: var(--ait-muted); padding: 30px !important; font-style: italic; }

/* ── Badges ── */
.ait-pro-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 500;
}
.ait-badge-blue   { background: #eff6ff; color: #1d4ed8; }
.ait-badge-green  { background: #f0fdf4; color: #15803d; }
.ait-badge-amber  { background: #fffbeb; color: #b45309; }
.ait-badge-purple { background: #f5f3ff; color: #6d28d9; }
.ait-badge-red    { background: #fef2f2; color: #b91c1c; }
.ait-badge-gray   { background: #f1f5f9; color: #475569; }

/* ── Progress bar ── */
.ait-pro-progress { height: 6px; border-radius: 3px; background: #e2e8f0; overflow: hidden; }
.ait-pro-progress-fill { height: 100%; border-radius: 3px; transition: width .3s ease; }

/* ── Grade rings ── */
.ait-pro-grade-ring {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.ait-ring-a { background: #f0fdf4; color: #15803d; border: 2px solid #bbf7d0; }
.ait-ring-b { background: #eff6ff; color: #1d4ed8; border: 2px solid #bfdbfe; }
.ait-ring-f { background: #fef2f2; color: #b91c1c; border: 2px solid #fecaca; }

/* ── Alert banners ── */
.ait-pro-alert-info {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
  padding: 10px 14px; display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px; font-size: 13px; color: #1d4ed8;
}
.ait-pro-alert-warn {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
  padding: 10px 14px; display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px; font-size: 13px; color: #b45309;
}
.ait-pro-alert-warn a, .ait-pro-alert-info a { color: inherit; font-weight: 600; }

/* ── Quiz cards (student) ── */
.ait-pro-quiz-card {
  background: var(--ait-card); border-radius: 10px; border: 1px solid var(--ait-border);
  padding: 14px 16px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 14px;
}
.ait-pro-quiz-icon {
  width: 42px; height: 42px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.ait-pro-quiz-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--ait-border);
}
.ait-pro-quiz-row:last-child { border-bottom: none; }

/* ── Resources ── */
.ait-pro-resource-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ait-pro-resource-card {
  background: var(--ait-card); border-radius: 11px; border: 1px solid var(--ait-border);
  padding: 14px; display: flex; align-items: flex-start; gap: 12px;
}
.ait-pro-resource-icon {
  width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.ait-pro-resource-body { flex: 1; min-width: 0; }
.ait-pro-resource-title { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.ait-pro-resource-desc  { font-size: 12px; color: var(--ait-muted); margin-bottom: 6px; }
.ait-pro-resource-meta  { display: flex; align-items: center; gap: 8px; }

/* ── Empty state ── */
.ait-pro-empty-state { text-align: center; padding: 40px 20px; color: var(--ait-muted); }
.ait-pro-empty-state i { font-size: 36px; opacity: .3; display: block; margin-bottom: 10px; }
.ait-pro-empty-state p { font-size: 13px; }
.ait-pro-empty-state a { color: var(--ait-teacher); }

/* ── Leaderboard ── */
.ait-pro-lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--ait-border);
}
.ait-pro-lb-row:last-child { border-bottom: none; }
.ait-lb-me { background: #e1f5ee; border-radius: 7px; margin: 2px 8px; }
.ait-lb-you-tag {
  display: inline-flex; font-size: 10px; font-weight: 700; color: var(--ait-student);
  background: #e1f5ee; padding: 1px 6px; border-radius: 10px; margin-left: 4px;
}
.ait-pro-rank {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.ait-rank-1 { background: #fef9c3; color: #854d0e; }
.ait-rank-2 { background: #f1f5f9; color: #475569; }
.ait-rank-3 { background: #fef3e2; color: #92400e; }
.ait-rank-n { background: #f1f5f9; color: #94a3b8; }
.ait-pro-lb-rank-badge {
  font-size: 20px; font-weight: 800; color: var(--ait-student);
  background: #e1f5ee; padding: 6px 14px; border-radius: 8px;
}

/* ── Responsive ── */

/* Sidebar icon-only collapse at 1100px (not 960) to give quizzes more room */
@media (max-width: 1100px) {
  .ait-pro-sidebar { width: 54px; }
  .ait-pro-logo-name, .ait-pro-logo-sub, .ait-pro-nav-item span,
  .ait-pro-user-name, .ait-pro-user-role, .ait-pro-nav-section,
  .ait-pro-logo > div:last-child { display: none; }
  .ait-pro-nav-item { justify-content: center; padding: 10px; }
  .ait-pro-logo { justify-content: center; padding: 14px 0; }
  .ait-pro-main { padding: 16px 20px; }
  .ait-pro-stats { grid-template-columns: repeat(2,1fr); }
  .ait-pro-two-col, .ait-pro-resource-grid { grid-template-columns: 1fr; }
}

/* Hover expand: show labels on hover when collapsed */
@media (max-width: 1100px) and (min-width: 601px) {
  .ait-pro-sidebar:hover { width: 200px; z-index: 100; box-shadow: 4px 0 16px rgba(0,0,0,.25); }
  .ait-pro-sidebar:hover .ait-pro-logo-name,
  .ait-pro-sidebar:hover .ait-pro-logo-sub,
  .ait-pro-sidebar:hover .ait-pro-nav-item span,
  .ait-pro-sidebar:hover .ait-pro-user-name,
  .ait-pro-sidebar:hover .ait-pro-user-role,
  .ait-pro-sidebar:hover .ait-pro-nav-section,
  .ait-pro-sidebar:hover .ait-pro-logo > div:last-child { display: block; }
  .ait-pro-sidebar:hover .ait-pro-nav-item { justify-content: flex-start; padding: 8px 10px; }
  .ait-pro-sidebar:hover .ait-pro-logo { justify-content: flex-start; padding: 18px 14px 14px; }
}

@media (max-width: 600px) {
  .ait-pro-wrap { flex-direction: column; }
  .ait-pro-sidebar { width: 100%; min-height: unset; height: auto; position: static; }
  .ait-pro-nav { display: flex; flex-direction: row; overflow-x: auto; gap: 4px; }
  .ait-pro-nav-item span { display: inline !important; }
  .ait-pro-nav-section { display: none !important; }
  .ait-pro-stats { grid-template-columns: 1fr 1fr; }
}


/* ═══════════════════════════════════════════════════════════════
   AI TUTORIZ — PROFESSIONAL LOGIN PAGE
   ═══════════════════════════════════════════════════════════════ */

/* Full-page layout */
.ait-login-page {
  display: flex;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: -20px;
}

/* ── Left branding panel ── */
.ait-lp-brand {
  flex: 0 0 45%;
  background: #1a2744;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  position: relative;
  overflow: hidden;
}
.ait-lp-brand::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: rgba(37,99,235,.18);
}
.ait-lp-brand::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: rgba(29,158,117,.12);
}
.ait-lp-brand-inner {
  position: relative;
  z-index: 1;
  padding: 48px 48px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.ait-lp-brand-footer {
  position: relative;
  z-index: 1;
  padding: 24px 48px;
  color: rgba(255,255,255,.3);
  font-size: 12px;
}

/* Logo row */
.ait-lp-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ait-lp-logo-icon {
  width: 44px; height: 44px;
  background: #2563eb;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; flex-shrink: 0;
}
.ait-lp-logo-img {
  width: 44px; height: 44px;
  border-radius: 10px; object-fit: contain;
}
.ait-lp-brand-name {
  display: block;
  color: #fff; font-size: 18px; font-weight: 700; line-height: 1.2;
}
.ait-lp-brand-tag {
  display: block;
  color: rgba(255,255,255,.45); font-size: 11px;
}

/* Headline */
.ait-lp-headline h1 {
  color: #fff; font-size: 36px; font-weight: 800;
  line-height: 1.2; margin: 0 0 14px;
}
.ait-lp-headline p {
  color: rgba(255,255,255,.6);
  font-size: 15px; line-height: 1.6; margin: 0;
}

/* Feature list */
.ait-lp-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ait-lp-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 12px 16px;
}
.ait-lp-feature-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.12);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; flex-shrink: 0;
}
.ait-lp-feature-title {
  color: #fff; font-size: 13px; font-weight: 600;
}
.ait-lp-feature-desc {
  color: rgba(255,255,255,.5); font-size: 11px; margin-top: 1px;
}

/* ── Right form panel ── */
.ait-lp-form-panel {
  flex: 1;
  background: #f4f6fb;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.ait-lp-form-wrap {
  width: 100%;
  max-width: 400px;
}

/* Form header */
.ait-lp-form-header {
  margin-bottom: 28px;
}
.ait-lp-form-header h2 {
  font-size: 28px; font-weight: 800;
  color: #0f172a; margin: 0 0 6px;
}
.ait-lp-form-header p {
  color: #64748b; font-size: 14px; margin: 0;
}

/* Error */
.ait-lp-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 14px;
  color: #b91c1c;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

/* Fields */
.ait-lp-field {
  margin-bottom: 18px;
}
.ait-lp-field label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px; font-weight: 600;
  color: #374151; margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .4px;
}
.ait-lp-field label i { font-size: 14px; color: #6b7280; }
.ait-lp-field input[type="text"],
.ait-lp-field input[type="password"],
.ait-lp-field input[type="email"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  font-size: 14px; color: #0f172a;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.ait-lp-field input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  outline: none;
}

/* Password toggle */
.ait-lp-pw-wrap { position: relative; }
.ait-lp-pw-wrap input { padding-right: 44px; }
.ait-lp-pw-toggle {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 17px; color: #94a3b8; padding: 0; line-height: 1;
  transition: color .15s;
}
.ait-lp-pw-toggle:hover { color: #475569; }

/* Remember + forgot */
.ait-lp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.ait-lp-remember {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: #374151; cursor: pointer;
}
.ait-lp-remember input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: #2563eb;
}
.ait-lp-forgot {
  font-size: 13px; color: #2563eb; font-weight: 500;
  text-decoration: none;
}
.ait-lp-forgot:hover { text-decoration: underline; }

/* Submit button */
.ait-lp-submit {
  width: 100%;
  padding: 13px 20px;
  background: #2563eb;
  color: #fff;
  border: none; border-radius: 9px;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s, transform .1s;
}
.ait-lp-submit:hover { background: #1d4ed8; transform: translateY(-1px); }
.ait-lp-submit:active { transform: translateY(0); }
.ait-lp-submit.loading { opacity: .7; pointer-events: none; }
.ait-lp-submit i { font-size: 18px; }

/* Divider */
.ait-lp-divider {
  display: flex; align-items: center;
  margin: 24px 0 16px;
  gap: 10px; color: #cbd5e1; font-size: 12px;
}
.ait-lp-divider::before,
.ait-lp-divider::after {
  content: ''; flex: 1; height: 1px; background: #e2e8f0;
}
.ait-lp-divider span { white-space: nowrap; text-transform: uppercase; letter-spacing: .5px; }

/* Portals */
.ait-lp-portals {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 20px;
}
.ait-lp-portal {
  border-radius: 9px; border: 1.5px solid #e2e8f0;
  padding: 12px; display: flex; align-items: center; gap: 10px;
  background: #fff;
}
.ait-lp-portal-icon {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.ait-portal-teacher .ait-lp-portal-icon { background: #eff6ff; color: #2563eb; }
.ait-portal-student .ait-lp-portal-icon { background: #e1f5ee; color: #1d9e75; }
.ait-lp-portal-name { font-size: 13px; font-weight: 600; color: #0f172a; }
.ait-lp-portal-desc { font-size: 11px; color: #94a3b8; margin-top: 1px; }

/* Register link */
.ait-lp-register {
  text-align: center;
  font-size: 13px; color: #64748b;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}
.ait-lp-register a {
  color: #2563eb; font-weight: 600; text-decoration: none;
}
.ait-lp-register a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
  .ait-login-page { flex-direction: column; }
  .ait-lp-brand { flex: none; min-height: 220px; }
  .ait-lp-brand-inner { padding: 28px 24px 0; gap: 20px; }
  .ait-lp-headline h1 { font-size: 24px; }
  .ait-lp-features { display: none; }
  .ait-lp-brand-footer { padding: 16px 24px; }
  .ait-lp-form-panel { padding: 28px 20px; }
}


/* ══════════════════════════════════════════════════════════════
   QUIZ BUILDER — full width, proper spacing
   ══════════════════════════════════════════════════════════════ */

/* Quiz builder form layout */
.ait-quiz-builder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.ait-quiz-builder-grid .ait-qb-full { grid-column: 1 / -1; }

/* Class multi-select grid */
.ait-class-multi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
}
.ait-class-check-label {
  display: flex; align-items: center; gap: 8px;
  background: #f8fafc; border: 1.5px solid #e2e8f0;
  border-radius: 8px; padding: 8px 12px;
  cursor: pointer; transition: all .15s;
  font-size: 13px;
}
.ait-class-check-label:hover { border-color: var(--ait-teacher); background: #eff6ff; }
.ait-class-check-label.selected { border-color: var(--ait-teacher); background: #eff6ff; }

/* Question block */
.ait-fq-q {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
  position: relative;
}
.ait-fq-q:focus-within { border-color: var(--ait-teacher); box-shadow: 0 0 0 3px rgba(37,99,235,.07); }

/* Answer choice row */
.ait-fq-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  transition: border-color .15s;
}
.ait-fq-choice:focus-within { border-color: var(--ait-teacher); }
.ait-fq-choice input[type=radio] { accent-color: var(--ait-teacher); width: 16px; height: 16px; flex-shrink: 0; }
.ait-fq-choice input[type=radio]:checked + .ait-choice-letter { color: var(--ait-teacher); }
.ait-choice-letter { font-weight: 700; color: #94a3b8; min-width: 18px; font-size: 14px; flex-shrink: 0; }
.ait-choice-input {
  flex: 1;
  border: none; outline: none;
  font-size: 14px; background: transparent;
  padding: 0 4px;
}
.ait-choice-remove {
  background: none; border: none; cursor: pointer;
  color: #cbd5e1; font-size: 15px; padding: 2px 4px;
  border-radius: 4px; transition: color .15s;
  line-height: 1; flex-shrink: 0;
}
.ait-choice-remove:hover { color: #ef4444; background: #fef2f2; }

/* Input styles */
.ait-fq-input {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 14px;
  background: #fff;
  color: var(--ait-text);
  transition: border-color .15s;
  box-sizing: border-box;
  font-family: inherit;
}
.ait-fq-input:focus { outline: none; border-color: var(--ait-teacher); box-shadow: 0 0 0 3px rgba(37,99,235,.07); }
textarea.ait-fq-input { resize: vertical; min-height: 72px; }

/* Q header row */
.ait-fq-q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.ait-fq-q-number {
  font-weight: 700;
  color: var(--ait-teacher);
  font-size: 14px;
}
.ait-fq-q-meta {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* Add choice button */
.ait-btn-add-choice {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 6px;
  border: 1.5px dashed #cbd5e1; background: transparent;
  color: #64748b; font-size: 12px; cursor: pointer;
  transition: all .15s; margin-top: 4px;
}
.ait-btn-add-choice:hover { border-color: var(--ait-teacher); color: var(--ait-teacher); background: #eff6ff; }

/* Quiz list table actions */
.ait-quiz-list-actions { display: flex; gap: 6px; }


/* ══════════════════════════════════════════════════════════════
   TEACHER DASHBOARD v3 — New components
   ══════════════════════════════════════════════════════════════ */

/* Top control bar (sidebar toggle + fullscreen) */
.ait-top-controls {
  position: absolute;
  top: 8px; right: 10px;
  z-index: 200;
  display: flex;
  gap: 4px;
}
.ait-pro-main { position: relative; }

.ait-icon-btn {
  width: 34px; height: 34px;
  border: 1.5px solid var(--ait-border);
  border-radius: 8px;
  background: var(--ait-card);
  color: var(--ait-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: all .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.ait-icon-btn:hover { border-color: var(--ait-teacher); color: var(--ait-teacher); background: #eff6ff; }

/* Fullscreen mode */
.ait-fullscreen {
  position: fixed !important;
  top: 0 !important; left: 0 !important;
  width: 100vw !important; height: 100vh !important;
  z-index: 99999 !important;
  overflow-y: scroll;
  background: var(--ait-bg);
  margin: 0 !important;
  padding: 0 !important;
}
/* Fullscreen: sidebar collapses to icons-only for maximum content space */
.ait-fullscreen .ait-pro-sidebar {
  position: sticky;
  top: 0;
  width: 54px !important;
  overflow: hidden !important;
  flex-shrink: 0;
}
.ait-fullscreen .ait-pro-sidebar .ait-pro-logo-name,
.ait-fullscreen .ait-pro-sidebar .ait-pro-logo-sub,
.ait-fullscreen .ait-pro-sidebar .ait-pro-nav-item span,
.ait-fullscreen .ait-pro-sidebar .ait-pro-user-name,
.ait-fullscreen .ait-pro-sidebar .ait-pro-user-role,
.ait-fullscreen .ait-pro-sidebar .ait-pro-nav-section,
.ait-fullscreen .ait-pro-sidebar .ait-pro-logo > div:last-child { display: none !important; }
.ait-fullscreen .ait-pro-sidebar .ait-pro-nav-item { justify-content: center; padding: 10px 0; }
.ait-fullscreen .ait-pro-sidebar .ait-pro-logo { justify-content: center; padding: 14px 0; }
/* Hover still expands in fullscreen */
.ait-fullscreen .ait-pro-sidebar:hover {
  width: 200px !important;
  overflow: visible !important;
  z-index: 100;
  box-shadow: 4px 0 20px rgba(0,0,0,.25);
}
.ait-fullscreen .ait-pro-sidebar:hover .ait-pro-logo-name,
.ait-fullscreen .ait-pro-sidebar:hover .ait-pro-logo-sub,
.ait-fullscreen .ait-pro-sidebar:hover .ait-pro-nav-item span,
.ait-fullscreen .ait-pro-sidebar:hover .ait-pro-user-name,
.ait-fullscreen .ait-pro-sidebar:hover .ait-pro-user-role,
.ait-fullscreen .ait-pro-sidebar:hover .ait-pro-nav-section,
.ait-fullscreen .ait-pro-sidebar:hover .ait-pro-logo > div:last-child { display: block !important; }
.ait-fullscreen .ait-pro-sidebar:hover .ait-pro-nav-item { justify-content: flex-start; padding: 8px 10px; }
.ait-fullscreen .ait-pro-sidebar:hover .ait-pro-logo { justify-content: flex-start; padding: 18px 14px 14px; }

.ait-fullscreen .ait-pro-main { padding: 48px 40px 32px; }
.ait-fullscreen .ait-top-controls { position: fixed; top: 8px; right: 8px; z-index: 100001; }
/* Hide WP admin bar in fullscreen */
.ait-fullscreen ~ #wpadminbar,
body.ait-fullscreen-active #wpadminbar { display: none !important; }

/* Field label */
.ait-field-label {
  display: block;
  font-weight: 600;
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 5px;
}

/* Form grids */
.ait-form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .ait-form-grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .ait-form-grid-3 { grid-template-columns: 1fr; } }

/* Count badge */
.ait-count-badge {
  background: var(--ait-teacher);
  color: #fff;
  border-radius: 20px;
  padding: 1px 9px;
  font-size: 11px;
  font-weight: 600;
}

/* Multi-class selector */
.ait-mg-wrap { display: flex; flex-direction: column; gap: 8px; }
.ait-mg-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.ait-mf-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--ait-border);
  background: var(--ait-card);
  color: #374151;
  cursor: pointer;
  font-size: 12px; font-weight: 500;
  transition: all .15s;
}
.ait-mf-btn.active { background: var(--ait-teacher); color: #fff; border-color: var(--ait-teacher); }
.ait-mf-btn:hover:not(.active) { border-color: var(--ait-teacher); color: var(--ait-teacher); }

.ait-mg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 7px;
  max-height: 200px;
  overflow-y: auto;
  padding: 2px;
}
.ait-mg-label {
  display: flex; align-items: center; gap: 9px;
  background: #f8fafc; border: 1.5px solid var(--ait-border);
  border-radius: 8px; padding: 8px 11px;
  cursor: pointer; transition: all .15s;
  font-size: 13px;
}
.ait-mg-label:hover { border-color: var(--ait-teacher); background: #eff6ff; }
.ait-mg-label.selected { border-color: var(--ait-teacher); background: #eff6ff; }
.ait-mg-label input[type=checkbox] { accent-color: var(--ait-teacher); width: 15px; height: 15px; flex-shrink: 0; }
.ait-mg-label span strong { display: block; font-size: 13px; }
.ait-mg-label span small { display: block; color: var(--ait-muted); font-size: 11px; margin-top: 1px; }

/* Lesson editor card */
.ait-editor-card { padding: 0 !important; overflow: visible; }
.ait-editor-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ait-border);
  background: #fafbfc;
}
.ait-editor-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--ait-border);
}
@media (max-width: 600px) { .ait-editor-meta { grid-template-columns: 1fr; } }

/* Rich text toolbar */
.ait-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 3px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--ait-border);
  background: #f1f5f9;
  border-radius: 0;
}
.ait-tb-btn {
  min-width: 30px; height: 28px;
  padding: 0 8px;
  border: 1px solid transparent; border-radius: 5px;
  background: none; cursor: pointer; color: #374151;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  transition: all .12s; gap: 3px;
}
.ait-tb-btn:hover { background: #e2e8f0; border-color: #cbd5e1; }
.ait-tb-btn:active { background: #dbeafe; }
.ait-tb-sep { width: 1px; height: 22px; background: #e2e8f0; margin: 0 4px; }
.ait-tb-select {
  height: 30px; font-size: 12px; border: 1px solid #e2e8f0;
  border-radius: 5px; padding: 0 6px; background: #fff; cursor: pointer;
}

/* Editable area */
.ait-editor-body {
  min-height: 300px;
  padding: 20px 24px;
  font-size: 15px; line-height: 1.7;
  color: var(--ait-text);
  outline: none;
}
.ait-editor-body:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8; pointer-events: none;
}
.ait-editor-body h2 { font-size: 22px; font-weight: 700; margin: 18px 0 8px; border-bottom: 2px solid #e2e8f0; padding-bottom: 4px; }
.ait-editor-body h3 { font-size: 18px; font-weight: 600; margin: 14px 0 6px; }
.ait-editor-body h4 { font-size: 15px; font-weight: 600; margin: 12px 0 4px; }
.ait-editor-body ul, .ait-editor-body ol { padding-left: 22px; margin: 8px 0; }
.ait-editor-body li { margin: 3px 0; }
.ait-editor-body table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.ait-editor-body table td, .ait-editor-body table th { border: 1px solid #cbd5e1; padding: 6px 10px; }
.ait-editor-body table th { background: #f1f5f9; font-weight: 600; }
.ait-editor-body img { max-width: 100%; border-radius: 6px; margin: 6px 0; }
.ait-editor-body a { color: var(--ait-teacher); text-decoration: underline; }
.ait-editor-body hr { border: none; border-top: 2px solid #e2e8f0; margin: 16px 0; }
.ait-editor-body blockquote { border-left: 3px solid var(--ait-teacher); padding: 6px 14px; color: #64748b; margin: 10px 0; background: #f8fafc; border-radius: 0 6px 6px 0; }

/* Attachments */
.ait-attachments-section { padding: 14px 18px; border-top: 1px solid var(--ait-border); }
.ait-attach-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
@media (max-width: 600px) { .ait-attach-row { flex-direction: column; } }

/* Lesson row */
.ait-lesson-row { padding: 14px 16px !important; }
.ait-lesson-preview { font-size: 13px; color: var(--ait-muted); margin-top: 6px; padding-top: 6px; border-top: 1px solid #f1f5f9; }

/* Amber badge */
.ait-badge-amber { background: #fffbeb; color: #d97706; }
.ait-badge-red   { background: #fef2f2; color: #dc2626; }

/* Wider sidebar give more main room */
.ait-pro-sidebar { width: 200px; transition: width .2s, overflow .2s; }
.ait-pro-main { flex: 1; padding: 52px 28px 32px; min-width: 0; position: relative; }

/* Sidebar collapse at 1200px */
@media (max-width: 1200px) {
  .ait-pro-sidebar { width: 54px; overflow: hidden; }
  .ait-pro-logo-name,.ait-pro-logo-sub,.ait-pro-nav-item span,
  .ait-pro-user-name,.ait-pro-user-role,.ait-pro-nav-section,
  .ait-pro-logo > div:last-child { display: none; }
  .ait-pro-nav-item { justify-content: center; padding: 10px 0; }
  .ait-pro-logo { justify-content: center; padding: 14px 0; }
}
@media (max-width: 1200px) and (min-width: 601px) {
  .ait-pro-sidebar:hover { width: 200px; overflow: visible; z-index: 100; box-shadow: 4px 0 20px rgba(0,0,0,.2); }
  .ait-pro-sidebar:hover .ait-pro-logo-name,
  .ait-pro-sidebar:hover .ait-pro-logo-sub,
  .ait-pro-sidebar:hover .ait-pro-nav-item span,
  .ait-pro-sidebar:hover .ait-pro-user-name,
  .ait-pro-sidebar:hover .ait-pro-user-role,
  .ait-pro-sidebar:hover .ait-pro-nav-section,
  .ait-pro-sidebar:hover .ait-pro-logo > div:last-child { display: block; }
  .ait-pro-sidebar:hover .ait-pro-nav-item { justify-content: flex-start; padding: 8px 10px; }
  .ait-pro-sidebar:hover .ait-pro-logo { justify-content: flex-start; padding: 18px 14px 14px; }
}


/* ── Wide mode (sidebar hidden entirely) ── */
.ait-sidebar-hidden .ait-pro-sidebar { width: 0 !important; overflow: hidden !important; min-width: 0 !important; }
.ait-sidebar-hidden .ait-pro-main { padding-left: 16px; }

/* ── Student assignment modal ── */
#ait-assign-modal { display: none; }
#ait-assign-modal.open { display: flex; }

/* Table overflow fix */
.ait-pro-card table { min-width: 0; }
.ait-pro-table th, .ait-pro-table td { white-space: nowrap; }
.ait-pro-table td:nth-child(2) { white-space: normal; } /* let name wrap */

/* Unassigned row highlight */
tr[data-grade-id="0"] td:first-child::after {
  content: '';
}

/* ── Overview class cards ── */
.ait-class-card {
  background: var(--ait-card);
  border: 1.5px solid var(--ait-border);
  border-radius: 14px;
  padding: 18px;
  transition: border-color .15s, box-shadow .15s;
}
.ait-class-card:hover {
  border-color: var(--ait-teacher);
  box-shadow: 0 4px 16px rgba(37,99,235,.1);
}

/* ── Attachments section fix ── */
.ait-attachments-section {
  padding: 16px 18px;
  border-top: 1px solid var(--ait-border);
  position: relative;
  z-index: 1;
}
.ait-attach-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

/* ── Teacher small button ── */
.ait-btn-teacher-sm {
  background: var(--ait-teacher);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s;
}
.ait-btn-teacher-sm:hover { background: var(--ait-teacher-dark); }
