/* Administrator navigation, management tools, reports, and settings. */
.admin-sidebar {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.admin-sidebar-title {
  display: grid;
  gap: 2px;
  padding: 4px 4px 0;
}

.admin-sidebar-title strong {
  color: var(--ink);
  font-size: 1rem;
}

.admin-sidebar-title span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-section-picker {
  display: none;
}

.admin-main {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.admin-global-search {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1fr);
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.admin-global-search label {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 900;
}

.admin-global-search-control {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.admin-global-search-control input {
  min-width: 0;
  flex: 1;
}

.admin-global-search-control button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
}

.admin-global-search-results {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.admin-global-search-result {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 84%, transparent);
  min-width: 0;
}

.admin-global-search-result strong,
.admin-global-search-result span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-global-search-result span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
}

.admin-global-search-result .actions {
  margin-top: 4px;
}

.admin-global-search-result .actions button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.84rem;
}

.admin-sidebar-actions {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.admin-sidebar-actions button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 38px;
  border-radius: 11px;
  font-size: 0.84rem;
}

.admin-tab-nav {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.admin-tab-nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  white-space: nowrap;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.admin-tab-nav button.active {
  color: #fff;
  border-color: var(--brand);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 22px color-mix(in srgb, var(--brand) 22%, transparent);
}

.admin-tab-nav button:not(.active):hover {
  color: var(--ink);
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.admin-nav-badge {
  display: inline-flex;
  min-width: 22px;
  min-height: 22px;
  margin-left: 6px;
  padding: 0 6px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: var(--warn);
  font-size: 0.72rem;
  font-weight: 900;
}

.admin-nav-badge:not(.hidden) {
  animation: adminAlertPulse 1700ms ease-in-out infinite;
}

.admin-page-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
  box-shadow: 0 10px 24px rgba(17, 25, 35, 0.06);
}

.admin-page-intro h3 {
  margin: 2px 0 4px;
}

.admin-page-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 420px;
}

.admin-overview-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 10px 0 14px;
}

.admin-overview-card {
  display: grid;
  gap: 8px;
  min-height: 148px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  box-shadow: 0 10px 22px rgba(17, 25, 35, 0.06);
}

.admin-overview-card strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.admin-overview-card span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.35;
}

.admin-overview-card .status-chip {
  width: fit-content;
}

.admin-overview-card .actions {
  align-self: end;
  margin-top: 0;
}

.admin-quick-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.admin-quick-actions button {
  min-width: 0;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 0.84rem;
}

/* Admin overview cards for warnings, activity, and quick decisions. */
.admin-command-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 14px;
}

.admin-command-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 88%, var(--panel-soft));
  box-shadow: 0 10px 22px rgba(17, 25, 35, 0.06);
}

.admin-section-title.compact {
  margin: 0;
  padding: 0;
}

.admin-section-title.compact h3 {
  font-size: 1rem;
}

.admin-command-list {
  display: grid;
  gap: 8px;
}

.admin-command-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.admin-command-item strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.admin-command-item span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.3;
}

.admin-command-item .status-chip {
  width: fit-content;
  align-self: start;
}

.admin-command-item button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 0.78rem;
}

.admin-tab-panel.hidden {
  display: none !important;
}

.admin-tab-panel.reveal {
  animation: adminPanelReveal 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.admin-tab-panel.admin-jump-focus {
  outline: 3px solid color-mix(in srgb, var(--gold) 72%, transparent);
  outline-offset: 4px;
  box-shadow:
    0 0 0 6px color-mix(in srgb, var(--gold) 18%, transparent),
    var(--shadow-soft);
}

.tempo-target-focus {
  outline: 3px solid color-mix(in srgb, var(--accent) 72%, transparent) !important;
  outline-offset: 5px;
  box-shadow:
    0 0 0 7px color-mix(in srgb, var(--accent) 16%, transparent),
    var(--shadow-soft) !important;
  border-radius: 12px;
}

.admin-readonly-banner {
  display: none;
  gap: 8px;
  align-items: center;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(181, 81, 45, 0.36);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(232, 169, 81, 0.16);
  font-weight: 800;
}

.admin-readonly-banner.show {
  display: flex;
}

.admin-notification-strip,
.morning-command-grid,
.smart-warning-grid,
.admin-search-results,
.calendar-chip-grid,
.offline-sync-panel,
.teacher-insights-grid,
.self-service-grid,
.approval-queue-grid,
.security-dashboard-grid,
.admin-alerts-grid,
.data-quality-grid,
.weekly-report-grid,
.notification-center-grid,
.badge-verification-grid {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
}

.admin-notification-strip {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.notification-popover {
  position: absolute;
  top: var(--notification-popover-top, 80px);
  left: var(--notification-popover-left, auto);
  right: var(--notification-popover-right, 16px);
  z-index: 1250;
  width: min(480px, calc(100vw - 24px));
  max-height: min(680px, calc(100vh - var(--notification-popover-top, 80px) - 12px - env(safe-area-inset-bottom)));
  overflow: auto;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 94%, white);
  box-shadow: 0 22px 48px rgba(17, 25, 35, 0.18);
  transform-origin: top right;
  animation: notificationPopoverIn 180ms ease-out both;
}

.notification-popover.hidden {
  display: none !important;
}

.notification-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-popover-head strong {
  font-size: 1.05rem;
}

.notification-popover-head > div {
  display: grid;
  gap: 2px;
}

.notification-popover-head span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.notification-popover-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}

.notification-popover-tabs button {
  min-height: 34px;
  padding: 0 6px;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-size: 0.8rem;
}

.notification-popover-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 18px rgba(6, 93, 180, 0.16);
}

.notification-popover .notification-center-grid {
  margin: 0;
}

.notification-popover .notification-center-card {
  box-shadow: none;
}

.notification-popover button {
  flex: 0 0 auto;
}

.notification-popover-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 2px;
}

.notification-popover-footer button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.88rem;
}

.news-card-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.notification-center-card.news-item,
.teacher-news-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.notification-center-card.notification-item {
  display: grid;
  gap: 8px;
  border-left: 4px solid color-mix(in srgb, var(--brand) 55%, var(--line));
}

.notification-center-card.notification-item.warn,
.notification-center-card.news-item.warn,
.teacher-news-item.warn {
  border-color: color-mix(in srgb, var(--gold) 72%, var(--line));
  background: color-mix(in srgb, var(--gold) 12%, var(--panel-soft));
}

.notification-center-card.notification-item.bad,
.notification-center-card.news-item.bad,
.teacher-news-item.bad {
  border-color: color-mix(in srgb, var(--warn) 72%, var(--line));
  background: color-mix(in srgb, var(--warn) 10%, var(--panel-soft));
}

.teacher-news-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
  box-shadow: 0 12px 26px rgba(17, 25, 35, 0.07);
}

.teacher-news-visual {
  position: relative;
  min-width: 64px;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.82) 0 10%, transparent 11%),
    linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24), 0 10px 22px rgba(17, 25, 35, 0.12);
}

.teacher-news-visual::before,
.teacher-news-visual::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
}

.teacher-news-visual::before {
  width: 38px;
  height: 10px;
  left: 13px;
  bottom: 16px;
}

.teacher-news-visual::after {
  width: 22px;
  height: 22px;
  right: 10px;
  top: 10px;
  background: color-mix(in srgb, var(--gold) 82%, white);
}

.teacher-news-visual.countdown {
  background:
    radial-gradient(circle at 50% 50%, #102235 0 28%, transparent 29%),
    conic-gradient(var(--gold) 0 22%, rgba(255, 255, 255, 0.2) 22% 100%),
    linear-gradient(135deg, #09233a, #15535b);
}

.teacher-news-visual.language {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.86) 0 54%, transparent 55%),
    linear-gradient(135deg, #0b63ce, #25bfb4);
}

.teacher-news-visual.appearance {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88) 0 30%, transparent 31%),
    linear-gradient(135deg, #3158c8 0 34%, #19a99d 34% 67%, #a33c7d 67%);
}

.teacher-news-visual.install {
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.9) 0 12%, transparent 13%),
    linear-gradient(135deg, #0f7f61, #18a7c5);
}

.teacher-news-visual.announcement {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86) 0 18%, transparent 19% 38%, rgba(255, 255, 255, 0.62) 39% 55%, transparent 56%),
    linear-gradient(135deg, var(--brand-deep), var(--gold));
}

.teacher-news-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.teacher-news-copy span {
  color: var(--muted);
  line-height: 1.45;
}

.teacher-news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.teacher-news-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.teacher-news-actions button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 0.82rem;
}

@keyframes notificationPopoverIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.admin-alert-chip,
.morning-command-card,
.smart-warning-card,
.admin-search-result,
.calendar-chip,
.notification-center-card,
.offline-sync-panel,
.teacher-insight-card,
.self-service-card,
.approval-queue-card,
.security-dashboard-card,
.admin-alert-card,
.data-quality-card,
.weekly-report-card,
.badge-verification-card {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
  box-shadow: 0 10px 22px rgba(17, 25, 35, 0.06);
}

.admin-alert-chip:hover,
.morning-command-card:hover,
.smart-warning-card:hover,
.admin-search-result:hover,
.calendar-chip:hover,
.teacher-insight-card:hover,
.self-service-card:hover,
.approval-queue-card:hover,
.security-dashboard-card:hover,
.admin-alert-card:hover,
.data-quality-card:hover,
.weekly-report-card:hover,
.badge-verification-card:hover {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  box-shadow: 0 14px 28px rgba(17, 25, 35, 0.09);
  transform: translateY(-1px);
}

.admin-alert-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.admin-alert-chip.pulse {
  animation: adminAlertPulse 1700ms ease-in-out infinite;
}

.admin-alert-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 5px rgba(45, 137, 74, 0.12);
}

.admin-alert-chip.warn .admin-alert-dot {
  background: var(--warn);
  box-shadow: 0 0 0 5px rgba(232, 169, 81, 0.16);
}

.admin-alert-chip.bad .admin-alert-dot {
  background: #d75050;
  box-shadow: 0 0 0 5px rgba(215, 80, 80, 0.14);
}

.admin-alert-chip strong,
.morning-command-card strong,
.smart-warning-card strong,
.admin-search-result strong,
.calendar-chip strong,
.offline-sync-panel strong,
.teacher-insight-card strong,
.self-service-card strong,
.approval-queue-card strong,
.security-dashboard-card strong,
.admin-alert-card strong,
.data-quality-card strong,
.weekly-report-card strong,
.badge-verification-card strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.admin-alert-chip span,
.morning-command-card span,
.smart-warning-card span,
.admin-search-result span,
.calendar-chip span,
.offline-sync-panel span,
.teacher-insight-card span,
.self-service-card span,
.approval-queue-card span,
.security-dashboard-card span,
.admin-alert-card span,
.data-quality-card span,
.weekly-report-card span,
.badge-verification-card span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.morning-command-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.smart-warning-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.teacher-insights-grid,
.self-service-grid,
.approval-queue-grid,
.security-dashboard-grid,
.admin-alerts-grid,
.data-quality-grid,
.weekly-report-grid,
.notification-center-grid,
.badge-verification-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.morning-command-card,
.smart-warning-card,
.notification-center-card,
.teacher-insight-card,
.self-service-card,
.approval-queue-card,
.security-dashboard-card,
.data-quality-card,
.weekly-report-card,
.badge-verification-card {
  display: grid;
  gap: 8px;
  align-content: start;
}

#adminBadgeCamera {
  width: 100%;
  max-height: 280px;
  border-radius: 12px;
  object-fit: cover;
  background: #07111a;
}

.morning-command-card strong {
  font-size: 1.45rem;
  line-height: 1;
}

.morning-command-card {
  border-top: 3px solid color-mix(in srgb, var(--brand) 72%, var(--gold));
}

.smart-warning-card {
  position: relative;
  overflow: hidden;
  border-left: 4px solid var(--brand);
}

.smart-warning-card.warn {
  border-left-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 13%, var(--panel));
}

.smart-warning-card.bad {
  border-left-color: #d75050;
  background: color-mix(in srgb, #d75050 10%, var(--panel));
}

.smart-warning-card.ok {
  border-left-color: var(--ok);
  background: color-mix(in srgb, var(--ok) 10%, var(--panel));
}

.teacher-insight-card {
  border-left: 4px solid var(--brand);
}

.teacher-insight-card.ok {
  border-left-color: var(--ok);
  background: color-mix(in srgb, var(--ok) 8%, var(--panel));
}

.teacher-insight-card.warn {
  border-left-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, var(--panel));
}

.teacher-insight-card.bad {
  border-left-color: #d75050;
  background: color-mix(in srgb, #d75050 9%, var(--panel));
}

.teacher-performance-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.teacher-performance-stats span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 76%, transparent);
  text-align: center;
}

