/* Enterprise polish layer */
:root {
  --brand-primary: #155eef;
  --brand-secondary: #008f6b;
  --brand-accent: #7a5af8;
  --bg-base: #080c14;
  --bg-surface: #0d1320;
  --bg-card: #111827;
  --bg-card-hover: #151f31;
  --bg-input: #0f1724;
  --bg-nav: rgba(8, 12, 20, 0.88);
  --bg-sidebar: #0a0f19;
  --text-primary: #f8fafc;
  --text-secondary: #a8b3c7;
  --text-muted: #67738a;
  --text-inverse: #ffffff;
  --border-color: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(226, 232, 240, 0.22);
  --border-focus: #155eef;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.36);
  --shadow-glow: 0 18px 70px rgba(21, 94, 239, 0.12);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-emphasis: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 180ms var(--ease-standard);
  --transition-slow: 420ms var(--ease-emphasis);
}

body.light-mode {
  --bg-base: #f6f8fb;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #ffffff;
  --bg-nav: rgba(255, 255, 255, 0.9);
  --bg-sidebar: #ffffff;
  --text-primary: #101828;
  --text-secondary: #475467;
  --text-muted: #667085;
  --text-inverse: #ffffff;
  --border-color: #e4e7ec;
  --border-strong: #d0d5dd;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 10px 28px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.14);
  --shadow-glow: 0 20px 72px rgba(21, 94, 239, 0.08);
}

html { background: var(--bg-base); }

body {
  letter-spacing: 0;
  background:
    linear-gradient(180deg, rgba(21, 94, 239, 0.07), transparent 340px),
    var(--bg-base);
}

body.light-mode {
  background:
    linear-gradient(180deg, rgba(21, 94, 239, 0.05), transparent 360px),
    var(--bg-base);
}

.page {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 360ms var(--ease-emphasis), transform 360ms var(--ease-emphasis);
}

.page.active {
  opacity: 1;
  transform: translateY(0);
}

.page.page-exit {
  opacity: 0;
  transform: translateY(-8px);
}

.landing-nav,
.topbar {
  background: var(--bg-nav);
  backdrop-filter: blur(18px) saturate(1.15);
}

.landing-nav {
  height: 76px;
  padding: 0 clamp(20px, 4vw, 56px);
}

.nav-logo,
.sidebar-logo,
.footer-logo {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(21, 94, 239, 0.14);
}

body.light-mode .nav-logo,
body.light-mode .sidebar-logo,
body.light-mode .footer-logo {
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.nav-logo img,
.sidebar-logo img,
.footer-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
  border-radius: inherit;
  filter: drop-shadow(0 12px 18px rgba(21, 94, 239, 0.2));
}

.login-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(21, 94, 239, 0.18);
  flex-shrink: 0;
  filter: drop-shadow(0 12px 18px rgba(21, 94, 239, 0.18));
}

