/* Teacher Portal – standalone styles */

body.teacher-portal-page {
  margin: 0;
  min-height: 100vh;
  background: var(--gray-50);
  font-family: var(--font, 'DM Sans', sans-serif);
  color: var(--gray-800);
}

/* Session restore — hide login flash while boot completes */
.tp-boot-view {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
}
.tp-boot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--gray-500);
  font-size: 14px;
}
.tp-boot-inner i { font-size: 28px; color: var(--navy-400); }

html.tp-booting #tpLoginView { display: none !important; }
html.tp-booting #tpPortalView { display: none !important; }
html.tp-booting .tp-boot-view { display: flex; }

html.tp-booting.tp-has-session #tpPortalView {
  display: flex !important;
}
html.tp-booting.tp-has-session .tp-boot-view {
  position: fixed;
  inset: 0;
  z-index: 500;
  min-height: 0;
  background: rgba(248, 250, 252, 0.88);
  backdrop-filter: blur(2px);
}

/* ── Login shell (split layout) ── */
.tp-login-shell {
  min-height: 100vh;
  display: flex;
  background: var(--gray-50);
}

.tp-brand-panel {
  flex: 1;
  background: linear-gradient(160deg, var(--navy-950) 0%, var(--navy-800) 45%, var(--navy-700) 100%);
  color: var(--white);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.tp-brand-panel::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(240, 171, 0, .08);
}

.tp-brand-panel::after {
  content: '';
  position: absolute;
  bottom: -120px;
  left: -60px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(59, 118, 196, .12);
}

.tp-brand-content { position: relative; z-index: 1; }

.tp-brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display, 'Fraunces', serif);
  font-weight: 700;
  font-size: 26px;
  color: var(--navy-900);
  background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
  box-shadow: 0 8px 24px rgba(240, 171, 0, .35);
  margin-bottom: 28px;
}

.tp-brand-title {
  font-family: var(--font-display, 'Fraunces', serif);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.5px;
  margin: 0 0 16px;
}

.tp-brand-title span { color: var(--gold-400); }

.tp-brand-desc {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255, 255, 255, .55);
  max-width: 400px;
  margin: 0;
}

.tp-brand-features {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 48px;
}

.tp-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, .7);
}

.tp-feature-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(240, 171, 0, .15);
  color: var(--gold-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.tp-form-panel {
  width: 480px;
  min-width: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 36px;
  background: var(--white);
  box-shadow: var(--shadow-lg, 0 20px 60px rgba(11, 22, 40, .12));
}

.tp-login-card {
  width: 100%;
  max-width: 400px;
}

.tp-login-card h1 {
  font-family: var(--font-display, 'Fraunces', serif);
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--navy-900);
  letter-spacing: -.3px;
}

.tp-login-card > .tp-panel > p,
.tp-login-card .tp-reset-info {
  margin: 0 0 22px;
  color: var(--gray-500);
  font-size: 14px;
  line-height: 1.55;
}

.tp-alert {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.tp-alert.error {
  display: block;
  background: var(--rose-bg);
  color: var(--rose);
  border: 1px solid rgba(225, 29, 72, .15);
}

.tp-alert.success {
  display: block;
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid rgba(5, 150, 105, .15);
}

.tp-login-footer {
  margin-top: 20px;
  font-size: 12px;
  color: var(--gray-500);
  text-align: center;
}

.tp-login-footer a {
  color: var(--navy-500);
  font-weight: 600;
  text-decoration: none;
}

.tp-login-footer a:hover { text-decoration: underline; }

.tp-panel { display: none; }
.tp-panel.active { display: block; }

.tp-link-btn {
  background: none;
  border: none;
  color: var(--navy-500);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
  font-family: inherit;
}

.tp-link-btn:hover { text-decoration: underline; }

.tp-otp-input {
  letter-spacing: .35em;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tp-resend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  font-size: 12px;
  color: var(--gray-500);
}

.tp-input-wrap { position: relative; }

.tp-input-wrap .form-control { padding-right: 42px; }

.tp-toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  font-size: 14px;
  padding: 4px;
}