.smart-warning-card small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.morning-command-card button {
  justify-self: start;
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.admin-search-results {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.admin-search-result,
.calendar-chip {
  display: grid;
  gap: 4px;
}

.correction-card.denied {
  opacity: 0.78;
}

.calendar-chip-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.offline-sync-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.offline-sync-panel button {
  min-height: 36px;
  padding: 0 11px;
  font-size: 0.8rem;
}

.mobile-action-bar {
  display: none;
  position: sticky;
  bottom: 12px;
  z-index: 12;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.mobile-action-bar button {
  flex: 1 1 0;
  min-height: 42px;
  padding: 0 10px;
  font-size: 0.8rem;
}

body.admin-dashboard #adminPanel {
  background: var(--panel);
}

body.admin-dashboard .admin-hero {
  padding: 16px;
  border-color: var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  box-shadow: none;
}

body.admin-dashboard .admin-kicker {
  margin-bottom: 6px;
  padding: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

body.admin-dashboard .admin-hero h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.1;
}

body.admin-dashboard .admin-hero p {
  margin-top: 6px;
  font-size: 0.92rem;
}

body.admin-dashboard .admin-date-badge {
  min-width: 84px;
  min-height: 84px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  color: var(--ink);
  background: var(--panel);
  box-shadow: none;
}

body.admin-dashboard .admin-date-badge span,
body.admin-dashboard .admin-date-badge small {
  color: var(--muted);
}

body.admin-dashboard .admin-section,
body.admin-dashboard .admin-page-intro,
body.admin-dashboard .admin-overview-card,
body.admin-dashboard .admin-command-panel,
body.admin-dashboard .settings-group,
body.admin-dashboard .table-wrap {
  border-color: var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: none;
  backdrop-filter: none;
}

body.admin-dashboard .admin-section {
  padding: 14px;
  margin: 12px 0;
}

body.admin-dashboard .admin-page-intro {
  padding: 14px;
  background: color-mix(in srgb, var(--panel-soft) 70%, var(--panel));
}

body.admin-dashboard .admin-section-title {
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

body.admin-dashboard .admin-section-title h3 {
  font-size: 1rem;
  line-height: 1.2;
}

body.admin-dashboard .admin-section-title h3::after {
  display: none;
}

body.admin-dashboard .admin-section-title span {
  font-size: 0.8rem;
  font-weight: 750;
}

body.admin-dashboard .admin-overview-card,
body.admin-dashboard .admin-command-panel,
body.admin-dashboard .admin-alert-chip,
body.admin-dashboard .morning-command-card,
body.admin-dashboard .smart-warning-card,
body.admin-dashboard .admin-search-result,
body.admin-dashboard .calendar-chip,
body.admin-dashboard .notification-center-card,
body.admin-dashboard .offline-sync-panel,
body.admin-dashboard .teacher-insight-card,
body.admin-dashboard .self-service-card,
body.admin-dashboard .approval-queue-card,
body.admin-dashboard .security-dashboard-card,
body.admin-dashboard .admin-alert-card,
body.admin-dashboard .data-quality-card,
body.admin-dashboard .weekly-report-card,
body.admin-dashboard .badge-verification-card,
body.admin-dashboard .admin-attendance-card,
body.admin-dashboard .audit-log-card {
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
}

body.admin-dashboard .admin-alert-chip:hover,
body.admin-dashboard .morning-command-card:hover,
body.admin-dashboard .smart-warning-card:hover,
body.admin-dashboard .admin-search-result:hover,
body.admin-dashboard .calendar-chip:hover,
body.admin-dashboard .teacher-insight-card:hover,
body.admin-dashboard .self-service-card:hover,
body.admin-dashboard .approval-queue-card:hover,
body.admin-dashboard .security-dashboard-card:hover,
body.admin-dashboard .admin-alert-card:hover,
body.admin-dashboard .data-quality-card:hover,
body.admin-dashboard .weekly-report-card:hover,
body.admin-dashboard .badge-verification-card:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--brand) 18%, var(--line));
  box-shadow: none;
}

body.admin-dashboard .admin-overview-card {
  min-height: 126px;
  padding: 12px;
}

body.admin-dashboard .admin-overview-card strong,
body.admin-dashboard .security-dashboard-card strong,
body.admin-dashboard .data-quality-card strong,
body.admin-dashboard .weekly-report-card strong {
  font-size: 0.98rem;
}

body.admin-dashboard .admin-overview-card span,
body.admin-dashboard .admin-command-item span,
body.admin-dashboard .morning-command-card span,
body.admin-dashboard .smart-warning-card span,
body.admin-dashboard .approval-queue-card span,
body.admin-dashboard .security-dashboard-card span,
body.admin-dashboard .data-quality-card span,
body.admin-dashboard .weekly-report-card span {
  font-weight: 700;
}

body.admin-dashboard .admin-quick-actions {
  gap: 6px;
  margin-bottom: 12px;
}

body.admin-dashboard .admin-quick-actions button,
body.admin-dashboard .admin-sidebar-actions button,
body.admin-dashboard .admin-command-item button,
body.admin-dashboard .morning-command-card button,
body.admin-dashboard .admin-overview-card .actions button,
body.admin-dashboard .data-quality-card .actions button,
body.admin-dashboard .security-dashboard-card .actions button {
  min-height: 32px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 0.76rem;
}

body.admin-dashboard .admin-quick-actions button.secondary,
body.admin-dashboard .admin-sidebar-actions button,
body.admin-dashboard .admin-command-item button,
body.admin-dashboard .morning-command-card button,
body.admin-dashboard .admin-overview-card .actions button,
body.admin-dashboard .data-quality-card .actions button,
body.admin-dashboard .security-dashboard-card .actions button {
  border-color: var(--line);
  color: var(--muted);
  background: var(--panel);
  box-shadow: none;
}

body.admin-dashboard .status-chip {
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line);
  font-size: 0.68rem;
  box-shadow: none;
}

body.admin-dashboard .status-chip.clocked,
body.admin-dashboard .status-chip.early,
body.admin-dashboard .status-chip.on_time {
  color: #23643c;
  background: color-mix(in srgb, var(--ok) 10%, var(--panel));
  border-color: color-mix(in srgb, var(--ok) 30%, var(--line));
}

body.admin-dashboard .status-chip.tardy,
body.admin-dashboard .status-chip.review,
body.admin-dashboard .status-chip.warn {
  color: #7b5417;
  background: color-mix(in srgb, var(--warn) 12%, var(--panel));
  border-color: color-mix(in srgb, var(--warn) 36%, var(--line));
}

body.admin-dashboard .status-chip.missing,
body.admin-dashboard .status-chip.inactive,
body.admin-dashboard .status-chip.absent,
body.admin-dashboard .status-chip.bad {
  color: #9d332f;
  background: color-mix(in srgb, var(--bad) 10%, var(--panel));
  border-color: color-mix(in srgb, var(--bad) 34%, var(--line));
}

body.admin-dashboard .admin-tools,
body.admin-dashboard .report-tools,
body.admin-dashboard .teacher-bulk-bar {
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: var(--panel);
}

body.admin-dashboard .table-wrap {
  max-height: min(620px, 70vh);
  overflow: auto;
}

body.admin-dashboard table {
  font-size: 0.88rem;
}

body.admin-dashboard th {
  font-size: 0.72rem;
  background: var(--panel);
}

body.admin-dashboard th,
body.admin-dashboard td {
  padding: 9px 8px;
}

body.admin-dashboard tbody tr:hover {
  transform: none;
}

body.admin-dashboard .admin-notification-strip,
body.admin-dashboard .morning-command-grid,
body.admin-dashboard .smart-warning-grid,
body.admin-dashboard .approval-queue-grid,
body.admin-dashboard .security-dashboard-grid,
body.admin-dashboard .data-quality-grid,
body.admin-dashboard .weekly-report-grid,
body.admin-dashboard .notification-center-grid,
body.admin-dashboard .badge-verification-grid {
  gap: 8px;
  margin-bottom: 12px;
}

.streak-leaderboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.streak-leaderboard-hero h2 {
  margin-bottom: 4px;
}

.streak-leaderboard-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}

.streak-leaderboard-summary .snapshot-card {
  min-height: 86px;
}

.streak-challenge-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 10px 0 12px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--gold) 34%, var(--line));
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(246, 196, 83, 0.18), transparent 55%),
    linear-gradient(135deg, color-mix(in srgb, var(--panel) 92%, transparent), color-mix(in srgb, var(--soft) 58%, transparent));
  box-shadow: 0 14px 30px rgba(17, 25, 35, 0.07);
}

.streak-challenge-banner strong,
.streak-challenge-banner span {
  display: block;
}

.streak-challenge-banner strong {
  color: var(--ink);
  font-size: 1rem;
}

.streak-challenge-banner span {
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.35;
}

.streak-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 14px;
}

.streak-filter-bar button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  box-shadow: none;
}

.streak-filter-bar button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.streak-podium {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.16fr) minmax(0, 0.92fr);
  gap: 10px;
  align-items: end;
  margin: 6px 0 16px;
}

.streak-podium-card {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 174px;
  padding: 13px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: center;
  background: var(--panel);
  box-shadow: 0 16px 32px rgba(17, 25, 35, 0.08);
  animation: leaderboardReveal 360ms ease both;
}

.streak-podium-card.first {
  min-height: 204px;
  border-color: rgba(246, 196, 83, 0.58);
  background:
    linear-gradient(180deg, rgba(246, 196, 83, 0.22), transparent 64%),
    var(--panel);
  box-shadow: 0 18px 42px rgba(246, 196, 83, 0.18);
  order: 2;
}

.streak-podium-card.second {
  order: 1;
}

.streak-podium-card.third {
  order: 3;
}

.streak-podium-rank {
  min-width: 38px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #2a1702;
  background: linear-gradient(135deg, #f6c453, #f28b2e);
  font-weight: 1000;
}

.streak-podium-card.second .streak-podium-rank {
  color: #1f2d3b;
  background: linear-gradient(135deg, #e9eef5, #aab8c8);
}

.streak-podium-card.third .streak-podium-rank {
  color: #fff;
  background: linear-gradient(135deg, #d99b65, #9d5a2f);
}

.streak-podium-card .admin-teacher-photo {
  width: 56px;
  height: 56px;
  font-size: 1rem;
}

.streak-podium-card.first .admin-teacher-photo {
  width: 70px;
  height: 70px;
  font-size: 1.15rem;
  box-shadow: 0 0 0 4px rgba(246, 196, 83, 0.22), 0 14px 28px rgba(17, 25, 35, 0.14);
}

.streak-podium-name {
  width: 100%;
  min-width: 0;
}

.streak-podium-name strong,
.streak-podium-name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.streak-podium-name strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.streak-podium-name span {
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 2px;
}

.streak-podium-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-weight: 1000;
}

.streak-leaderboard-list {
  display: grid;
  gap: 10px;
}

.streak-leaderboard-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--panel) 94%, transparent), color-mix(in srgb, var(--soft) 48%, transparent)),
    var(--panel);
  box-shadow: 0 10px 24px rgba(17, 25, 35, 0.06);
  animation: leaderboardReveal 340ms ease both;
}

.streak-leaderboard-row.me {
  border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
  box-shadow: 0 14px 30px rgba(6, 93, 180, 0.12);
}

.streak-rank {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand);
  font-weight: 1000;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 14%, transparent);
}