body.light-mode .login-brand img {
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.nav-title,
.sb-title,
.breadcrumb,
.view-title,
.section-title,
.hero-title,
.login-title,
.login-form-header h2 {
  font-family: Inter, system-ui, sans-serif;
  letter-spacing: 0;
}

.hero {
  min-height: min(920px, 96vh);
  padding: 112px clamp(22px, 5vw, 72px) 70px;
  align-items: center;
  gap: clamp(28px, 5vw, 80px);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 36%;
  background: linear-gradient(180deg, transparent, var(--bg-base));
  pointer-events: none;
}

.hero-grid {
  opacity: 0.55;
  mask-image: linear-gradient(180deg, #000, transparent 82%);
}

.hero-glow {
  opacity: 0.65;
  filter: blur(110px);
}

.hero-content { max-width: 640px; }

.hero-badge,
.section-badge {
  border-radius: 999px;
  background: rgba(21, 94, 239, 0.1);
  color: #9cc2ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.light-mode .hero-badge,
body.light-mode .section-badge {
  color: #155eef;
  background: #eff4ff;
}

.hero-title {
  max-width: 760px;
  font-size: clamp(46px, 6.7vw, 88px);
  line-height: 0.96;
  font-weight: 800;
}

.hero-accent {
  background: linear-gradient(90deg, #8bb7ff 0%, #32d583 92%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-mode .hero-accent {
  background: linear-gradient(90deg, #155eef, #008f6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  max-width: 550px;
  font-size: 18px;
}

.btn-hero-primary,
.btn-primary,
.btn-login,
.btn-blue,
.btn-green,
.btn-red,
.btn-yellow {
  background: var(--brand-primary);
  box-shadow: var(--shadow-sm);
}

.btn-hero-primary:hover,
.btn-primary:hover,
.btn-login:hover,
.btn-blue:hover,
.btn-green:hover,
.btn-red:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(21, 94, 239, 0.22);
}

.btn-hero-secondary,
.btn-ghost,
.btn-outline,
.btn-theme-toggle,
.topbar-theme,
.topbar-notif,
.menu-toggle,
.topbar-user {
  background: color-mix(in srgb, var(--bg-card) 88%, transparent);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.dashboard-preview {
  width: min(470px, 42vw);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: previewFloat 7s var(--ease-emphasis) infinite alternate;
}

@keyframes previewFloat {
  from { transform: translate3d(0, 0, 0) rotate(-0.35deg); }
  to { transform: translate3d(0, -14px, 0) rotate(0.35deg); }
}

.features-section,
.how-section {
  padding: clamp(72px, 9vw, 120px) clamp(22px, 5vw, 72px);
}

.section-container { max-width: 1240px; }
.features-grid { gap: 18px; }

.feature-card,
.role-card,
.card,
.chart-container,
.settings-card,
.student-att-row,
.notif-item,
.table-wrapper,
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.feature-card,
.role-card,
.card,
.chart-container,
.settings-card {
  position: relative;
}

.feature-card:hover,
.card:hover,
.chart-container:hover,
.stat-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.app-content {
  background:
    radial-gradient(circle at 70% -12%, rgba(21, 94, 239, 0.12), transparent 32%),
    var(--bg-base);
}

body.light-mode .app-content {
  background:
    radial-gradient(circle at 70% -12%, rgba(21, 94, 239, 0.08), transparent 32%),
    var(--bg-base);
}

.sidebar {
  border-right: 1px solid var(--border-color);
  box-shadow: 18px 0 46px rgba(0, 0, 0, 0.12);
}

body.light-mode .sidebar {
  box-shadow: 18px 0 46px rgba(16, 24, 40, 0.04);
}

.sidebar-header { min-height: 76px; }
.sidebar-user { background: transparent; }

.sidebar-avatar,
.topbar-avatar,
.avatar-preview,
.user-avatar,
.sar-avatar {
  background: linear-gradient(135deg, #155eef, #008f6b);
  border-radius: 999px;
}

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  color: #fff;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.floor-management-shell {
  display: grid;
  gap: 16px;
}

.floor-block-selector-panel,
.floor-block-overview {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.floor-block-selector-panel {
  padding: 16px;
}

.floor-block-selector-head,
.floor-block-overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.floor-block-selector-head {
  margin-bottom: 14px;
}

.floor-block-selector-head h3,
.floor-block-overview-head h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 760;
}

.floor-block-overview-head p {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 14px;
}

.floor-block-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.floor-block-card {
  width: 100%;
  min-height: 92px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.floor-block-card:hover,
.floor-block-card.active {
  transform: translateY(-1px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-sm);
}

.floor-block-card.active {
  background: color-mix(in srgb, var(--blue-bg) 62%, var(--bg-card));
}

.floor-block-code {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(21, 94, 239, 0.14);
  color: #7fb0ff;
  font-weight: 800;
  font-size: 15px;
}

.floor-block-card-copy strong,
.floor-block-card-copy small {
  display: block;
}

.floor-block-card-copy strong {
  font-size: 16px;
}

.floor-block-card-copy small {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.floor-empty-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.floor-block-overview {
  padding: 18px;
  margin-bottom: 14px;
}

.floor-block-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.floor-block-kpi {
  min-width: 0;
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.floor-block-kpi strong,
.floor-block-kpi span {
  display: block;
}

.floor-block-kpi strong {
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1;
}

.floor-block-kpi span {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.floor-management-table tbody td {
  vertical-align: middle;
}

.floor-row-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.floor-row-number {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(21, 94, 239, 0.14);
  color: #7fb0ff;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}

.floor-row-title strong {
  display: block;
  color: var(--text-primary);
}

.floor-row-sub {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.floor-warden-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.floor-warden-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

.notifications-summary-panel,
.notification-block-card {
  background: color-mix(in srgb, var(--bg-card) 84%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  backdrop-filter: blur(24px) saturate(1.2);
  border-radius: var(--radius-lg);
}

body.light-mode .notifications-summary-panel,
body.light-mode .notification-block-card {
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow:
    0 14px 32px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.notifications-summary-panel {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.notifications-summary-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.notifications-summary-card {
  min-width: 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--bg-surface) 84%, transparent);
  border: 1px solid var(--border-color);
}

.notifications-summary-card span,
.notifications-summary-card strong,
.notifications-summary-card small {
  display: block;
}

.notifications-summary-card span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.notifications-summary-card strong {
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
  color: var(--text-primary);
}

.notifications-summary-card small {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.notifications-summary-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.notifications-shell {
  display: grid;
  gap: 16px;
}

.notification-block-card {
  padding: 18px;
}

.notification-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.notification-block-title {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 760;
}

.notification-block-subtitle {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.notification-block-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notification-list-stack {
  display: grid;
  gap: 10px;
}

.notif-item {
  margin-bottom: 0;
}

.notif-item.is-read {
  opacity: 0.9;
}

.notif-card-head,
.notif-footer-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.notif-context-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.notif-status-col {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.notif-read-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.notif-read-label.unread {
  color: #7fb0ff;
  background: rgba(21, 94, 239, 0.12);
  border-color: rgba(21, 94, 239, 0.18);
}

body.light-mode .notif-read-label {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.08);
}

.notif-footer-row {
  margin-top: 12px;
  align-items: center;
}

.notif-student-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

body.light-mode .notif-student-chip {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.08);
}

.badge-muted {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

body.light-mode .badge-muted {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.08);
}

@media (max-width: 920px) {
  .floor-block-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notifications-summary-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .notifications-summary-grid {
    grid-template-columns: 1fr;
  }

  .notifications-summary-actions {
    justify-content: stretch;
  }

  .notifications-summary-actions .btn {
    flex: 1 1 220px;
    justify-content: center;
  }
}

@media (max-width: 620px) {
  .floor-block-selector-head,
  .floor-block-overview-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .floor-block-kpis {
    grid-template-columns: 1fr;
  }

  .notification-block-head,
  .notif-card-head,
  .notif-footer-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .notif-status-col {
    align-items: flex-start;
  }
}

/* Notifications workspace refinement */
.notifications-workspace {
  display: grid;
  grid-template-columns: minmax(340px, 410px) minmax(0, 1fr);
  gap: 18px;
  height: clamp(560px, calc(100dvh - 320px), 780px);
  min-height: 0;
}

.notifications-side-column {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
}

.notifications-summary-panel,
.notifications-stats-panel,
.notifications-feed-panel {
  overflow: hidden;
}

.notifications-summary-panel {
  margin-bottom: 0;
}

.notifications-stats-panel,
.notifications-feed-panel {
  background: color-mix(in srgb, var(--bg-card) 84%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  backdrop-filter: blur(24px) saturate(1.2);
  border-radius: var(--radius-lg);
}

body.light-mode .notifications-stats-panel,
body.light-mode .notifications-feed-panel {
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow:
    0 14px 32px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.notifications-stats-panel {
  min-height: 0;
  padding: 18px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.notifications-panel-head,
.notifications-feed-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.notifications-panel-title {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 760;
}

.notifications-panel-subtitle {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.notification-scope-grid {
  display: grid;
  gap: 10px;
  max-height: 210px;
  overflow-y: auto;
  padding-right: 4px;
}

.notification-scope-card {
  width: 100%;
  padding: 14px;
  text-align: left;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--bg-surface) 84%, transparent);
  border: 1px solid var(--border-color);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.notification-scope-card:hover,
.notification-scope-card.active {
  transform: translateY(-1px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-sm);
}

.notification-scope-card strong,
.notification-scope-card span,
.notification-scope-card small {
  display: block;
}

.notification-scope-card strong {
  color: var(--text-primary);
  font-size: 14px;
}

.notification-scope-card span {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 12px;
}

.notification-scope-card small {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
}

.notification-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.notification-mini-card {
  padding: 14px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--bg-surface) 84%, transparent);
  border: 1px solid var(--border-color);
}

.notification-mini-card span,
.notification-mini-card strong {
  display: block;
}

.notification-mini-card span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.notification-mini-card strong {
  margin-top: 8px;
  color: var(--text-primary);
  font-size: 28px;
  line-height: 1;
}

.notification-mini-card.tone-red { box-shadow: inset 0 3px 0 rgba(239, 68, 68, 0.78); }
.notification-mini-card.tone-yellow { box-shadow: inset 0 3px 0 rgba(245, 158, 11, 0.78); }
.notification-mini-card.tone-blue { box-shadow: inset 0 3px 0 rgba(59, 130, 246, 0.78); }
.notification-mini-card.tone-green { box-shadow: inset 0 3px 0 rgba(34, 197, 94, 0.78); }

.notifications-insight-block {
  display: grid;
  gap: 10px;
}

.notifications-section-title {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 720;
}

.notifications-warden-list,
.notifications-history-list {
  display: grid;
  gap: 10px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.notifications-warden-row,
.notifications-history-row {
  padding: 12px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--bg-surface) 84%, transparent);
  border: 1px solid var(--border-color);
}

.notifications-warden-main,
.notifications-warden-metrics,
.notifications-history-row > div,
.notifications-history-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notifications-warden-main strong,
.notifications-history-row strong {
  color: var(--text-primary);
  font-size: 13px;
}

.notifications-warden-main span,
.notifications-warden-metrics small,
.notifications-history-row span,
.notifications-history-meta small {
  color: var(--text-muted);
  font-size: 12px;
}

.notifications-warden-metrics {
  margin-top: 10px;
}

.notifications-warden-metrics span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.notifications-date-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.notifications-date-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

body.light-mode .notifications-date-chips span {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.08);
}

.notifications-empty-line {
  padding: 12px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--bg-surface) 84%, transparent);
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
  font-size: 12px;
}

.notifications-feed-panel {
  min-height: 0;
  padding: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}

.notifications-feed-scroll {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 14px;
  padding-right: 4px;
}

.notification-block-card {
  padding: 16px;
}

.notification-list-stack {
  display: grid;
  gap: 10px;
}

@media (max-width: 1180px) {
  .notifications-workspace {
    grid-template-columns: 1fr;
    height: auto;
  }

  .notifications-side-column {
    grid-template-rows: auto;
  }

  .notifications-feed-panel {
    max-height: none;
  }

  .notifications-feed-scroll,
  .notification-scope-grid,
  .notifications-warden-list,
  .notifications-history-list {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .notification-mini-grid {
    grid-template-columns: 1fr;
  }

  .notifications-panel-head,
  .notifications-feed-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

.profile-image-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.profile-image-hint {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 8px;
}

.settings-console {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.settings-profile-panel,
.settings-main-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.settings-profile-panel {
  position: sticky;
  top: 18px;
  overflow: hidden;
}

.settings-profile-cover {
  height: 76px;
  background:
    linear-gradient(135deg, rgba(21, 94, 239, 0.9), rgba(0, 143, 107, 0.75)),
    var(--brand-primary);
}

.settings-profile-body {
  padding: 0 22px 22px;
}

.settings-profile-avatar {
  margin-top: -36px;
  margin-bottom: 14px;
}

.settings-profile-name {
  font-size: 18px;
  font-weight: 750;
  color: var(--text-primary);
}

.settings-profile-meta {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 3px;
}

.settings-profile-facts {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

.settings-fact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 13px;
}

.settings-fact span:first-child {
  color: var(--text-muted);
}

.settings-fact span:last-child {
  color: var(--text-primary);
  font-weight: 650;
  text-align: right;
}

.settings-main-panel {
  overflow: hidden;
}

.settings-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border-color);
}

.settings-panel-title {
  font-size: 18px;
  font-weight: 750;
  color: var(--text-primary);
}

.settings-panel-desc {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}

.settings-panel-section {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border-color);
}

.settings-panel-section:last-child {
  border-bottom: 0;
}

.settings-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.settings-section-heading h3 {
  font-size: 14px;
  font-weight: 750;
  color: var(--text-primary);
}

.settings-section-heading p {
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-muted);
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.settings-inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.settings-danger-row {
  background: color-mix(in srgb, var(--red-bg) 45%, transparent);
}

.student-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.student-directory-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.student-directory-card:hover,
.student-directory-card.active {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.student-directory-card.active {
  box-shadow: inset 3px 0 0 var(--brand-primary), var(--shadow-md);
}

.student-directory-title {
  font-size: 17px;
  font-weight: 750;
  color: var(--text-primary);
}

.student-directory-meta {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.student-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.student-detail-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

.student-detail-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.student-detail-value {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
}

.attendance-range-panel {
  display: none;
  border-top: 1px solid var(--border-color);
  margin-top: 18px;
  padding-top: 18px;
}

.attendance-range-panel.open {
  display: block;
}

.attendance-range-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.command-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 16px;
  margin-bottom: 18px;
}

.command-hero {
  background:
    linear-gradient(135deg, rgba(21, 94, 239, 0.16), rgba(0, 143, 107, 0.08)),
    var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.command-eyebrow {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.command-title {
  color: var(--text-primary);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 820;
  line-height: 1.08;
}

.command-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 10px;
  max-width: 720px;
}

.command-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.command-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.signal-list {
  display: grid;
  gap: 10px;
}

.signal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.signal-title {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}

.signal-meta {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.risk-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex-shrink: 0;
}

.risk-dot.green { background: var(--green); }
.risk-dot.yellow { background: var(--yellow); }
.risk-dot.red { background: var(--red); }
.risk-dot.blue { background: var(--blue); }

.dashboard-rank {
  display: grid;
  gap: 10px;
}

.dashboard-rank-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.dashboard-rank-row:last-child {
  border-bottom: 0;
}

.rank-number {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--blue-bg);
  color: var(--brand-primary);
  font-weight: 800;
  font-size: 12px;
}

@media (max-width: 920px) {
  .command-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .student-detail-grid,
  .attendance-range-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .settings-console {
    grid-template-columns: 1fr;
  }

  .settings-profile-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  .settings-panel-header,
  .settings-panel-section {
    padding: 18px;
  }

  .settings-form-grid {
    grid-template-columns: 1fr;
  }

  .settings-inline-row,
  .settings-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

.nav-section-label {
  margin-top: 8px;
  letter-spacing: 0.1em;
}

.nav-item {
  min-height: 42px;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}

.nav-item:hover { transform: translateX(2px); }

.nav-item.active {
  background: rgba(21, 94, 239, 0.12);
  color: #7fb0ff;
}

body.light-mode .nav-item.active { color: #155eef; }

.nav-item.active::before {
  left: -10px;
  top: 9px;
  bottom: 9px;
  width: 4px;
}

.topbar {
  height: 76px;
  padding: 0 28px;
}

.breadcrumb {
  font-size: 17px;
  font-weight: 700;
}

.main-content {
  padding: clamp(22px, 3vw, 36px);
  scroll-behavior: smooth;
}

.view {
  opacity: 0;
  transform: translateY(8px);
}

.view.active {
  opacity: 1;
  transform: translateY(0);
}

.view.view-loading { opacity: 0.86; }
.view.view-ready { animation: viewShellIn 360ms var(--ease-emphasis) both; }
.view.view-ready > * { animation: viewContentIn 520ms var(--ease-emphasis) both; }
.view.view-ready > *:nth-child(2) { animation-delay: 55ms; }
.view.view-ready > *:nth-child(3) { animation-delay: 90ms; }
.view.view-ready > *:nth-child(4) { animation-delay: 125ms; }

@keyframes viewShellIn {
  from { opacity: 0.72; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes viewContentIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-header {
  align-items: flex-end;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
}

.view-title {
  font-size: clamp(24px, 2vw, 30px);
  font-weight: 760;
}

.view-subtitle { color: var(--text-secondary); }
.stats-grid { gap: 14px; }

.stat-card {
  min-height: 164px;
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.stat-card::before { height: 2px; }

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  margin-bottom: 18px;
}

.stat-value {
  font-family: Inter, system-ui, sans-serif;
  font-size: 34px;
  letter-spacing: 0;
}

.stat-label { color: var(--text-secondary); }

.chart-container,
.card {
  padding: 22px;
}

.card-header {
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
}

.card-title,
.chart-title {
  font-size: 15px;
  letter-spacing: 0;
}

.table-wrapper {
  border-radius: var(--radius-lg);
  overflow: auto;
}

thead tr {
  background: color-mix(in srgb, var(--bg-surface) 86%, var(--bg-card));
}

thead th {
  padding: 12px 16px;
  font-size: 11px;
  letter-spacing: 0.04em;
}

tbody td { padding: 15px 16px; }

tbody tr {
  transition: background var(--transition), box-shadow var(--transition);
}

tbody tr:hover {
  background: var(--bg-card-hover);
  box-shadow: inset 3px 0 0 var(--brand-primary);
}

.form-input,
.form-select,
.form-textarea,
.search-input {
  min-height: 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.search-input:focus {
  border-color: rgba(21, 94, 239, 0.66);
  box-shadow: 0 0 0 4px rgba(21, 94, 239, 0.12);
}

.btn,
.btn-primary,
.btn-hero-primary,
.btn-hero-secondary,
.btn-login,
.tab-btn,
.att-btn {
  border-radius: var(--radius-md);
  transition:
    transform var(--transition),
    color var(--transition),
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}

.btn:active,
.btn-primary:active,
.btn-hero-primary:active,
.btn-hero-secondary:active,
.btn-login:active {
  transform: translateY(0);
}

.badge,
.role-tag,
.role-badge,
.notif-badge,
.topbar-notif-count,
.rgh-count,
.pli-badge {
  border-radius: 999px;
}

.progress-bar-wrap {
  height: 7px;
  background: color-mix(in srgb, var(--border-color) 76%, transparent);
}

.progress-bar { transition: width 900ms var(--ease-emphasis); }

.toast {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: toastIn 360ms var(--ease-emphasis);
}

@keyframes toastIn {
  from { opacity: 0; transform: translate3d(18px, 8px, 0) scale(0.98); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.modal-overlay.open { animation: overlayIn 220ms ease both; }
.modal-box { animation: modalRise 340ms var(--ease-emphasis); }

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalRise {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.loading-state { min-height: 260px; }
.spinner { border-top-color: var(--brand-primary); }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 1024px) {
  .dashboard-preview { width: min(430px, 86vw); }
  .hero { min-height: auto; }
}

@media (max-width: 768px) {
  .landing-nav,
  .topbar {
    height: 68px;
  }

  .hero-title {
    font-size: clamp(42px, 13vw, 62px);
  }

  .hero-stats {
    gap: 20px;
  }

  .main-content {
    padding: 20px 16px;
  }

  .view-header {
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .hero-stats {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  .hero-stat-divider {
    display: none;
  }

  .stats-grid,
  .stats-grid-4,
  .stats-grid-3,
  .stats-grid-2 {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 138px;
  }

  .toast-container {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}

/* Responsive hardening */
body,
.app-content,
.main-content,
.modal-box,
.card,
.chart-container,
.settings-main-panel,
.settings-profile-panel,
.table-wrapper {
  min-width: 0;
}

.view-title,
.card-title,
.chart-title,
.settings-panel-title,
.student-directory-title,
.student-detail-value,
.topbar-user-name,
.sidebar-user-name,
td,
th {
  overflow-wrap: anywhere;
}

.topbar-left,
.topbar-right,
.view-header,
.view-actions,
.filter-bar,
.table-actions {
  min-width: 0;
}

.breadcrumb {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(44vw, 520px);
}

.table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrapper table {
  min-width: 760px;
}

.table-wrapper::after {
  content: "";
  position: sticky;
  right: 0;
  display: block;
  width: 1px;
  height: 1px;
}

.form-input,
.form-select,
.form-textarea,
.search-input,
.btn,
.btn-primary,
.btn-hero-primary,
.btn-hero-secondary {
  max-width: 100%;
}

.form-group,
.input-wrapper,
.search-input-wrapper {
  min-width: 0;
}

.modal-overlay {
  padding: clamp(10px, 3vw, 20px);
}

.modal-box {
  width: min(100%, 720px);
}

#modal-body {
  max-width: 100%;
}

#modal-body [style*="grid-template-columns:1fr 1fr"],
#modal-body [style*="grid-template-columns: 1fr 1fr"],
#modal-body [style*="grid-template-columns:repeat(2"],
#modal-body [style*="grid-template-columns: repeat(2"] {
  min-width: 0;
}

@media (max-width: 1100px) {
  .hero {
    gap: 34px;
  }

  .dashboard-preview {
    width: min(420px, 88vw);
  }

  .stats-grid-4,
  .stats-grid[style*="repeat(4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .charts-grid,
  .charts-grid-equal,
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 860px) {
  :root {
    --sidebar-width: min(300px, 86vw);
    --topbar-height: 68px;
  }

  #app-page {
    min-height: 100dvh;
    height: 100dvh;
  }

  .sidebar {
    width: var(--sidebar-width);
    max-width: 86vw;
  }

  .topbar {
    gap: 10px;
    padding: 0 14px;
  }

  .topbar-right {
    gap: 8px;
  }

  .topbar-user {
    padding: 4px;
  }

  .topbar-user > div:not(.topbar-avatar) {
    display: none;
  }

  .breadcrumb {
    max-width: 50vw;
    font-size: 15px;
  }

  .main-content {
    padding: 18px 14px;
  }

  .view-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .view-actions {
    width: 100%;
  }

  .view-actions .btn,
  .filter-bar .btn {
    justify-content: center;
  }

  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-bar .form-select,
  .filter-bar select,
  .filter-bar .btn,
  .search-input-wrapper {
    width: 100% !important;
    min-width: 0;
  }

  .student-directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-nav {
    height: 66px;
    padding: 0 14px;
  }

  .nav-subtitle,
  .topbar-user-role {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 92px 16px 48px;
  }

  .hero-title {
    font-size: clamp(38px, 11vw, 58px);
  }

  .hero-desc {
    font-size: 16px;
  }

  .features-section,
  .how-section {
    padding: 54px 16px;
  }

  .login-right {
    min-height: 100dvh;
    padding: 34px 18px;
  }
}

@media (max-width: 640px) {
  .main-content {
    padding: 14px 10px;
  }

  .card,
  .chart-container,
  .settings-main-panel,
  .settings-profile-panel,
  .student-directory-card {
    border-radius: 8px;
  }

  .card,
  .chart-container {
    padding: 16px;
  }

  .card-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .view-title {
    font-size: 22px;
  }

  .view-subtitle,
  .card-subtitle,
  .settings-panel-desc {
    font-size: 12px;
  }

  .stats-grid,
  .stats-grid-4,
  .stats-grid-3,
  .stats-grid-2,
  .stats-grid[style*="repeat(4"],
  .stats-grid[style*="repeat(3"],
  .stats-grid[style*="repeat(2"] {
    grid-template-columns: 1fr !important;
  }

  .stat-card {
    min-height: 118px;
    padding: 16px;
  }

  .stat-value {
    font-size: 30px;
  }

  .student-directory-grid {
    grid-template-columns: 1fr;
  }

  .student-directory-card {
    padding: 15px;
    text-align: left;
  }

  .settings-profile-body,
  .settings-panel-header,
  .settings-panel-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .profile-image-actions,
  .view-actions {
    gap: 8px;
  }

  .view-actions .btn {
    flex: 1 1 160px;
  }

  .btn {
    min-height: 38px;
  }

  .btn-icon {
    min-width: 38px;
  }

  .modal-overlay {
    align-items: stretch;
    padding: 8px;
  }

  .modal-box {
    max-height: calc(100dvh - 16px);
    border-radius: 10px;
  }

  .modal-header {
    padding: 16px;
    gap: 10px;
  }

  .modal-header h3 {
    font-size: 16px;
    line-height: 1.25;
  }

  #modal-body {
    padding: 16px;
  }

  #modal-body [style*="grid-template-columns:1fr 1fr"],
  #modal-body [style*="grid-template-columns: 1fr 1fr"],
  #modal-body [style*="grid-template-columns:repeat(2"],
  #modal-body [style*="grid-template-columns: repeat(2"] {
    grid-template-columns: 1fr !important;
  }

  #modal-body [style*="justify-content:flex-end"],
  #modal-body [style*="justify-content: flex-end"] {
    justify-content: stretch !important;
    flex-wrap: wrap;
  }

  #modal-body [style*="justify-content:flex-end"] .btn,
  #modal-body [style*="justify-content: flex-end"] .btn {
    flex: 1 1 140px;
    justify-content: center;
  }

  .table-wrapper {
    border-radius: 8px;
  }

  .table-wrapper table {
    min-width: 680px;
  }

  thead th,
  tbody td {
    padding: 11px 12px;
    font-size: 13px;
  }

  .student-att-row {
    align-items: flex-start;
  }

  .sar-actions,
  .att-btn-group {
    width: 100%;
  }

  .att-btn-group .att-btn,
  .sar-actions .btn {
    flex: 1 1 110px;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .landing-nav .nav-title,
  .sidebar-brand .sb-title {
    font-size: 13px;
  }

  .nav-logo,
  .sidebar-logo {
    width: 32px;
    height: 32px;
  }

  .breadcrumb {
    max-width: 42vw;
  }

  .topbar-theme,
  .topbar-notif,
  .menu-toggle {
    width: 34px;
    height: 34px;
  }

  .hero-cta,
  .nav-actions {
    width: 100%;
  }

  .hero-cta .btn-hero-primary,
  .hero-cta .btn-hero-secondary {
    width: 100%;
    justify-content: center;
  }

  .hero-stats {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-stat {
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
  }

  .dashboard-preview {
    width: 100%;
  }

  .preview-stat-row {
    grid-template-columns: 1fr;
  }

  .table-wrapper table {
    min-width: 620px;
  }

  .toast-container {
    left: 8px;
    right: 8px;
  }
}

.attendance-browser {
  --attendance-browser-height: clamp(420px, calc(100dvh - 250px), 740px);
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(220px, 0.75fr) minmax(0, 1.5fr);
  gap: 14px;
  align-items: stretch;
  min-height: 0;
}

.attendance-browser.compact {
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
}

.attendance-step-panel,
.attendance-workspace,
.account-profile-card,
.account-settings-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.attendance-step-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 14px;
  min-height: var(--attendance-browser-height);
  max-height: var(--attendance-browser-height);
  height: var(--attendance-browser-height);
  overflow: hidden;
}

.attendance-results-panel {
  min-height: var(--attendance-browser-height);
  height: var(--attendance-browser-height);
}

.attendance-scroll-area {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.attendance-results-shell {
  overflow: hidden;
  padding-right: 0;
}

.attendance-scroll-area::-webkit-scrollbar,
.attendance-rows-scroll::-webkit-scrollbar {
  width: 8px;
}

.attendance-scroll-area::-webkit-scrollbar-thumb,
.attendance-rows-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--border-color) 72%, transparent);
  border-radius: 999px;
}

.attendance-scroll-area::-webkit-scrollbar-track,
.attendance-rows-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.attendance-step-head,
.attendance-workspace-head,
.account-section-head,
.account-toggle-row,
.account-avatar-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.attendance-step-head {
  margin-bottom: 12px;
}

.attendance-step-head h3,
.attendance-workspace-head h3,
.account-section-head h3,
.account-toggle-row h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 760;
}

.attendance-step-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.attendance-picker-grid {
  display: grid;
  gap: 9px;
}

.attendance-picker-card {
  width: 100%;
  min-height: 82px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.attendance-picker-card:hover,
.attendance-picker-card.active {
  transform: translateY(-1px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-sm);
}

.attendance-picker-card.active {
  background: color-mix(in srgb, var(--blue-bg) 65%, var(--bg-card));
  box-shadow: inset 3px 0 0 var(--brand-primary), var(--shadow-sm);
}

.attendance-picker-card strong,
.attendance-picker-card small,
.picker-kicker {
  display: block;
}

.attendance-picker-card strong {
  font-size: 16px;
  margin: 4px 0 3px;
}

.attendance-picker-card small,
.picker-kicker {
  color: var(--text-muted);
  font-size: 12px;
}

.attendance-workspace {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  padding: 14px;
}

.attendance-summary-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.attendance-summary-row > div {
  min-width: 0;
  padding: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.attendance-summary-row strong,
.attendance-summary-row span {
  display: block;
}

.attendance-summary-row strong {
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1;
}

.attendance-summary-row span {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 5px;
}

.attendance-summary-row .ok {
  border-color: color-mix(in srgb, var(--green) 35%, var(--border-color));
}

.attendance-summary-row .warn {
  border-color: color-mix(in srgb, var(--yellow) 35%, var(--border-color));
}

.attendance-summary-row .danger {
  border-color: color-mix(in srgb, var(--red) 35%, var(--border-color));
}

.attendance-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.attendance-rows-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

#view-attendance.active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
}

#view-attendance .attendance-browser,
#view-attendance .attendance-browser.compact {
  min-height: 0;
  height: 100%;
}

.attendance-filter-chipset {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-room-block {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 10px;
  background: var(--bg-card);
}

.admin-room-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 13px;
}

.admin-room-head strong {
  color: var(--text-primary);
}

.admin-attendance-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-color);
}

.admin-attendance-row:last-child {
  border-bottom: 0;
}

.account-settings-shell {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  max-width: 1120px;
}

.account-profile-card {
  padding: 16px;
  position: sticky;
  top: 16px;
}

.account-avatar-row {
  justify-content: flex-start;
}

.settings-avatar-compact {
  flex: 0 0 auto;
}

.account-profile-name {
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 780;
  line-height: 1.2;
}

.account-profile-meta {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 3px;
}

.account-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.account-mini-facts {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.account-mini-facts > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.account-mini-facts span {
  color: var(--text-muted);
}

.account-mini-facts strong {
  color: var(--text-primary);
  text-align: right;
}

.account-settings-panel {
  overflow: hidden;
}

.account-panel-section {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-color);
}

.account-panel-section:last-child {
  border-bottom: 0;
}

.account-panel-section.slim {
  padding-top: 13px;
  padding-bottom: 13px;
}

.account-panel-section.danger {
  background: color-mix(in srgb, var(--red-bg) 42%, transparent);
}

.account-section-head {
  align-items: center;
  margin-bottom: 13px;
}

.account-section-head p,
.account-toggle-row p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.account-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-form-grid.password-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.account-field {
  display: grid;
  gap: 6px;
}

.account-field span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
}

.account-field.readonly input {
  color: var(--text-muted);
  background: var(--bg-surface);
}

.profile-page-shell {
  max-width: 1080px;
}

.profile-hero-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.profile-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--border-color);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue-bg) 58%, transparent), transparent 52%),
    var(--bg-card);
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.profile-avatar-xl {
  flex: 0 0 auto;
}

.profile-eyebrow {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.profile-identity h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
  font-weight: 820;
  letter-spacing: 0;
}

.profile-username {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 5px;
}

.profile-role-line {
  margin-top: 10px;
}

.profile-edit-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: pointer;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.profile-edit-btn:hover {
  transform: translateY(-1px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-sm);
}

.profile-edit-btn svg {
  width: 18px;
  height: 18px;
}

.profile-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 22px;
}

.profile-info-card {
  min-width: 0;
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.profile-info-card span,
.profile-info-card strong {
  display: block;
}

.profile-info-card span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 680;
  margin-bottom: 7px;
}

.profile-info-card strong {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.profile-note-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--border-color);
}

.profile-note-row h3,
.profile-note-row p,
.profile-edit-section h3,
.profile-edit-section p {
  margin: 0;
}

.profile-note-row h3,
.profile-edit-section h3 {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 760;
}

.profile-note-row p,
.profile-edit-section p {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
}

.profile-edit-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 22px 22px;
}

.profile-photo-editor,
.profile-edit-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.profile-photo-editor {
  padding: 16px;
  display: grid;
  gap: 10px;
  align-content: start;
  text-align: center;
}

.profile-photo-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

.profile-photo-editor p {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.profile-edit-sections {
  display: grid;
  gap: 12px;
}

.profile-edit-section {
  padding: 16px;
}

.profile-edit-section-head,
.profile-edit-section.compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.profile-edit-section.compact-row {
  margin-bottom: 0;
}

.profile-edit-section.danger {
  background: color-mix(in srgb, var(--red-bg) 42%, var(--bg-surface));
}

.report-files-panel {
  margin-top: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.report-files-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
}

.report-file-form {
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 16px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
}

.report-file-list {
  display: grid;
}

.report-file-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
}

.report-file-item:last-child {
  border-bottom: 0;
}

.report-file-icon {
  width: 58px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  background: var(--brand-primary);
}

.report-file-icon.pdf {
  background: var(--red);
}

.report-file-icon.word {
  background: #2563eb;
}

.report-file-icon.excel {
  background: #059669;
}

.report-file-main {
  min-width: 0;
}

.report-file-title {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.report-file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 12px;
}

.report-file-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.report-file-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 1180px) {
  .attendance-browser {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .attendance-results-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  #view-attendance.active {
    display: block;
    height: auto;
  }

  .attendance-browser,
  .attendance-browser.compact,
  .account-settings-shell,
  .profile-edit-layout {
    grid-template-columns: 1fr;
  }

  .account-profile-card {
    position: static;
  }

  .attendance-toolbar,
  .profile-info-grid,
  .report-file-form,
  .account-form-grid,
  .account-form-grid.password-grid {
    grid-template-columns: 1fr;
  }

  .attendance-filter-chipset {
    justify-content: flex-start;
  }

  .attendance-step-panel,
  .attendance-results-panel {
    min-height: 0;
    max-height: none;
    height: auto;
  }

  .attendance-scroll-area,
  .attendance-rows-scroll,
  .attendance-results-shell {
    overflow: visible;
    padding-right: 0;
  }

  .attendance-workspace {
    height: auto;
    grid-template-rows: auto auto auto auto;
  }
}

@media (max-width: 560px) {
  .attendance-step-head,
  .attendance-workspace-head,
  .account-section-head,
  .account-toggle-row,
  .account-avatar-row,
  .report-files-header,
  .profile-hero-top,
  .profile-identity,
  .profile-note-row,
  .profile-edit-section-head,
  .profile-edit-section.compact-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .attendance-summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-attendance-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .admin-attendance-row .sar-status {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .account-photo-actions .btn,
  .account-section-head .btn,
  .account-toggle-row .btn,
  .report-file-form .btn,
  .profile-action-row,
  .profile-action-row .btn,
  .profile-note-row .btn,
  .profile-edit-section-head .btn,
  .profile-edit-section.compact-row .btn {
    width: 100%;
    justify-content: center;
  }

  .report-file-item {
    grid-template-columns: 52px minmax(0, 1fr);
    padding: 14px 16px;
  }

  .report-file-icon {
    width: 48px;
  }

  .report-file-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .report-file-actions .btn {
    flex: 1 1 130px;
    justify-content: center;
  }

  .profile-hero-top,
  .profile-info-grid,
  .profile-note-row,
  .profile-edit-layout {
    padding-left: 16px;
    padding-right: 16px;
  }

  .profile-edit-btn {
    align-self: flex-end;
  }
}

.hero-title-line {
  display: block;
  animation: heroLineReveal 880ms var(--ease-emphasis) both;
}

.hero-title-line:nth-child(2) {
  animation-delay: 120ms;
}

.hero-title-line:nth-child(3) {
  animation-delay: 220ms;
}

@keyframes heroLineReveal {
  from {
    opacity: 0;
    transform: translateY(22px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.hero-accent {
  background-size: 180% 180%;
  animation: accentFlow 7s linear infinite;
}

@keyframes accentFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-marquee {
  position: relative;
  overflow: hidden;
  margin: 0 0 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 11px 0;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

body.light-mode .hero-marquee {
  border-color: rgba(15, 23, 42, 0.08);
}

.hero-marquee-track {
  display: flex;
  gap: 14px;
  width: max-content;
  animation: heroMarquee 22s linear infinite;
}

.hero-marquee-track span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.hero-marquee-track span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #60a5fa, #32d583);
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.4);
}

@keyframes heroMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.hero-visual {
  min-height: 560px;
  align-items: center;
}

.hero-floating-note {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(15, 23, 41, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 650;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
}

body.light-mode .hero-floating-note {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.08);
}

.hero-floating-note-a {
  top: 8%;
  left: 8%;
  animation: floatingNoteA 6s ease-in-out infinite;
}

.hero-floating-note-b {
  top: 42%;
  right: -2%;
  animation: floatingNoteB 7s ease-in-out infinite;
}

.hero-floating-note-c {
  bottom: 11%;
  left: 0;
  animation: floatingNoteC 6.5s ease-in-out infinite;
}

.hero-floating-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.hero-floating-dot.green { background: #22c55e; }
.hero-floating-dot.blue { background: #3b82f6; }
.hero-floating-dot.yellow { background: #f59e0b; }

@keyframes floatingNoteA {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes floatingNoteB {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(12px, -10px, 0); }
}

@keyframes floatingNoteC {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(8px, -12px, 0); }
}

.preview-chart-mock .chart-bar-mock {
  animation: previewBars 3.6s var(--ease-emphasis) infinite alternate;
  transform-origin: bottom;
}

.preview-chart-mock .chart-bar-mock:nth-child(2) { animation-delay: 120ms; }
.preview-chart-mock .chart-bar-mock:nth-child(3) { animation-delay: 220ms; }
.preview-chart-mock .chart-bar-mock:nth-child(4) { animation-delay: 340ms; }
.preview-chart-mock .chart-bar-mock:nth-child(5) { animation-delay: 460ms; }
.preview-chart-mock .chart-bar-mock:nth-child(6) { animation-delay: 580ms; }
.preview-chart-mock .chart-bar-mock:nth-child(7) { animation-delay: 700ms; }

@keyframes previewBars {
  from { transform: scaleY(0.82); opacity: 0.8; }
  to { transform: scaleY(1.08); opacity: 1; }
}

.preview-list-item {
  animation: previewItemPulse 4.8s ease-in-out infinite;
}

.preview-list-item:nth-child(2) { animation-delay: 180ms; }
.preview-list-item:nth-child(3) { animation-delay: 320ms; }

@keyframes previewItemPulse {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}

.ops-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.ops-hero-card,
.ops-rail-card,
.ops-panel,
.ops-metric-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.ops-hero-card {
  padding: 28px;
  isolation: isolate;
}

.ops-hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(96, 165, 250, 0.22), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(16, 185, 129, 0.14), transparent 24%),
    linear-gradient(135deg, rgba(21, 94, 239, 0.12), transparent 48%);
  z-index: -1;
}

.ops-hero-card.block::before {
  background:
    radial-gradient(circle at 16% 16%, rgba(56, 189, 248, 0.18), transparent 28%),
    radial-gradient(circle at 84% 20%, rgba(34, 197, 94, 0.16), transparent 24%),
    linear-gradient(135deg, rgba(14, 159, 110, 0.12), transparent 56%);
}

.ops-hero-card.floor::before {
  background:
    radial-gradient(circle at 18% 18%, rgba(59, 130, 246, 0.18), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(245, 158, 11, 0.14), transparent 24%),
    linear-gradient(135deg, rgba(21, 94, 239, 0.1), transparent 56%);
}

.ops-kicker {
  color: #8fb7ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.ops-live-pill {
  position: absolute;
  top: 22px;
  right: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #dbeafe;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ops-live-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.52);
}

body.light-mode .ops-live-pill {
  background: rgba(255, 255, 255, 0.85);
  color: #155eef;
  border-color: rgba(15, 23, 42, 0.08);
}

.ops-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ops-title {
  margin: 0;
  max-width: 700px;
  color: var(--text-primary);
  font-size: clamp(30px, 4.2vw, 54px);
  line-height: 0.96;
  font-weight: 860;
}

.ops-date-chip {
  flex: 0 0 auto;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
}

body.light-mode .ops-date-chip {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.ops-copy {
  max-width: 760px;
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.72;
}

.ops-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.ops-hero-stat {
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

body.light-mode .ops-hero-stat {
  background: #fcfdff;
  border-color: #e4e7ec;
}

.ops-hero-stat span,
.ops-hero-stat strong,
.ops-hero-stat small {
  display: block;
}

.ops-hero-stat span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ops-hero-stat strong {
  color: var(--text-primary);
  font-size: 26px;
  line-height: 1.05;
  margin-top: 8px;
}

.ops-hero-stat small {
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 6px;
}

.ops-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.ops-marquee {
  position: relative;
  overflow: hidden;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.ops-marquee-track {
  display: flex;
  gap: 12px;
  width: max-content;
  animation: heroMarquee 26s linear infinite;
}

.ops-marquee-track span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
}

.ops-marquee-track span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #60a5fa, #32d583);
}

.ops-rail-card {
  padding: 18px;
}

.ops-rail-head,
.ops-panel-head,
.ops-progress-head,
.ops-signal-head,
.ops-feed-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.ops-rail-title {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 760;
}

.ops-rail-copy {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 3px;
}

.ops-rail-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--blue-bg);
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.ops-signal-stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.ops-signal-card {
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.ops-signal-title {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 760;
}

.ops-signal-meta,
.ops-signal-foot {
  color: var(--text-muted);
  font-size: 12px;
}

.ops-signal-foot {
  margin-top: 8px;
}

.ops-rail-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.ops-rail-score span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ops-rail-score strong {
  color: var(--text-primary);
  font-size: 28px;
  line-height: 1;
}

.ops-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.ops-metric-card {
  padding: 16px;
}

.ops-metric-card span,
.ops-metric-card strong,
.ops-metric-card small {
  display: block;
}

.ops-metric-card span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ops-metric-card strong {
  color: var(--text-primary);
  font-size: 34px;
  line-height: 1.02;
  margin-top: 10px;
}

.ops-metric-card small {
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 8px;
}

.ops-metric-card.tone-blue { box-shadow: inset 0 3px 0 rgba(59, 130, 246, 0.76); }
.ops-metric-card.tone-green { box-shadow: inset 0 3px 0 rgba(34, 197, 94, 0.76); }
.ops-metric-card.tone-red { box-shadow: inset 0 3px 0 rgba(239, 68, 68, 0.76); }
.ops-metric-card.tone-teal { box-shadow: inset 0 3px 0 rgba(45, 212, 191, 0.76); }
.ops-metric-card.tone-yellow { box-shadow: inset 0 3px 0 rgba(245, 158, 11, 0.76); }

.ops-main-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ops-panel {
  padding: 18px;
}

.ops-panel-wide {
  grid-column: 1 / -1;
}

.ops-chart-wrap {
  height: 320px;
  position: relative;
  margin-top: 14px;
}

.ops-chart-wrap.compact {
  height: 250px;
}

.ops-progress-list,
.ops-feed {
  display: grid;
  gap: 12px;
}

.ops-progress-row {
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.ops-progress-head strong {
  color: var(--text-primary);
  font-size: 14px;
}

.ops-progress-head span {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 760;
}

.ops-progress-meta {
  color: var(--text-muted);
  font-size: 12px;
  margin: 5px 0 9px;
}

.ops-feed-row {
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.ops-feed-date {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--blue-bg);
  color: var(--brand-primary);
  font-size: 11px;
  font-weight: 800;
}

.ops-feed-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.ops-feed-copy strong,
.ops-feed-copy span {
  display: block;
}

.ops-feed-copy strong {
  color: var(--text-primary);
  font-size: 14px;
}

.ops-feed-copy span {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 3px;
}

.ops-feed-note {
  max-width: 180px;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: right;
}

@media (max-width: 1180px) {
  .ops-shell {
    grid-template-columns: 1fr;
  }

  .ops-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .hero-floating-note-b {
    right: 6%;
  }
}

@media (max-width: 920px) {
  .ops-main-grid {
    grid-template-columns: 1fr;
  }

  .ops-hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-visual {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .hero-marquee {
    margin-bottom: 22px;
  }

  .hero-floating-note {
    position: static;
    margin-bottom: 10px;
  }

  .hero-visual {
    padding-top: 8px;
    display: grid;
    gap: 10px;
  }

  .ops-title-row,
  .ops-rail-head,
  .ops-signal-head,
  .ops-feed-row {
    flex-direction: column;
  }

  .ops-feed-note {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .ops-hero-card,
  .ops-rail-card,
  .ops-panel {
    padding: 16px;
  }

  .ops-live-pill {
    position: static;
    margin-bottom: 12px;
    align-self: flex-start;
  }

  .ops-title {
    font-size: clamp(28px, 10vw, 42px);
  }

  .ops-metric-grid {
    grid-template-columns: 1fr;
  }

  .ops-hero-stats {
    grid-template-columns: 1fr;
  }

  .ops-chart-wrap {
    height: 260px;
  }

  .hero-marquee-track,
  .ops-marquee-track {
    animation-duration: 30s;
  }
}

/* Glass refinement */
:root {
  --bg-surface: rgba(13, 19, 32, 0.7);
  --bg-card: rgba(17, 24, 39, 0.72);
  --bg-card-hover: rgba(22, 32, 49, 0.82);
  --bg-input: rgba(15, 23, 36, 0.66);
  --bg-nav: rgba(8, 12, 20, 0.62);
  --bg-sidebar: rgba(9, 14, 24, 0.6);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.16);
  --shadow-md: 0 16px 44px rgba(0, 0, 0, 0.22);
  --shadow-lg: 0 28px 74px rgba(0, 0, 0, 0.3);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 18px;
  --radius-xl: 26px;
}

body.light-mode {
  --bg-surface: rgba(255, 255, 255, 0.74);
  --bg-card: rgba(255, 255, 255, 0.76);
  --bg-card-hover: rgba(255, 255, 255, 0.88);
  --bg-input: rgba(255, 255, 255, 0.72);
  --bg-nav: rgba(255, 255, 255, 0.62);
  --bg-sidebar: rgba(255, 255, 255, 0.58);
  --border-color: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.18);
  --shadow-sm: 0 8px 28px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 16px 42px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 28px 72px rgba(15, 23, 42, 0.16);
}

.landing-nav,
.topbar,
.sidebar {
  -webkit-backdrop-filter: blur(28px) saturate(1.22);
  backdrop-filter: blur(28px) saturate(1.22);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(8, 12, 20, 0.82), rgba(8, 12, 20, 0.56));
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

body.light-mode .sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.62));
  border-right-color: rgba(15, 23, 42, 0.08);
}

.topbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

body.light-mode .topbar {
  border-bottom-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.sidebar-header,
.sidebar-user,
.sidebar-footer,
.view-header {
  border-color: rgba(255, 255, 255, 0.08);
}

body.light-mode .sidebar-header,
body.light-mode .sidebar-user,
body.light-mode .sidebar-footer,
body.light-mode .view-header {
  border-color: rgba(15, 23, 42, 0.08);
}

.btn,
.btn-primary,
.btn-hero-primary,
.btn-hero-secondary,
.btn-login,
.btn-icon,
.topbar-theme,
.topbar-notif,
.menu-toggle,
.topbar-user,
.btn-logout,
.nav-item,
.form-input,
.form-select,
.form-textarea,
.search-input,
.toggle-switch {
  border-radius: 16px;
}

.nav-item {
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  background: rgba(21, 94, 239, 0.15);
  border-color: rgba(127, 176, 255, 0.16);
}

body.light-mode .nav-item:hover {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.08);
}

.btn-hero-secondary,
.btn-ghost,
.btn-outline,
.btn-theme-toggle,
.topbar-theme,
.topbar-notif,
.menu-toggle,
.topbar-user,
.btn-logout {
  background: color-mix(in srgb, var(--bg-card) 82%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(20px) saturate(1.18);
  backdrop-filter: blur(20px) saturate(1.18);
}

body.light-mode .btn-hero-secondary,
body.light-mode .btn-ghost,
body.light-mode .btn-outline,
body.light-mode .btn-theme-toggle,
body.light-mode .topbar-theme,
body.light-mode .topbar-notif,
body.light-mode .menu-toggle,
body.light-mode .topbar-user,
body.light-mode .btn-logout {
  border-color: rgba(15, 23, 42, 0.08);
}

.btn-blue,
.btn-green,
.btn-red,
.btn-yellow,
.btn-primary,
.btn-login,
.btn-hero-primary {
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 14px 34px rgba(21, 94, 239, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.feature-card,
.role-card,
.card,
.chart-container,
.settings-card,
.settings-profile-panel,
.settings-main-panel,
.student-att-row,
.notif-item,
.table-wrapper,
.modal-box,
.student-directory-card,
.student-detail-tile,
.command-hero,
.command-panel,
.attendance-step-panel,
.attendance-workspace,
.account-profile-card,
.account-settings-panel,
.profile-hero-panel,
.profile-photo-editor,
.profile-edit-section,
.report-files-panel,
.report-file-form,
.report-file-item,
.ops-hero-card,
.ops-rail-card,
.ops-panel,
.ops-metric-card,
.ops-signal-card,
.ops-progress-row,
.ops-feed-row,
.signal-item {
  background: color-mix(in srgb, var(--bg-card) 84%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  backdrop-filter: blur(24px) saturate(1.2);
}

body.light-mode .feature-card,
body.light-mode .role-card,
body.light-mode .card,
body.light-mode .chart-container,
body.light-mode .settings-card,
body.light-mode .settings-profile-panel,
body.light-mode .settings-main-panel,
body.light-mode .student-att-row,
body.light-mode .notif-item,
body.light-mode .table-wrapper,
body.light-mode .modal-box,
body.light-mode .student-directory-card,
body.light-mode .student-detail-tile,
body.light-mode .command-hero,
body.light-mode .command-panel,
body.light-mode .attendance-step-panel,
body.light-mode .attendance-workspace,
body.light-mode .account-profile-card,
body.light-mode .account-settings-panel,
body.light-mode .profile-hero-panel,
body.light-mode .profile-photo-editor,
body.light-mode .profile-edit-section,
body.light-mode .report-files-panel,
body.light-mode .report-file-form,
body.light-mode .report-file-item,
body.light-mode .ops-hero-card,
body.light-mode .ops-rail-card,
body.light-mode .ops-panel,
body.light-mode .ops-metric-card,
body.light-mode .ops-signal-card,
body.light-mode .ops-progress-row,
body.light-mode .ops-feed-row,
body.light-mode .signal-item {
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow:
    0 14px 32px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.stat-card {
  background: color-mix(in srgb, var(--bg-card) 88%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  backdrop-filter: blur(24px) saturate(1.2);
}

body.light-mode .stat-card {
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow:
    0 14px 30px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.form-input,
.form-select,
.form-textarea,
.search-input {
  background: color-mix(in srgb, var(--bg-input) 88%, transparent);
  border-color: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.14);
  backdrop-filter: blur(16px) saturate(1.14);
}

body.light-mode .form-input,
body.light-mode .form-select,
body.light-mode .form-textarea,
body.light-mode .search-input {
  border-color: rgba(15, 23, 42, 0.08);
}

.ops-live-pill,
.ops-date-chip,
.hero-floating-note,
.hero-marquee-track span,
.ops-marquee-track span {
  border: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  backdrop-filter: blur(18px) saturate(1.18);
}

body.light-mode .ops-live-pill,
body.light-mode .ops-date-chip,
body.light-mode .hero-floating-note,
body.light-mode .hero-marquee-track span,
body.light-mode .ops-marquee-track span {
  border-color: rgba(15, 23, 42, 0.08);
}

.rank-number,
.report-file-icon {
  border-radius: 14px;
}

.topbar-avatar,
.sidebar-avatar,
.user-avatar,
.sar-avatar,
.avatar-preview {
  border-radius: 999px;
}

.notifications-shell-compact {
  display: grid;
  gap: 16px;
}

.notifications-console-card,
.notifications-feed-card,
.notification-stats-modal {
  background: color-mix(in srgb, var(--bg-card) 84%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  backdrop-filter: blur(24px) saturate(1.2);
}

body.light-mode .notifications-console-card,
body.light-mode .notifications-feed-card,
body.light-mode .notification-stats-modal {
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow:
    0 14px 32px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.notifications-console-card,
.notifications-feed-card {
  border-radius: 18px;
  padding: 18px;
}

.notifications-toolbar-top,
.notifications-feed-simple-head,
.notification-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.notifications-console-title {
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 760;
}

.notifications-console-subtitle {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.notifications-toolbar-actions,
.notification-compact-stats,
.notification-date-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notifications-toolbar-actions {
  justify-content: flex-end;
}

.notification-filter-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.notification-filter-btn {
  min-width: 154px;
  padding: 11px 14px;
  display: grid;
  gap: 4px;
  text-align: left;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-surface) 84%, transparent);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition), background var(--transition);
}

.notification-filter-btn:hover,
.notification-filter-btn.active {
  transform: translateY(-1px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-sm);
}

.notification-filter-btn.active {
  background: color-mix(in srgb, var(--blue-bg) 66%, var(--bg-card));
}

.notification-filter-btn strong,
.notification-filter-btn span,
.notification-filter-btn small {
  display: block;
}

.notification-filter-btn strong {
  font-size: 14px;
}

.notification-filter-btn span,
.notification-filter-btn small {
  color: var(--text-muted);
  font-size: 12px;
}

.notification-compact-stats {
  margin-top: 14px;
}

.notification-compact-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-surface) 90%, transparent);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
}

.notification-compact-chip.is-accent {
  color: var(--brand-primary);
  border-color: color-mix(in srgb, var(--brand-primary) 44%, var(--border-color));
}

.notifications-feed-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-height: clamp(520px, calc(100dvh - 320px), 780px);
  max-height: clamp(520px, calc(100dvh - 320px), 780px);
}

.notifications-feed-scroll-simple {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 14px;
  padding-right: 4px;
}

.notifications-feed-scroll-simple::-webkit-scrollbar {
  width: 8px;
}

.notifications-feed-scroll-simple::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--border-color) 72%, transparent);
  border-radius: 999px;
}

.notification-group-panel {
  padding: 16px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-surface) 86%, transparent);
  border: 1px solid var(--border-color);
}

.notification-group-head {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.notification-group-name {
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 760;
}

.notification-group-meta {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.notification-clean-list {
  display: grid;
  gap: 10px;
}

.notif-card-clean {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-card) 94%, transparent);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.notif-card-clean:hover {
  transform: translateY(-1px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-sm);
}

.notif-card-clean.unread {
  border-color: color-mix(in srgb, var(--brand-primary) 38%, var(--border-color));
}

.notif-clean-body {
  min-width: 0;
}

.notif-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.notif-heading {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 760;
}

.notif-state-pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-surface) 90%, transparent);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.notif-state-pill.unread {
  color: var(--brand-primary);
  border-color: color-mix(in srgb, var(--brand-primary) 38%, var(--border-color));
}