.tp-toggle-pw:hover { color: var(--navy-500); }

/* ── Authenticated portal ── */
.tp-portal-shell {
  display: none;
  min-height: 100vh;
  flex-direction: column;
  background: var(--gray-50);
}

.tp-portal-shell.active { display: flex; }

.tp-topbar {
  background: var(--navy-900);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  padding: 0 22px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
}

.tp-topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tp-topbar-brand .ava {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
  color: var(--navy-900);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 3px 10px rgba(240, 171, 0, .3);
}

.tp-topbar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.2;
}

.tp-topbar-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, .4);
  margin-top: 2px;
}

.tp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tp-topbar-actions .form-control {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .12);
  color: var(--white);
  font-size: 12px;
  height: 36px;
}

.tp-topbar-actions .form-control option { color: var(--navy-900); }

.tp-context-wrap {
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  padding: 4px 12px;
}

.tp-context-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, .45);
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}

.tp-topbar .btn-outline {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .15);
  color: var(--white);
}

.tp-topbar .btn-outline:hover {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(240, 171, 0, .35);
  color: var(--gold-300);
}

.tp-topbar .btn-ghost {
  color: rgba(255, 255, 255, .55);
}

.tp-topbar .btn-ghost:hover {
  background: rgba(255, 255, 255, .08);
  color: var(--white);
}

.tp-main {
  flex: 1;
  padding: 24px 22px 40px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Welcome hero */
.tp-welcome {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding: 22px 24px;
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 100%);
  border-radius: var(--radius-lg, 16px);
  color: var(--white);
  box-shadow: var(--shadow-md, 0 8px 32px rgba(11, 22, 40, .14));
  position: relative;
  overflow: hidden;
}

.tp-welcome::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(240, 171, 0, .1);
}

.tp-welcome-text { position: relative; z-index: 1; }

.tp-welcome-greeting {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-400);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin: 0 0 6px;
}

.tp-welcome-name {
  font-family: var(--font-display, 'Fraunces', serif);
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -.3px;
}

.tp-welcome-meta {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, .55);
  line-height: 1.5;
}

.tp-welcome-slot {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  padding: 14px 18px;
  min-width: 200px;
  max-width: 280px;
}

.tp-welcome-slot-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--gold-400);
  margin-bottom: 6px;
}

.tp-welcome-slot-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.tp-welcome-slot-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, .5);
  margin-top: 4px;
}

.tp-welcome-slot.tp-welcome-slot--idle .tp-welcome-slot-title {
  color: rgba(255, 255, 255, .65);
  font-weight: 500;
}

/* Stat cards */
.tp-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.tp-stat {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm, 0 1px 4px rgba(0, 0, 0, .04));
  transition: var(--transition, .18s ease);
}

.tp-stat:hover {
  border-color: var(--navy-200);
  box-shadow: var(--shadow, 0 4px 20px rgba(11, 22, 40, .08));
}

.tp-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.tp-stat-icon--navy { background: var(--navy-50); color: var(--navy-600); }
.tp-stat-icon--gold { background: var(--gold-100); color: var(--gold-700); }
.tp-stat-icon--emerald { background: var(--emerald-bg); color: var(--emerald); }
.tp-stat-icon--sky { background: var(--sky-bg); color: var(--sky); }

.tp-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy-900);
  line-height: 1;
}

.tp-stat-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 3px;
}

/* Quick actions */
.tp-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.tp-action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 18px 16px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 14px;
  cursor: pointer;
  transition: var(--transition, .18s ease);
  text-align: left;
  font-family: inherit;
  width: 100%;
}

.tp-action-card:hover {
  border-color: var(--navy-300);
  box-shadow: var(--shadow, 0 4px 20px rgba(11, 22, 40, .1));
  transform: translateY(-2px);
}

.tp-action-card:active { transform: translateY(0); }