.streak-leaderboard-row:nth-child(1) .streak-rank {
  background: linear-gradient(135deg, #f6c453, #f28b2e);
  color: #2a1702;
}

.streak-leaderboard-row:nth-child(2) .streak-rank {
  background: linear-gradient(135deg, #e9eef5, #aab8c8);
  color: #1f2d3b;
}

.streak-leaderboard-row:nth-child(3) .streak-rank {
  background: linear-gradient(135deg, #d99b65, #9d5a2f);
  color: #fff;
}

.streak-teacher-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.streak-teacher-main .admin-teacher-identity {
  min-width: 0;
}

.streak-teacher-main .admin-teacher-name strong,
.streak-teacher-main .admin-teacher-name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.streak-score {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 88px;
}

.streak-score strong {
  font-size: 1.18rem;
  color: var(--ink);
}

.streak-score small {
  color: var(--muted);
  font-weight: 800;
}

.streak-score-flame {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(180deg, #ffcf58, #ff6a2f 55%, #c4251e);
  box-shadow: 0 0 18px rgba(255, 106, 47, 0.34);
  font-size: 0.78rem;
  font-weight: 1000;
  transform-origin: 50% 90%;
  animation: leaderboardFlame 1400ms ease-in-out infinite;
}

.streak-score-flame:not(.inactive)::before {
  content: "";
  width: 12px;
  height: 15px;
  border-radius: 999px;
  background: #fff3b8;
  clip-path: polygon(50% 0, 80% 46%, 64% 100%, 50% 88%, 36% 100%, 20% 46%);
}

.streak-score-flame.inactive {
  background: linear-gradient(180deg, #d5dbe3, #8794a3);
  box-shadow: none;
  animation: none;
}

.streak-score-flame.warm {
  background: linear-gradient(180deg, #dfe5ec, #9aa6b5);
  box-shadow: 0 0 10px rgba(135, 148, 163, 0.18);
}

.streak-score-flame.red {
  background: linear-gradient(180deg, #ffcf58, #ff6a2f 55%, #c4251e);
  box-shadow: 0 0 18px rgba(255, 106, 47, 0.34);
}

.streak-score-flame.orange {
  background: linear-gradient(180deg, #ffe08a, #ff9e2f 55%, #d95122);
  box-shadow: 0 0 22px rgba(255, 158, 47, 0.38);
}

.streak-score-flame.gold {
  background: linear-gradient(180deg, #fff3a6, #f6c453 55%, #b97913);
  box-shadow: 0 0 24px rgba(246, 196, 83, 0.45);
}

.streak-score-flame.elite {
  background: linear-gradient(180deg, #ffffff, #8fe5ff 55%, #3386ff);
  box-shadow: 0 0 28px rgba(79, 184, 255, 0.5);
}

.streak-milestone-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--soft);
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.streak-empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 18px;
  border: 1px dashed color-mix(in srgb, var(--brand) 28%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--soft) 42%, transparent);
  text-align: center;
}

.streak-empty-flame {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(180deg, #dfe5ec, #9aa6b5);
  box-shadow: 0 14px 28px rgba(17, 25, 35, 0.08);
}

.streak-empty-flame::before {
  content: "";
  width: 21px;
  height: 28px;
  border-radius: 999px;
  background: #fff;
  clip-path: polygon(50% 0, 80% 46%, 64% 100%, 50% 88%, 36% 100%, 20% 46%);
}

.streak-leaderboard-note {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed color-mix(in srgb, var(--brand) 28%, var(--line));
  border-radius: 10px;
  color: var(--muted);
  background: color-mix(in srgb, var(--soft) 52%, transparent);
}

@keyframes leaderboardFlame {
  0%, 100% { transform: scale(1) rotate(-1deg); filter: saturate(1); }
  45% { transform: scale(1.08) rotate(1deg); filter: saturate(1.12); }
}

@keyframes leaderboardReveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-print-brand {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-print-brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.section-title-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 8px;
}

.admin-card-grid,
.admin-card-list,
.admin-health-grid,
.late-pattern-grid,
.teacher-detail-grid,
.admin-timeline {
  display: grid;
  gap: 10px;
}

.admin-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px 0;
}

.admin-glance-card,
.admin-health-item,
.late-pattern-card,
.teacher-detail-item,
.timeline-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(17, 25, 35, 0.05);
}

.admin-glance-card strong,
.admin-health-item strong,
.late-pattern-card strong,
.teacher-detail-item strong,
.timeline-item strong {
  display: block;
  color: var(--ink);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.admin-glance-card span,
.admin-health-item span,
.late-pattern-card span,
.teacher-detail-item span,
.timeline-item span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.island-logo-preview {
  align-items: center;
  align-self: end;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  min-height: 58px;
  padding: 8px 10px;
}

.island-logo-preview img,
.island-school-logo {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 42px;
  object-fit: contain;
  padding: 4px;
  width: 42px;
}

.island-logo-preview span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.25;
}

.teacher-timeline {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.teacher-timeline-step {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
}

.teacher-timeline-step::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 5px;
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-soft);
}

.teacher-timeline-step.warn::before {
  background: var(--warn);
  box-shadow: 0 0 0 4px var(--warn-soft);
}

.teacher-timeline-step.bad::before {
  background: var(--bad);
  box-shadow: 0 0 0 4px var(--bad-soft);
}

.teacher-timeline-step strong {
  display: block;
  color: var(--ink);
  font-size: 0.94rem;
}

.teacher-timeline-step span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
  margin-top: 2px;
}

.teacher-bulk-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.teacher-bulk-bar button {
  min-height: 44px;
}

.admin-teacher-card {
  display: grid;
  grid-template-columns: auto minmax(220px, 1.5fr) minmax(180px, 0.8fr) minmax(240px, 1.2fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.admin-teacher-card > div {
  min-width: 0;
}

.admin-teacher-card small {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.admin-teacher-tools {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.admin-teacher-tools::before {
  content: "Actions";
  margin-right: auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-teacher-tools button {
  min-height: 38px;
  padding-inline: 12px;
  font-size: 0.82rem;
}

.admin-teacher-tools .danger {
  margin-left: 2px;
}

.note-history {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.35;
}

/* Shared protected-action dialog and confirmation states. */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 16, 24, 0.58);
  opacity: 1;
  visibility: visible;
  backdrop-filter: blur(8px);
  transition: opacity 220ms ease, visibility 220ms ease, background 220ms ease;
}

.admin-modal.hidden {
  display: grid !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.admin-modal-card {
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transform: translateY(0) scale(1);
  transform-origin: center;
  transition: transform 220ms ease, opacity 220ms ease;
  animation: adminModalLiftIn 260ms cubic-bezier(0.2, 0.82, 0.2, 1) both;
}

.admin-modal.hidden .admin-modal-card,
.admin-modal.closing .admin-modal-card {
  opacity: 0;
  transform: translateY(18px) scale(0.97);
}

.admin-modal.closing {
  opacity: 0;
}

.admin-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.admin-modal-head h3 {
  margin: 0;
  font-size: 1.2rem;
}

.admin-modal-close {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 999px;
}

.admin-modal-body {
  display: grid;
  gap: 12px;
}

.admin-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

@keyframes adminModalLiftIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.admin-modal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-modal-form label:last-child {
  grid-column: 1 / -1;
}

.admin-modal-list {
  max-height: 220px;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.admin-modal-list p {
  margin: 0 0 6px;
  color: var(--ink);
  font-weight: 800;
}

.announcement-admin-form {
  display: grid;
  gap: 10px;
}

.announcement-admin-form textarea {
  min-height: 96px;
  resize: vertical;
}

.approval-inbox {
  display: grid;
  gap: 10px;
}

.approval-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 10px 20px rgba(17, 25, 35, 0.06);
}

.approval-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.approval-card-head .admin-teacher-identity {
  min-width: 0;
}

.approval-card-head strong {
  color: var(--ink);
}

.approval-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.approval-note {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.approval-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.admin-chart {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.chart-row {
  display: grid;
  grid-template-columns: 76px 1fr 52px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.chart-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.chart-fill {
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--ok));
}

.security-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.security-item {
  display: grid;
  gap: 8px;
  min-height: 110px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.security-item strong {
  color: var(--ink);
}

.security-item span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.device-approval-note {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-item {
  display: grid;
  gap: 5px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.profile-item span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-item strong {
  align-self: end;
  color: var(--ink);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.notice-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.notice-copy strong {
  color: var(--ink);
  line-height: 1.2;
}

.notice-copy span {
  color: var(--muted);
  line-height: 1.35;
}

.success-celebration {
  display: none;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(32, 122, 75, 0.34);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(32, 122, 75, 0.14), rgba(20, 166, 161, 0.12)),
    var(--panel);
  box-shadow: 0 14px 30px rgba(32, 122, 75, 0.13);
}

.success-celebration.show {
  display: grid;
  grid-template-columns: auto 1fr;
  animation: celebrationIn 520ms ease, successGlow 1700ms ease 1;
}

.success-badge {
  display: grid;
  width: 54px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--ok), var(--accent));
  box-shadow: 0 14px 24px rgba(32, 122, 75, 0.22);
  font-size: 1.45rem;
  font-weight: 900;
  animation: checkPulse 900ms ease 1;
}

.success-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.success-copy strong {
  color: var(--ink);
  font-size: 1.06rem;
  line-height: 1.2;
}

.success-copy span {
  color: var(--muted);
  line-height: 1.35;
}

.teacher-notification {
  display: none;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(32, 122, 75, 0.32);
  border-radius: 12px;
  color: var(--ok);
  background: linear-gradient(135deg, rgba(32, 122, 75, 0.14), rgba(20, 166, 161, 0.12));
  font-weight: 800;
  line-height: 1.35;
}

.teacher-notification.show {
  display: block;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 80;
  display: none;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 15px;
  border: 1px solid color-mix(in srgb, var(--ok) 34%, var(--line));
  border-radius: 999px;
  color: var(--ok);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--ok) 14%, transparent), color-mix(in srgb, var(--accent) 12%, transparent)),
    var(--panel);
  box-shadow: 0 18px 38px rgba(17, 25, 35, 0.18);
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  transform: translate(-50%, 8px);
}

.app-toast.show {
  display: block;
  animation: toastIn 180ms ease forwards;
}

.tempo-assistant {
  position: fixed;
  right: 18px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 82;
  display: grid;
  width: min(360px, calc(100vw - 28px));
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  transform-origin: 92% 100%;
  transition: width 180ms ease, gap 180ms ease, transform 180ms ease;
  --tempo-mood-color: var(--brand);
}

.tempo-assistant[data-mood="calm"] {
  --tempo-mood-color: var(--brand);
}

.tempo-assistant[data-mood="focused"] {
  --tempo-mood-color: #4b7bec;
}

.tempo-assistant[data-mood="confirming"] {
  --tempo-mood-color: var(--ok);
}

.tempo-assistant[data-mood="concerned"] {
  --tempo-mood-color: var(--warn);
}

.tempo-assistant[data-mood="guiding"] {
  --tempo-mood-color: var(--accent);
}

.tempo-assistant[data-mood="serious"] {
  --tempo-mood-color: #64748b;
}

.tempo-assistant[data-mood="reporting"] {
  --tempo-mood-color: #0f766e;
}

.tempo-assistant[data-mood-transition="calm-focused"] .tempo-copy,
.tempo-assistant[data-mood-transition="focused-confirming"] .tempo-copy,
.tempo-assistant[data-mood-transition="focused-concerned"] .tempo-copy,
.tempo-assistant[data-mood-transition="guiding-calm"] .tempo-copy {
  animation: tempoMoodGlow 520ms ease-out 1;
}

.tempo-assistant[data-mood-transition="calm-focused"] img {
  animation: tempoToFocused 520ms ease-out 1, tempoFocusedPulse 1.6s ease-in-out 520ms infinite;
}

.tempo-assistant[data-mood-transition="focused-confirming"] img {
  animation: tempoSuccessPop 560ms ease-out, tempoFloat 4s ease-in-out 560ms infinite;
}

.tempo-assistant[data-mood-transition="focused-concerned"] img {
  animation: tempoErrorShake 420ms ease-in-out, tempoFloat 4.2s ease-in-out 420ms infinite;
}

.tempo-assistant[data-mood-transition="guiding-calm"] img {
  animation: tempoToCalm 520ms ease-out 1, tempoIdleBreath 4.8s ease-in-out 520ms infinite;
}

.tempo-assistant.show {
  animation: tempoPanelIn 220ms ease forwards;
}

.tempo-assistant.attention-pulse .tempo-copy {
  animation: tempoAttentionPulse 780ms ease-out 1;
}

.tempo-assistant.attention-pulse img {
  animation: tempoAttentionLean 780ms ease-out 1;
}

.tempo-assistant[data-placement="bottom-left"] {
  right: auto;
  left: 18px;
  transform-origin: 8% 100%;
}

.tempo-assistant[data-placement="top-right"] {
  top: calc(18px + env(safe-area-inset-top));
  bottom: auto;
  transform-origin: 92% 0%;
}

.tempo-assistant[data-placement="top-left"] {
  top: calc(18px + env(safe-area-inset-top));
  right: auto;
  bottom: auto;
  left: 18px;
  transform-origin: 8% 0%;
}

.tempo-assistant[data-size="small"] {
  width: min(300px, calc(100vw - 28px));
}

.tempo-assistant[data-size="large"] {
  width: min(430px, calc(100vw - 28px));
}

.tempo-assistant[data-mode="idle"] {
  width: min(210px, calc(100vw - 28px));
  bottom: calc(86px + env(safe-area-inset-bottom));
  gap: 8px;
  cursor: pointer;
}

.tempo-assistant[data-mode="idle"][data-status-size="medium"] {
  width: min(270px, calc(100vw - 28px));
}

.tempo-assistant[data-mode="idle"][data-status-size="long"],
.tempo-assistant[data-mode="idle"][data-status-size="urgent"] {
  width: min(340px, calc(100vw - 28px));
}

.tempo-assistant[data-mode="idle"]:hover,
.tempo-assistant[data-mode="idle"]:focus-visible,
.tempo-assistant[data-mode="idle"][data-interacting="true"] {
  transform: translateY(-3px) rotate(-1.2deg);
}

.tempo-assistant[data-mode="active"] {
  top: calc(18px + env(safe-area-inset-top));
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  align-items: stretch;
  width: min(420px, calc(100vw - 28px));
  grid-template-columns: 74px minmax(0, 1fr);
  grid-template-rows: 1fr;
  gap: 10px;
}

.tempo-assistant img {
  width: 78px;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(17, 25, 35, 0.16));
  transform-origin: 50% 78%;
  transition: width 180ms ease;
}

.tempo-assistant[data-size="small"] img {
  width: 62px;
}

.tempo-assistant[data-size="large"] img {
  width: 96px;
}

.tempo-assistant[data-mode="idle"] img {
  width: 56px;
}

.tempo-assistant[data-mode="active"] img {
  align-self: center;
  width: 70px;
  max-height: 78px;
}

.tempo-copy {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px 16px 15px;
  border: 1px solid color-mix(in srgb, var(--tempo-mood-color) 24%, var(--line));
  border-radius: 30px 34px 28px 32px;
  background: color-mix(in srgb, var(--panel) 96%, white);
  box-shadow:
    0 16px 38px rgba(17, 25, 35, 0.16),
    0 0 0 3px color-mix(in srgb, var(--tempo-mood-color) 8%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  transition: padding 180ms ease, border-radius 180ms ease, box-shadow 180ms ease;
}

.tempo-assistant[data-mode="active"] .tempo-copy {
  align-self: stretch;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
  gap: 10px;
  max-height: calc(100vh - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  padding: 14px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 22px 54px rgba(17, 25, 35, 0.22),
    0 0 0 3px color-mix(in srgb, var(--tempo-mood-color) 9%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.tempo-assistant[data-mode="idle"] .tempo-copy {
  grid-column: 2 / -1;
  min-width: 0;
  max-width: 100%;
  gap: 0;
  padding: 9px 12px;
  border-radius: 999px;
  box-shadow:
    0 10px 24px rgba(17, 25, 35, 0.13),
    0 0 0 3px color-mix(in srgb, var(--tempo-mood-color) 8%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.tempo-assistant[data-mode="idle"]:hover .tempo-copy,
.tempo-assistant[data-mode="idle"]:focus-visible .tempo-copy,
.tempo-assistant[data-mode="idle"][data-interacting="true"] .tempo-copy {
  box-shadow:
    0 14px 28px rgba(17, 25, 35, 0.16),
    0 0 0 4px color-mix(in srgb, var(--tempo-mood-color) 12%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.tempo-copy::before,
.tempo-copy::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.tempo-copy::before {
  inset: -9px 22px auto 34px;
  height: 18px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 20% 50%, color-mix(in srgb, var(--panel) 98%, white) 0 12px, transparent 13px),
    radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--panel) 98%, white) 0 15px, transparent 16px),
    radial-gradient(circle at 80% 60%, color-mix(in srgb, var(--panel) 98%, white) 0 12px, transparent 13px);
}

.tempo-assistant[data-mode="active"] .tempo-copy::before,
.tempo-assistant[data-mode="active"] .tempo-copy::after {
  display: none;
}

.tempo-copy::after {
  left: -14px;
  bottom: 16px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--panel) 96%, white);
  box-shadow:
    -12px 10px 0 -5px color-mix(in srgb, var(--panel) 96%, white),
    0 0 0 1px color-mix(in srgb, var(--brand) 10%, transparent);
}

.tempo-copy > * {
  position: relative;
  z-index: 1;
}

.tempo-copy strong {
  color: var(--ink);
  line-height: 1.15;
}

.tempo-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.tempo-panel-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.tempo-panel-head span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.tempo-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: color-mix(in srgb, var(--tempo-mood-color) 78%, var(--muted));
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.2;
}

.tempo-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tempo-mood-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tempo-mood-color) 13%, transparent);
  content: "";
}

.tempo-assistant[data-thinking="true"] .tempo-status::after {
  content: "...";
  display: inline-block;
  width: 1.1em;
  overflow: hidden;
  vertical-align: bottom;
  animation: tempoTypingDots 900ms steps(4, end) infinite;
}

.tempo-assistant[data-thinking="true"] .tempo-copy {
  box-shadow:
    0 18px 40px rgba(17, 25, 35, 0.18),
    0 0 0 4px color-mix(in srgb, var(--tempo-mood-color) 13%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.tempo-assistant[data-mode="idle"] .tempo-copy strong,
.tempo-assistant[data-mode="idle"] .tempo-action,
.tempo-assistant[data-mode="idle"] .tempo-panel-head,
.tempo-assistant[data-mode="idle"] .tempo-chat-form,
.tempo-assistant[data-mode="idle"] .tempo-footer {
  display: none;
}

.tempo-voice {
  display: none !important;
}

.tempo-copy span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.3;
}

.tempo-copy span[data-text-reveal="true"] {
  animation: tempoTextReveal 260ms ease-out 1;
}

.tempo-assistant[data-mode="idle"] .tempo-copy span {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.tempo-assistant[data-mode="idle"][data-status-size="long"] .tempo-copy span,
.tempo-assistant[data-mode="idle"][data-status-size="urgent"] .tempo-copy span {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tempo-conversation {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 2px;
}

.tempo-message {
  display: grid;
  gap: 5px;
  max-width: 100%;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--tempo-mood-color) 24%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-soft) 72%, white);
  animation: tempoMessageIn 180ms ease-out 1;
}

.tempo-message-assistant {
  justify-self: start;
  border-top-left-radius: 6px;
}

.tempo-message-user {
  justify-self: end;
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  border-top-right-radius: 6px;
  background: color-mix(in srgb, var(--brand) 9%, var(--panel));
}

.tempo-message-label {
  color: var(--tempo-mood-color);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.tempo-message-typing span:last-child::after {
  content: "";
  display: inline-block;
  width: 1.8em;
  overflow: hidden;
  vertical-align: bottom;
  animation: tempoTypingDots 980ms steps(4, end) infinite;
}

.tempo-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow: visible;
  padding: 1px 2px 3px;
}

.tempo-suggestions.hidden {
  display: none;
}

.tempo-suggestions button {
  flex: 1 1 calc(50% - 6px);
  max-width: 100%;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1.12;
  white-space: normal;
  box-shadow: none;
}

.tempo-action {
  display: none;
  justify-self: start;
  min-height: 32px;
  width: max-content;
  max-width: 100%;
  margin-top: 2px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.1;
}

.tempo-action.show {
  display: inline-grid;
  place-items: center;
}

.tempo-assistant[data-mode="idle"] .tempo-conversation {
  overflow: visible;
  padding: 0;
}

.tempo-assistant[data-mode="idle"] .tempo-suggestions {
  display: none;
}

.tempo-assistant[data-mode="idle"] .tempo-action {
  display: none !important;
}

.tempo-assistant[data-mode="idle"] .tempo-message {
  padding: 0;
  border: 0;
  background: transparent;
}

.tempo-assistant[data-mode="idle"] .tempo-message-label {
  display: none;
}

.tempo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.tempo-menu-button {
  flex: 1;
  justify-content: center;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 0.8rem;
}

.tempo-clear {
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 0.78rem;
  box-shadow: none;
}

.tempo-action.tempo-action-working {
  opacity: 0.72;
  transform: translateY(1px);
  cursor: wait;
}

.tempo-menu {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  min-height: 0;
  overflow: auto;
}

.tempo-search {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.tempo-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tempo-search-head strong {
  font-size: 0.78rem;
  color: var(--muted);
}

.tempo-search-close {
  width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 999px;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.tempo-search input {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--panel);
  font: inherit;
  font-size: 0.86rem;
  outline: none;
}

.tempo-search input:focus {
  border-color: color-mix(in srgb, var(--tempo-mood-color) 52%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tempo-mood-color) 12%, transparent);
}

.tempo-search-results {
  display: grid;
  gap: 5px;
  max-height: 184px;
  overflow: auto;
}

.tempo-menu.hidden {
  display: none;
}

.tempo-menu button {
  justify-content: start;
  min-height: 30px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  line-height: 1.1;
  text-align: left;
  box-shadow: none;
}

.tempo-assistant[data-mode="idle"] .tempo-menu {
  display: none;
}

.tempo-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--tempo-mood-color) 18%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-soft) 70%, white);
}