.notif-clean-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.notif-card-clean .notif-message {
  margin-top: 10px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.notif-person-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.notif-person-row strong {
  color: var(--text-primary);
  font-size: 13px;
}

.notif-person-row span {
  color: var(--text-muted);
  font-size: 12px;
}

.notification-stats-modal {
  display: grid;
  gap: 16px;
  border-radius: 18px;
  padding: 4px;
}

.notification-stats-note {
  display: grid;
  gap: 4px;
  padding: 4px 2px 0;
}

.notification-stats-note strong {
  color: var(--text-primary);
  font-size: 16px;
}

.notification-stats-note span {
  color: var(--text-muted);
  font-size: 13px;
}

.notification-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.notification-stats-card {
  padding: 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  border: 1px solid var(--border-color);
}

.notification-stats-card span,
.notification-stats-card strong {
  display: block;
}

.notification-stats-card span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.notification-stats-card strong {
  margin-top: 8px;
  color: var(--text-primary);
  font-size: 28px;
  line-height: 1;
}

.notification-stats-card.tone-red { box-shadow: inset 0 3px 0 rgba(239, 68, 68, 0.8); }
.notification-stats-card.tone-yellow { box-shadow: inset 0 3px 0 rgba(245, 158, 11, 0.8); }
.notification-stats-card.tone-blue { box-shadow: inset 0 3px 0 rgba(59, 130, 246, 0.8); }
.notification-stats-card.tone-green { box-shadow: inset 0 3px 0 rgba(34, 197, 94, 0.8); }

.notification-stats-section {
  display: grid;
  gap: 10px;
}

.notification-stats-section-title {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 720;
}

.notification-stats-stack {
  display: grid;
  gap: 10px;
}

.notification-stats-row {
  padding: 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  border: 1px solid var(--border-color);
}

.notification-stats-row-main,
.notification-stats-row-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notification-stats-row-main strong {
  color: var(--text-primary);
  font-size: 14px;
}

.notification-stats-row-main span,
.notification-stats-row-meta span,
.notification-stats-row-meta small {
  color: var(--text-muted);
  font-size: 12px;
}

.notification-stats-row-meta {
  margin-top: 10px;
}

.notification-date-list {
  margin-top: 10px;
}

.notification-date-list span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
}