.tp-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--navy-50), var(--navy-100));
  color: var(--navy-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.tp-action-card:hover .tp-action-icon {
  background: linear-gradient(135deg, var(--navy-100), var(--navy-200));
  color: var(--navy-700);
}

.tp-action-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-900);
  line-height: 1.3;
}

.tp-action-hint {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: -6px;
}

/* Dashboard grid */
.tp-dashboard-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.tp-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 4px rgba(0, 0, 0, .04));
}

.tp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.tp-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tp-card-title i {
  color: var(--navy-500);
  font-size: 15px;
}

.tp-card-body { padding: 0; }

.tp-card-body--padded { padding: 14px 18px; }

.tp-timetable .tbl { margin: 0; }

.tp-timetable .tbl th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--gray-500);
  background: var(--white);
}

.tp-timetable .tbl td { font-size: 13px; }

.tp-timetable .tp-period-time {
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 400;
}

.tp-timetable .tp-double-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--violet);
  background: rgba(124, 58, 237, .1);
  border-radius: 999px;
  padding: 2px 8px;
  letter-spacing: .2px;
}

.tp-timetable tr.tp-row-double td:first-child {
  border-left: 3px solid var(--violet);
}

.tp-timetable tr.tp-row-today {
  background: rgba(253, 230, 138, .2);
}

.tp-timetable tr.tp-row-today td:first-child {
  border-left: 3px solid var(--gold-500);
}

.tp-timetable tr.tp-row-now {
  background: var(--emerald-bg) !important;
}

.tp-timetable tr.tp-row-now td { font-weight: 600; }

.tp-badge-today {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--gold-500);
  color: var(--navy-900);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: 4px;
  vertical-align: middle;
}

.tp-badge-now {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--emerald);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 4px;
  vertical-align: middle;
}

.tp-obs-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 4px 18px 12px;
}

.tp-obs-list::-webkit-scrollbar { width: 5px; }
.tp-obs-list::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 4px; }

.tp-obs-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
}

.tp-obs-item:last-child { border-bottom: none; }

.tp-obs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.tp-obs-student {
  font-weight: 600;
  font-size: 13px;
  color: var(--navy-900);
}

.tp-obs-date {
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 500;
}

.tp-obs-category {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 3px 8px;
  border-radius: 6px;
  margin: 6px 0 4px;
  background: var(--navy-50);
  color: var(--navy-600);
}

.tp-obs-note {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.5;
}

.tp-empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--gray-400);
  font-size: 13px;
}

.tp-empty i {
  display: block;
  font-size: 28px;
  margin-bottom: 10px;
  opacity: .4;
}

.tp-access-card .tp-card-body--padded {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.65;
}

.tp-access-card .tp-card-body--padded p { margin: 0 0 10px; }
.tp-access-card .tp-card-body--padded p:last-child { margin-bottom: 0; }
.tp-access-card strong { color: var(--navy-800); }

/* Section label */
.tp-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--gray-400);
  margin: 0 0 12px 2px;
}

/* Modal polish on portal page */
body.teacher-portal-page .modal-overlay.open {
  backdrop-filter: blur(4px);
}

body.teacher-portal-page #teacherObservationModal .modal {
  border-radius: var(--radius-lg, 16px);
}

/* Attendance modal */
body.teacher-portal-page .tp-att-modal {
  max-width: 920px;
  width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
}

body.teacher-portal-page .tp-att-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

body.teacher-portal-page .tp-att-stats {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 14px;
}

body.teacher-portal-page .tp-att-stats .stat-card {
  padding: 12px;
}

body.teacher-portal-page .tp-att-stats .stat-val {
  font-size: 22px;
}

body.teacher-portal-page .tp-att-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

body.teacher-portal-page .tp-att-meta {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 12px;
}

body.teacher-portal-page .tp-att-footer {
  flex-wrap: wrap;
  gap: 8px;
}

body.teacher-portal-page .att-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

body.teacher-portal-page .att-student-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}