.tempo-chat-form input {
  width: 100%;
  min-height: 36px;
  border: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  outline: none;
}

.tempo-chat-form button {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
}

.tempo-voice {
  align-self: start;
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 94%, white);
  box-shadow: 0 8px 18px rgba(17, 25, 35, 0.12);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.tempo-voice:hover,
.tempo-voice:focus-visible {
  color: var(--ink);
  background: var(--surface-hover);
  transform: none;
}

.tempo-voice[aria-pressed="true"] {
  color: #fff;
  border-color: color-mix(in srgb, var(--ok) 55%, var(--line));
  background: var(--ok);
  box-shadow:
    0 10px 22px rgba(32, 122, 75, 0.22),
    0 0 0 4px color-mix(in srgb, var(--ok) 14%, transparent);
}

.tempo-close {
  align-self: start;
  display: none;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--line));
  border-radius: 50%;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 94%, white);
  box-shadow: 0 8px 18px rgba(17, 25, 35, 0.12);
  font-size: 1rem;
}

.tempo-assistant[data-mode="active"] .tempo-close {
  display: grid;
}

.tempo-close:hover {
  color: var(--ink);
  background: var(--surface-hover);
  transform: none;
}

.tempo-assistant[data-mood="confirming"] img {
  animation: tempoSuccessPop 560ms ease-out, tempoFloat 4s ease-in-out 560ms infinite;
}

.tempo-assistant[data-mood="concerned"] img {
  animation: tempoErrorShake 420ms ease-in-out, tempoFloat 4.2s ease-in-out 420ms infinite;
}

.tempo-assistant[data-mood="focused"] img {
  animation: tempoFocusedPulse 1.6s ease-in-out infinite;
}

.tempo-assistant[data-mood="guiding"] img {
  animation: tempoGuidingLean 3.4s ease-in-out infinite;
}

.tempo-assistant[data-mood="serious"] img {
  animation: tempoSeriousHold 3.6s ease-in-out infinite;
}

.tempo-assistant[data-mood="reporting"] img {
  animation: tempoReportingNod 3.8s ease-in-out infinite;
}

.tempo-assistant[data-state="admin"][data-mood="reporting"] img {
  animation: tempoAdminChecklistTap 3.2s ease-in-out infinite;
}

.tempo-assistant[data-mood="calm"] img {
  animation: tempoIdleBreath 4.8s ease-in-out infinite;
}

.tempo-assistant[data-pose="pointing"] img {
  animation: tempoPointToTarget 2.8s ease-in-out infinite;
}

.tempo-assistant[data-pose="shield"] img {
  animation: tempoSeriousHold 3.6s ease-in-out infinite;
}

.tempo-assistant[data-pose="chart"] img {
  animation: tempoReportingNod 3.8s ease-in-out infinite;
}

.tempo-assistant[data-pose="lean"] img {
  animation: tempoGuidingLean 3.4s ease-in-out infinite;
}

.tempo-assistant::before {
  position: absolute;
  right: 42px;
  bottom: 7px;
  width: 12px;
  height: 12px;
  border: 3px solid color-mix(in srgb, var(--tempo-mood-color) 28%, var(--panel));
  border-radius: 50%;
  background: var(--tempo-mood-color);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--tempo-mood-color) 12%, transparent);
  content: "";
  pointer-events: none;
  z-index: 4;
  transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.tempo-assistant[data-mode="active"]::before {
  right: 27px;
  bottom: 27px;
  transform: scale(0.82);
}

.tempo-assistant[data-mode="idle"]::before {
  right: auto;
  left: 44px;
  bottom: 7px;
  width: 10px;
  height: 10px;
  border-width: 2px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tempo-mood-color) 12%, transparent);
}

.tempo-assistant[data-clock-closed="true"]::before {
  display: none;
}

.tempo-assistant[data-thinking="true"]::before {
  animation: tempoStatusPulse 1s ease-in-out infinite;
}

.tempo-assistant[data-context="admin"] {
  --tempo-mood-color: #0f766e;
}

.tempo-assistant[data-context="maintenance"] {
  --tempo-mood-color: #64748b;
}

.tempo-assistant[data-mode="active"] .tempo-conversation {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--tempo-mood-color) 42%, var(--line)) transparent;
}

.tempo-assistant[data-mode="active"] .tempo-message {
  max-width: min(92%, 360px);
  line-height: 1.38;
}

.tempo-assistant[data-mode="active"] .tempo-message-user {
  margin-left: auto;
}