body.light-mode .notification-date-list span {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.08);
}

@media (max-width: 640px) {
  .btn,
  .btn-primary,
  .btn-hero-primary,
  .btn-hero-secondary,
  .btn-login,
  .btn-icon,
  .topbar-theme,
  .topbar-notif,
  .menu-toggle,
  .topbar-user,
  .btn-logout,
  .nav-item,
  .form-input,
  .form-select,
  .form-textarea,
  .search-input,
  .toggle-switch {
    border-radius: 14px;
  }

  .notification-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .notifications-toolbar-top,
  .notifications-feed-simple-head,
  .notification-group-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .notifications-toolbar-actions {
    justify-content: flex-start;
  }

  .notifications-feed-card {
    min-height: auto;
    max-height: none;
  }

  .notifications-feed-scroll-simple {
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 560px) {
  .notification-filter-btn {
    width: 100%;
    min-width: 0;
  }

  .notification-stats-grid {
    grid-template-columns: 1fr;
  }
}


/* Landing reveal animations */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 720ms cubic-bezier(.2,.7,.2,1),
    transform 720ms cubic-bezier(.2,.7,.2,1),
    box-shadow 220ms ease,
    border-color 220ms ease;
  will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.features-grid .reveal-on-scroll:nth-child(1) { transition-delay: 60ms; }
.features-grid .reveal-on-scroll:nth-child(2) { transition-delay: 130ms; }
.features-grid .reveal-on-scroll:nth-child(3) { transition-delay: 200ms; }
.features-grid .reveal-on-scroll:nth-child(4) { transition-delay: 90ms; }
.features-grid .reveal-on-scroll:nth-child(5) { transition-delay: 160ms; }
.features-grid .reveal-on-scroll:nth-child(6) { transition-delay: 230ms; }

.roles-grid .reveal-on-scroll:nth-child(1),
.steps-grid .reveal-on-scroll:nth-child(1) { transition-delay: 70ms; }
.roles-grid .reveal-on-scroll:nth-child(2),
.steps-grid .reveal-on-scroll:nth-child(2) { transition-delay: 140ms; }
.roles-grid .reveal-on-scroll:nth-child(3),
.steps-grid .reveal-on-scroll:nth-child(3) { transition-delay: 210ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
}


/* Mobile stability layer */
@media (max-width: 768px) {
  html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
  body { width: 100%; overflow-x: hidden; touch-action: pan-y; }

  .landing-nav {
    height: 64px;
    padding: 0 14px;
    background: rgba(7, 11, 20, 0.96);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  body.light-mode .landing-nav { background: rgba(255,255,255,.98); }

  .nav-brand { min-width: 0; gap: 10px; }
  .nav-logo, .nav-logo img { width: 38px; height: 38px; }
  .nav-title {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
  }
  .nav-subtitle { display: none; }
  .nav-actions { width: auto; flex-shrink: 0; gap: 8px; }
  .btn-theme-toggle { width: 38px; height: 38px; flex: 0 0 38px; }

  .hero {
    display: block;
    min-height: auto;
    padding: 86px 16px 38px;
    overflow: visible;
    text-align: left;
  }
  .hero-glow, .hero-marquee { display: none; }
  .hero-content, .hero-visual { width: 100%; max-width: 100%; }
  .hero-title {
    margin-bottom: 16px;
    font-size: clamp(42px, 16vw, 62px) !important;
    line-height: .98;
  }
  .hero-title-line, .hero-accent {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
  }
  .hero-desc { max-width: 100%; margin: 0 0 24px; font-size: 16px; line-height: 1.65; }

  .hero-cta {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 10px;
    margin-bottom: 22px;
  }
  .hero-cta .btn-hero-primary,
  .hero-cta .btn-hero-secondary {
    width: 100%;
    min-height: 52px;
    justify-content: center;
    padding: 13px 18px;
    border-radius: 14px;
    font-size: 16px;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
    text-align: center;
  }
  .hero-stat-divider { display: none; }

  .hero-visual { margin-top: 24px; padding: 0; }
  .dashboard-preview {
    width: 100% !important;
    max-width: 390px;
    margin: 0 auto;
    animation: none !important;
    transform: none !important;
    will-change: auto;
  }

  .hero-floating-note {
    position: relative !important;
    inset: auto !important;
    width: 100%;
    max-width: 390px;
    justify-content: center;
    margin: 8px auto;
    padding: 9px 12px;
    transform: none !important;
    animation: none !important;
    font-size: 12px;
  }

  .preview-list-item, .chart-bar-mock {
    animation: none !important;
    transform: none !important;
  }

  .features-section, .how-section { padding: 52px 16px; }
  .features-grid, .roles-grid { grid-template-columns: 1fr !important; gap: 14px; }
  .feature-card, .role-card { min-height: auto; padding: 22px; border-radius: 14px; }

  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
  }

  .login-container { min-height: 100dvh; }
  .login-left { display: none !important; }
  .login-right { min-height: 100dvh; padding: 26px 16px; align-items: center; }
  .login-form-header h2 { font-size: 34px; line-height: 1.1; }
  .btn-login { min-height: 52px; border-radius: 14px; }

  #app-page { height: 100dvh; min-height: 100dvh; }
  .main-content {
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: auto;
  }
  .view.active, .view.view-loading, .view.view-ready, .view.view-ready > * {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}
@media (max-width: 420px) {
  .hero { padding-top: 82px; }
  .hero-title { font-size: clamp(38px, 15vw, 54px) !important; }
  .hero-stats, .preview-stat-row { grid-template-columns: 1fr; }
}


/* Users view responsive cards */
.users-table .user-cell-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.users-table .user-cell-copy { min-width: 0; }
.users-table .user-cell-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 650;
}
.users-table .user-cell-username,
.users-table .user-location-cell,
.users-table .user-phone-cell {
  color: var(--text-muted);
  font-size: 12px;
}
.users-table .user-location-cell {
  color: var(--text-secondary);
  line-height: 1.45;
}
.users-table .role-tag {
  max-width: 100%;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .topbar, .sidebar, .btn-ghost, .btn-outline, .btn-theme-toggle,
  .topbar-theme, .topbar-notif, .menu-toggle, .topbar-user, .btn-logout {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .card, .chart-container, .stat-card, .settings-main-panel,
  .settings-profile-panel, .student-directory-card, .users-table tbody tr {
    box-shadow: none !important;
  }

  .users-table-wrapper {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .users-table {
    min-width: 0 !important;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
  }
  .users-table thead { display: none; }
  .users-table tbody, .users-table tr, .users-table td {
    display: block;
    width: 100%;
  }
  .users-table tbody tr {
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-card);
  }
  .users-table tbody td {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border: 0;
    font-size: 13px;
  }
  .users-table tbody td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
  }
  .users-table .user-cell {
    grid-template-columns: 1fr;
    padding-top: 0;
  }
  .users-table .user-cell::before,
  .users-table .user-actions-cell::before {
    display: none;
  }
  .users-table .user-cell-name {
    white-space: normal;
    line-height: 1.25;
  }
  .users-table .role-tag,
  .users-table .badge {
    justify-self: start;
    white-space: nowrap;
  }
  .users-table .user-actions-cell {
    grid-template-columns: 1fr;
    padding-bottom: 0;
  }
  .users-table .user-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(42px, 1fr));
    width: 100%;
    gap: 8px;
  }
  .users-table .user-actions .btn-icon {
    width: 100%;
    min-width: 0;
    height: 42px;
  }
  .filter-bar .form-select[style] {
    width: 100% !important;
  }
}
@media (max-width: 380px) {
  .users-table tbody td {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
  }
}


