:root {
  --primary: #1a5276;
  --primary-light: #2e86c1;
  --accent: #f39c12;
  --accent2: #27ae60;
  --danger: #e74c3c;
  --bg: #f0f4f8;
  --sidebar-bg: #0d3349;
  --sidebar-text: #a8c8e8;
  --sidebar-active: #1a5276;
  --card-bg: #ffffff;
  --text-main: #1c2b3a;
  --text-muted: #6c8096;
  --border: #dce6ef;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(26,82,118,0.10);
  --shadow-sm: 0 2px 8px rgba(26,82,118,0.07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background: var(--bg); color: var(--text-main); min-height: 100vh; overflow-x: hidden; }

/* ─── APP SHELL (PHP multi-page layout) ─── */
.app-shell {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-content: flex-start;
  min-height: 100vh;
}

/* ─── LOGIN ─── */
.page-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d3349 0%, #1a5276 60%, #2e86c1 100%);
  position: relative;
  overflow: hidden;
}
.page-login::before {
  content:''; position:absolute; width:600px; height:600px; border-radius:50%;
  background: rgba(255,255,255,0.04); top:-200px; right:-200px; pointer-events:none;
}
.page-login::after {
  content:''; position:absolute; width:400px; height:400px; border-radius:50%;
  background: rgba(243,156,18,0.08); bottom:-150px; left:-100px; pointer-events:none;
}
.login-card {
  background: #fff; border-radius: 22px; padding: 48px 44px;
  width: 100%; max-width: 440px; box-shadow: 0 24px 80px rgba(0,0,0,0.25);
  position: relative; z-index: 2;
  display: flex;
  flex-direction: column;
}
.login-logo { text-align:center; margin-bottom:32px; }
.login-logo-tagline { margin-top: 4px; }
.login-form { flex: 0 0 auto; }
.login-card-bottom {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.login-pwa-block {
  text-align: center;
  font-size: 12px;
  line-height: 1.45;
}
.login-pwa-link {
  display: inline-block;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  padding: 6px 4px;
  border-radius: 8px;
}
.login-pwa-link:hover { color: var(--primary-light); text-decoration: underline; }
.login-pwa-manual {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 300px;
  margin: 0 auto;
}
.login-powered-text {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin: 14px 0 0;
  line-height: 1.4;
}
.login-powered-text strong {
  color: var(--text-main);
  font-weight: 600;
}
.login-logo .logo-icon {
  width:64px; height:64px; border-radius:16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display:inline-flex; align-items:center; justify-content:center; margin-bottom:12px;
  box-shadow: 0 8px 24px rgba(26,82,118,0.3);
}
.login-logo .logo-icon i { color:#fff; font-size:28px; }
.login-logo h1 { font-family:'Sora',sans-serif; font-size:24px; font-weight:700; color:var(--text-main); }
.login-logo p { color:var(--text-muted); font-size:13px; margin-top:2px; }
.role-tabs { display:flex; gap:8px; margin-bottom:24px; background:#f0f4f8; border-radius:10px; padding:4px; }
.role-tab {
  flex:1; padding:8px; text-align:center; border-radius:7px; font-size:12px; font-weight:600;
  cursor:pointer; transition:all .2s; color:var(--text-muted);
}
.role-tab.active { background:#fff; color:var(--primary); box-shadow:0 2px 8px rgba(0,0,0,0.08); }
.form-label { font-size:13px; font-weight:600; color:var(--text-main); margin-bottom:6px; }
.form-control {
  border:1.5px solid var(--border); border-radius: var(--radius-sm); padding:11px 14px;
  font-size:14px; font-family:'Plus Jakarta Sans', sans-serif; transition:border .2s;
}
.form-control:focus { border-color:var(--primary-light); box-shadow:0 0 0 3px rgba(46,134,193,0.12); outline:none; }
.btn-primary-main {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color:#fff; border:none; border-radius:10px; padding:13px; font-size:15px;
  font-weight:700; font-family:'Plus Jakarta Sans', sans-serif; width:100%; cursor:pointer;
  transition:transform .15s, box-shadow .15s; box-shadow:0 4px 16px rgba(26,82,118,0.3);
}
.btn-primary-main:hover { transform:translateY(-1px); box-shadow:0 6px 20px rgba(26,82,118,0.4); }

/* Login: phones — compact card (no stretched empty area), safer tap targets, 16px inputs (avoids iOS zoom) */
@media (max-width: 576px) {
  .page-login {
    align-items: center;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
      max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    min-height: 100vh;
    min-height: 100dvh;
  }

  .login-card {
    flex: 0 1 auto;
    width: 100%;
    max-width: 440px;
    margin-inline: auto;
    padding: clamp(24px, 6vw, 32px) clamp(20px, 5vw, 26px) clamp(22px, 5.5vw, 28px);
    border-radius: 18px;
    box-shadow: 0 18px 56px rgba(0, 0, 0, 0.22);
  }

  .login-logo {
    margin-bottom: 22px;
  }

  .login-logo h1 {
    font-size: 1.35rem;
    line-height: 1.25;
    padding-inline: 4px;
  }

  .login-logo p {
    font-size: 13px;
    line-height: 1.4;
    padding-inline: 8px;
  }

  .page-login .login-logo img {
    max-height: 64px !important;
    margin-bottom: 10px !important;
  }

  .page-login .form-group {
    margin-bottom: 18px;
  }

  .page-login .form-label {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .page-login .form-control {
    min-height: 48px;
    padding: 13px 16px;
    font-size: 16px;
    border-radius: 10px;
  }

  .page-login .btn-primary-main {
    min-height: 52px;
    padding: 14px 18px;
    font-size: 16px;
    border-radius: 12px;
    margin-top: 4px;
  }

  .login-card-bottom {
    margin-top: 18px;
    padding-top: 16px;
  }

  .login-powered-text {
    margin-top: 12px;
  }

  .login-pwa-manual {
    max-width: 100%;
    padding: 0 4px;
  }
}

/* ─── MAIN LAYOUT ─── */
.sidebar {
  width: 260px;
  min-height: 100vh;
  max-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: width .25s;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
.sidebar-brand {
  padding: 24px 20px 20px; border-bottom:1px solid rgba(255,255,255,0.06);
  display:flex; align-items:center; gap:12px; flex-wrap:nowrap;
}
.sidebar-close-mobile {
  display:none;
  margin-left:auto;
  flex-shrink:0;
  width:38px;
  height:38px;
  border:none;
  border-radius:10px;
  background:rgba(255,255,255,0.08);
  color:#fff;
  cursor:pointer;
  align-items:center;
  justify-content:center;
  transition:background .2s;
}
.sidebar-close-mobile:hover { background:rgba(255,255,255,0.15); }

/* Mobile menu (drawer) */
.mobile-sidebar-toggle {
  display: none;
  position: fixed;
  top: 10px;
  right: 10px;
  left: auto;
  z-index: 400;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #fff;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  padding: 0;
}
.mobile-sidebar-toggle i { font-size: 18px; }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(13, 51, 73, 0.45);
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
  body.has-sidebar-open .sidebar-backdrop { display: block; }
  body.has-sidebar-open { overflow: hidden; }

.subject-row .stat-icon,
.subjects-grid .stat-icon {
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

a.class-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
a.class-card-link:focus-visible .class-card {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

/* ─── RESPONSIVE ─── */
@media(max-width:900px) {
  .mobile-sidebar-toggle { display: flex; }
  .sidebar-close-mobile { display: flex; align-items: center; justify-content: center; }
  .sidebar {
    width: min(280px, 88vw);
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    box-shadow: 8px 0 32px rgba(0,0,0,0.18);
  }
  body.has-sidebar-open .sidebar {
    transform: translateX(0);
  }
  .main-content { margin-left: 0 !important; }
  .topbar {
    padding-left: 18px;
    padding-right: 58px;
  }
  body.role-parent:not(.parent-desktop-sidebar) .topbar {
    padding-left: 18px !important;
  }

  body.role-teacher.teacher-app-page:not(.teacher-desktop-sidebar) .mobile-sidebar-toggle {
    left: auto;
    right: max(10px, env(safe-area-inset-right));
    top: max(10px, env(safe-area-inset-top));
  }

  body.role-teacher.teacher-app-page:not(.teacher-desktop-sidebar) .topbar {
    padding-left: 18px !important;
    padding-right: 58px;
  }

  .page-content { padding: 18px 16px 24px; }
  .quick-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .search-box { width: 100%; max-width: 100%; }
  .topbar { height: auto; min-height: 56px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .topbar-right { flex-wrap: wrap; }

  .app-powered-footer {
    margin-left: 0;
    width: 100%;
    padding: 14px 16px max(18px, env(safe-area-inset-bottom, 0));
  }
}

@media(min-width:901px) {
  .sidebar-backdrop { display: none !important; }
  .sidebar-close-mobile { display: none !important; }
  .mobile-sidebar-toggle { display: none !important; }
}
.sidebar-brand .sidebar-brand-logo-wrap {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.sidebar-brand-logo { max-width: 100%; max-height: 100%; object-fit: contain; }
.sidebar-brand .brand-text h2 { font-family:'Sora',sans-serif; font-size:15px; font-weight:700; color:#fff; }
.sidebar-brand .brand-text p { font-size:10px; color:var(--sidebar-text); margin-top:1px; text-transform:uppercase; letter-spacing:1px; }
.sidebar-section { padding: 20px 12px 8px; font-size:10px; font-weight:700; color:rgba(168,200,232,0.4); text-transform:uppercase; letter-spacing:1.5px; }
.nav-item { margin:2px 0; }
.nav-link-sidebar {
  display:flex; align-items:center; gap:12px; padding:11px 16px; border-radius:10px;
  color:var(--sidebar-text); font-size:13.5px; font-weight:500; cursor:pointer;
  transition:all .18s; text-decoration:none; border:none; background:none; width:100%; text-align:left;
}
a.nav-link-sidebar { display:flex; }
.nav-link-sidebar:hover { background:rgba(255,255,255,0.06); color:#fff; }
.nav-link-sidebar.active { background:var(--primary); color:#fff; box-shadow:0 4px 12px rgba(26,82,118,0.4); }
.nav-link-sidebar i { width:18px; text-align:center; font-size:15px; }
.nav-link-sidebar .badge-count {
  margin-left:auto; background:var(--accent); color:#fff; border-radius:20px;
  font-size:10px; font-weight:700; padding:2px 7px;
}
.sidebar-footer {
  margin-top:auto; padding:16px 12px; border-top:1px solid rgba(255,255,255,0.06);
}
.user-info { display:flex; align-items:center; gap:10px; padding:10px; border-radius:10px; }
.user-avatar {
  width:36px; height:36px; border-radius:10px;
  background: linear-gradient(135deg, var(--accent), #e67e22); display:flex; align-items:center; justify-content:center;
}
.user-avatar i { color:#fff; font-size:16px; }
.user-info .user-name { font-size:13px; font-weight:600; color:#fff; }
.user-info .user-role { font-size:11px; color:var(--sidebar-text); }
.btn-logout { background:none; border:none; color:var(--sidebar-text); cursor:pointer; padding:4px; margin-left:auto; font-size:14px; transition:color .2s; text-decoration:none; display:inline-flex; align-items:center; }
.btn-logout:hover { color:#e74c3c; }

/* ─── MAIN CONTENT ─── */
.main-content { margin-left:260px; flex:1; min-height:100vh; }
.topbar {
  background:#fff; border-bottom:1px solid var(--border); padding:0 28px;
  height:64px; display:flex; align-items:center; justify-content:space-between;
  position:sticky; top:0; z-index:50; box-shadow:var(--shadow-sm);
}
.topbar-title { font-family:'Sora',sans-serif; font-size:18px; font-weight:700; color:var(--text-main); }
.topbar-subtitle { font-size:12px; color:var(--text-muted); margin-top:1px; }
.topbar-right { display:flex; align-items:center; gap:12px; }
.btn-icon {
  width:38px; height:38px; border-radius:9px; border:1.5px solid var(--border);
  background:#fff; display:flex; align-items:center; justify-content:center;
  cursor:pointer; transition:all .2s; color:var(--text-muted); font-size:15px;
}
.btn-icon:hover { border-color:var(--primary-light); color:var(--primary); }
.page-content { padding:28px; }

/* Credit line under dashboard main column (not in sidebar) */
.app-powered-footer {
  flex: 0 0 auto;
  width: calc(100% - 260px);
  margin-left: 260px;
  margin-top: auto;
  padding: 16px 28px 22px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  border-top: 1px solid var(--border);
  box-sizing: border-box;
}

.app-powered-footer-text {
  margin: 0;
  line-height: 1.5;
}

.app-powered-footer strong {
  color: var(--text-main);
  font-weight: 600;
}

/* ─── STAT CARDS ─── */
.stat-card {
  background:var(--card-bg); border-radius:var(--radius); padding:22px 24px;
  box-shadow:var(--shadow-sm); border:1px solid var(--border); position:relative; overflow:hidden;
  transition:transform .2s, box-shadow .2s;
}
.stat-card:hover { transform:translateY(-2px); box-shadow:var(--shadow); }
.stat-card .stat-icon {
  width:48px; height:48px; border-radius:12px; display:flex; align-items:center; justify-content:center;
  font-size:20px; margin-bottom:14px;
}
.stat-card .stat-value { font-family:'Sora',sans-serif; font-size:28px; font-weight:700; color:var(--text-main); }
.stat-card .stat-label { font-size:13px; color:var(--text-muted); margin-top:3px; font-weight:500; }
.stat-card .stat-change { font-size:11px; font-weight:600; margin-top:6px; }
.stat-card .stat-change.up { color:var(--accent2); }
.stat-card .stat-change.neutral { color:var(--text-muted); }
.icon-blue { background:#e8f4fd; color:var(--primary-light); }
.icon-green { background:#e8f8ef; color:var(--accent2); }
.icon-amber { background:#fef6e8; color:var(--accent); }
.icon-red { background:#fde8e8; color:var(--danger); }
.icon-purple { background:#f0e8fe; color:#8e44ad; }

/* ─── CARDS ─── */
.card-section {
  background:var(--card-bg); border-radius:var(--radius); border:1px solid var(--border);
  box-shadow:var(--shadow-sm); overflow:hidden;
}
.card-section-header {
  padding:18px 24px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
}
.card-section-header h3 { font-size:15px; font-weight:700; color:var(--text-main); }
.card-section-header p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.35;
}
.card-section-body { padding:24px; }

/* ─── TABLE ─── */
.table-modern { width:100%; border-collapse:collapse; }
.table-modern th {
  font-size:11px; font-weight:700; color:var(--text-muted); text-transform:uppercase;
  letter-spacing:.8px; padding:10px 16px; background:#f8fafc; border-bottom:1px solid var(--border);
  text-align:left;
}
.table-modern td { padding:13px 16px; border-bottom:1px solid #f1f5f9; font-size:13.5px; vertical-align:middle; }
.table-modern tr:last-child td { border-bottom:none; }
.table-modern tr:hover td { background:#f8fafc; }
.avatar-sm {
  width:32px; height:32px; border-radius:8px; display:inline-flex; align-items:center;
  justify-content:center; font-size:12px; font-weight:700; color:#fff; margin-right:10px;
}
.badge-role {
  display:inline-block; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:600;
}
.badge-primary { background:#e8f4fd; color:var(--primary); }
.badge-success { background:#e8f8ef; color:var(--accent2); }
.badge-warning { background:#fef6e8; color:#d68910; }
.badge-danger { background:#fde8e8; color:var(--danger); }
.badge-purple { background:#f0e8fe; color:#8e44ad; }

/* Plain text table action (no filled button) */
a.table-action-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
}
a.table-action-link:hover { text-decoration: underline; color: var(--primary-light); }

/* ─── BUTTONS ─── */
.btn-sm-primary {
  background:var(--primary); color:#fff; border:none; border-radius:7px;
  padding:7px 14px; font-size:12px; font-weight:600; cursor:pointer; font-family:'Plus Jakarta Sans',sans-serif;
  transition:all .2s; display:inline-flex; align-items:center; gap:6px;
}
.btn-sm-primary:hover { background:var(--primary-light); }
a.btn-sm-primary, a.btn-sm-outline, a.btn-sm-success { text-decoration: none; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }
a.btn-sm-primary { color: #fff !important; }
a.btn-sm-outline { color: var(--primary); }
.btn-sm-outline {
  background:transparent; color:var(--primary); border:1.5px solid var(--border); border-radius:7px;
  padding:6px 13px; font-size:12px; font-weight:600; cursor:pointer; font-family:'Plus Jakarta Sans',sans-serif;
  transition:all .2s; display:inline-flex; align-items:center; gap:6px;
}
.btn-sm-outline:hover { border-color:var(--primary); background:#f0f7ff; }
.btn-sm-danger { background:#fde8e8; color:var(--danger); border:none; border-radius:7px; padding:6px 12px; font-size:12px; font-weight:600; cursor:pointer; }
.btn-sm-success { background:var(--accent2); color:#fff; border:none; border-radius:7px; padding:7px 14px; font-size:12px; font-weight:600; cursor:pointer; font-family:'Plus Jakarta Sans',sans-serif; }

/* Payroll / table row actions (admin) */
.payroll-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}
.payroll-row-actions .btn-sm-outline,
.payroll-row-actions .btn-sm-danger {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.payroll-row-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.payroll-row-actions .btn-sm-danger:hover:not(:disabled) {
  background: #f9d4d4;
  color: var(--danger);
}

/* ─── MODAL ─── */
.modal-overlay {
  display:none; position:fixed; inset:0; background:rgba(13,51,73,0.55); z-index:999;
  align-items:center; justify-content:center; backdrop-filter:blur(3px);
  padding: 16px;
}
.modal-overlay.show { display:flex; }
.modal-box {
  background:#fff; border-radius:18px; width:100%; max-width:560px; max-height:90vh;
  overflow: visible;
  display: flex;
  flex-direction: column;
  box-shadow:0 24px 80px rgba(0,0,0,0.25); animation:modalIn .22s ease;
}
/* Avoid transform on the modal box: it breaks native <select> dropdowns on some browsers. */
@keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }
.modal-header {
  padding:22px 26px 18px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  flex-shrink:0;
  background:#fff;
  border-radius:18px 18px 0 0;
}
.modal-header h4 { font-size:16px; font-weight:700; }
.modal-close { background:none; border:none; cursor:pointer; color:var(--text-muted); font-size:18px; padding:4px; border-radius:6px; transition:color .2s; }
.modal-close:hover { color:var(--danger); }
.modal-body { padding:24px 26px; overflow-y:auto; overflow-x: visible; flex:1; min-height:0; max-height:calc(90vh - 130px); }
.modal-footer { padding:16px 26px 22px; display:flex; gap:10px; justify-content:flex-end; flex-shrink:0; border-top:1px solid var(--border); background:#fff; border-radius:0 0 18px 18px; }

/* ─── FORM ELEMENTS ─── */
.form-group { margin-bottom:18px; }
.form-select {
  border:1.5px solid var(--border); border-radius:var(--radius-sm); padding:10px 14px;
  font-size:14px; font-family:'Plus Jakarta Sans',sans-serif; width:100%; background:#fff;
  transition:border .2s; appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath fill='%236c8096' d='M6 7L0 0h12z'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 14px center;
}
.form-select:focus { border-color:var(--primary-light); box-shadow:0 0 0 3px rgba(46,134,193,0.12); outline:none; }
.checkbox-group { display:flex; flex-wrap:wrap; gap:8px; }
.checkbox-chip {
  position: relative;
  display:inline-flex; align-items:center; gap:6px; padding:7px 13px;
  border:1.5px solid var(--border); border-radius:8px; cursor:pointer; font-size:12.5px; font-weight:600;
  transition:all .2s; user-select:none;
}
.checkbox-chip.selected,
.checkbox-chip:has(input:checked) { border-color:var(--primary); background:#e8f4fd; color:var(--primary); }
.checkbox-chip input {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* ─── QUICK STATS ROW ─── */
.quick-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:18px; margin-bottom:24px; }

/* ─── COMPACT FINANCE STRIP (payments / trackers) ─── */
.finance-stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px 10px;
  margin-bottom: 10px;
}
@media (min-width: 1200px) {
  .finance-stats-strip {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
.finance-stat-cell {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px 11px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}
.finance-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  line-height: 1.2;
}
.finance-stat-value {
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  letter-spacing: -0.02em;
  word-break: break-word;
}
.finance-stat-value--muted { color: var(--text-muted); font-weight: 600; }
.finance-stats-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.45;
}
.finance-stats-meta strong { color: var(--text-main); font-weight: 700; }

/* Accountant record payment workspace */
.acc-pay-layout {
  display: grid;
  gap: 20px;
  align-items: start;
}
@media (min-width: 992px) {
  .acc-pay-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  }
}
.acc-pay-form-card .card-section-header h3 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.acc-pay-form-card .card-section-header p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.acc-pay-form-grid .form-group { margin-bottom: 0; }
.acc-pay-actions {
  margin-top: 8px;
  padding-top: 4px;
}
.acc-pay-summary-card .acc-pay-summary-panel {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fafbfd 0%, #f4f7fb 100%);
  padding: 16px 18px;
}
.acc-pay-summary-card .acc-pay-summary-name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.35;
  color: var(--text-main);
}
.acc-pay-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  margin: 6px 0;
}
.acc-pay-summary-row + .acc-pay-summary-row.acc-pay-summary-total {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.acc-pay-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin: 12px 0 0;
  line-height: 1.45;
}

/* ─── CLASS CARD ─── */
.class-card {
  background:#fff; border-radius:var(--radius); border:1px solid var(--border);
  box-shadow:var(--shadow-sm); overflow:hidden; cursor:pointer; transition:all .2s;
}
.class-card:hover { transform:translateY(-2px); box-shadow:var(--shadow); border-color:var(--primary-light); }
.class-card-header { padding:16px 18px; display:flex; align-items:center; gap:12px; }
.class-badge {
  width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center;
  font-family:'Sora',sans-serif; font-size:15px; font-weight:700; color:#fff; flex-shrink:0;
}
.class-card-body { padding:0 18px 16px; }
.stream-chip {
  display:inline-block; padding:3px 10px; border-radius:6px; font-size:11px; font-weight:600;
  background:#f0f7ff; color:var(--primary); margin:2px;
}

/* ─── ATTENDANCE ─── */
.attendance-row {
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 0; border-bottom:1px solid #f1f5f9;
}
.attendance-row:last-child { border-bottom:none; }
.att-toggle { display:flex; gap:6px; }
.att-btn {
  padding:5px 12px; border-radius:6px; font-size:12px; font-weight:600; border:1.5px solid var(--border);
  cursor:pointer; background:#fff; transition:all .18s;
}
.att-btn.present { border-color:var(--accent2); background:#e8f8ef; color:var(--accent2); }
.att-btn.absent { border-color:var(--danger); background:#fde8e8; color:var(--danger); }
.att-btn.late { border-color:var(--accent); background:#fef6e8; color:#d68910; }

/* ─── PROGRESS BAR ─── */
.progress-bar-wrap { background:#f0f4f8; border-radius:20px; height:8px; overflow:hidden; }
.progress-bar-fill { height:100%; border-radius:20px; transition:width .5s; }

/* ─── PAYMENT CARD ─── */
.payment-card {
  background:linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius:var(--radius); padding:22px; color:#fff; position:relative; overflow:hidden;
}
.payment-card::after {
  content:''; position:absolute; width:200px; height:200px; border-radius:50%;
  background:rgba(255,255,255,0.06); right:-60px; top:-60px;
}

/* ─── RECEIPT ─── */
.receipt-preview {
  border:2px dashed var(--border); border-radius:var(--radius); padding:24px;
  background:#fff; font-size:13px;
}

/* ─── ANIMATIONS ─── */
.fade-in { animation:fadeIn .3s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

/* ─── SEARCH BOX ─── */
.search-box {
  display:flex; align-items:center; gap:10px; background:#f8fafc;
  border:1.5px solid var(--border); border-radius:10px; padding:9px 14px; width:260px;
}
.search-box input { border:none; background:none; outline:none; font-size:13px; flex:1; font-family:'Plus Jakarta Sans',sans-serif; color:var(--text-main); }
.search-box i { color:var(--text-muted); font-size:14px; }

/* ─── NOTIFICATION DOT ─── */
.notif-dot { position:relative; }
.notif-dot::after { content:''; position:absolute; top:6px; right:6px; width:7px; height:7px; border-radius:50%; background:#e74c3c; border:2px solid #fff; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:#c8d8e8; border-radius:10px; }

/* ─── TERM CHIP ─── */
.term-btn { padding:6px 16px; border-radius:8px; border:1.5px solid var(--border); background:#fff; font-size:12px; font-weight:600; cursor:pointer; transition:all .2s; }
.term-btn.active { background:var(--primary); color:#fff; border-color:var(--primary); }

.divider { border:none; border-top:1px solid var(--border); margin:16px 0; }
.text-muted-sm { font-size:12px; color:var(--text-muted); }
.fw-600 { font-weight:600; }
.gap-8 { gap:8px; }

/* Clickable row / card links */
a.text-reset { color: inherit; text-decoration: none; }
a.stretch-link { display: block; color: inherit; text-decoration: none; }

/* ─── AJAX skeleton loaders ─── */
.skeleton-wrap { min-height: 120px; }
.skeleton { position: relative; overflow: hidden; background: #e8eef4; border-radius: 8px; }
.skeleton::after {
  content: '';
  position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  animation: skShimmer 1.15s ease-in-out infinite;
}
@keyframes skShimmer {
  100% { transform: translateX(100%); }
}
.skeleton-line { height: 12px; margin-bottom: 10px; border-radius: 6px; }
.skeleton-line.sm { height: 10px; }
.skeleton-line.lg { height: 22px; margin-bottom: 14px; }
.skeleton-card { border-radius: var(--radius); border: 1px solid var(--border); padding: 18px; background: #fff; margin-bottom: 16px; }
.skeleton-hidden { display: none !important; }
.btn-loading { pointer-events: none; opacity: 0.72; }
.skeleton-pill {
  height: 56px;
  min-width: 120px;
  border-radius: 14px;
  flex-shrink: 0;
}

/* ─── Parent home dashboard (mobile-app style) ─── */
.parent-app-page .page-content {
  padding-top: 0;
}

.parent-powered-footer-desktop.app-powered-footer {
  display: none;
}

@media (min-width: 768px) {
  .parent-powered-footer-desktop.app-powered-footer {
    display: block;
    width: calc(100% - 260px);
    margin-left: 260px;
    margin-top: 0;
    flex: none;
    box-sizing: border-box;
  }
}

@media (max-width: 767.98px) {
  body.role-parent.parent-app-page {
    overflow-x: clip;
  }
  body.role-parent.parent-app-page .main-content {
    overflow-x: clip;
    max-width: 100%;
    padding-top: calc(50px + env(safe-area-inset-top, 0px));
  }
}

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

@media (max-width: 767.98px) {
  body.role-parent.parent-app-page .topbar {
    position: relative;
  }

  .parent-app-header {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    padding: max(8px, env(safe-area-inset-top)) 14px 10px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 14px rgba(13, 51, 73, 0.08);
  }

  .parent-app-header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
  }

  .parent-app-header__logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: contain;
    flex-shrink: 0;
    background: #f4f7fb;
  }

  .parent-app-header__name {
    font-family: 'Sora', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-main);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

/* Shared parent mobile header (home page overrides title visibility below) */
@media (max-width: 768px) {
  body.role-parent.parent-app-page:not(.parent-desktop-sidebar) .topbar {
    background: linear-gradient(165deg, #e3f2fd 0%, #f0f4f8 48%, #f0f4f8 100%);
    border-bottom: none;
    box-shadow: none;
    align-items: flex-start;
    min-height: auto;
    padding: 14px 18px 16px;
    height: auto;
  }

  body.role-parent.parent-app-page:not(.parent-home-page):not(.parent-desktop-sidebar) .topbar-title {
    font-family: 'Sora', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    letter-spacing: -0.02em;
  }

  body.role-parent.parent-app-page:not(.parent-home-page):not(.parent-desktop-sidebar) .topbar-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 500;
    line-height: 1.35;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .parent-home-page .topbar-title {
    display: none;
  }

  .parent-home-page .topbar-subtitle {
    font-family: 'Sora', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
    letter-spacing: -0.02em;
    max-width: 20ch;
  }
}

@media (min-width: 769px) {
  .parent-home-page .topbar-subtitle {
    color: var(--text-muted);
    font-weight: 500;
  }
}

.parent-fees-skeleton .parent-skel-balance {
  min-width: 100%;
  height: 92px;
  border-radius: 18px;
}

.parent-balance-hero {
  position: relative;
  z-index: 1;
  border-radius: 20px !important;
  padding: 20px 20px 22px !important;
}

.parent-balance-hero__label {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.88;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.parent-balance-hero__amount {
  font-size: clamp(1.75rem, 8vw, 2.25rem);
  font-weight: 800;
  font-family: 'Sora', sans-serif;
  line-height: 1.15;
}

.parent-balance-hero__hint {
  font-size: 13px;
  opacity: 0.88;
  margin-top: 8px;
  line-height: 1.4;
}

.parent-fees-top {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 4px;
}

.parent-pay-quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.parent-pay-quick__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.parent-pay-quick__btn:active {
  transform: scale(0.98);
}

.parent-pay-quick__btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 14px rgba(26, 82, 118, 0.25);
}

.parent-pay-quick__btn--primary:hover {
  filter: brightness(1.03);
}

.parent-pay-quick__btn--outline {
  background: #fff;
  border: 2px solid var(--border);
  color: var(--primary);
}

.parent-pay-quick__btn--outline:hover {
  border-color: var(--primary-light);
  background: #f8fafc;
}

.parent-fees-history__title {
  font-family: 'Sora', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.parent-fees-history {
  margin-top: 8px;
}

.parent-fees-history__empty {
  display: block;
  padding: 4px 0 20px;
  margin: 0;
}

@media (min-width: 992px) {
  body.role-parent.parent-fees-page .parent-fees-page-content #feesDataRoot {
    max-width: 900px;
  }
}

.parent-pay-panel__head {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.parent-pay-panel__head h3 {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 15px;
}

.parent-pay-panel__close {
  flex-shrink: 0;
  border: none;
  background: #eef2f6;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.parent-pay-panel__close:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

@media (max-width: 768px) {
  body.role-parent.parent-app-page .page-content > .row {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 768px) {
  body.role-parent.parent-app-page:not(.parent-desktop-sidebar) .parent-panel {
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 6px 24px rgba(26, 82, 118, 0.06);
  }

  body.role-parent.parent-app-page:not(.parent-desktop-sidebar) .parent-panel .card-section-header {
    padding: 16px 18px;
    background: #f8fafc;
  }

  body.role-parent.parent-app-page:not(.parent-desktop-sidebar) .parent-panel .card-section-body:not(.p-0) {
    padding: 18px;
  }

  body.role-parent.parent-app-page:not(.parent-desktop-sidebar) .parent-panel__note {
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 14px;
  }

  body.role-parent.parent-app-page:not(.parent-desktop-sidebar) .parent-panel .form-control,
  body.role-parent.parent-app-page:not(.parent-desktop-sidebar) .parent-panel .form-select {
    min-height: 48px;
    font-size: 16px;
    border-radius: 12px;
  }

  body.role-parent.parent-app-page:not(.parent-desktop-sidebar) .parent-panel .form-label {
    font-size: 13px;
    margin-bottom: 8px;
  }
}

.parent-btn-block {
  width: 100%;
  padding: 14px 16px !important;
  font-size: 15px !important;
  border-radius: 14px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.parent-alert-wrap {
  margin-bottom: 14px;
}

.parent-app-alert {
  border-radius: 14px;
  font-size: 14px;
  margin: 0;
  border: none;
}

.parent-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .parent-stack-table thead {
    display: none;
  }

  .parent-stack-table tbody tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 10px;
    padding: 4px 14px;
    background: #fff;
    box-shadow: var(--shadow-sm);
  }

  .parent-stack-table tbody tr:hover td {
    background: transparent;
  }

  .parent-stack-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
  }

  .parent-stack-table tbody tr td:last-child {
    border-bottom: none;
  }

  .parent-stack-table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    max-width: 42%;
  }

  .parent-stack-table .parent-td-small {
    font-size: 13px;
  }

  .parent-stack-table .parent-td-action::before {
    align-self: center;
  }

  .parent-receipt-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 12px;
  }
}

/* Performance */
.parent-perf-toolbar {
  margin-bottom: 18px;
  padding: 16px 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.parent-perf-toolbar__label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.parent-perf-toolbar__select {
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border-radius: 12px;
}

@media (min-width: 769px) {
  .parent-perf-toolbar__select {
    max-width: 360px;
    font-size: 14px;
  }
}

.parent-perf-card {
  background: var(--card-bg);
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 28px rgba(26, 82, 118, 0.07);
  margin-bottom: 16px;
  overflow: hidden;
}

.parent-perf-card__head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fdfefe 0%, #f4f9fc 100%);
}

.parent-perf-card__title {
  margin: 0;
  font-family: 'Sora', sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-main);
}

.parent-perf-card__body {
  padding: 18px;
}

.parent-perf-empty {
  margin: 0 0 14px;
}

.parent-perf-subject {
  margin-bottom: 16px;
}

.parent-perf-subject__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 8px;
}

.parent-perf-subject__name {
  font-weight: 600;
  color: var(--text-main);
}

.parent-perf-subject__score {
  font-weight: 700;
  color: var(--accent2);
  flex-shrink: 0;
}

.parent-perf-bar {
  height: 10px;
  border-radius: 20px;
}

.parent-perf-overall {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding: 16px;
  border-radius: 14px;
  background: #f4f7fb;
  border: 1px solid var(--border);
}

.parent-perf-overall__lbl {
  font-weight: 700;
  font-size: 14px;
}

.parent-perf-overall__val {
  font-weight: 800;
  font-size: 1.15rem;
  font-family: 'Sora', sans-serif;
  color: var(--accent2);
}

/* Attendance */
.parent-att-card {
  background: var(--card-bg);
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 28px rgba(26, 82, 118, 0.07);
  margin-bottom: 16px;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

.parent-att-card__head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fdfefe 0%, #f4f9fc 100%);
}

.parent-att-card__title {
  margin: 0;
  font-family: 'Sora', sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
}

.parent-att-card__stream {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.parent-att-card__body {
  padding: 18px;
}

.parent-att-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.parent-att-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #f4f7fb;
  border: 1px solid var(--border);
}

.parent-att-stat__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.parent-att-stat--ok .parent-att-stat__icon {
  background: #e8f8f0;
  color: #1e8449;
}

.parent-att-stat--bad .parent-att-stat__icon {
  background: #fdecea;
  color: #c0392b;
}

.parent-att-stat--rate .parent-att-stat__icon {
  background: #e8f4fd;
  color: var(--primary);
}

.parent-att-stat__val {
  display: block;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.2;
}

.parent-att-stat__lbl {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .parent-att-stats {
    gap: 6px;
  }
  .parent-att-stat {
    padding: 10px 8px;
    gap: 8px;
    min-width: 0;
  }
  .parent-att-stat__val {
    font-size: 0.92rem;
  }
  .parent-att-stat__lbl {
    font-size: 9px;
  }
  .parent-att-heatmap {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
}

.parent-att-heatmap-title {
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--text-main);
}

.parent-att-heatmap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.parent-att-cell {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex-shrink: 0;
}

@media (min-width: 480px) {
  .parent-att-cell {
    width: 13px;
    height: 13px;
  }
}

.parent-att-cell--present {
  background: #6ee7b7;
}

.parent-att-cell--absent {
  background: #fca5a5;
}

.parent-att-cell--excused {
  background: #a5b4fc;
}

.parent-att-cell--empty,
.parent-att-cell--none {
  background: #e5e7eb;
}

/* Profile */
.parent-profile-card {
  text-align: center;
  padding: 28px 20px 22px;
  background: linear-gradient(180deg, #e3f2fd 0%, transparent 100%);
  border-radius: 20px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
}

.parent-profile-card__avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 20px;
  background: linear-gradient(145deg, var(--primary), var(--primary-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 8px 24px rgba(26, 82, 118, 0.25);
}

.parent-profile-card__name {
  margin: 0;
  font-family: 'Sora', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
}

.parent-profile-card__role {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.parent-profile-details .parent-profile-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.parent-profile-details .parent-profile-row:last-child {
  border-bottom: none;
}

.parent-profile-row__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.parent-profile-row__value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-word;
}

.parent-profile-logout {
  margin-top: 20px;
}

@media (max-width: 380px) {
  .parent-att-stats {
    grid-template-columns: 1fr;
  }
}

.parent-home-data {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.parent-home-overview .parent-home-summary {
  margin-bottom: 0;
}

.parent-home-children-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.parent-home-children-grid .parent-child-card {
  margin-bottom: 0;
}

.parent-home-notice-blurb {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  max-width: 42rem;
}

@media (min-width: 992px) {
  body.role-parent.parent-home-page .parent-home-page-content #parentHomeData {
    max-width: 960px;
  }

  .parent-home-children-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.parent-home-skeleton {
  padding-top: 8px;
}
.parent-skel-metrics {
  display: flex;
  gap: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.parent-skel-card {
  margin-bottom: 14px;
  min-height: 180px;
}

.parent-home-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 1100px) and (min-width: 769px) {
  .parent-home-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .parent-home-summary {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .parent-home-summary::-webkit-scrollbar {
    display: none;
  }

  .parent-metric {
    scroll-snap-align: start;
    min-width: 148px;
    flex: 0 0 auto;
  }
}

.parent-metric {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.parent-metric__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.parent-metric__icon--kids {
  background: #e8f4fd;
  color: var(--primary-light);
}
.parent-metric__icon--fees {
  background: #fef5e7;
  color: #d68910;
}
.parent-metric__icon--att {
  background: #e8f8f0;
  color: #1e8449;
}
.parent-metric__icon--score {
  background: #f4ecf7;
  color: #6c3483;
}

.parent-metric__value {
  display: block;
  font-family: 'Sora', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.parent-metric__label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 2px;
}

.parent-child-card {
  background: var(--card-bg);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(26, 82, 118, 0.08);
  padding: 0;
  overflow: hidden;
  margin-bottom: 6px;
  max-width: 100%;
  box-sizing: border-box;
}

.parent-child-card__hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 18px 16px;
  background: linear-gradient(135deg, #fdfefe 0%, #f4f9fc 100%);
  border-bottom: 1px solid var(--border);
}

.parent-child-card__avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--primary), var(--primary-light));
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(26, 82, 118, 0.28);
}

.parent-child-card__headtext {
  flex: 1;
  min-width: 0;
}

.parent-child-card__name {
  font-family: 'Sora', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
  color: var(--text-main);
}

.parent-child-card__meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.parent-child-card__pill {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 10px;
  border-radius: 20px;
  background: #e8f8f0;
  color: #1e8449;
}

.parent-child-card__chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 18px 0;
  box-sizing: border-box;
}

.parent-child-chip {
  background: #f4f7fb;
  border-radius: 14px;
  padding: 12px 12px;
  text-align: center;
}

.parent-child-chip__lbl {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.parent-child-chip__val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.parent-child-fee {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 14px 18px 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(90deg, #fff8e8 0%, #fef5e7 100%);
  border: 1px solid rgba(243, 156, 18, 0.35);
  box-sizing: border-box;
  max-width: calc(100% - 36px);
}

.parent-child-fee__icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(243, 156, 18, 0.2);
  color: #b9770e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.parent-child-fee__body {
  flex: 1;
  min-width: 140px;
}

.parent-child-fee__lbl {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #a56900;
}

.parent-child-fee__amt {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: 'Sora', sans-serif;
  color: var(--text-main);
  margin-top: 2px;
}

.parent-child-fee__hint {
  flex: 1 1 100%;
  font-size: 11px;
  color: #a56900;
  font-weight: 600;
}

.parent-child-card__actions {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}

.parent-child-card__cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.parent-child-card__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-main);
  background: #f4f7fb;
  border: 1.5px solid var(--border);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.parent-child-card__cta i {
  font-size: 15px;
  opacity: 0.85;
}

.parent-child-card__cta:active {
  transform: scale(0.98);
}

.parent-child-card__cta--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(26, 82, 118, 0.28);
}

.parent-child-card__cta--primary i {
  color: #fff;
  opacity: 1;
}

.parent-home-notices {
  padding-bottom: 8px;
}

.parent-empty-state {
  text-align: center;
  padding: 48px 24px 56px;
  max-width: 360px;
  margin: 0 auto;
}

.parent-empty-state__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 20px;
  background: #e8f4fd;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.parent-empty-state--error .parent-empty-state__icon {
  background: #fdecea;
  color: #c0392b;
}

.parent-empty-state__title {
  font-family: 'Sora', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--text-main);
}

.parent-empty-state__text {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ─── Parent mobile dock (credit + tab bar) & desktop credit ─── */
@media (max-width: 767.98px) {
  body.role-parent:not(.parent-desktop-sidebar) .sidebar { display: none !important; }
  body.role-parent:not(.parent-desktop-sidebar) .mobile-sidebar-toggle { display: none !important; }
  body.role-parent:not(.parent-desktop-sidebar) .main-content { margin-left: 0 !important; }
  body.role-parent:not(.parent-desktop-sidebar) .topbar { padding-left: 18px !important; padding-right: 18px !important; }
  body.role-parent:not(.parent-desktop-sidebar) .page-content {
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0)) !important;
  }

  .parent-mobile-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 28px rgba(13, 51, 73, 0.09);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .parent-mobile-dock__credit {
    margin: 0;
    padding: 8px 12px 2px;
    text-align: center;
    font-size: 10px;
    line-height: 1.35;
    color: var(--text-muted);
  }

  .parent-mobile-dock__credit strong {
    color: var(--text-main);
    font-weight: 600;
  }

  .parent-mobile-dock .parent-bottom-nav {
    display: flex;
    position: static;
    border: none;
    box-shadow: none;
    padding: 6px 4px 10px;
    margin: 0;
    background: transparent;
    justify-content: space-around;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .parent-mobile-dock .parent-bottom-nav a {
    flex: 1;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 2px;
    border-radius: 12px;
    max-width: 72px;
    margin: 0 auto;
  }

  .parent-mobile-dock .parent-bottom-nav a i {
    display: block;
    font-size: 20px;
    margin-bottom: 4px;
  }

  .parent-mobile-dock .parent-bottom-nav a.active {
    color: var(--brand-primary, var(--primary));
    background: rgba(26, 82, 118, 0.1);
  }
}

@media (min-width: 768px) {
  .parent-mobile-dock {
    display: none !important;
  }

  .teacher-mobile-dock {
    display: none !important;
  }
}

/* Teacher app — fixed header + page chrome (like parent portal) */
.teacher-app-header {
  display: none;
}

.teacher-app-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.teacher-app-header__logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
  background: #f4f7fb;
}

.teacher-app-header__name {
  font-family: 'Sora', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 767.98px) {
  body.role-teacher.teacher-app-page {
    overflow-x: clip;
  }

  body.role-teacher.teacher-app-page .main-content {
    overflow-x: clip;
    max-width: 100%;
    padding-top: calc(50px + env(safe-area-inset-top, 0px));
  }

  .teacher-app-header {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    padding: max(8px, env(safe-area-inset-top)) 14px 10px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 14px rgba(13, 51, 73, 0.08);
  }

  body.role-teacher.teacher-app-page:not(.teacher-desktop-sidebar) .teacher-app-topbar {
    background: linear-gradient(165deg, #e8f4fd 0%, #eef5fb 48%, #f4f8fc 100%);
    border-bottom: none;
    box-shadow: none;
    padding: 14px 18px 16px;
    align-items: flex-start;
    min-height: auto;
    height: auto;
  }

  body.role-teacher.teacher-app-page:not(.teacher-desktop-sidebar) .teacher-app-topbar .topbar-title {
    font-family: 'Sora', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    letter-spacing: -0.02em;
  }

  body.role-teacher.teacher-app-page:not(.teacher-desktop-sidebar) .teacher-app-topbar .topbar-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 500;
    line-height: 1.35;
  }
}

.teacher-marks-context {
  padding: 16px 18px;
  margin-bottom: 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fdfefe 0%, #f0f7fd 100%);
  border: 1px solid rgba(26, 82, 118, 0.12);
  box-shadow: 0 6px 22px rgba(26, 82, 118, 0.07);
}

.teacher-marks-context__eyebrow {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.teacher-marks-context__subject {
  font-family: 'Sora', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.teacher-marks-context__meta {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.teacher-marks-section-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.teacher-mark-modal__context {
  padding: 14px 16px;
  margin: -4px 0 16px;
  border-radius: 14px;
  background: #f4f9fc;
  border: 1px solid var(--border);
}

.teacher-mark-modal__ctx-eyebrow {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.teacher-mark-modal__ctx-subject {
  font-family: 'Sora', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.25;
}

.teacher-mark-modal__ctx-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.teacher-mark-modal__adm {
  font-size: 13px;
  margin-top: 0;
}

.teacher-mark-actions__save {
  width: 100%;
}

@media (min-width: 576px) {
  .teacher-mark-actions__save {
    width: auto;
    min-width: 160px;
  }
}

.teacher-class-tile {
  border-radius: 18px !important;
  overflow: hidden;
  border: 1px solid var(--border) !important;
  box-shadow: 0 6px 24px rgba(26, 82, 118, 0.06) !important;
}

.teacher-roster-card {
  border-radius: 18px !important;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 8px 28px rgba(26, 82, 118, 0.06);
}

.teacher-roster-scroll {
  -webkit-overflow-scrolling: touch;
}

.teacher-roster-score {
  font-size: 13px;
  line-height: 1.4;
  text-align: right;
}

@media (max-width: 768px) {
  .teacher-roster-table.parent-stack-table tbody td.teacher-roster-score {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .teacher-roster-table.parent-stack-table tbody td.teacher-roster-score::before {
    max-width: 100%;
  }
}

/* Teacher — class grid, dashboard links, subjects, timetable */
.teacher-classes-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 576px) {
  .teacher-classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
  }
}

.teacher-stream-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, #fff 0%, #f6fafc 100%);
  box-shadow: 0 8px 28px rgba(26, 82, 118, 0.08);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s;
}

.teacher-stream-card:hover {
  border-color: rgba(26, 82, 118, 0.25);
  box-shadow: 0 12px 36px rgba(26, 82, 118, 0.12);
  transform: translateY(-1px);
}

.teacher-stream-card__badge {
  flex-shrink: 0;
  min-width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.teacher-stream-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.teacher-stream-card__title {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
}

.teacher-stream-card__meta {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.teacher-stream-card__cta {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.teacher-dash-class {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fff;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 18px rgba(26, 82, 118, 0.06);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.teacher-dash-class:hover {
  border-color: var(--primary-light);
}

.teacher-dash-class__badge {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.teacher-dash-class__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.teacher-dash-class__title {
  font-weight: 700;
  font-size: 15px;
}

.teacher-dash-class__meta {
  font-size: 12px;
  color: var(--text-muted);
}

.teacher-dash-class__chev {
  color: var(--text-muted);
  font-size: 14px;
}

.teacher-empty-panel {
  padding: 28px 22px;
  text-align: center;
  border-radius: 18px;
  border: 1px dashed var(--border);
  background: #fafbfd;
}

.teacher-empty-panel--compact {
  padding: 18px 16px;
  text-align: left;
}

.teacher-empty-panel__title {
  font-weight: 700;
  margin: 0 0 8px;
  font-size: 16px;
}

.teacher-empty-panel__text {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.45;
}

.teacher-att-hint {
  font-size: 13px;
  line-height: 1.45;
}

.teacher-att-actions__save {
  width: 100%;
}

@media (min-width: 768px) {
  .teacher-att-actions {
    justify-content: flex-end;
  }

  .teacher-att-actions__save {
    width: auto;
    min-width: 200px;
  }
}

.teacher-subject-grade {
  margin-bottom: 20px;
}

.teacher-subject-grade__title {
  font-family: 'Sora', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 10px;
}

.teacher-subject-grade__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.teacher-subject-chip {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: #eef5fb;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.teacher-timetable-page {
  min-height: 55vh;
}

.teacher-timetable-hero {
  text-align: center;
  padding: 40px 22px 44px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, #fdfefe 0%, #eef6fc 100%);
  box-shadow: 0 10px 40px rgba(26, 82, 118, 0.08);
  color: var(--text-main);
}

.teacher-timetable-hero__eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
}

.teacher-timetable-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

.teacher-timetable-hero__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.teacher-timetable-hero__title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.35rem, 4.5vw, 1.75rem);
  font-weight: 800;
  margin: 0 0 14px;
  color: var(--text-main);
  line-height: 1.2;
}

.teacher-timetable-hero__text {
  margin: 0 auto 22px;
  max-width: 32rem;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}

.teacher-dash-footnote {
  margin: -8px 0 20px;
  font-size: 11px;
  line-height: 1.45;
}

.teacher-dash-teaching__lead {
  line-height: 1.45;
}

.teacher-dash-preview-host {
  min-height: 0;
}

.teacher-dash-preview {
  padding: 12px 14px;
  border-radius: 14px;
  background: #f4f9fc;
  border: 1px solid var(--border);
}

.teacher-dash-preview__label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.teacher-dash-preview__chips {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.45;
}

.teacher-dash-teaching__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 400px) {
  .teacher-dash-teaching__grid {
    grid-template-columns: 1fr;
  }
}

.teacher-dash-teach-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, #fff 0%, #f6fafc 100%);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 16px rgba(26, 82, 118, 0.06);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.teacher-dash-teach-tile:hover {
  border-color: var(--primary-light);
  box-shadow: 0 8px 22px rgba(26, 82, 118, 0.1);
}

.teacher-dash-teach-tile__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.teacher-dash-teach-tile__label {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 15px;
}

.teacher-dash-teach-tile__hint {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.teacher-dash-today__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 576px) {
  .teacher-dash-today__actions {
    flex-direction: row;
  }
}

.teacher-dash-action-btn {
  padding: 12px 18px !important;
  border-radius: 14px !important;
  font-weight: 600 !important;
  flex: 1;
}

.teacher-dash-classes-card .card-section-body {
  padding-top: 8px;
}

.teacher-stat-card .stat-label {
  font-size: 11px;
}

/* My subjects page */
.teacher-subjects-hero {
  border-radius: 18px !important;
  overflow: hidden;
  background: linear-gradient(135deg, #f8fbff 0%, #eef6fc 100%) !important;
  border: 1px solid rgba(26, 82, 118, 0.12) !important;
}

.teacher-subjects-hero .card-section-body {
  text-align: center;
  padding: 24px 20px !important;
}

.teacher-subjects-hero__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.teacher-subjects-hero__title {
  font-family: 'Sora', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--text-main);
}

.teacher-subjects-hero__streams {
  margin: 0;
  font-size: 13px;
}

.teacher-subject-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.teacher-subject-block__count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.teacher-subject-pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.teacher-subject-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.teacher-subject-pill__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #eef5fb;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.teacher-subject-pill__name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  color: var(--text-main);
}

.teacher-topbar-with-action .topbar-right {
  flex-shrink: 0;
}

/* ─── Teacher mobile app shell ─── */
@media (max-width: 767.98px) {
  body.role-teacher.teacher-app-page .teacher-page-content {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0)) !important;
  }

  .teacher-mobile-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 28px rgba(13, 51, 73, 0.09);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .teacher-bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    gap: 4px;
    padding: 10px 12px 14px;
    margin: 0;
    border: none;
    background: transparent;
  }

  .teacher-bottom-nav.teacher-bottom-nav--compact a {
    flex: 1;
    min-width: 0;
    max-width: 100px;
    margin: 0 auto;
  }

  .teacher-bottom-nav a {
    flex: 1;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 4px;
    border-radius: 12px;
  }

  .teacher-bottom-nav a i {
    display: block;
    font-size: 20px;
    margin-bottom: 4px;
  }

  .teacher-bottom-nav a.active {
    color: var(--brand-primary, var(--primary));
    background: rgba(26, 82, 118, 0.1);
  }

  body.role-teacher.teacher-app-page:not(.teacher-desktop-sidebar) .teacher-dash-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  body.role-teacher.teacher-app-page:not(.teacher-desktop-sidebar) .teacher-toolbar-topbar .topbar-right {
    width: 100%;
    margin-top: 12px;
  }

  body.role-teacher.teacher-app-page:not(.teacher-desktop-sidebar) .topbar {
    flex-wrap: wrap;
    align-items: flex-start !important;
  }

  body.role-teacher.teacher-app-page:not(.teacher-desktop-sidebar) #tclassRosterCard .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (min-width: 992px) {
  body.role-teacher.teacher-app-page .teacher-dash-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

body.role-teacher.teacher-app-page .teacher-dash-stats {
  display: grid;
  gap: 14px;
}

.teacher-toolbar-topbar .topbar-title {
  line-height: 1.25;
}

.teacher-attendance-content .teacher-att-filters__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.teacher-att-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.teacher-att-actions__btn {
  flex: 1;
  min-width: 110px;
  justify-content: center;
}

.teacher-att-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.teacher-att-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.teacher-att-row__meta {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.teacher-att-row__name {
  font-weight: 700;
  font-size: 15px;
}

.teacher-att-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex-shrink: 0;
  width: min(280px, 100%);
}

.teacher-att-toggle__btn {
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: #f4f7fb;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-muted);
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.teacher-att-toggle__btn:active {
  transform: scale(0.98);
}

.teacher-att-toggle__btn--present.is-active {
  background: #d4edda;
  border-color: #1e8449;
  color: #146c38;
}

.teacher-att-toggle__btn--absent.is-active {
  background: #fadbd8;
  border-color: #c0392b;
  color: #922b21;
}

.teacher-mark-filters__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.teacher-mark-actions {
  padding-top: 4px;
}

.teacher-marks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.teacher-mark-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.teacher-mark-card:hover {
  border-color: var(--primary-light);
}

.teacher-mark-card__name {
  font-weight: 700;
  font-size: 15px;
}

.teacher-mark-card__subject {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
}

.teacher-mark-card__adm {
  font-size: 12px;
  margin-top: 4px;
}

.teacher-mark-card__row2 {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.teacher-mark-card__tap {
  font-size: 12px;
}

.teacher-mark-modal-box {
  max-width: 420px;
}

/* Transport + Leave responsive polish */
.transport-page .table-responsive,
.leave-page .table-responsive {
  overflow-x: auto;
}

.transport-page-content .card-section,
.leave-page-content .card-section {
  overflow: hidden;
}

.leave-filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.transport-page .table-modern th,
.transport-page .table-modern td,
.leave-page .table-modern th,
.leave-page .table-modern td {
  white-space: nowrap;
}

.transport-page .table-modern td:nth-child(1),
.transport-page .table-modern td:nth-child(2),
.leave-page .table-modern td:nth-child(1),
.leave-page .table-modern td:nth-child(5) {
  white-space: normal;
}

@media (max-width: 991.98px) {
  .transport-page-content .row.g-4 > [class*='col-'] {
    width: 100%;
  }

  .transport-page .card-section-body .row.g-2 > [class*='col-'] {
    width: 100%;
  }

  .transport-page .card-section-body .row.g-2 > .d-flex.align-items-end.gap-2 {
    align-items: stretch !important;
    justify-content: flex-start;
  }

  .transport-page .card-section-body .row.g-2 > .d-flex.align-items-end.gap-2 .btn-sm-primary,
  .transport-page .card-section-body .row.g-2 > .d-flex.align-items-end.gap-2 .btn-sm-outline {
    width: 100%;
  }

  .leave-page .leave-filter-bar .btn-sm-primary {
    margin-left: 0 !important;
  }
}

@media (max-width: 767.98px) {
  .transport-page .card-section-header,
  .leave-page .card-section-header {
    gap: 10px;
    align-items: flex-start;
  }

  .transport-page .card-section-header .btn-sm-outline,
  .transport-page .card-section-header .btn-sm-primary,
  .leave-page .card-section-header .btn-sm-outline,
  .leave-page .card-section-header .btn-sm-primary {
    width: 100%;
  }

  .leave-page .lv-filter-btn {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
  }

  .transport-page .table-modern,
  .leave-page .table-modern {
    min-width: 680px;
  }
}

@media (max-width: 575.98px) {
  .transport-page .table-modern.transport-stops-table,
  .transport-page .table-modern.transport-pupil-table,
  .transport-page .table-modern.transport-parent-table,
  .leave-page .table-modern.leave-my-table,
  .leave-page .table-modern.leave-admin-table {
    min-width: 0;
  }

  .transport-page .table-modern.transport-stops-table thead,
  .transport-page .table-modern.transport-pupil-table thead,
  .transport-page .table-modern.transport-parent-table thead,
  .leave-page .table-modern.leave-my-table thead,
  .leave-page .table-modern.leave-admin-table thead {
    display: none;
  }

  .transport-page .table-modern.transport-stops-table tbody tr,
  .transport-page .table-modern.transport-pupil-table tbody tr,
  .transport-page .table-modern.transport-parent-table tbody tr,
  .leave-page .table-modern.leave-my-table tbody tr,
  .leave-page .table-modern.leave-admin-table tbody tr {
    display: block;
    margin: 0 10px 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }

  .transport-page .table-modern.transport-stops-table td,
  .transport-page .table-modern.transport-pupil-table td,
  .transport-page .table-modern.transport-parent-table td,
  .leave-page .table-modern.leave-my-table td,
  .leave-page .table-modern.leave-admin-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    white-space: normal;
    border-bottom: 1px dashed #e8edf3;
  }

  .transport-page .table-modern.transport-stops-table td:last-child,
  .transport-page .table-modern.transport-pupil-table td:last-child,
  .transport-page .table-modern.transport-parent-table td:last-child,
  .leave-page .table-modern.leave-my-table td:last-child,
  .leave-page .table-modern.leave-admin-table td:last-child {
    border-bottom: none;
  }

  .transport-page .table-modern.transport-stops-table td::before,
  .transport-page .table-modern.transport-pupil-table td::before,
  .transport-page .table-modern.transport-parent-table td::before,
  .leave-page .table-modern.leave-my-table td::before,
  .leave-page .table-modern.leave-admin-table td::before {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 86px;
    content: '';
  }

  .transport-page .table-modern.transport-stops-table td:nth-child(1)::before { content: '#'; }
  .transport-page .table-modern.transport-stops-table td:nth-child(2)::before { content: 'Place'; }
  .transport-page .table-modern.transport-stops-table td:nth-child(3)::before { content: 'Morning'; }
  .transport-page .table-modern.transport-stops-table td:nth-child(4)::before { content: 'Evening'; }
  .transport-page .table-modern.transport-stops-table td:nth-child(5)::before { content: 'Actions'; }

  .transport-page .table-modern.transport-pupil-table td:nth-child(1)::before { content: 'Pupil'; }
  .transport-page .table-modern.transport-pupil-table td:nth-child(2)::before { content: 'Class'; }
  .transport-page .table-modern.transport-pupil-table td:nth-child(3)::before { content: 'Status'; }
  .transport-page .table-modern.transport-pupil-table td:nth-child(4)::before { content: 'Route'; }
  .transport-page .table-modern.transport-pupil-table td:nth-child(5)::before { content: 'Stop'; }
  .transport-page .table-modern.transport-pupil-table td:nth-child(6)::before { content: 'Actions'; }

  .transport-page .table-modern.transport-parent-table td:nth-child(1)::before { content: '#'; }
  .transport-page .table-modern.transport-parent-table td:nth-child(2)::before { content: 'Stop'; }
  .transport-page .table-modern.transport-parent-table td:nth-child(3)::before { content: 'Morning'; }
  .transport-page .table-modern.transport-parent-table td:nth-child(4)::before { content: 'Evening'; }
  .transport-page .table-modern.transport-parent-table td:nth-child(5)::before { content: ''; }

  .leave-page .table-modern.leave-my-table td:nth-child(1)::before { content: 'Dates'; }
  .leave-page .table-modern.leave-my-table td:nth-child(2)::before { content: 'Days'; }
  .leave-page .table-modern.leave-my-table td:nth-child(3)::before { content: 'Status'; }
  .leave-page .table-modern.leave-my-table td:nth-child(4)::before { content: 'Submitted'; }

  .leave-page .table-modern.leave-admin-table td:nth-child(1)::before { content: 'Staff'; }
  .leave-page .table-modern.leave-admin-table td:nth-child(2)::before { content: 'Role'; }
  .leave-page .table-modern.leave-admin-table td:nth-child(3)::before { content: 'Dates'; }
  .leave-page .table-modern.leave-admin-table td:nth-child(4)::before { content: 'Days'; }
  .leave-page .table-modern.leave-admin-table td:nth-child(5)::before { content: 'Reason'; }
  .leave-page .table-modern.leave-admin-table td:nth-child(6)::before { content: 'Status'; }
  .leave-page .table-modern.leave-admin-table td:nth-child(7)::before { content: 'Action'; }

  .transport-page .table-modern.transport-pupil-table td:nth-child(4) select,
  .transport-page .table-modern.transport-pupil-table td:nth-child(5) select {
    width: 100%;
    min-width: 0 !important;
  }

  .transport-page .table-modern.transport-pupil-table td:nth-child(6),
  .transport-page .table-modern.transport-stops-table td:nth-child(5),
  .leave-page .table-modern.leave-admin-table td:nth-child(7) {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* ─── PRINT: app shell (browser print / Cmd+P) ─── */
@media print {
  body.page-app {
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body.page-app .sidebar,
  body.page-app .mobile-sidebar-toggle,
  body.page-app .sidebar-backdrop,
  body.page-app .parent-mobile-dock,
  body.page-app .teacher-mobile-dock,
  body.page-app .parent-app-header,
  body.page-app .topbar,
  body.page-app footer.app-powered-footer {
    display: none !important;
  }
  body.page-app .main-content {
    margin: 0 !important;
    padding: 12px !important;
    max-width: none !important;
  }
}

/* POS receipt page (accountant/receipt.php) */
.receipt-pos-page { background: #fff; color: #111; font-family: 'Plus Jakarta Sans', sans-serif; padding: 8px; max-width: 80mm; margin: 0 auto; font-size: 12px; }
.receipt-pos-page .logo { max-width: 100%; max-height: 56px; object-fit: contain; display: block; margin: 0 auto 8px; }