.tempo-assistant[data-mode="active"] .tempo-chat-form {
  padding: 5px;
  border: 1px solid color-mix(in srgb, var(--tempo-mood-color) 24%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-soft) 70%, white);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.tempo-assistant[data-mode="active"] .tempo-chat-form input {
  min-height: 38px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.tempo-assistant[data-mode="active"] .tempo-chat-form input:focus {
  box-shadow: none;
}

.tempo-assistant[data-mode="active"] .tempo-chat-form button {
  min-height: 38px;
  border-radius: 10px;
}

@media (max-width: 640px) {
  .tempo-assistant,
  .tempo-assistant[data-placement="bottom-left"],
  .tempo-assistant[data-placement="top-left"],
  .tempo-assistant[data-placement="top-right"] {
    right: 12px;
    left: 12px;
    width: auto;
  }

  .tempo-assistant {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .tempo-assistant[data-mode="active"] {
    top: auto;
    right: 0;
    bottom: calc(var(--teacher-mobile-nav-height, 74px) + 10px + env(safe-area-inset-bottom));
    left: 0;
    width: auto;
    max-height: min(68vh, calc(100svh - var(--teacher-mobile-nav-height, 74px) - 34px - env(safe-area-inset-bottom)), 640px);
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    gap: 0;
    padding: 0 10px;
    transform-origin: 50% 100%;
  }

  .tempo-assistant[data-mode="idle"] {
    right: 12px;
    left: auto;
    width: min(190px, calc(100vw - 24px));
    bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .tempo-assistant[data-mode="idle"][data-placement="bottom-left"],
  .tempo-assistant[data-mode="idle"][data-placement="top-left"] {
    right: auto;
    left: 12px;
  }

  .tempo-assistant[data-mode="active"] img {
    position: absolute;
    top: 12px;
    left: 14px;
    z-index: 2;
    width: 46px;
    height: 46px;
    max-height: 46px;
    object-fit: contain;
    pointer-events: none;
  }

  .tempo-assistant[data-mode="active"] .tempo-copy {
    width: 100%;
    max-height: min(68vh, calc(100svh - var(--teacher-mobile-nav-height, 74px) - 34px - env(safe-area-inset-bottom)), 640px);
    padding: 14px 14px 12px;
    border-radius: 22px 22px 16px 16px;
    box-shadow:
      0 -18px 54px rgba(17, 25, 35, 0.24),
      0 0 0 3px color-mix(in srgb, var(--tempo-mood-color) 10%, transparent),
      inset 0 1px 0 rgba(255, 255, 255, 0.92);
  }

  .tempo-assistant.tempo-keyboard-open[data-mode="active"] {
    bottom: calc(8px + env(safe-area-inset-bottom));
    max-height: min(58vh, 460px);
  }

  .tempo-assistant.tempo-keyboard-open[data-mode="active"] .tempo-copy {
    max-height: min(58vh, 460px);
  }

  .tempo-assistant[data-mode="active"].show {
    animation: tempoSheetIn 240ms cubic-bezier(.2, .8, .2, 1) forwards;
  }

  .tempo-assistant[data-mode="active"] .tempo-panel-head {
    min-height: 44px;
    padding-left: 58px;
  }

  .tempo-conversation {
    max-height: none;
  }

  .tempo-menu {
    max-height: 30vh;
  }

  .tempo-footer {
    position: sticky;
    bottom: 0;
    background: color-mix(in srgb, var(--panel) 96%, white);
  }

  .tempo-menu button {
    min-height: 36px;
  }
}

@keyframes toastIn {
  to {
    transform: translate(-50%, 0);
  }
}

@keyframes tempoTextReveal {
  from {
    opacity: 0;
    transform: translateY(3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tempoPanelIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tempoMessageIn {
  from {
    opacity: 0;
    transform: translateY(7px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tempoTypingDots {
  0% { width: 0; }
  25% { width: 0.35em; }
  50% { width: 0.7em; }
  75%, 100% { width: 1.1em; }
}

@keyframes tempoStatusPulse {
  0%, 100% { transform: scale(0.82); opacity: 0.72; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes tempoAttentionPulse {
  0% {
    box-shadow:
      0 10px 24px rgba(17, 25, 35, 0.13),
      0 0 0 3px color-mix(in srgb, var(--tempo-mood-color) 8%, transparent),
      inset 0 1px 0 rgba(255, 255, 255, 0.92);
  }

  42% {
    box-shadow:
      0 18px 34px rgba(17, 25, 35, 0.18),
      0 0 0 7px color-mix(in srgb, var(--tempo-mood-color) 18%, transparent),
      inset 0 1px 0 rgba(255, 255, 255, 0.92);
  }

  100% {
    box-shadow:
      0 10px 24px rgba(17, 25, 35, 0.13),
      0 0 0 3px color-mix(in srgb, var(--tempo-mood-color) 8%, transparent),
      inset 0 1px 0 rgba(255, 255, 255, 0.92);
  }
}

@keyframes tempoAttentionLean {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  45% {
    transform: translateY(-4px) scale(1.025);
  }
}

@keyframes tempoMoodGlow {
  0% {
    box-shadow:
      0 10px 24px rgba(17, 25, 35, 0.13),
      0 0 0 3px color-mix(in srgb, var(--tempo-mood-color) 6%, transparent),
      inset 0 1px 0 rgba(255, 255, 255, 0.92);
  }

  45% {
    box-shadow:
      0 18px 36px rgba(17, 25, 35, 0.16),
      0 0 0 6px color-mix(in srgb, var(--tempo-mood-color) 16%, transparent),
      inset 0 1px 0 rgba(255, 255, 255, 0.92);
  }

  100% {
    box-shadow:
      0 16px 38px rgba(17, 25, 35, 0.16),
      0 0 0 3px color-mix(in srgb, var(--tempo-mood-color) 8%, transparent),
      inset 0 1px 0 rgba(255, 255, 255, 0.92);
  }
}

@keyframes tempoToFocused {
  0% {
    transform: translateY(0) scale(1);
  }

  55% {
    transform: translateY(-4px) scale(1.028);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes tempoToCalm {
  0% {
    transform: translateY(-3px) scale(1.018);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes tempoSuccessPop {
  0% {
    opacity: 0.9;
    transform: scale(0.94) translateY(6px);
  }

  55% {
    opacity: 1;
    transform: scale(1.045) translateY(-4px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes tempoErrorShake {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }

  20% {
    transform: translateX(-5px) rotate(-1.2deg);
  }

  45% {
    transform: translateX(4px) rotate(1.2deg);
  }

  70% {
    transform: translateX(-2px) rotate(-0.6deg);
  }
}

@keyframes tempoFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

@keyframes tempoFocusedPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 10px 14px rgba(17, 25, 35, 0.16));
  }

  50% {
    transform: translateY(-3px) scale(1.025);
    filter: drop-shadow(0 14px 18px rgba(75, 123, 236, 0.22));
  }
}

@keyframes tempoGuidingLean {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }

  50% {
    transform: rotate(2deg) translateY(-4px);
  }
}

@keyframes tempoPointToTarget {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }

  45% {
    transform: translateX(-5px) translateY(-2px) rotate(-3deg);
  }
}

@keyframes tempoSeriousHold {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-2px) scale(1.006);
  }
}

@keyframes tempoReportingNod {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }

  35% {
    transform: rotate(-1.4deg) translateY(-3px);
  }

  70% {
    transform: rotate(0.8deg) translateY(-1px);
  }
}

@keyframes tempoAdminChecklistTap {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  30% {
    transform: translateY(-3px) rotate(-1deg);
  }

  42% {
    transform: translateY(0) rotate(1deg);
  }

  54% {
    transform: translateY(-2px) rotate(-0.6deg);
  }

  68% {
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes tempoIdleBreath {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-2px) scale(1.012);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes successPop {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.012);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes celebrationIn {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes successGlow {
  0%,
  100% {
    box-shadow: 0 14px 30px rgba(32, 122, 75, 0.13);
  }

  45% {
    box-shadow: 0 18px 38px color-mix(in srgb, var(--ok) 28%, transparent);
  }
}

@keyframes checkPulse {
  0% {
    transform: scale(0.88);
  }

  55% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes qrScanLine {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(156px);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes zoneRing {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }

  45% {
    opacity: 0.85;
  }

  100% {
    opacity: 0;
    transform: scale(1.04);
  }
}

@keyframes progressShimmer {
  0% {
    background-position: 160% 0;
  }

  100% {
    background-position: -60% 0;
  }
}

@keyframes clockHandSweep {
  to {
    transform: translate(-50%, -92%) rotate(360deg);
  }
}

@keyframes adminAlertPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--warn) 36%, transparent);
  }

  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 6px transparent;
  }
}

@keyframes adminPanelReveal {
  from {
    opacity: 0.78;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes adminRowReveal {
  from {
    opacity: 0;
    transform: translateY(7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes adminSoftPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 transparent;
  }

  50% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 12%, transparent);
  }
}

@keyframes dashboardRise {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes clockPulse {
  0%,
  100% {
    opacity: 0.34;
    transform: scale(0.92);
  }

  50% {
    opacity: 0.7;
    transform: scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

#adminPanel {
  width: 100%;
  border-color: rgba(6, 93, 180, 0.2);
  background:
    radial-gradient(circle at top right, rgba(20, 166, 161, 0.12), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(245, 248, 251, 0.82)),
    var(--panel);
}

body.dark #adminPanel {
  border-color: rgba(113, 187, 255, 0.2);
  background:
    radial-gradient(circle at top right, rgba(67, 215, 207, 0.12), transparent 34%),
    linear-gradient(145deg, rgba(18, 27, 36, 0.96), rgba(10, 18, 27, 0.94)),
    var(--panel);
}

.admin-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(6, 93, 180, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 14%, rgba(232, 169, 81, 0.2), transparent 26%),
    linear-gradient(135deg, rgba(6, 93, 180, 0.16), rgba(20, 166, 161, 0.1)),
    var(--panel-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  margin-bottom: 16px;
}

body.dark .admin-hero {
  border-color: rgba(113, 187, 255, 0.2);
  background:
    radial-gradient(circle at 92% 14%, rgba(240, 185, 106, 0.14), transparent 26%),
    linear-gradient(135deg, rgba(74, 163, 255, 0.12), rgba(67, 215, 207, 0.08)),
    var(--panel-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.admin-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(6, 93, 180, 0.1);
  color: var(--brand-deep);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

body.dark .admin-kicker {
  background: rgba(74, 163, 255, 0.14);
  color: #d9ecff;
}

.admin-hero h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.45rem);
}

.admin-hero p {
  max-width: 560px;
  margin: 8px 0 0;
}

.admin-date-badge {
  display: grid;
  place-items: center;
  min-width: 96px;
  min-height: 96px;
  padding: 12px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  box-shadow: 0 18px 34px rgba(6, 93, 180, 0.24);
  text-align: center;
  font-weight: 900;
}

.admin-date-badge span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.admin-date-badge strong {
  font-size: 1.55rem;
  line-height: 1;
}

.admin-date-badge small {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.75rem;
  font-weight: 800;
}

.admin-section {
  padding: 16px;
  margin: 16px 0;
  border: 1px solid rgba(6, 93, 180, 0.14);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  box-shadow: 0 12px 24px rgba(17, 25, 35, 0.06);
  backdrop-filter: blur(12px);
}

body.dark .admin-section {
  border-color: rgba(113, 187, 255, 0.14);
  background: rgba(13, 23, 33, 0.66);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.admin-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-section-title h3 {
  margin: 0;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  letter-spacing: 0;
}

.admin-section-title span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.admin-section-title h3::after {
  content: "";
  width: 34px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--accent));
}

.admin-tools {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin: 16px 0;
}

/* Attendance reporting filters, summaries, tables, and export controls. */
.report-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin: 14px 0;
}

.monthly-attendance-panel {
  display: grid;
  gap: 14px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}

.monthly-report-tools {
  grid-template-columns: minmax(160px, 0.8fr) repeat(2, minmax(150px, 1fr)) repeat(4, auto);
  margin: 0;
}

.monthly-attendance-metrics {
  margin: 0;
}

.monthly-day-list {
  display: grid;
  gap: 12px;
}

.monthly-day-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.monthly-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.monthly-day-head strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}

.monthly-day-head span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.monthly-day-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.monthly-day-counts span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.monthly-day-counts .ok {
  color: #0f5132;
  background: #dff5e7;
}

.monthly-day-counts .bad {
  color: #8a1f1f;
  background: #ffe1e1;
}

.monthly-day-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.monthly-day-column {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-glass);
}

.monthly-day-column h4 {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
}

.monthly-teacher-line {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
}

.monthly-teacher-line:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.monthly-teacher-line strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.monthly-teacher-line span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.monthly-day-edit-list {
  display: grid;
  gap: 10px;
  max-height: min(62vh, 680px);
  overflow: auto;
  padding-right: 4px;
}

.monthly-day-edit-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(130px, 0.8fr) minmax(170px, 0.9fr) minmax(160px, 1fr);
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.monthly-day-edit-teacher {
  display: grid;
  gap: 3px;
  align-self: center;
}

.monthly-day-edit-teacher strong {
  color: var(--ink);
}

.monthly-day-edit-teacher span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.settings-form {
  display: grid;
  gap: 14px;
  margin: 14px 0;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* School-wide configuration groups and guarded danger-zone actions. */
.settings-group {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  box-shadow: 0 10px 22px rgba(17, 25, 35, 0.06);
}

.settings-group.full {
  grid-column: 1 / -1;
}

.settings-group.danger-zone {
  border-color: color-mix(in srgb, var(--bad) 38%, var(--line));
  background: color-mix(in srgb, var(--bad) 9%, var(--panel));
}

.settings-group-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.settings-group-head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.settings-group-head strong {
  color: var(--ink);
  font-size: 1rem;
}

.settings-group-head span,
.settings-preview span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.settings-preview {
  display: grid;
  gap: 8px;
  min-height: 120px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.settings-preview strong {
  color: var(--ink);
  font-size: 1.02rem;
}

.settings-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.45;
}

.settings-actions {
  position: sticky;
  bottom: 10px;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  box-shadow: 0 14px 32px rgba(17, 25, 35, 0.16);
  backdrop-filter: blur(14px);
}

.settings-actions .message {
  flex: 1 1 220px;
  margin: 0;
  text-align: left;
}

details.settings-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

details.settings-group summary::-webkit-details-marker {
  display: none;
}

details.settings-group summary::after {
  content: "+";
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel);
}

details.settings-group[open] summary::after {
  content: "-";
}

.holiday-manager {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.holiday-manager-head {
  display: grid;
  gap: 4px;
}

.holiday-manager-head strong {
  color: var(--ink);
  font-size: 1rem;
}

.holiday-manager-head span,
.holiday-manual-edit summary {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.holiday-add-row,
.holiday-import-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1.4fr) auto;
  gap: 12px;
  align-items: end;
}

.holiday-import-row {
  grid-template-columns: minmax(240px, 1fr) auto;
  margin-top: 10px;
}

.holiday-list-wrap {
  margin: 0;
}

.holiday-list-wrap input {
  min-height: 38px;
  width: 100%;
  padding: 0 10px;
}

.holiday-manual-edit {
  display: grid;
  gap: 10px;
}

.holiday-manual-edit summary {
  cursor: pointer;
}

.metric {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(17, 25, 35, 0.06);
}

.metric::after {
  content: "";
  position: absolute;
  inset: auto 12px 10px auto;
  width: 30px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(6, 93, 180, 0.1);
}

.metric strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1;
  margin-bottom: 8px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(6, 93, 180, 0.1);
  color: var(--brand-deep);
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.icon-button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding-inline: 11px;
}

.icon-button::before {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 6px;
  color: currentColor;
  border: 1px solid currentColor;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.icon-export::before { content: "EX"; }
.icon-print::before { content: "PR"; }
.icon-reset::before { content: "RS"; }
.icon-delete::before { content: "DL"; }
.icon-copy::before { content: "ID"; }

.status-chip.clocked,
.status-chip.early,
.status-chip.on_time {
  background: rgba(18, 140, 90, 0.12);
  color: #08784b;
}

.status-chip.tardy,
.status-chip.review {
  background: rgba(232, 169, 81, 0.18);
  color: #9b5c00;
}

.status-chip.excused,
.status-chip.activity,
.status-chip.sick,
.status-chip.authorized_leave {
  color: #2253a3;
  background: #e8f0ff;
  border-color: #b9cdf5;
}

.status-chip.missing,
.status-chip.inactive,
.status-chip.absent {
  background: rgba(215, 80, 80, 0.12);
  color: #a83232;
}

body.dark .status-chip {
  color: #d9ecff;
  background: rgba(74, 163, 255, 0.16);
}

body.dark .status-chip.clocked,
body.dark .status-chip.early,
body.dark .status-chip.on_time {
  color: #bff6df;
  background: rgba(73, 219, 159, 0.16);
}

body.dark .status-chip.tardy,
body.dark .status-chip.review {
  color: #ffe2aa;
  background: rgba(240, 185, 106, 0.18);
}

body.dark .status-chip.missing,
body.dark .status-chip.inactive {
  color: #ffd2d2;
  background: rgba(255, 122, 122, 0.16);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 12px 24px rgba(17, 25, 35, 0.06);
  -webkit-overflow-scrolling: touch;
}

#adminPanel table {
  border-collapse: separate;
  border-spacing: 0;
}

#adminPanel thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
  box-shadow: 0 1px 0 var(--line);
}

#adminPanel tbody tr:nth-child(even) {
  background: rgba(6, 93, 180, 0.035);
}

body.dark #adminPanel tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.035);
}

#adminTodayWrap table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

#adminFailuresWrap table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

#adminTeachersWrap table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

#adminMissedRequestsWrap table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

#adminPanel th,
#adminPanel td {
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

#adminPanel td:first-child,
#adminPanel td:nth-child(3),
#adminPanel .admin-note-cell {
  white-space: normal;
}

#adminPanel .admin-note-cell {
  min-width: 280px;
}

body.dark .table-wrap {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
}

.teacher-report {
  display: grid;
  gap: 14px;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.report-summary-card {
  display: grid;
  gap: 7px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(6, 93, 180, 0.07), rgba(20, 166, 161, 0.06)),
    var(--panel-soft);
}

.report-summary-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.report-summary-card strong {
  align-self: end;
  color: var(--brand-deep);
  font-size: clamp(1.45rem, 5vw, 2rem);
  line-height: 1;
}

#teacherHistoryCard .report-summary-grid {
  gap: 8px;
}

#teacherHistoryCard .report-summary-card,
#teacherHistoryCard .monthly-report .snapshot-card {
  min-height: 70px;
  padding: 10px;
  border-radius: 11px;
}

#teacherHistoryCard .report-summary-card strong,
#teacherHistoryCard .monthly-report .snapshot-card strong {
  font-size: clamp(1.05rem, 3vw, 1.34rem);
}

#teacherHistoryCard .report-summary-card span,
#teacherHistoryCard .monthly-report .snapshot-card span,
#teacherHistoryCard .monthly-report .snapshot-card small {
  font-size: 0.66rem;
}

body.dark .report-summary-card strong {
  color: var(--ink);
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-entry {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}

.history-entry.absent,
.history-entry.tardy,
.history-entry.review {
  border-left: 4px solid var(--warn);
}

.history-entry.absent {
  border-left-color: #d75050;
}

.history-entry.present {
  border-left: 4px solid var(--ok);
}

.history-entry summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 10px;
  cursor: pointer;
  list-style: none;
}