/* App performance mode for phones and tablets */
@media (max-width: 900px) {
  #app-page, #app-page * { scroll-behavior: auto !important; }

  #app-page .view,
  #app-page .view > *,
  #app-page .card,
  #app-page .chart-container,
  #app-page .stat-card,
  #app-page .student-directory-card,
  #app-page .settings-main-panel,
  #app-page .settings-profile-panel,
  #app-page .attendance-step-panel,
  #app-page .attendance-workspace,
  #app-page .attendance-results-panel,
  #app-page .notification-mini-card,
  #app-page .notification-stats-card,
  #app-page .modal-box,
  #app-page .toast {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    filter: none !important;
  }

  #app-page .sidebar,
  #app-page .topbar,
  #app-page .sidebar-overlay,
  #app-page .modal-overlay,
  #app-page .btn,
  #app-page .btn-primary,
  #app-page .btn-ghost,
  #app-page .btn-outline,
  #app-page .topbar-theme,
  #app-page .topbar-notif,
  #app-page .menu-toggle,
  #app-page .topbar-user {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  #app-page .card,
  #app-page .chart-container,
  #app-page .stat-card,
  #app-page .student-directory-card,
  #app-page .settings-main-panel,
  #app-page .settings-profile-panel,
  #app-page .attendance-step-panel,
  #app-page .attendance-workspace,
  #app-page .attendance-results-panel,
  #app-page .notification-mini-card,
  #app-page .notification-stats-card {
    box-shadow: none !important;
  }

  #app-page .progress-bar { transition: none !important; }
  #app-page .main-content { contain: none !important; }
}