body.teacher-portal-page .att-student-card:hover {
  border-color: var(--navy-300);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

body.teacher-portal-page .att-student-card.status-Absent {
  border-left: 4px solid var(--rose);
  background: var(--rose-bg);
}

body.teacher-portal-page .att-student-card.status-Late {
  border-left: 4px solid var(--gold);
  background: var(--amber-bg);
}

body.teacher-portal-page .att-student-card.status-Excused {
  border-left: 4px solid var(--sky);
  background: var(--navy-50);
}

body.teacher-portal-page .att-student-card.status-Present {
  border-left: 4px solid var(--emerald);
}

body.teacher-portal-page .att-student-card.pre-excused {
  opacity: .85;
}

body.teacher-portal-page .att-sms-opt-in {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  user-select: none;
}

body.teacher-portal-page .att-sms-opt-in input {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--rose);
}

body.teacher-portal-page .att-student-card.status-Absent .att-sms-opt-in {
  color: var(--rose);
}

body.teacher-portal-page .att-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

body.teacher-portal-page .att-status-pill.Present { background: var(--emerald-bg); color: var(--emerald); }
body.teacher-portal-page .att-status-pill.Absent { background: var(--rose-bg); color: var(--rose); }
body.teacher-portal-page .att-status-pill.Late { background: var(--amber-bg); color: var(--gold-600); }
body.teacher-portal-page .att-status-pill.Excused { background: var(--navy-50); color: var(--sky); }

body.teacher-portal-page .att-mode-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--navy-50);
  color: var(--navy-600);
}

body.teacher-portal-page .tp-att-period-cards {
  margin-bottom: 14px;
}

body.teacher-portal-page .tp-att-period-heading {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

body.teacher-portal-page .tp-att-period-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

body.teacher-portal-page .tp-att-period-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

body.teacher-portal-page .tp-att-period-card:hover {
  border-color: var(--navy-300);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}

body.teacher-portal-page .tp-att-period-card.is-selected {
  border-color: var(--navy-600);
  background: var(--navy-50);
  box-shadow: 0 0 0 1px var(--navy-600);
}

body.teacher-portal-page .tp-att-homeroom-card.is-selected {
  border-color: var(--emerald);
  background: var(--emerald-bg);
  box-shadow: 0 0 0 1px var(--emerald);
}

body.teacher-portal-page .tp-att-homeroom-card .tp-att-period-label {
  color: var(--navy-700);
}

body.teacher-portal-page .tp-att-period-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy-800);
}

body.teacher-portal-page .tp-att-period-time {
  font-size: 12px;
  color: var(--gray-500);
  font-variant-numeric: tabular-nums;
}

body.teacher-portal-page .tp-att-period-subject {
  font-size: 11px;
  color: var(--gray-600);
  line-height: 1.3;
}

body.teacher-portal-page .tp-att-period-mine {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--emerald);
  background: var(--emerald-bg);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
}

body.teacher-portal-page .tp-att-period-empty {
  font-size: 13px;
  color: var(--gray-500);
  padding: 12px 14px;
  border: 1px dashed var(--gray-200);
  border-radius: 12px;
  background: var(--gray-50);
}

@media (max-width: 640px) {
  body.teacher-portal-page .tp-att-stats { grid-template-columns: repeat(2, 1fr); }
  body.teacher-portal-page .att-roster-grid { grid-template-columns: 1fr; }
  body.teacher-portal-page .tp-att-toolbar { flex-direction: column; align-items: stretch; }
  body.teacher-portal-page .tp-att-toolbar .form-control { width: 100%; }
body.teacher-portal-page .tp-att-period-card.is-unmarked {
  border-color: #f43f5e;
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.18);
  animation: tp-att-unmarked-pulse 2.2s ease-in-out infinite;
}

body.teacher-portal-page .tp-att-period-card.is-unmarked .tp-att-period-label {
  color: #9f1239;
}

body.teacher-portal-page .tp-att-period-card.is-unmarked::after {
  content: 'NOT MARKED';
  display: block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #be123c;
}

body.teacher-portal-page .tp-att-period-card.is-selected.is-unmarked {
  border-color: #e11d48;
  box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.35);
}