.history-entry summary::-webkit-details-marker {
  display: none;
}

.history-date-badge {
  display: grid;
  width: 46px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  font-weight: 900;
  line-height: 1;
}

.history-date-badge span {
  font-size: 0.62rem;
  text-transform: uppercase;
}

.history-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.history-main strong {
  color: var(--ink);
  line-height: 1.2;
}

.history-main span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.25;
}

.history-correction-inline {
  min-height: 32px;
  padding: 0 9px;
  border-radius: 9px;
  font-size: 0.76rem;
}

.history-more {
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 900;
}

.history-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 12px 12px;
}

.history-detail {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 12px;
  background: var(--panel-soft);
}

.history-detail span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.history-detail strong {
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.25;
}

.trend-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.trend-row {
  display: grid;
  grid-template-columns: 106px 1fr 64px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.trend-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf2;
}

.trend-fill {
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--ok));
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

th,
td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

tbody tr:last-child td {
  border-bottom: 0;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0;
  background: var(--panel-soft);
}

tbody tr:nth-child(even) {
  background: var(--table-stripe);
}

tbody tr {
  transition: background-color 160ms ease, transform 160ms ease;
}

tbody tr:hover {
  background: var(--surface-hover);
}

.table-wrap {
  border-radius: var(--radius-md);
  border-color: color-mix(in srgb, var(--line) 82%, var(--brand));
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.empty {
  color: var(--muted);
  display: grid;
  min-height: 76px;
  place-items: center;
  gap: 8px;
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  font-weight: 800;
  text-align: center;
}

.empty::before {
  content: "";
  width: 44px;
  aspect-ratio: 1;
  border-radius: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand) 18%, transparent), color-mix(in srgb, var(--accent) 16%, transparent)),
    var(--panel);
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  box-shadow: inset 0 0 0 8px color-mix(in srgb, var(--panel-soft) 78%, transparent);
}

.empty {
  overflow: hidden;
}

.empty::after {
  content: "Nothing needs action here";
  display: block;
  color: color-mix(in srgb, var(--muted) 82%, var(--brand));
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

#adminMissedRequestsWrap .empty::after {
  content: "Requests will appear here";
}

#adminTeachersWrap .empty::after {
  content: "Teacher accounts will appear here";
}

#adminTodayWrap .empty::after {
  content: "Choose a school day or wait for clock-ins";
}

#adminFailuresWrap .empty::after {
  content: "Location issues will appear here";
}

#adminAuditWrap .empty::after {
  content: "System changes will appear here";
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}

.status-chip,
.pill,
.admin-nav-badge {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 12%, transparent);
}

.status-chip {
  min-height: 24px;
  padding-inline: 9px;
  font-size: 0.72rem;
}

.admin-tools,
.report-tools,
.teacher-bulk-bar {
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--panel-soft) 74%, transparent);
}

.admin-attendance-card,
.approval-card,
.admin-teacher-card,
#adminFailuresWrap tbody tr,
#adminAuditWrap tbody tr,
#adminPendingRegistrationsWrap tbody tr {
  animation: adminRowReveal 260ms ease both;
}

.approval-card:has(.status-chip.review),
.admin-attendance-card:has(.status-chip.review),
#adminFailuresWrap tbody tr {
  animation: adminRowReveal 260ms ease both, adminSoftPulse 2100ms ease-in-out infinite;
}

@media (max-width: 860px) {
  .shell,
  .dashboard-grid,
  .welcome-timebar,
  .admin-metrics,
  .admin-tools,
  .report-tools,
  .holiday-add-row,
  .holiday-import-row,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 92px;
    padding: 12px 14px;
  }

  .brand-panel > div {
    width: auto;
    min-height: 68px;
    padding: 0;
    border-radius: 0;
  }

  .logo-mark {
    width: 68px;
    height: 68px;
    margin: 0;
  }

  main {
    padding: 20px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  body.teacher-dashboard .topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: calc(100% + 56px);
    max-width: none;
    box-sizing: border-box;
    min-height: 64px;
    margin: -28px -28px 18px;
    padding: max(10px, env(safe-area-inset-top)) 28px 10px;
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--page) 94%, transparent), color-mix(in srgb, var(--page) 82%, transparent));
    backdrop-filter: blur(18px);
  }

  .top-actions {
    width: 100%;
  }

  body.teacher-dashboard .top-actions {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
  }

  body.teacher-dashboard .topbar-logo-link {
    min-height: 50px;
    padding-right: 6px;
  }

  body.teacher-dashboard .topbar-logo-link img {
    width: 46px;
    height: 46px;
  }

  .topbar-logo-copy strong {
    font-size: 0.9rem;
  }

  .topbar-logo-copy span {
    font-size: 0.64rem;
  }

  .admin-global-search {
    grid-template-columns: 1fr;
  }

  .admin-global-search-control {
    flex-direction: column;
    align-items: stretch;
  }

  body.teacher-dashboard .top-actions button {
    flex: 0 0 auto;
  }

  .top-actions button {
    flex: 1;
  }

  body.teacher-dashboard .top-actions > button {
    flex: 0 0 auto;
  }

  .top-actions .notification-popover button {
    flex: 0 0 auto;
  }

  .top-actions .notification-popover {
    width: min(420px, calc(100vw - 24px));
    transform-origin: top center;
  }

  .admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-workspace {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .admin-sidebar-title {
    display: grid;
  }

  .admin-section-picker {
    display: grid;
    gap: 6px;
  }

  .admin-tab-nav {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-tab-nav button {
    min-width: 108px;
  }

  .admin-sidebar-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-sidebar-actions button {
    justify-content: center;
  }

  .admin-page-intro {
    grid-template-columns: 1fr;
  }

  .admin-page-summary {
    justify-content: flex-start;
    max-width: none;
  }

  .settings-form-grid,
  .settings-form-grid.three {
    grid-template-columns: 1fr;
  }

  .settings-actions {
    position: static;
    justify-content: stretch;
  }

  .settings-actions button {
    width: 100%;
  }

  .admin-overview-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-quick-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-command-panels {
    grid-template-columns: 1fr;
  }

  .admin-hero {
    grid-template-columns: 1fr;
  }

  .admin-date-badge {
    width: 100%;
    min-height: 76px;
  }

  .admin-section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  body.admin-dashboard .page {
    width: 100%;
    padding-bottom: 120px;
  }

  body.admin-dashboard main {
    padding: 18px 18px 110px;
  }

  body.admin-dashboard .topbar {
    position: sticky;
    top: 0;
    z-index: 12;
    margin: -18px -18px 14px;
    padding: 12px 18px;
    background: color-mix(in srgb, var(--panel) 88%, transparent);
    backdrop-filter: blur(14px);
  }

  .clock-hero.hero-layout-wide {
    grid-template-columns: 1fr;
  }

  .clock-hero.hero-layout-wide .clock-hero-head,
  .clock-hero.hero-layout-wide .clock-face,
  .clock-hero.hero-layout-wide .success-celebration,
  .clock-hero.hero-layout-wide .teacher-notification,
  .clock-hero.hero-layout-wide .clock-actions,
  .clock-hero.hero-layout-wide .secure-check,
  .clock-hero.hero-layout-wide .arrival-preview,
  .clock-hero.hero-layout-wide .system-health,
  .clock-hero.hero-layout-wide .offline-sync-panel,
  .clock-hero.hero-layout-wide .missed-clock-note,
  .clock-hero.hero-layout-wide #clockMessage {
    grid-column: 1;
  }

  body.teacher-dashboard .page {
    padding-bottom: 18px;
  }

  body.teacher-dashboard .creator-footer {
    margin-top: 0;
    padding-top: 2px;
  }
}