/* Deep mobile scroll performance patch */
@media (max-width: 900px), (prefers-reduced-motion: reduce) {
  html, body {
    scroll-behavior: auto !important;
    overscroll-behavior-x: none;
  }

  #app-page {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    touch-action: pan-y;
  }

  #app-page *,
  #app-page *::before,
  #app-page *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }

  #app-page .view,
  #app-page .view > *,
  #app-page .card,
  #app-page .chart-container,
  #app-page .stat-card,
  #app-page .student-directory-card,
  #app-page .settings-main-panel,
  #app-page .settings-profile-panel,
  #app-page .attendance-step-panel,
  #app-page .attendance-workspace,
  #app-page .attendance-results-panel,
  #app-page .notification-mini-card,
  #app-page .notification-stats-card,
  #app-page .modal-box,
  #app-page .toast {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    filter: none !important;
  }

  #app-page .sidebar,
  #app-page .topbar,
  #app-page .sidebar-overlay,
  #app-page .modal-overlay,
  #app-page .btn,
  #app-page .btn-primary,
  #app-page .btn-ghost,
  #app-page .btn-outline,
  #app-page .topbar-theme,
  #app-page .topbar-notif,
  #app-page .menu-toggle,
  #app-page .topbar-user {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  #app-page .card,
  #app-page .chart-container,
  #app-page .stat-card,
  #app-page .student-directory-card,
  #app-page .settings-main-panel,
  #app-page .settings-profile-panel,
  #app-page .attendance-step-panel,
  #app-page .attendance-workspace,
  #app-page .attendance-results-panel,
  #app-page .notification-mini-card,
  #app-page .notification-stats-card,
  #app-page .sidebar.open {
    box-shadow: none !important;
  }

  #app-page canvas {
    pointer-events: none !important;
    touch-action: pan-y !important;
  }

  #app-page thead th,
  #app-page .attendance-step-panel,
  #app-page .attendance-results-panel {
    position: static !important;
  }

  #app-page .nav-item:hover,
  #app-page .btn:hover,
  #app-page .btn-primary:hover,
  #app-page .btn-ghost:hover,
  #app-page .stat-card:hover,
  #app-page .card:hover,
  #app-page .student-directory-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  #app-page .table-wrapper,
  #app-page .attendance-scroll-area,
  #app-page .attendance-rows-scroll,
  #app-page .notifications-feed-scroll-simple,
  #app-page .main-content {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  #app-page .main-content {
    contain: none !important;
    will-change: auto !important;
  }

  .page-exit {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}