body.teacher-portal-page .tp-att-missing-banner {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid #f43f5e;
  background: linear-gradient(135deg, #fff5f5 0%, #ffe4e6 100%);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.12);
}

body.teacher-portal-page .tp-att-missing-banner-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

body.teacher-portal-page .tp-att-missing-banner-head i {
  color: #e11d48;
  font-size: 20px;
  margin-top: 2px;
}

body.teacher-portal-page .tp-att-missing-banner-title {
  font-size: 14px;
  font-weight: 800;
  color: #9f1239;
}

body.teacher-portal-page .tp-att-missing-banner-sub {
  font-size: 12px;
  color: #be123c;
  margin-top: 2px;
}

body.teacher-portal-page .tp-att-missing-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

body.teacher-portal-page .tp-att-missing-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #fda4af;
  background: #fff;
  color: #9f1239;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

@keyframes tp-att-unmarked-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.18); }
  50% { box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.28); }
}

  body.teacher-portal-page .tp-att-period-grid { grid-template-columns: repeat(2, 1fr); }
  body.teacher-portal-page .tp-att-footer .btn { flex: 1; }
}

/* Responsive */
@media (max-width: 900px) {
  .tp-login-shell { flex-direction: column; }
  .tp-brand-panel { padding: 36px 28px; min-height: auto; }
  .tp-brand-features { display: none; }
  .tp-brand-title { font-size: 28px; }
  .tp-form-panel { width: 100%; box-shadow: none; padding: 32px 24px 48px; }
}

@media (max-width: 768px) {
  .tp-dashboard-grid { grid-template-columns: 1fr; }
  .tp-welcome-slot { width: 100%; max-width: none; }
  .tp-topbar { height: auto; min-height: 64px; padding: 12px 16px; }
  .tp-main { padding: 16px; }
  .tp-welcome-name { font-size: 22px; }
}

@media (max-width: 480px) {
  .tp-topbar-actions { width: 100%; }
  .tp-topbar-actions .btn { flex: 1; justify-content: center; }
  .tp-context-wrap { width: 100%; }
  .tp-context-wrap .form-control { flex: 1; width: auto !important; }
}

/* CBA rubric gradebook modal */
body.teacher-portal-page .tp-cba-modal {
  max-width: 720px;
  width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
}

/* My Appraisal modal */
body.teacher-portal-page .tp-appraisal-modal {
  max-width: 640px;
  width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
}

body.teacher-portal-page .tp-appraisal-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

body.teacher-portal-page .tp-appraisal-intro {
  font-size: 12px;
  color: var(--gray-500);
  margin: 0 0 14px;
  line-height: 1.5;
}

body.teacher-portal-page .tp-appraisal-alert {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  background: var(--navy-50);
  border: 1px solid var(--navy-100);
  color: var(--navy-700);
}

body.teacher-portal-page .tp-appraisal-loading,
body.teacher-portal-page .tp-appraisal-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--gray-400);
}

body.teacher-portal-page .tp-appraisal-card {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--white);
}

body.teacher-portal-page .tp-appraisal-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

body.teacher-portal-page .tp-appraisal-cycle {
  font-weight: 600;
  font-size: 15px;
  color: var(--navy-800);
}

body.teacher-portal-page .tp-appraisal-meta {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

body.teacher-portal-page .tp-appraisal-scores {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

body.teacher-portal-page .tp-appraisal-score {
  text-align: center;
  padding: 10px 8px;
  border-radius: 8px;
  background: var(--gray-50);
}

body.teacher-portal-page .tp-appraisal-score-val {
  font-weight: 700;
  font-size: 18px;
  color: var(--navy-700);
}

body.teacher-portal-page .tp-appraisal-score-label {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 2px;
}

body.teacher-portal-page .tp-appraisal-comments {
  font-size: 13px;
  color: var(--gray-700);
  background: var(--gray-50);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  line-height: 1.5;
}

body.teacher-portal-page .tp-appraisal-hint {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 10px;
}

body.teacher-portal-page .tp-appraisal-ack-done {
  font-size: 13px;
  color: #059669;
}

body.teacher-portal-page .tp-cba-body {
  position: relative;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

body.teacher-portal-page .tp-cba-saving-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(2px);
}

body.teacher-portal-page .tp-cba-saving-overlay[hidden] {
  display: none !important;
}

body.teacher-portal-page .tp-cba-saving-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

body.teacher-portal-page .tp-cba-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--navy-500);
  border-radius: 50%;
  animation: tp-cba-spin 0.75s linear infinite;
}