@media (max-width: 520px) {
  :root {
    --teacher-mobile-nav-height: 74px;
  }

  html,
  body.teacher-dashboard {
    min-height: 100%;
    overscroll-behavior-y: contain;
  }

  .page {
    width: 100%;
    padding: 0;
  }

  .brand-panel,
  main {
    padding: 16px;
  }

  .shell {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  body.admin-dashboard main {
    padding: 10px 10px 120px;
  }

  body.admin-dashboard #adminPanel {
    padding: 12px;
    border-radius: 0;
  }

  body.admin-dashboard .topbar {
    margin: -10px -10px 10px;
    padding: 10px;
  }

  body.admin-dashboard .tabs {
    grid-template-columns: 1fr;
  }

  body.admin-dashboard .top-actions button {
    width: 100%;
  }

  body.admin-dashboard .admin-tab-nav {
    position: sticky;
    top: 74px;
    z-index: 10;
    scroll-snap-type: x mandatory;
    display: none;
  }

  body.admin-dashboard .admin-tab-nav button {
    min-width: 104px;
    scroll-snap-align: start;
  }

  body.admin-dashboard .admin-sidebar {
    position: sticky;
    top: 62px;
    z-index: 11;
    gap: 10px;
    margin: 0 -2px 4px;
    padding: 10px;
    border-radius: 14px;
  }

  body.admin-dashboard .admin-sidebar-title {
    padding: 0;
  }

  body.admin-dashboard .admin-section-picker select {
    width: 100%;
    min-height: 48px;
    font-size: 1rem;
  }

  .admin-sidebar-actions,
  .admin-overview-cards,
  .admin-quick-actions {
    grid-template-columns: 1fr;
  }

  .admin-command-item {
    grid-template-columns: 1fr;
  }

  .admin-command-item button {
    width: 100%;
  }

  .admin-hero {
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
  }

  .admin-hero h2 {
    font-size: 1.7rem;
  }

  .admin-date-badge {
    min-height: 68px;
    border-radius: 14px;
  }

  .admin-section {
    margin: 12px 0;
    padding: 12px;
    border-radius: 14px;
  }

  .admin-notification-strip {
    grid-template-columns: 1fr;
  }

  .admin-notification-strip > button {
    width: 100%;
  }

  .admin-tools,
  .report-tools {
    gap: 10px;
    margin: 12px 0;
  }

  body.admin-dashboard input,
  body.admin-dashboard select,
  body.admin-dashboard textarea {
    min-height: 48px;
    font-size: 1rem;
  }

  body.admin-dashboard textarea {
    min-height: 118px;
  }

  body.admin-dashboard button {
    min-height: 46px;
  }

  body.admin-dashboard .actions,
  body.admin-dashboard .admin-sidebar-actions,
  body.admin-dashboard .admin-quick-actions,
  body.admin-dashboard .settings-actions,
  body.admin-dashboard .admin-modal-actions {
    align-items: stretch;
  }

  body.admin-dashboard .actions button,
  body.admin-dashboard .admin-sidebar-actions button,
  body.admin-dashboard .admin-quick-actions button,
  body.admin-dashboard .settings-actions button,
  body.admin-dashboard .admin-modal-actions button {
    width: 100%;
  }

  .admin-metrics,
  .admin-insights,
  .security-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .smart-warning-grid,
  .morning-command-grid,
  .admin-alerts-grid,
  .approval-queue-grid,
  .data-quality-grid,
  .weekly-report-grid,
  .badge-verification-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .smart-warning-card,
  .morning-command-card,
  .approval-queue-card,
  .data-quality-card,
  .weekly-report-card,
  .badge-verification-card {
    padding: 11px 12px;
    border-radius: 12px;
  }

  .metric {
    min-height: 78px;
    padding: 12px;
  }

  .metric strong {
    font-size: 1.45rem;
  }

  #adminMissedRequestsWrap table,
  #adminTodayWrap table,
  #adminFailuresWrap table,
  #adminTeachersWrap table,
  #holidayClosureListWrap table {
    min-width: 0;
  }

  #adminMissedRequestsWrap thead,
  #adminTodayWrap thead,
  #adminFailuresWrap thead,
  #adminTeachersWrap thead,
  #holidayClosureListWrap thead {
    display: none;
  }

  #adminMissedRequestsWrap table,
  #adminMissedRequestsWrap tbody,
  #adminMissedRequestsWrap tr,
  #adminMissedRequestsWrap td,
  #adminTodayWrap table,
  #adminTodayWrap tbody,
  #adminTodayWrap tr,
  #adminTodayWrap td,
  #adminFailuresWrap table,
  #adminFailuresWrap tbody,
  #adminFailuresWrap tr,
  #adminFailuresWrap td,
  #adminTeachersWrap table,
  #adminTeachersWrap tbody,
  #adminTeachersWrap tr,
  #adminTeachersWrap td,
  #holidayClosureListWrap table,
  #holidayClosureListWrap tbody,
  #holidayClosureListWrap tr,
  #holidayClosureListWrap td {
    display: block;
    width: 100%;
  }

  #adminMissedRequestsWrap tr,
  #adminTodayWrap tr,
  #adminFailuresWrap tr,
  #adminTeachersWrap tr,
  #holidayClosureListWrap tr {
    margin: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel-soft);
    box-shadow: 0 10px 20px rgba(17, 25, 35, 0.08);
  }

  #adminMissedRequestsWrap td,
  #adminTodayWrap td,
  #adminFailuresWrap td,
  #adminTeachersWrap td,
  #holidayClosureListWrap td {
    display: grid;
    grid-template-columns: minmax(94px, 36%) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #adminMissedRequestsWrap td:last-child,
  #adminTodayWrap td:last-child,
  #adminFailuresWrap td:last-child,
  #adminTeachersWrap td:last-child,
  #holidayClosureListWrap td:last-child {
    border-bottom: 0;
  }

  #adminMissedRequestsWrap td::before,
  #adminTodayWrap td::before,
  #adminFailuresWrap td::before,
  #adminTeachersWrap td::before,
  #holidayClosureListWrap td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  body.admin-dashboard .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body.admin-dashboard .table-wrap table,
  body.admin-dashboard .table-wrap tbody,
  body.admin-dashboard .table-wrap tr,
  body.admin-dashboard .table-wrap td {
    display: block;
    width: 100%;
  }

  body.admin-dashboard .table-wrap thead {
    display: none;
  }

  body.admin-dashboard .table-wrap tr {
    margin: 10px 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel-soft);
    box-shadow: 0 10px 20px rgba(17, 25, 35, 0.08);
  }

  body.admin-dashboard .table-wrap td {
    display: grid;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body.admin-dashboard .table-wrap td:last-child {
    border-bottom: 0;
  }

  body.admin-dashboard .table-wrap td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  #adminPanel .admin-note-cell {
    min-width: 0;
  }

  .admin-note-control,
  .admin-device-actions {
    min-width: 0;
    grid-template-columns: 1fr;
  }

  .admin-device-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-note-control input,
  #adminMissedRequestsWrap input {
    width: 100%;
  }

  .admin-device-actions button,
  .admin-note-control button,
  #adminTeachersWrap td > button,
  #adminMissedRequestsWrap td > button {
    width: 100%;
  }

  .admin-attendance-head,
  .audit-log-head {
    grid-template-columns: 1fr;
  }

  .admin-attendance-stats,
  .audit-log-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-attendance-actions,
  .audit-log-actions {
    justify-content: stretch;
  }

  .admin-attendance-actions button,
  .audit-log-actions button {
    flex: 1 1 140px;
  }

  .mobile-action-bar {
    display: flex;
    border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
    background: color-mix(in srgb, var(--panel) 90%, transparent);
    box-shadow: 0 18px 36px rgba(17, 25, 35, 0.2);
    backdrop-filter: blur(16px);
  }

  .admin-modal {
    align-items: end;
    padding: 14px;
  }

  .admin-modal-card {
    width: 100%;
    max-height: calc(100dvh - 28px);
    border-radius: 18px 18px 12px 12px;
    animation-name: adminModalSheetIn;
  }

  .admin-modal-head {
    position: sticky;
    top: -18px;
    z-index: 2;
    padding-top: 4px;
    background: var(--panel);
  }

  .admin-modal-actions {
    position: sticky;
    bottom: -18px;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr;
    padding-top: 10px;
    background: var(--panel);
  }

  .admin-modal.hidden .admin-modal-card,
  .admin-modal.closing .admin-modal-card {
    transform: translateY(34px) scale(1);
  }

  .badge-main {
    grid-template-columns: 1fr;
  }

  .teacher-qr-box {
    width: min(100%, 240px);
    justify-self: center;
  }

  .approval-card-head,
  .approval-actions {
    grid-template-columns: 1fr;
  }

  .approval-card-head {
    display: grid;
  }

  .approval-actions button,
  .announcement-admin-form button {
    width: 100%;
  }

  .brand-panel {
    min-height: 90px;
    padding: 12px;
  }

  .brand-panel::before {
    display: none;
  }

  .brand-panel > div {
    width: auto;
    min-height: 68px;
    padding: 0;
    border-radius: 0;
  }

  .brand-panel h1 {
    font-size: 1.7rem;
  }

  .brand-panel p {
    margin-top: 10px;
  }

  .logo-mark {
    width: 68px;
    height: 68px;
    margin: 0;
  }

  .status-strip {
    display: none;
  }

  .card {
    padding: 16px;
    border-radius: 12px;
  }

  .registration-progress {
    grid-template-columns: 1fr;
  }

  .registration-progress-step {
    grid-template-columns: auto 1fr;
    align-items: center;
    min-height: 0;
    text-align: left;
  }

  .registration-progress-step::before {
    margin: 0;
  }

  .registration-step-head,
  .registration-photo-card,
  .registration-status-grid,
  .registration-nav {
    grid-template-columns: 1fr;
  }

  .registration-step-head {
    display: grid;
  }

  .registration-nav button {
    width: 100%;
  }

  .password-field {
    grid-template-columns: 1fr;
  }

  .password-toggle,
  .login-help-panel,
  .login-security-note,
  .admin-access-link {
    width: 100%;
  }

  #loginPanel {
    gap: 14px;
    padding: 18px;
  }

  .login-primary-actions {
    grid-template-columns: 1fr;
  }

  .login-primary-actions #loginSubmitBtn,
  .login-secondary-link {
    width: 100%;
  }

  .login-footer {
    display: grid;
    gap: 6px;
    justify-items: center;
  }

  .login-help-panel {
    grid-template-columns: 1fr;
  }

  .creator-info-grid {
    grid-template-columns: 1fr;
  }

  .creator-about-header,
  .creator-info-hero,
  .creator-collab-card,
  .creator-contact-row {
    grid-template-columns: 1fr;
  }

  .creator-info-hero,
  .creator-collab-card {
    text-align: center;
  }

  .creator-info-logo {
    width: min(220px, 86%);
  }

  .creator-collab-logo {
    margin: 0 auto;
  }

  .creator-role-pill,
  .creator-contact-actions,
  .creator-copy-button,
  .creator-open-link {
    width: 100%;
    justify-content: center;
  }

  @keyframes adminModalSheetIn {
    from {
      opacity: 0;
      transform: translateY(42px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .teacher-welcome {
    grid-template-columns: auto 1fr;
    justify-items: start;
    margin-bottom: 12px;
    align-items: start;
  }

  .teacher-dashboard-header {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
  }

  .dashboard-header-logo {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .dashboard-header-logo img {
    width: 36px;
    height: 36px;
  }

  .dashboard-product-logo {
    width: 54px;
    height: 54px;
    margin-bottom: 6px;
    border-radius: 16px;
  }

  .dashboard-product-logo img {
    width: 44px;
    height: 44px;
  }

  .dashboard-header-actions {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-header-chip {
    min-width: 0;
  }

  .dashboard-header-copy h2 {
    font-size: 1.14rem;
    white-space: normal;
  }

  .dashboard-header-copy p {
    font-size: 0.82rem;
  }

  .teacher-welcome .school-logo-badge {
    justify-self: start;
  }

  .teacher-welcome .hero-streak-badge {
    position: static;
    order: -1;
    grid-column: 1 / -1;
    justify-self: start;
    min-width: 0;
    margin-bottom: 2px;
    padding: 7px 9px;
  }

  .teacher-welcome .streak-popover {
    top: 44px;
    left: 10px;
    width: calc(100% - 20px);
    max-height: min(270px, calc(100vh - 170px));
    padding: 12px;
  }

  .streak-popover-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .streak-popover-grid div {
    padding: 8px 6px;
  }

  .streak-popover-grid strong {
    font-size: 0.9rem;
  }

  .streak-popover-week {
    gap: 5px;
  }

  .teacher-welcome .hero-streak-flame {
    width: 26px;
    height: 26px;
  }

  .teacher-welcome .hero-streak-copy strong {
    font-size: 0.78rem;
  }

  .teacher-welcome .hero-streak-copy span {
    font-size: 0.58rem;
  }

  .teacher-welcome .welcome-copy {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }

  .teacher-welcome .welcome-copy h2,
  .teacher-welcome .welcome-copy p,
  .welcome-meta,
  .welcome-meta span {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .timeline-steps {
    grid-template-columns: 1fr;
  }

  .snapshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .term-countdown-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .streak-card {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 12px;
    padding: 13px;
    text-align: center;
  }

  .streak-ring {
    width: 106px;
    height: 106px;
  }

  .streak-ring strong {
    font-size: 1.95rem;
  }

  .streak-copy {
    width: 100%;
  }

  .streak-week-row {
    gap: 5px;
  }

  .streak-day {
    min-height: 54px;
    padding: 6px 3px;
    border-radius: 10px;
  }

  .streak-day strong {
    width: 22px;
    height: 22px;
  }

  .streak-leaderboard-hero {
    grid-template-columns: 1fr;
  }

  .streak-challenge-banner {
    grid-template-columns: 1fr;
  }

  .streak-challenge-banner button {
    width: 100%;
  }

  .streak-filter-bar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x mandatory;
  }

  .streak-filter-bar button {
    flex: 0 0 auto;
    min-width: 122px;
    padding: 0 8px;
    scroll-snap-align: start;
  }

  .streak-leaderboard-summary {
    grid-template-columns: 1fr;
  }

  .streak-podium {
    grid-template-columns: 1fr;
  }

  .streak-podium-card,
  .streak-podium-card.first {
    order: initial;
    min-height: 0;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    justify-items: start;
    text-align: left;
  }

  .streak-podium-card .admin-teacher-photo,
  .streak-podium-card.first .admin-teacher-photo {
    width: 48px;
    height: 48px;
    font-size: 0.86rem;
  }

  .streak-leaderboard-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    padding: 11px;
  }

  .streak-score {
    grid-column: 2;
    justify-items: start;
    grid-template-columns: auto auto;
    align-items: center;
    min-width: 0;
  }

  .streak-head,
  .streak-meta {
    justify-content: center;
  }

  .term-countdown-copy {
    width: 100%;
  }

  .term-countdown-meta,
  .term-countdown-card .actions {
    justify-content: center;
  }

  .term-countdown-ring {
    width: 118px;
    height: 118px;
  }

  .mini-calendar {
    padding: 10px;
  }

  .calendar-strip,
  .calendar-weekdays {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
  }

  .calendar-day {
    min-width: 0;
    min-height: 76px;
    padding: 7px 5px;
    border-radius: 10px;
  }

  .calendar-day strong {
    font-size: 1.04rem;
  }

  .calendar-day span {
    font-size: 0.62rem;
  }

  .calendar-status {
    min-height: 19px;
    padding: 0 5px;
    font-size: 0.6rem;
  }

  .calendar-day small {
    display: none;
  }

  .calendar-day .calendar-term-label {
    display: inline-flex;
    max-width: 100%;
    padding: 0 4px;
    font-size: 0.54rem;
  }

  .monthly-report,
  .admin-insights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #teacherCard .clock-hero {
    margin-bottom: 12px;
  }

  .clock-hero-head {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .hero-cutoff,
  .hero-mode-pill {
    max-width: 100%;
    white-space: normal;
  }

  .clock-face {
    min-height: 176px;
  }

  .clock-face strong {
    font-size: 2.8rem;
  }

  .tabs,
  .tab {
    width: 100%;
  }

  .tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .actions button {
    width: 100%;
  }

  .offline-banner {
    width: calc(100% - 18px);
  }

  body.teacher-dashboard .page {
    padding-bottom: 10px;
  }

  body.teacher-dashboard .creator-footer {
    margin-top: -4px;
    padding-top: 2px;
  }

  .creator-footer {
    width: 100%;
    margin-top: 0;
    padding: 6px 12px 12px;
  }

  .creator-logo {
    width: min(250px, 78vw);
  }

  .trend-row {
    grid-template-columns: 82px 1fr 48px;
  }

  .clock-actions {
    margin: 10px 0 0;
  }

  body.dark .clock-actions {
    background: transparent;
  }

  .clock-actions button {
    width: 100%;
    min-height: 62px;
    font-size: 1.12rem;
  }

  .missed-note-grid,
  .missed-note-actions {
    grid-template-columns: 1fr;
  }

  .missed-clock-note summary {
    grid-template-columns: auto 1fr auto;
  }

  .missed-request-status {
    grid-column: 2 / 3;
    justify-self: start;
  }

  .missed-note-toggle {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
  }

  .missed-note-actions button {
    width: 100%;
  }

  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .snapshot-grid {
    grid-template-columns: 1fr;
  }

  .report-summary-grid,
  .monthly-report,
  .admin-insights,
  .history-detail-grid,
  .admin-card-grid,
  .teacher-bulk-bar,
  .admin-modal-form {
    grid-template-columns: 1fr;
  }

  .admin-teacher-card {
    grid-template-columns: 1fr;
  }

  .admin-teacher-card > input {
    justify-self: start;
  }

  .admin-teacher-tools {
    grid-column: auto;
    justify-content: stretch;
  }

  .admin-teacher-tools::before {
    flex-basis: 100%;
  }

  .admin-teacher-tools button {
    flex: 1 1 120px;
  }

  .admin-teacher-identity,
  .admin-profile-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .success-celebration.show {
    grid-template-columns: 1fr;
  }

  .smart-notice {
    grid-template-columns: 1fr;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-photo-panel {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  body.teacher-dashboard .page {
    padding-bottom: calc(var(--teacher-mobile-nav-height) + 16px + env(safe-area-inset-bottom));
  }

  .dashboard:not(.hidden) {
    padding-bottom: calc(var(--teacher-mobile-nav-height) + 10px + env(safe-area-inset-bottom));
  }

  body.teacher-dashboard .dashboard.profile-view {
    padding-bottom: 18px;
  }

  body.teacher-dashboard:has(.dashboard.profile-view) .page {
    padding-bottom: 78px;
  }

  body.teacher-dashboard:has(.dashboard.profile-view) main {
    padding-bottom: 22px;
  }

  body.teacher-dashboard .dashboard.profile-view #teacherCard {
    width: 100%;
    max-width: none;
    padding: 0;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
  }

  body.teacher-dashboard .dashboard.profile-view .profile-card {
    width: 100%;
    box-sizing: border-box;
    padding: 14px;
  }

  body.teacher-dashboard .dashboard.profile-view .profile-title,
  body.teacher-dashboard .dashboard.profile-view .actions {
    align-items: stretch;
  }

  body.teacher-dashboard .dashboard.profile-view .profile-title strong,
  body.teacher-dashboard .dashboard.profile-view .profile-photo-copy strong,
  body.teacher-dashboard .dashboard.profile-view .profile-photo-copy span,
  body.teacher-dashboard .dashboard.profile-view .profile-item span,
  body.teacher-dashboard .dashboard.profile-view .profile-item strong,
  body.teacher-dashboard .dashboard.profile-view .hint {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  body.teacher-dashboard .dashboard.profile-view .profile-photo-panel {
    width: 100%;
    box-sizing: border-box;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 12px;
  }

  body.teacher-dashboard .dashboard.profile-view .profile-photo-preview {
    width: 68px;
    border-radius: 18px;
  }

  body.teacher-dashboard .dashboard.profile-view .photo-actions,
  body.teacher-dashboard .dashboard.profile-view .actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
  }

  body.teacher-dashboard .dashboard.profile-view .photo-actions button,
  body.teacher-dashboard .dashboard.profile-view .photo-actions label,
  body.teacher-dashboard .dashboard.profile-view .actions button {
    width: 100%;
  }

  body.teacher-dashboard .dashboard.profile-view .profile-grid {
    width: 100%;
    grid-template-columns: 1fr;
  }

  body.teacher-dashboard .dashboard.profile-view .profile-extra-details,
  body.teacher-dashboard .dashboard.profile-view .profile-help-panel,
  body.teacher-dashboard .dashboard.profile-view .privacy-note {
    width: 100%;
    box-sizing: border-box;
  }

  body.teacher-dashboard .dashboard.profile-view .profile-item {
    min-height: 0;
    padding: 11px;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard {
    gap: 12px;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .teacher-welcome {
    order: 1;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .teacher-announcement {
    order: 2;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .teacher-status-badge {
    order: 3;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .today-status {
    order: 4;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .clock-hero {
    order: 5;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .today-timeline {
    order: 6;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .smart-notices {
    order: 7;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .profile-completion-card,
  body.teacher-dashboard .dashboard.home-view #teacherCard .welcome-timebar,
  body.teacher-dashboard .dashboard.home-view #teacherCard .attendance-snapshot,
  body.teacher-dashboard .dashboard.home-view #teacherCard .term-countdown-card,
  body.teacher-dashboard .dashboard.home-view #teacherCard .streak-card,
  body.teacher-dashboard .dashboard.home-view #teacherCard .mini-calendar {
    display: none;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .clock-hero {
    margin-bottom: 0;
    padding: 12px;
    gap: 9px;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .clock-hero .clock-face {
    min-height: 148px;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .clock-face strong {
    font-size: clamp(2.1rem, 12vw, 3.05rem);
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .clock-hero .arrival-preview,
  body.teacher-dashboard .dashboard.home-view #teacherCard .clock-hero .teacher-notification,
  body.teacher-dashboard .dashboard.home-view #teacherCard .clock-hero .system-health,
  body.teacher-dashboard .dashboard.home-view #teacherCard .clock-hero .offline-sync-panel {
    display: none;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .clock-hero .success-celebration.show {
    grid-template-columns: auto 1fr;
    align-items: center;
    min-height: 0;
    padding: 12px;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .clock-hero .success-celebration.show p {
    display: none;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .clock-hero .actions {
    position: sticky;
    bottom: calc(var(--teacher-mobile-nav-height) + 14px + env(safe-area-inset-bottom));
    z-index: 22;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
    border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
    border-radius: 16px;
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    box-shadow: 0 12px 30px rgba(17, 25, 35, 0.16);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .clock-hero .actions button {
    min-height: 48px;
    font-size: 0.98rem;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .clock-hero .missed-clock-note {
    margin-top: 0;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .teacher-announcement,
  body.teacher-dashboard .dashboard.home-view #teacherCard .teacher-status-badge,
  body.teacher-dashboard .dashboard.home-view #teacherCard .today-status,
  body.teacher-dashboard .dashboard.home-view #teacherCard .today-timeline,
  body.teacher-dashboard .dashboard.home-view #teacherCard .smart-notice {
    padding: 10px;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .teacher-announcement,
  body.teacher-dashboard .dashboard.home-view #teacherCard .teacher-status-badge,
  body.teacher-dashboard .dashboard.home-view #teacherCard .smart-notice {
    grid-template-columns: auto minmax(0, 1fr);
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .timeline-steps {
    grid-template-columns: 1fr;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .timeline-step {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-height: 0;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .timeline-step strong {
    grid-column: 2;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .timeline-step span:last-child {
    grid-column: 2;
  }

  .dashboard.history-view #teacherHistoryCard,
  .dashboard.news-view #teacherNewsCard,
  .dashboard.settings-view #teacherRequestsCard,
  .dashboard.history-view #teacherStreaksCard {
    padding: 12px;
  }

  .history-filter-bar,
  .report-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .monthly-report-tools,
  .monthly-day-columns,
  .monthly-day-edit-row {
    grid-template-columns: 1fr;
  }

  .monthly-day-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .monthly-day-counts {
    justify-content: flex-start;
  }

  .history-filter-bar button,
  .report-tools button {
    width: 100%;
  }

  .teacher-insights-grid,
  .self-service-grid,
  .news-card-grid,
  .streak-leaderboard-summary {
    gap: 10px;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .calendar-title {
    gap: 8px;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .calendar-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 108px;
    grid-template-columns: none;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    padding: 0 2px 6px;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .compact-recent-day {
    box-sizing: border-box;
    grid-template-rows: auto auto auto auto 1fr;
    align-content: start;
    width: 108px;
    min-width: 108px;
    min-height: 128px;
    max-width: 108px;
    gap: 6px;
    overflow: hidden;
    padding: 10px;
    scroll-snap-align: start;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .calendar-day strong {
    font-size: 1.12rem;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .calendar-status {
    max-width: 100%;
    min-height: 22px;
    padding: 0 6px;
    font-size: 0.62rem;
    line-height: 1.1;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .calendar-time {
    max-width: 100%;
    font-size: 0.66rem;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.teacher-dashboard .dashboard.home-view #teacherCard .calendar-today-badge {
    top: 7px;
    right: 7px;
    min-height: 16px;
    padding: 0 5px;
    font-size: 0.5rem;
  }

  body.teacher-dashboard .bottom-nav:not(.hidden) {
    position: fixed !important;
    top: auto !important;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 150;
    min-height: var(--teacher-mobile-nav-height);
    width: auto;
    max-width: none;
    transform: none !important;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 5px;
    border-radius: 18px;
  }

  body.teacher-dashboard .bottom-nav:not(.hidden)::before {
    inset: 5px auto 5px 5px;
    width: calc((100% - 10px - (4 * 4px)) / 5);
    transform: translateX(calc(var(--nav-index, 0) * (100% + 4px)));
  }

  .bottom-nav button {
    min-height: 56px;
    padding: 5px 3px;
    border-radius: 14px;
    font-size: 0.64rem;
  }

  .bottom-nav button > span:last-child {
    max-width: 11ch;
    line-height: 1.05;
  }

  .nav-icon {
    width: 20px;
  }

  body.teacher-dashboard main {
    padding: 14px 12px calc(var(--teacher-mobile-nav-height) + 22px + env(safe-area-inset-bottom));
  }

  body.teacher-dashboard .creator-footer {
    margin: 22px 0 calc(var(--teacher-mobile-nav-height) + 14px + env(safe-area-inset-bottom));
    padding: 0 0 4px;
    gap: 8px;
  }

  body.teacher-dashboard .creator-footer span {
    font-size: 0.82rem;
  }

  body.teacher-dashboard .creator-logo {
    width: min(260px, 68vw);
    max-height: 78px;
    object-fit: contain;
  }

  body.teacher-dashboard .topbar {
    width: calc(100% + 24px);
    margin: -14px -12px 12px;
    padding: max(8px, env(safe-area-inset-top)) 12px 8px;
    min-height: 58px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.teacher-dashboard .topbar-logo-link {
    min-height: 44px;
    gap: 7px;
  }

  body.teacher-dashboard .topbar-logo-link img {
    width: 38px;
    height: 38px;
  }

  body.teacher-dashboard .topbar-logo-copy strong {
    font-size: 0.78rem;
  }

  body.teacher-dashboard .topbar-logo-copy span {
    display: none;
  }

  body.teacher-dashboard .top-actions {
    gap: 6px;
    position: static;
  }

  body.teacher-dashboard .top-actions .mode-toggle,
  body.teacher-dashboard .top-actions > button {
    width: 40px;
    min-height: 40px;
  }

  body.teacher-dashboard #logoutBtn {
    width: 40px;
    min-height: 40px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    font-size: 0;
    position: relative;
  }

  body.teacher-dashboard #logoutBtn::before {
    content: "";
    position: absolute;
    inset: 10px 12px 10px 10px;
    border: 2px solid var(--ink);
    border-right: 0;
    border-radius: 4px 0 0 4px;
    opacity: 0.9;
  }

  body.teacher-dashboard #logoutBtn::after {
    content: "";
    position: absolute;
    width: 13px;
    height: 13px;
    right: 8px;
    top: 50%;
    border-top: 2px solid var(--ink);
    border-right: 2px solid var(--ink);
    transform: translateY(-50%) rotate(45deg);
    box-shadow: 5px -5px 0 -3px var(--ink);
  }

  .settings-row {
    grid-template-columns: 1fr;
  }

  body.teacher-dashboard input,
  body.teacher-dashboard select,
  body.teacher-dashboard textarea {
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    font-size: 1rem;
  }

  body.teacher-dashboard textarea {
    min-height: 108px;
  }

  body.teacher-dashboard .field-grid,
  body.teacher-dashboard .missed-note-grid,
  body.teacher-dashboard .settings-form-grid,
  body.teacher-dashboard .admin-modal-form,
  body.teacher-dashboard .photo-actions,
  body.teacher-dashboard .badge-actions,
  body.teacher-dashboard .help-grid,
  body.teacher-dashboard .profile-insight-grid,
  body.teacher-dashboard .self-service-grid {
    grid-template-columns: 1fr !important;
  }

  body.teacher-dashboard .photo-upload-button,
  body.teacher-dashboard .badge-actions button,
  body.teacher-dashboard .self-service-card button,
  body.teacher-dashboard .profile-edit-panel button,
  body.teacher-dashboard .settings-row button,
  body.teacher-dashboard .feature-update-actions > button,
  body.teacher-dashboard .feature-update-step-actions button {
    width: 100%;
  }

  body.teacher-dashboard .profile-edit-panel,
  body.teacher-dashboard .settings-card,
  body.teacher-dashboard .profile-card,
  body.teacher-dashboard #teacherHistoryCard,
  body.teacher-dashboard #teacherNewsCard,
  body.teacher-dashboard #teacherRequestsCard,
  body.teacher-dashboard #teacherStreaksCard {
    overflow-wrap: anywhere;
  }

  body.teacher-dashboard .profile-edit-panel,
  body.teacher-dashboard .settings-grid,
  body.teacher-dashboard .teacher-badge-card,
  body.teacher-dashboard .help-center,
  body.teacher-dashboard .missed-clock-note,
  body.teacher-dashboard .notification-popover,
  body.teacher-dashboard .feature-update-card {
    max-width: 100%;
    box-sizing: border-box;
  }

  .theme-mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-style-grid {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 0.88rem;
  }

  .feature-update-modal,
  .streak-celebration-modal,
  .admin-modal {
    padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
    align-items: center;
  }

  .feature-update-card,
  .streak-celebration-card,
  .admin-modal-card {
    width: min(360px, calc(100vw - 16px));
    max-height: min(620px, calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    overflow: auto;
    overscroll-behavior: contain;
  }

  .notification-popover {
    position: absolute;
    left: 8px !important;
    right: 8px !important;
    top: calc(100% + 8px) !important;
    width: auto !important;
    max-height: min(78dvh, calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    padding: 12px;
    border-radius: 16px;
  }

  #teacherHistoryCard .history-entry summary {
    align-items: start;
  }

  #teacherHistoryCard .history-detail strong,
  #teacherHistoryCard .history-main span,
  #teacherHistoryCard .calendar-detail-grid strong,
  #teacherHistoryCard .calendar-selected-detail strong,
  .settings-copy span,
  .teacher-news-copy span,
  .profile-item strong,
  .profile-item span {
    overflow-wrap: anywhere;
  }
}
.system-health {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.system-health span,
.onboarding-checklist span {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.system-health span.ok,
.onboarding-checklist span.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.system-health span.bad { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.onboarding-checklist { display: grid; gap: 10px; }
.onboarding-checklist > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.help-center { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-soft); }
.help-center summary { cursor: pointer; }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 13px; }
.help-grid article { display: grid; gap: 4px; padding: 12px; border-radius: 12px; background: var(--panel); }
.help-grid span { color: var(--muted); font-size: 0.84rem; }
.maintenance-panel {
  display: grid;
  gap: 18px;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
}

.maintenance-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand) 16%, transparent), transparent 48%),
    radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 30%);
  pointer-events: none;
}

.maintenance-panel > * {
  position: relative;
  z-index: 1;
}

.maintenance-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.maintenance-brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(6, 93, 180, 0.22));
}

.maintenance-brand span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.maintenance-brand strong {
  display: block;
  font-size: 1.08rem;
}

.maintenance-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 32%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 10%, var(--panel));
  color: var(--brand);
  font-weight: 900;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.maintenance-panel h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1;
}

.maintenance-panel p {
  max-width: 62ch;
}

.maintenance-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.maintenance-status-grid span {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.maintenance-status-grid strong {
  color: var(--ink);
  font-size: 1rem;
}

.maintenance-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.maintenance-meta span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
}

.maintenance-contact {
  padding: 12px 14px;
  border-left: 4px solid var(--brand);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--ink);
  font-weight: 800;
}

.maintenance-powered {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding-top: 6px;
  color: var(--muted);
  text-align: center;
}

.maintenance-powered span {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.maintenance-powered img {
  width: min(220px, 58vw);
  height: auto;
  filter: drop-shadow(0 12px 22px rgba(17, 25, 35, 0.18));
}

.maintenance-coming-soon {
  display: grid;
  gap: 10px;
}

.maintenance-coming-soon-track {
  display: grid;
  min-height: 0;
}

.maintenance-coming-soon-card {
  display: none;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 9%, var(--panel));
  animation: maintenanceSlideIn 240ms ease both;
}

.maintenance-coming-soon-card.active {
  display: grid;
}

.maintenance-coming-soon-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.maintenance-coming-soon-dot {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 42%, transparent);
  padding: 0;
  min-height: 0;
  cursor: pointer;
}

.maintenance-coming-soon-dot.active {
  width: 22px;
  background: var(--brand);
}

@keyframes maintenanceSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.maintenance-coming-soon-card strong {
  color: var(--ink);
  font-size: 0.95rem;
  text-transform: uppercase;
}

.maintenance-coming-soon-card span {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
  white-space: pre-line;
}

.maintenance-coming-soon-images,
.feature-update-media {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  width: 100%;
}

.maintenance-coming-soon-images img,
.feature-update-media img {
  width: 100%;
  height: 128px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  box-shadow: 0 10px 22px rgba(17, 25, 35, 0.08);
}