/* Floors view mobile layout */
.floor-block-card-copy {
  min-width: 0;
}

.floor-block-card-copy strong,
.floor-block-card-copy small,
.floor-row-title > div:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.floor-management-table .floors-table {
  width: 100%;
}

.floor-management-table .floor-rooms-cell,
.floor-management-table .floor-students-cell,
.floor-management-table .floor-wardens-cell {
  color: var(--text-secondary);
  font-size: 13px;
}

.floor-management-table .floor-actions-cell .btn {
  white-space: nowrap;
}

@media (max-width: 768px) {
  #view-floors .view-header {
    gap: 12px;
  }

  #view-floors .view-actions,
  #view-floors .view-actions .btn {
    width: 100%;
  }

  .floor-management-shell {
    gap: 12px;
  }

  .floor-block-selector-panel,
  .floor-block-overview,
  .floor-empty-panel {
    padding: 14px;
    border-radius: 14px;
    box-shadow: none;
  }

  .floor-block-selector-head,
  .floor-block-overview-head {
    gap: 10px;
  }

  .floor-block-selector-head h3,
  .floor-block-overview-head h3 {
    font-size: 16px;
    line-height: 1.25;
  }

  .floor-block-overview-head p {
    font-size: 13px;
    line-height: 1.45;
  }

  .floor-block-selector-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .floor-block-card {
    min-height: 72px;
    padding: 12px;
    border-radius: 14px;
    transform: none !important;
    box-shadow: none !important;
  }

  .floor-block-code {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .floor-block-card-copy strong {
    font-size: 14px;
    line-height: 1.25;
  }

  .floor-block-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  .floor-block-kpi {
    padding: 12px;
    border-radius: 12px;
  }

  .floor-block-kpi strong {
    font-size: 22px;
  }

  .floor-management-table {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .floor-management-table .floors-table {
    min-width: 0 !important;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .floor-management-table thead {
    display: none;
  }

  .floor-management-table tbody,
  .floor-management-table tr,
  .floor-management-table td {
    display: block;
    width: 100%;
  }

  .floor-management-table tbody tr {
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-card);
    box-shadow: none;
  }

  .floor-management-table tbody td {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border: 0;
  }

  .floor-management-table tbody td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .floor-management-table .floor-main-cell {
    grid-template-columns: 1fr;
    padding-top: 0;
  }

  .floor-management-table .floor-main-cell::before {
    display: none;
  }

  .floor-row-title {
    gap: 10px;
  }

  .floor-row-number {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .floor-row-sub {
    font-size: 11px;
  }

  .floor-warden-list {
    gap: 6px;
  }

  .floor-warden-item {
    min-width: 0;
  }

  .floor-warden-item span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .floor-management-table .floor-actions-cell {
    grid-template-columns: 1fr;
    padding-bottom: 0;
  }

  .floor-management-table .floor-actions-cell::before {
    display: none;
  }

  .floor-management-table .floor-actions-cell .btn {
    width: 100%;
    justify-content: center;
    min-height: 42px;
  }

  #floor-stats-section {
    margin-top: 12px !important;
  }

  #floor-stats-section .card {
    padding: 14px;
  }

  #floor-stats-section .card-header {
    align-items: stretch;
  }

  #floor-stats-section .card-header .btn {
    width: 100%;
    justify-content: center;
  }

  #floor-stats-section .stats-grid[style] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  #floor-stats-section .progress-bar-wrap {
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .floor-block-kpis,
  #floor-stats-section .stats-grid[style] {
    grid-template-columns: 1fr !important;
  }

  .floor-management-table tbody td {
    grid-template-columns: 78px minmax(0, 1fr);
  }
}


/* Paint immediately on mobile: no delayed route shell */
@media (max-width: 900px) {
  #app-page .main-content {
    contain: none !important;
    will-change: auto !important;
  }

  #app-page .view,
  #app-page .view.active,
  #app-page .view.view-loading,
  #app-page .view.view-ready,
  #app-page .view.view-ready > * {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
    transition: none !important;
  }

  #app-page .loading-state {
    min-height: 96px;
    padding: 16px;
  }

  #app-page .spinner {
    animation: none !important;
  }
}


/* Mobile sidebar footer and profile shortcuts */
@media (max-width: 768px) {
  #app-page .sidebar {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  #app-page .sidebar-header,
  #app-page .sidebar-user,
  #app-page .sidebar-footer {
    flex-shrink: 0;
  }

  #app-page .sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }

  #app-page .sidebar-footer {
    display: block;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border-color);
  }

  #app-page .btn-logout {
    min-height: 44px;
    justify-content: center;
    color: var(--red);
    background: var(--red-bg);
  }

  #app-page .topbar-avatar,
  #app-page .topbar-user {
    cursor: pointer;
  }
}


/* Mobile solid surfaces: no transparent glass layers */
@media (max-width: 900px) {
  body.dark-mode {
    --bg-surface: #0d1320;
    --bg-card: #111827;
    --bg-card-hover: #172033;
    --bg-input: #0f1724;
    --bg-nav: #0a0f19;
    --bg-sidebar: #0a0f19;
    --border-color: #263244;
    --border-strong: #344257;
  }

  body.light-mode {
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f3f6fb;
    --bg-input: #ffffff;
    --bg-nav: #ffffff;
    --bg-sidebar: #ffffff;
    --border-color: #d9e1ec;
    --border-strong: #c6d0df;
  }

  #app-page,
  #app-page .app-content,
  #app-page .main-content {
    background: var(--bg-base) !important;
  }

  #app-page .topbar,
  #app-page .sidebar,
  #app-page .sidebar-header,
  #app-page .sidebar-user,
  #app-page .sidebar-footer,
  #app-page .topbar-theme,
  #app-page .topbar-notif,
  #app-page .topbar-user,
  #app-page .menu-toggle,
  #app-page .btn-ghost,
  #app-page .btn-outline,
  #app-page .card,
  #app-page .chart-container,
  #app-page .stat-card,
  #app-page .settings-card,
  #app-page .settings-main-panel,
  #app-page .settings-profile-panel,
  #app-page .student-directory-card,
  #app-page .attendance-step-panel,
  #app-page .attendance-workspace,
  #app-page .attendance-results-panel,
  #app-page .account-profile-card,
  #app-page .account-settings-panel,
  #app-page .profile-hero-panel,
  #app-page .report-files-panel,
  #app-page .notifications-console-card,
  #app-page .notifications-feed-card,
  #app-page .notification-mini-card,
  #app-page .notification-stats-card,
  #app-page .notification-group-panel,
  #app-page .notif-card-clean,
  #app-page .floor-block-selector-panel,
  #app-page .floor-block-overview,
  #app-page .floor-empty-panel,
  #app-page .floor-block-card,
  #app-page .floor-block-kpi,
  #app-page .users-table tbody tr,
  #app-page .floor-management-table tbody tr,
  #app-page .modal-box,
  #app-page .toast,
  #app-page .form-input,
  #app-page .form-select,
  #app-page .form-textarea,
  #app-page .search-input {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
  }

  #app-page .topbar,
  #app-page .sidebar,
  #app-page .sidebar-footer {
    background: var(--bg-sidebar) !important;
  }

  #app-page .modal-overlay,
  #app-page .sidebar-overlay {
    background: rgba(0, 0, 0, 0.72) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  body.light-mode #app-page .modal-overlay,
  body.light-mode #app-page .sidebar-overlay {
    background: rgba(15, 23, 42, 0.42) !important;
  }

  #app-page .table-wrapper,
  #app-page thead tr,
  #app-page tbody tr,
  #app-page .filter-bar,
  #app-page .progress-bar-wrap,
  #app-page .notification-stats-row,
  #app-page .notifications-feed-scroll-simple {
    background: var(--bg-surface) !important;
  }

  #app-page .nav-item:hover,
  #app-page .nav-item.active {
    background: var(--blue-bg) !important;
  }

  #app-page .badge,
  #app-page .role-tag,
  #app-page .pli-badge,
  #app-page .badge-muted {
    border: 1px solid var(--border-color);
  }
}