body.teacher-portal-page .tp-cba-btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tp-cba-spin 0.75s linear infinite;
}

body.teacher-portal-page .tp-cba-saving-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-600);
}

@keyframes tp-cba-spin {
  to {
    transform: rotate(360deg);
  }
}

body.teacher-portal-page .tp-cba-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

body.teacher-portal-page .tp-cba-assess-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.teacher-portal-page .tp-cba-assess-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  background: var(--white);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: var(--font);
}

body.teacher-portal-page .tp-cba-assess-btn span {
  font-size: 12px;
  color: var(--gray-500);
}

body.teacher-portal-page .tp-cba-student-card {
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: var(--white);
}

body.teacher-portal-page .tp-cba-student-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
}

body.teacher-portal-page .tp-cba-student-name span {
  font-weight: 400;
  font-size: 12px;
  color: var(--gray-400);
  margin-left: 6px;
}

body.teacher-portal-page .tp-cba-crit-block {
  margin-bottom: 10px;
}

body.teacher-portal-page .tp-cba-crit-block label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 4px;
}

body.teacher-portal-page .tp-cba-stream-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

body.teacher-portal-page .tp-cba-stream-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--navy-50);
  border: 1.5px solid var(--navy-100);
  flex: 1;
  min-width: 180px;
}

body.teacher-portal-page .tp-cba-stream-label-text {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--gray-400);
}

body.teacher-portal-page .tp-cba-stream-chip strong {
  font-size: 14px;
  color: var(--navy-700);
}

body.teacher-portal-page .tp-cba-stream-hint {
  font-size: 12px;
  color: var(--gray-500);
  margin: 0 0 12px;
}

body.teacher-portal-page .tp-cba-remarks {
  width: 100%;
  margin-top: 6px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  padding: 0 10px;
  font-size: 12px;
}

body.teacher-portal-page .tp-cba-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

body.teacher-portal-page .tp-cba-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  font-family: var(--font);
}

body.teacher-portal-page .tp-cba-tab.active {
  border-color: var(--navy-400);
  background: var(--navy-50);
  color: var(--navy-600);
}

body.teacher-portal-page .tp-cba-panel {
  display: none;
}

body.teacher-portal-page .tp-cba-create-details summary {
  list-style: none;
}
body.teacher-portal-page .tp-cba-create-details summary::-webkit-details-marker {
  display: none;
}
body.teacher-portal-page .tp-cba-panel.active {
  display: block;
}

/* Class Diary & Homework */
.tp-diary-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tp-diary-type {
  flex: 1 1 30%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  margin: 0;
  transition: border-color .15s, background .15s;
}
.tp-diary-type input { margin: 0; }
.tp-diary-type:has(input:checked) {
  border-color: var(--navy-500, #2563eb);
  background: rgba(37, 99, 235, 0.06);
  font-weight: 600;
}
.tp-diary-entry {
  border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.tp-diary-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tp-diary-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 2px 8px;
  border-radius: 999px;
}
.tp-diary-badge.is-homework { background: #fef3c7; color: #92400e; }
.tp-diary-badge.is-materials { background: #dcfce7; color: #166534; }
.tp-diary-badge.is-announcement { background: #e0e7ff; color: #3730a3; }
.tp-diary-attach-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  margin-top: 6px;
  color: var(--navy-500, #2563eb);
  text-decoration: none;
}
.tp-diary-archive-btn {
  border: none;
  background: none;
  color: var(--gray-400, #94a3b8);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
}
.tp-diary-archive-btn:hover { color: var(--rose, #e11d48); }