/* Hard mobile performance mode */
@media (max-width: 900px) {
  html,
  body,
  #app-page,
  #app-page .app-content,
  #app-page .main-content {
    background-image: none !important;
  }

  #app-page .main-content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }

  #app-page .ops-chart-wrap.mobile-chart-disabled,
  #app-page .chart-container.mobile-chart-disabled,
  #app-page .ops-panel:has(.mobile-chart-disabled),
  #app-page canvas {
    display: none !important;
  }

  #app-page,
  #app-page * {
    scroll-behavior: auto !important;
    text-rendering: optimizeSpeed;
  }
}


/* Fixed catalog/card sizing: one item must not stretch into a giant card */
.attendance-picker-grid,
.student-directory-grid,
.floor-block-selector-grid {
  align-content: start !important;
  justify-content: start !important;
}

.attendance-picker-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-auto-rows: 92px !important;
}

.attendance-picker-card {
  height: 92px !important;
  min-height: 92px !important;
  max-height: 92px !important;
}

.student-directory-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 260px)) !important;
  grid-auto-rows: 104px !important;
  max-height: 360px;
  overflow-y: auto;
}

.student-directory-card {
  height: 104px !important;
  min-height: 104px !important;
  max-height: 104px !important;
}

.floor-block-selector-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 260px)) !important;
  grid-auto-rows: 96px !important;
  max-height: 360px;
  overflow-y: auto;
}

.floor-block-card {
  height: 96px !important;
  min-height: 96px !important;
  max-height: 96px !important;
}

.attendance-picker-card,
.student-directory-card,
.floor-block-card {
  overflow: hidden;
}

@media (max-width: 640px) {
  .student-directory-grid,
  .floor-block-selector-grid {
    grid-template-columns: 1fr !important;
    max-height: 320px;
  }
}


/* Attendance final layout fix */
#view-attendance #att-stats.attendance-stats-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:18px!important;
  min-height:0!important;
  height:auto!important;
  margin:0 0 28px!important;
  clear:both!important;
}
#view-attendance #att-stats.attendance-stats-grid .stat-card{
  min-height:124px!important;
  height:auto!important;
  padding:22px 24px!important;
}
#view-attendance .tab-bar:empty{display:none!important}
#view-attendance .filter-bar{
  display:grid!important;
  grid-template-columns:minmax(280px,1fr) auto!important;
  gap:16px!important;
  align-items:center!important;
  margin:0 0 24px!important;
  padding:14px 16px!important;
  border:1px solid var(--border-color)!important;
  border-radius:var(--radius-lg)!important;
  background:var(--bg-surface)!important;
  position:relative!important;
  top:auto!important;
  transform:none!important;
}
#view-attendance .filter-bar>div:last-child{
  display:flex!important;
  justify-content:flex-end!important;
  flex-wrap:wrap!important;
  gap:10px!important;
}
.attendance-choice-actions{gap:10px!important}
.attendance-choice-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-width:78px;height:38px;padding:0 14px;border-radius:999px;
  border:1px solid var(--border-color);background:var(--bg-surface);
  color:var(--text-secondary);font-size:13px;font-weight:750;letter-spacing:0;
}
.attendance-choice-btn .choice-dot{width:8px;height:8px;border-radius:999px;background:currentColor}
.attendance-choice-btn.present{color:#22c55e}
.attendance-choice-btn.absent{color:#ef4444}
.attendance-choice-btn:hover,.attendance-choice-btn.active{
  border-color:currentColor;background:color-mix(in srgb,currentColor 13%,var(--bg-card));color:var(--text-primary)
}
@media(max-width:1100px){
  #view-attendance #att-stats.attendance-stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:720px){
  #view-attendance #att-stats.attendance-stats-grid{grid-template-columns:1fr!important}
  #view-attendance .filter-bar{grid-template-columns:1fr!important}
  #view-attendance .filter-bar>div:last-child{justify-content:flex-start!important}
}


/* final attendance/server-time polish */
#view-attendance #att-stats.attendance-stats-grid { margin:0 0 22px!important; position:relative!important; z-index:1!important; }
#view-attendance .filter-bar { margin:0 0 20px!important; position:relative!important; z-index:2!important; transform:none!important; }
#view-attendance #attendance-list { display:flex!important; flex-direction:column!important; gap:16px!important; clear:both!important; position:relative!important; z-index:1!important; }
.attendance-choice-actions { display:flex!important; gap:10px!important; justify-content:flex-end!important; flex-wrap:wrap!important; }
.attendance-choice-btn { min-width:88px!important; min-height:40px!important; height:auto!important; border-radius:10px!important; padding:9px 14px!important; background:rgba(15,23,42,.56)!important; border:1px solid rgba(148,163,184,.28)!important; color:var(--text-primary)!important; box-shadow:none!important; cursor:pointer!important; }
.attendance-choice-btn.present { color:#7dd3a8!important; }
.attendance-choice-btn.absent { color:#fda4af!important; }
.attendance-choice-btn:hover,.attendance-choice-btn.active { border-color:currentColor!important; background:rgba(30,41,59,.86)!important; }
body.light-mode .attendance-choice-btn { background:#fff!important; border-color:#d8e0ef!important; }
.absence-reason-btn { width:100%; border:1px solid var(--border-color); background:var(--bg-card); color:var(--text-primary); border-radius:12px; padding:13px 14px; display:flex; align-items:center; justify-content:space-between; gap:14px; text-align:left; cursor:pointer; }
.absence-reason-btn span { font-weight:800; }
.absence-reason-btn small { color:var(--text-muted); font-size:12px; }
.absence-reason-btn:hover { border-color:var(--brand-primary); background:rgba(21,94,239,.1); }
body.light-mode .absence-reason-btn { background:#fff; border-color:#d8e0ef; }
@media (max-width:768px){ #app-page .server-time{display:flex!important;min-width:0!important;padding:0 4px!important} #app-page .server-time span{display:none!important} #app-page .server-time strong{font-size:12px!important} }

/* Server time spacing fix */
#app-page .topbar-right .server-time {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  min-width: max-content !important;
  white-space: nowrap !important;
}

#app-page .topbar-right .server-time span {
  display: inline-block !important;
  margin-right: 2px !important;
}

#app-page .topbar-right .server-time strong {
  display: inline-block !important;
}

@media (max-width: 768px) {
  #app-page .topbar-right .server-time {
    gap: 0 !important;
    min-width: 0 !important;
  }

  #app-page .topbar-right .server-time span {
    display: none !important;
  }
}


/* MOBILE_FINAL_TOPBAR_DASHBOARD_START */
@media (max-width: 768px) {
  #app-page .topbar {
    height: auto !important;
    min-height: 82px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto auto !important;
    grid-template-areas:
      "left theme notif user"
      "time time time time" !important;
    align-items: center !important;
    column-gap: 8px !important;
    row-gap: 5px !important;
    padding: 8px 10px 7px !important;
  }
  #app-page .topbar-left { grid-area: left !important; min-width: 0 !important; width: 100% !important; }
  #app-page .topbar-right { display: contents !important; }
  #app-page .topbar-theme { grid-area: theme !important; }
  #app-page .topbar-notif { grid-area: notif !important; }
  #app-page .topbar-user { grid-area: user !important; }
  #app-page .breadcrumb {
    max-width: calc(100vw - 190px) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  #app-page .topbar-right .server-time,
  #app-page .server-time {
    grid-area: time !important;
    justify-self: start !important;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    white-space: nowrap !important;
  }
  #app-page .server-time span {
    display: inline-block !important;
    font-size: 10px !important;
    color: var(--text-muted) !important;
  }
  #app-page .server-time strong {
    display: inline-block !important;
    font-size: 12px !important;
    color: var(--text-primary) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  #app-page .topbar-theme,
  #app-page .topbar-notif,
  #app-page .topbar-user,
  #app-page .menu-toggle {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
  }
  #app-page .main-content { padding-top: 14px !important; }
}
@media (max-width: 380px) {
  #app-page .breadcrumb { max-width: calc(100vw - 166px) !important; }
  #app-page .server-time span { display: none !important; }
}
.mobile-dashboard { display: grid; gap: 14px; padding-bottom: 24px; }
.mobile-dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mobile-dash-head .view-title { font-size: clamp(25px, 7vw, 34px); line-height: 1.05; }
.mobile-dash-head .view-subtitle { font-size: 13px; line-height: 1.35; margin-top: 6px; }
.mobile-dash-hero,
.mobile-list-card,
.mobile-kpi {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: none;
}
.mobile-dash-hero { padding: 18px; display: grid; gap: 9px; overflow: hidden; }
.mobile-dash-hero span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mobile-dash-hero strong {
  color: var(--text-primary);
  font-size: clamp(31px, 11vw, 45px);
  line-height: 0.98;
  font-weight: 850;
}
.mobile-dash-hero p { margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.48; }
.mobile-dash-hero.blue { border-top: 3px solid var(--brand-primary); }
.mobile-dash-hero.green { border-top: 3px solid var(--green); }
.mobile-dash-hero.yellow { border-top: 3px solid var(--yellow); }
.mobile-dash-hero.red { border-top: 3px solid var(--red); }
.mobile-dash-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.mobile-kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mobile-kpi { padding: 13px; min-width: 0; }
.mobile-kpi span,
.mobile-kpi strong,
.mobile-kpi small { display: block; }
.mobile-kpi span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.mobile-kpi strong { margin-top: 7px; color: var(--text-primary); font-size: 24px; line-height: 1; }
.mobile-kpi small { margin-top: 6px; color: var(--text-secondary); font-size: 12px; overflow-wrap: anywhere; }
.mobile-kpi.blue { border-top: 2px solid var(--brand-primary); }
.mobile-kpi.green { border-top: 2px solid var(--green); }
.mobile-kpi.yellow { border-top: 2px solid var(--yellow); }
.mobile-kpi.red { border-top: 2px solid var(--red); }
.mobile-kpi.teal { border-top: 2px solid var(--teal); }
.mobile-list-card { padding: 14px; }
.mobile-list-title { color: var(--text-primary); font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.mobile-signal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--border-color);
}
.mobile-signal-row:first-of-type { border-top: 0; padding-top: 0; }
.mobile-signal-row strong,
.mobile-signal-row span { display: block; }
.mobile-signal-row strong { color: var(--text-primary); font-size: 13px; line-height: 1.25; }
.mobile-signal-row span,
.mobile-signal-row small { color: var(--text-muted); font-size: 12px; line-height: 1.3; margin-top: 3px; }
.mobile-empty {
  padding: 14px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
}
/* MOBILE_FINAL_TOPBAR_DASHBOARD_END */
