/* =========================================================
   جمعية الأمل — لوحة التحكم الذكية والمتقدمة
   style.css — Modern Light White Sidebar & Dynamic System
   Pristine White Sidebar · 100% Fixed Anchor · Bento Gradients
   Full Support: Subjects Management & User Access Control
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Readex+Pro:wght@300;400;500;600;700;800&display=swap');

/* ---------------------------------------------------------
   1. Design Tokens & Vibrant Gradients
   --------------------------------------------------------- */
:root {
  /* Dynamic Brand Gradients */
  --grad-primary:       linear-gradient(135deg, #10B981 0%, #059669 50%, #047857 100%);
  --grad-primary-hover: linear-gradient(135deg, #34D399 0%, #10B981 50%, #059669 100%);
  --grad-emerald-soft:  linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
  --grad-blue:          linear-gradient(135deg, #38BDF8 0%, #2563EB 100%);
  --grad-blue-soft:     linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  --grad-amber:         linear-gradient(135deg, #FBBF24 0%, #D97706 100%);
  --grad-amber-soft:    linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  --grad-rose:          linear-gradient(135deg, #FB7185 0%, #E11D48 100%);
  --grad-rose-soft:     linear-gradient(135deg, #FFF1F2 0%, #FFE4E6 100%);
  --grad-purple:        linear-gradient(135deg, #C084FC 0%, #7E22CE 100%);
  --grad-purple-soft:   linear-gradient(135deg, #FAF5FF 0%, #F3E8FF 100%);
  --grad-chart-bar:     linear-gradient(180deg, #34D399 0%, #10B981 60%, #059669 100%);
  --grad-progress:      linear-gradient(90deg, #10B981 0%, #34D399 50%, #059669 100%);

  /* Light White Sidebar System */
  --grad-sidebar:       linear-gradient(180deg, #FFFFFF 0%, #F9FBFA 100%);
  --sidebar-w:          276px;
  --sidebar-border:     #E2E8F0;
  --sidebar-text:       #475569;
  --sidebar-text-muted: #94A3B8;
  --sidebar-text-dark:  #0F172A;
  --sidebar-hover:      #F1F5F9;
  --sidebar-active:     #059669;

  /* Solid Colors */
  --primary:            #059669;
  --primary-glow:       rgba(16, 185, 129, 0.28);
  --primary-border:     #A7F3D0;
  --rose:               #E11D48;
  --rose-glow:          rgba(225, 29, 72, 0.25);
  --text-main:          #0F172A;
  --text-secondary:     #475569;
  --text-muted:         #94A3B8;

  /* Surfaces & Canvas */
  --bg-app:             #F8FAFC;
  --surface:            #FFFFFF;
  --surface-raised:     #FFFFFF;
  --surface-subtle:     #F1F5F9;

  /* Borders & Dividers */
  --border-card:        rgba(226, 232, 240, 0.85);
  --border-light:       #E2E8F0;
  --border-input:       #CBD5E1;

  /* Corner Radii */
  --radius-xs:          6px;
  --radius-sm:          8px;
  --radius-md:          12px;
  --radius-lg:          16px;
  --radius-xl:          24px;

  /* Elevated Multi-layer Shadows */
  --shadow-xs:          0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm:          0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.03);
  --shadow-md:          0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
  --shadow-glow:        0 12px 30px -4px rgba(16, 185, 129, 0.22);
  --shadow-hover:       0 20px 35px -8px rgba(15, 23, 42, 0.09), 0 10px 15px -4px rgba(15, 23, 42, 0.04);
  --shadow-modal:       0 25px 60px -12px rgba(5, 25, 16, 0.35);

  /* Physics Transitions */
  --ease-spring:        cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast:             180ms var(--ease-spring);
  --t-base:             280ms var(--ease-spring);
  --t-smooth:           380ms var(--ease-spring);
}

/* ---------------------------------------------------------
   2. Reset, Base & Smooth Scroll
   --------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: 'Readex Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

img {
  max-width: 100%;
  display: block;
}

::selection {
  background: #A7F3D0;
  color: #064E3B;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* ---------------------------------------------------------
   3. True Fixed Layout Shell (Guaranteed Permanent Anchor)
   --------------------------------------------------------- */
.app-shell {
  min-height: 100vh;
  background: var(--bg-app);
  position: relative;
  padding-right: var(--sidebar-w);
  transition: padding-right 320ms var(--ease-spring);
}

/* Admin login */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(145deg, #F3FAF7 0%, #F8FAFC 55%, #EDF8F4 100%);
}

.login-card {
  width: min(100%, 420px);
  padding: 34px;
  text-align: center;
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: 20px;
  box-shadow: 0 24px 55px rgba(15, 23, 42, .12);
}

.login-logo {
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  object-fit: contain;
}

.login-brand h1 {
  margin: 0;
  color: var(--text-main);
  font-size: 23px;
}

.login-brand p {
  margin: 6px 0 27px;
  color: var(--text-secondary);
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 16px;
  text-align: right;
}

.login-submit {
  width: 100%;
  margin-top: 2px;
}

.login-error {
  margin: -4px 0 0;
  padding: 9px 11px;
  border: 1px solid #FECACA;
  border-radius: var(--radius-sm);
  background: #FFF7F7;
  color: #BE123C;
  font-size: 12px;
}

.login-note {
  margin: 22px 0 0;
  padding-top: 17px;
  border-top: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.7;
}

.login-note b {
  color: var(--text-main);
}

body.is-authenticated .login-screen { display: none; }
body:not(.is-authenticated) .app-shell { display: none; }

.app-shell.sidebar-closed,
body.sidebar-closed .app-shell {
  padding-right: 0 !important;
}

.main {
  direction: rtl;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------------------------------------------------------
   4. Sidebar (Light White Modern Aesthetic · 100% Fixed)
   --------------------------------------------------------- */
.sidebar {
  direction: rtl;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--grad-sidebar);
  border-left: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  padding: 24px 18px 22px;
  z-index: 60;
  box-shadow: -4px 0 25px rgba(15, 23, 42, 0.04);
  transition: transform 320ms var(--ease-spring),
              opacity 240ms var(--ease-spring),
              visibility 320ms;
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
}

.app-shell.sidebar-closed .sidebar,
body.sidebar-closed .sidebar,
.sidebar.is-closed {
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Soft Pastel Ambient Orbs */
.sidebar::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -40px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}

.sidebar::after {
  content: "";
  position: absolute;
  bottom: 40px;
  left: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.06) 0%, transparent 70%);
  filter: blur(25px);
  pointer-events: none;
}

/* Brand Header */
.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 6px 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.brand-logo {
  height: 48px;
  width: auto;
  max-width: 105px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(15, 23, 42, 0.08));
  transition: transform var(--t-fast);
}

.brand-logo:hover {
  transform: scale(1.04) rotate(-1deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--sidebar-text-dark);
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 11px;
  color: var(--sidebar-text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* Navigation Menu */
.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
  transition: all var(--t-fast);
  outline: none;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-dark);
  transform: translateX(-3px);
}

.nav-item:focus-visible {
  box-shadow: 0 0 0 2px var(--sidebar-active);
}

/* Active State */
.nav-item.is-active {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.14) 0%, rgba(16, 185, 129, 0.04) 100%);
  color: #065F46;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.28);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}

.nav-item.is-active::after {
  content: "";
  position: absolute;
  inset-inline-start: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  background: var(--sidebar-active);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: none;
  opacity: 0.85;
  transition: transform var(--t-fast), opacity var(--t-fast);
}

.nav-item:hover .nav-icon {
  color: var(--sidebar-text-dark);
  opacity: 1;
}

.nav-item.is-active .nav-icon {
  opacity: 1;
  color: var(--sidebar-active);
  transform: scale(1.12);
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.year-box {
  font-size: 11px;
  font-weight: 600;
  color: var(--sidebar-text);
  background: #F8FAFC;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  text-align: center;
  white-space: nowrap;
}

.user-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: var(--radius-md);
  background: #F8FAFC;
  border: 1px solid var(--sidebar-border);
  transition: all var(--t-fast);
}

.user-box:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}

.sidebar-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  border: 1px solid #FECACA;
  border-radius: var(--radius-md);
  background: #FFF7F7;
  color: #BE123C;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}

.sidebar-logout:hover {
  background: #FFF1F2;
  border-color: #FDA4AF;
}

.sidebar-logout svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--grad-primary);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.25);
  flex: none;
}

.user-text {
  min-width: 0;
}

.user-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--sidebar-text-dark);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--sidebar-text-muted);
}

/* ---------------------------------------------------------
   5. Modern Sticky Topbar
   --------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 36px;
  background: rgba(248, 250, 252, 0.88);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.menu-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.menu-btn:hover {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.menu-btn svg {
  transition: transform var(--t-fast);
}

.menu-btn:hover svg {
  transform: scale(1.12);
}

.topbar-titles {
  flex: 1;
  min-width: 0;
}

.page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.page-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.badge-outline {
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-input);
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
}

.year-select {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.year-select label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.year-select select {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
  transition: all var(--t-fast);
}

.icon-btn:hover {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: var(--text-main);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.notif-badge {
  position: absolute;
  top: -4px;
  inset-inline-start: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-amber);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.45);
  animation: pulseGlow 2.4s infinite;
}

.profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 14px 4px 6px;
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
  transition: all var(--t-fast);
}

.profile-btn:hover {
  border-color: #CBD5E1;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.profile-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  background: var(--grad-primary);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

/* ---------------------------------------------------------
   6. Content Layout & Spacing
   --------------------------------------------------------- */
.content {
  flex: 1;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 32px 36px 48px;
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
  animation: panelIn 340ms var(--ease-spring) both;
}

.panel-head {
  margin-bottom: 26px;
}

.panel-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

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

.panel-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

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

.num {
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: embed;
  letter-spacing: 0.2px;
}

/* ---------------------------------------------------------
   7. Bento Cards & Spacing Architecture
   --------------------------------------------------------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: all var(--t-base);
  overflow: hidden;
}

.card:hover {
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.card + .card,
.card + .stats-grid,
.stats-grid + .card,
.card + .stats-grid-4,
.stats-grid-4 + .card {
  margin-top: 22px;
}

.card-gap {
  margin-top: 22px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.card-head h3 {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

/* ---------------------------------------------------------
   8. Tactile Gradient Buttons
   --------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  outline: none;
  border: 1px solid transparent;
  transition: all var(--t-fast);
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
  transform: none;
}

.btn-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-primary {
  background: var(--grad-primary);
  color: #FFFFFF;
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  background: var(--grad-primary-hover);
  box-shadow: 0 14px 28px -4px rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-input);
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--surface-subtle);
  border-color: #94A3B8;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
}

.btn-ghost:hover {
  background: var(--grad-emerald-soft);
  color: #047857;
}

.btn-ghost-danger {
  background: transparent;
  color: var(--rose);
}

.btn-ghost-danger:hover {
  background: var(--grad-rose-soft);
  color: #BE123C;
}

.btn-danger {
  background: var(--grad-rose);
  color: #FFFFFF;
  border-color: rgba(225, 29, 72, 0.5);
  box-shadow: 0 4px 14px var(--rose-glow);
}

.btn-danger:hover {
  box-shadow: 0 8px 22px rgba(225, 29, 72, 0.4);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------
   9. Clean Forms & Inputs
   --------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  background: #FFFFFF;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  color: var(--text-main);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: all var(--t-fast);
}

input[type="text"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
select:hover {
  border-color: #94A3B8;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-inline-start: 34px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  padding: 6px 0;
}

.check-item input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
  border-radius: 4px;
}

.checkbox-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 14px;
  max-height: 190px;
  overflow-y: auto;
  padding: 8px 12px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  background: #FFFFFF;
}

.checkbox-list-levels {
  max-height: 250px;
}

.checkbox-list .check-item {
  font-size: 12px;
}

.form-actions {
  margin-top: 28px;
  display: flex;
  gap: 12px;
}

/* ---------------------------------------------------------
   10. Bento Stat Cards Grid
   --------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all var(--t-base);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.stat-card::after {
  content: "";
  position: absolute;
  top: -20px;
  right: -20px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.15;
  transition: opacity var(--t-fast);
}

.stat-card:hover::after {
  opacity: 0.3;
}

.stat-card.green::after { background: #10B981; }
.stat-card.blue::after { background: #38BDF8; }
.stat-card.yellow::after { background: #F59E0B; }

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
  transition: transform var(--t-fast);
}

.stat-card:hover .stat-icon {
  transform: scale(1.1) rotate(2deg);
}

.stat-card.green .stat-icon {
  background: var(--grad-emerald-soft);
  color: #059669;
  border: 1px solid #A7F3D0;
}

.stat-card.blue .stat-icon {
  background: var(--grad-blue-soft);
  color: #2563EB;
  border: 1px solid #BFDBFE;
}

.stat-card.yellow .stat-icon {
  background: var(--grad-amber-soft);
  color: #D97706;
  border: 1px solid #FDE68A;
}

.stat-value {
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* Dashboard overview */
.dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.dashboard-date {
  padding: 7px 11px;
  border: 1px solid var(--border-card);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.dashboard-stats .stat-card { min-height: 166px; }
.dashboard-stats .stat-card .stat-icon { font-size: 19px; font-weight: 800; }
.dashboard-stats .stat-card small { margin-top: 7px; color: var(--text-secondary); font-size: 11px; }

.dashboard-main-grid,
.dashboard-operational-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 20px;
  margin-bottom: 20px;
}

.dashboard-main-grid .card,
.dashboard-operational-grid .card,
.dashboard-levels-card { margin: 0; }

.dashboard-attendance-content {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 190px;
}

.dashboard-donut {
  position: relative;
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(#10B981 0 92.2%, #E11D48 92.2% 100%);
}

.dashboard-donut::before {
  content: '';
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: #FFFFFF;
}

.dashboard-donut > div {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
}

.dashboard-donut strong { color: var(--text-main); font-size: 23px; }
.dashboard-donut span { color: var(--text-secondary); font-size: 12px; }

.dashboard-attendance-list { flex: 1; display: grid; gap: 10px; }
.dashboard-attendance-list > div { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--border-light); color: var(--text-secondary); font-size: 13px; }
.dashboard-attendance-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
.dashboard-attendance-list strong { color: var(--text-main); font-size: 14px; }
.dash-dot { width: 8px; height: 8px; border-radius: 50%; }
.dash-dot.present { background: #10B981; }
.dash-dot.absent { background: #E11D48; }
.dash-dot.pending { background: #F59E0B; }

.dashboard-week-bars {
  display: flex;
  align-items: end;
  gap: 15px;
  height: 190px;
  padding: 22px 6px 0;
  border-bottom: 1px solid var(--border-light);
}

.dashboard-week-bars > div { position: relative; display: grid; flex: 1; height: 100%; align-items: end; justify-items: center; }
.dashboard-week-bars i { width: min(100%, 38px); border-radius: 7px 7px 2px 2px; background: #10B981; box-shadow: 0 4px 10px rgba(16,185,129,.2); }
.dashboard-week-bars > div:last-child i { background: #059669; }
.week-value { position: absolute; bottom: calc(var(--value, 60%) + 4px); transform: translateY(-8px); color: var(--text-secondary); font-size: 11px; font-weight: 700; }
.dashboard-week-bars i + small { position: absolute; bottom: -25px; color: var(--text-secondary); font-size: 11px; white-space: nowrap; }

.dashboard-session-list,
.dashboard-risk-list { display: grid; gap: 0; list-style: none; margin: 0; padding: 0; }
.dashboard-session-list > div { display: grid; grid-template-columns: auto 1fr auto; gap: 7px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.dashboard-session-list > div:last-child { border-bottom: 0; }
.dashboard-session-list strong { font-size: 13px; color: var(--text-main); }
.dashboard-session-list span:not(.session-status) { grid-column: 2; color: var(--text-secondary); font-size: 11px; }
.dashboard-session-list small { grid-row: span 2; color: var(--text-secondary); font-size: 11px; direction: ltr; }
.session-status { padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.session-status.is-done { background: #E8F8F0; color: #087A55; }
.session-status.is-pending { background: #FFF7E6; color: #B45309; }

.dashboard-risk-list li { display: grid; grid-template-columns: 27px 1fr auto; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.dashboard-risk-list li:last-child { border-bottom: 0; }
.dashboard-risk-list b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: #FFF1F2; color: #BE123C; font-size: 11px; }
.dashboard-risk-list div { display: grid; gap: 2px; }
.dashboard-risk-list strong { color: var(--text-main); font-size: 13px; }
.dashboard-risk-list span { color: var(--text-secondary); font-size: 11px; }
.dashboard-risk-list em { padding: 4px 7px; border-radius: 999px; background: #FFF7F7; color: #BE123C; font-size: 11px; font-style: normal; font-weight: 700; }

.dashboard-levels-card { margin-bottom: 20px !important; }
.dashboard-actions { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .dashboard-main-grid,
  .dashboard-operational-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .dashboard-head { align-items: stretch; flex-direction: column; }
  .dashboard-date { width: fit-content; }
  .dashboard-attendance-content { gap: 18px; }
  .dashboard-donut { width: 120px; height: 120px; }
  .dashboard-week-bars { gap: 8px; }
  .dashboard-week-bars i { width: 22px; }
  .dashboard-week-bars > div:nth-child(2n) small { display: none; }
  .dashboard-actions .btn { flex: 1 1 100%; }
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 22px;
  margin-bottom: 22px;
}

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

/* ---------------------------------------------------------
   11. Dynamic Weekly Pill Chart
   --------------------------------------------------------- */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  height: 210px;
  padding: 26px 10px 8px;
  border-bottom: 1px solid var(--border-light);
}

.chart-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  cursor: pointer;
}

.chart-track {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar {
  position: relative;
  width: 100%;
  max-width: 44px;
  background: var(--grad-chart-bar);
  border-radius: 8px 8px 4px 4px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28);
  animation: growBar 900ms var(--ease-spring) both;
  transition: all var(--t-fast);
}

.chart-col:hover .chart-bar {
  background: linear-gradient(180deg, #6EE7B7 0%, #10B981 100%);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.45);
  transform: scaleY(1.03);
}

.chart-val {
  position: absolute;
  top: 8px;
  inset-inline: 0;
  text-align: center;
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-size: 11.5px;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.chart-day {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--t-fast);
}

.chart-col:hover .chart-day {
  color: var(--primary);
  font-weight: 700;
}

/* ---------------------------------------------------------
   12. Summary & Dynamic Progress
   --------------------------------------------------------- */
.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 13.5px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
}

.summary-row:last-of-type {
  border-bottom: none;
}

.summary-row strong {
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text-main);
}

.progress {
  position: relative;
  height: 9px;
  margin-top: 20px;
  background: var(--surface-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--grad-progress);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.55);
  animation: growWidth 950ms var(--ease-spring) both;
}

.progress-caption {
  margin-top: 12px;
}

/* ---------------------------------------------------------
   13. Activity Timeline
   --------------------------------------------------------- */
.activity {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.activity li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
  flex: none;
  position: relative;
}

.dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.35;
}

.dot-green { background: #10B981; }
.dot-blue { background: #38BDF8; }
.dot-yellow { background: #F59E0B; }

.activity p {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.5;
}

/* ---------------------------------------------------------
   14. Quick Action Grid
   --------------------------------------------------------- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.quick-actions .btn {
  width: 100%;
  padding: 13px;
}

/* ---------------------------------------------------------
   15. Filters Bar
   --------------------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.filters .field {
  min-width: 170px;
}

.filters .field.grow {
  flex: 1;
  min-width: 260px;
}

/* ---------------------------------------------------------
   16. Clean Tables & Specialized Cells (Subjects + Users)
   --------------------------------------------------------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: #FFFFFF;
}

.table {
  width: 100%;
  min-width: 780px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.table th {
  padding: 15px 18px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-light);
  text-align: right;
  white-space: nowrap;
}

.select-col {
  width: 46px;
  padding-inline: 12px !important;
  text-align: center !important;
}

.select-col input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.gender-icon {
  width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.gender-icon.is-male {
  background: var(--grad-blue-soft);
  color: #2563EB;
}

.gender-icon.is-female {
  background: var(--grad-rose-soft);
  color: #DB2777;
}

.table td {
  padding: 15px 18px;
  border-bottom: 1px solid rgba(241, 245, 249, 0.9);
  color: var(--text-main);
  vertical-align: middle;
  text-align: right;
}

.table tbody tr {
  transition: background-color var(--t-fast);
}

.table tbody tr:hover {
  background-color: #F8FAFC;
}

.table tbody tr:has(.student-select:checked) {
  background: #ECFDF5;
}

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

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-icon-btn {
  width: 31px;
  height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  color: var(--text-secondary);
  transition: all var(--t-fast);
}

.table-icon-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.table-icon-btn:hover {
  color: var(--primary);
  border-color: var(--primary-border);
  background: var(--grad-emerald-soft);
}

.table-icon-btn.is-danger:hover {
  color: #FFFFFF;
  border-color: #BE123C;
  background: #BE123C;
}

.table-icon-btn.is-danger {
  background: var(--rose);
  border-color: var(--rose);
  color: #FFFFFF;
}

.pagination {
  display: flex;
  gap: 6px;
}

.page-btn {
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
  transition: all var(--t-fast);
}

.page-btn:hover {
  background: var(--surface-subtle);
  border-color: #94A3B8;
}

.page-btn.is-active {
  background: var(--grad-primary);
  border-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

/* User Table Cell */
.user-cell {
  display: flex;
  align-items: center;
}

.user-cell-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.user-cell-email {
  font-size: 11px;
  color: var(--text-muted);
  direction: ltr;
  text-align: right;
  margin-top: 1px;
}

/* Subject Table Cell */
.subject-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.subject-icon-box {
  width: 44px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  border: 1px solid var(--border-input);
  color: var(--primary);
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-size: 11.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-xs);
}

.subject-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.subject-code {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* The subject list deliberately omits status; it is not needed in daily management. */
#subjectsTable td:nth-child(4) {
  display: none;
}

/* ---------------------------------------------------------
   17. Dynamic Status Tags & Badges
   --------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
}

.tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.tag-green {
  background: var(--grad-emerald-soft);
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.tag-red {
  background: var(--grad-rose-soft);
  color: #9F1239;
  border: 1px solid #FECDD3;
}

.tag-blue {
  background: var(--grad-blue-soft);
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.tag-amber {
  background: var(--grad-amber-soft);
  color: #B45309;
  border: 1px solid #FDE68A;
}

.tag-purple {
  background: var(--grad-purple-soft);
  color: #7E22CE;
  border: 1px solid #E9D5FF;
}

.tag-gray {
  background: var(--surface-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-input);
}

.chip {
  display: inline-flex;
  align-items: center;
  margin: 2px 3px 2px 0;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

/* ---------------------------------------------------------
   18. Mini Stats (Attendance & Subjects Bento)
   --------------------------------------------------------- */
.stats-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.stats-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.mini-stat {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  transition: all var(--t-base);
}

.mini-stat:hover {
  transform: translateY(-3px);
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: var(--shadow-md);
}

.mini-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.mini-value {
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

/* ---------------------------------------------------------
   19. Reports & Horizontal Gradient Fills
   --------------------------------------------------------- */
.report-card {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  transition: all var(--t-base);
}

.report-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(16, 185, 129, 0.35);
}

.report-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.report-card p {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
}

/* Reports workspace */
.report-builder,
.report-preview-card,
.report-history-card {
  overflow: hidden;
}

.report-builder-head,
.report-preview-head,
.report-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--border-card);
}

.report-builder-head h3,
.report-preview-head h3,
.report-history-head h3 {
  margin: 0;
  color: var(--text-main);
  font-size: 15px;
  font-weight: 750;
}

.report-builder-head span,
.report-preview-head > div > span,
.report-history-head span {
  color: var(--text-secondary);
  font-size: 12px;
}

.report-builder-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 20px 22px 16px;
}

.report-builder-actions {
  padding: 0 22px 21px;
}

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

.report-template {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  min-height: 82px;
  padding: 14px;
  text-align: right;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text-main);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t-base), background var(--t-base), box-shadow var(--t-base);
}

.report-template:hover,
.report-template.is-active {
  border-color: rgba(16, 185, 129, .45);
  background: #f2fbf8;
  box-shadow: var(--shadow-md);
}

.report-template > span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #e7f7f1;
  color: var(--primary);
  font-size: 19px;
}

.report-template strong {
  min-width: 0;
  font-size: 13px;
}

.report-template small {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 11px;
}

.report-ready,
.report-format {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.report-ready {
  color: #087a55;
  background: #e7f7f1;
}

.report-format {
  color: #1d5fa7;
  background: #eaf3ff;
}

.report-preview-card,
.report-history-card {
  margin-bottom: 18px;
}

.report-preview-head > div {
  display: grid;
  gap: 4px;
}

.report-history-card .table-wrap,
.report-preview-card .table-wrap {
  border: 0;
  border-radius: 0;
}

/* Printable attendance sheet */
.attendance-report-controls {
  overflow: hidden;
  margin-bottom: 20px;
}

.attendance-report-controls .report-builder-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.attendance-print-sheet {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

.attendance-print-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding-bottom: 17px;
  border-bottom: 2px solid var(--primary);
}

.attendance-print-head img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.attendance-print-head > div:not(.attendance-print-title) {
  display: grid;
  gap: 3px;
  color: var(--text-secondary);
  font-size: 12px;
}

.attendance-print-head > div:not(.attendance-print-title) strong {
  color: var(--text-main);
  font-size: 16px;
}

.attendance-print-title {
  display: grid;
  gap: 3px;
  justify-items: end;
  text-align: left;
}

.attendance-print-title h3 {
  margin: 0;
  color: var(--text-main);
  font-size: 17px;
}

.attendance-print-title span {
  color: var(--text-secondary);
  font-size: 12px;
}

.attendance-print-meta {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 0;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
}

.attendance-print-sheet .table-wrap {
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
}

.attendance-report-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  text-align: center;
  font-size: 12px;
}

.attendance-report-table th,
.attendance-report-table td {
  padding: 11px 9px;
  border-inline-start: 1px solid var(--border-card);
  border-bottom: 1px solid var(--border-card);
}

.attendance-report-table th:first-child,
.attendance-report-table td:first-child {
  min-width: 175px;
  border-inline-start: 0;
  text-align: right;
}

.attendance-report-table thead th {
  background: #F0FDF8;
  color: var(--text-main);
  font-weight: 750;
}

.attendance-report-table thead th span,
.attendance-report-table thead th small,
.attendance-report-table tbody td small {
  display: block;
}

.attendance-report-table thead th small,
.attendance-report-table tbody td small {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 500;
}

.attendance-report-table tbody tr:last-child td,
.attendance-report-table tfoot th {
  border-bottom: 0;
}

.attendance-report-table tfoot th {
  background: #F8FAFC;
  color: var(--text-main);
  font-weight: 800;
}

.attendance-hour.has-absence {
  color: #BE123C;
  font-weight: 800;
  background: #FFF8F8;
}

.attendance-total-col {
  background: #F8FAFC;
  font-weight: 800;
}

.attendance-print-foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-input);
  color: var(--text-secondary);
  font-size: 11px;
}

.user-login {
  display: inline-flex;
  padding: 4px 8px;
  direction: ltr;
  border-radius: 6px;
  background: #F1F5F9;
  color: var(--text-secondary);
  font-family: monospace;
  font-size: 11px;
}

.hbar-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hbar-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 18px;
  padding: 10px 0;
}

.hbar-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.hbar-track {
  height: 9px;
  background: var(--surface-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.hbar-fill {
  height: 100%;
  background: var(--grad-rose);
  border-radius: 999px;
  animation: growWidth 950ms var(--ease-spring) both;
}

.hbar-value {
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: left;
}

/* ---------------------------------------------------------
   20. Glassmorphic Modals
   --------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 15, 10, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-overlay.is-open {
  display: flex;
  animation: modalFadeIn 240ms var(--ease-spring) both;
}

.modal {
  width: 100%;
  max-width: 530px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: modalScaleUp 320ms var(--ease-spring) both;
  overflow: hidden;
}

.modal-wide {
  width: min(94vw, 1240px);
  max-width: 1240px;
  max-height: 92vh;
}

#modal-student-view .modal-head {
  padding: 22px 30px;
}

#modal-student-view .modal-body {
  gap: 22px;
  padding: 28px 30px 32px;
}

#modal-student-view .detail-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

#modal-student-view .detail-item {
  min-height: 76px;
  padding: 14px 16px;
}

#modal-student-view .detail-attendance {
  margin-top: 0;
  padding: 18px 20px;
}

#modal-student-view .absence-history {
  margin-top: 2px;
  padding-top: 24px;
}

#modal-student-view .absence-insights {
  gap: 14px;
  margin-top: 18px;
}

#modal-student-view .absence-insight {
  padding: 14px 16px;
}

#modal-student-view .absence-record-filters {
  gap: 14px;
  margin-top: 20px;
}

#modal-student-view .absence-filters {
  margin-top: 20px;
}

#modal-student-view .absence-table-wrap {
  margin-top: 18px;
}

@media (max-width: 1050px) {
  .modal-wide { width: min(96vw, 960px); }
  #modal-student-view .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  #modal-student-view { padding: 12px; }
  .modal-wide { width: 100%; max-height: 94vh; }
  #modal-student-view .modal-head { padding: 17px 18px; }
  #modal-student-view .modal-body { padding: 18px; gap: 18px; }
  #modal-student-view .detail-grid { grid-template-columns: minmax(0, 1fr); }
  #modal-student-view .absence-insights { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

.modal-logout {
  align-items: center;
  padding-top: 30px;
  text-align: center;
}

.logout-dialog-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #FFF1F2;
  color: #BE123C;
}

.logout-dialog-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logout-dialog-body {
  padding: 16px 28px 20px;
}

.logout-dialog-body h3 {
  margin: 0 0 7px;
  color: var(--text-main);
  font-size: 18px;
}

.logout-dialog-body p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
}

.logout-dialog-actions {
  width: 100%;
  justify-content: center;
  padding: 0 28px 28px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 26px;
  border-bottom: 1px solid var(--border-light);
}

.modal-head h3 {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text-main);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 20px;
  transition: all var(--t-fast);
}

.modal-close:hover {
  background: var(--surface-subtle);
  color: var(--text-main);
  transform: rotate(90deg);
}

.modal-body {
  padding: 26px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-copy {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.teacher-access-code {
  padding: 9px 12px;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-sm);
  background: var(--grad-blue-soft);
  color: #1D4ED8;
  font-size: 12px;
  font-weight: 700;
}

.modal-foot {
  display: flex;
  gap: 12px;
  padding: 18px 26px;
  border-top: 1px solid var(--border-light);
  background: #F8FAFC;
}

/* Student Detail Grid */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--surface-subtle);
  border-radius: var(--radius-md);
}

.detail-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.detail-value {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.detail-attendance {
  margin-top: 14px;
  padding: 16px;
  background: var(--surface-subtle);
  border-radius: var(--radius-md);
}

/* Student absence history */
.absence-history {
  margin-top: 4px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.absence-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.absence-history-head h4 {
  color: var(--text-main);
  font-size: 15px;
  font-weight: 800;
}

.absence-history-head p {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 3px;
}

.absence-insights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.absence-insight {
  padding: 11px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: #FFFFFF;
}

.absence-insight span,
.absence-insight small {
  display: block;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
}

.absence-insight strong {
  display: block;
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
  margin: 4px 0;
}

.absence-insight.is-attendance {
  border-color: #A7F3D0;
  background: var(--grad-emerald-soft);
}

.absence-insight.is-attendance strong {
  color: #065F46;
}

.absence-insight.is-absence {
  border-color: #FECDD3;
  background: var(--grad-rose-soft);
}

.absence-insight.is-absence strong {
  color: #9F1239;
}

.absence-record-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.absence-record-filters select {
  padding: 8px 10px;
}

.absence-total {
  min-width: 114px;
  padding: 8px 12px;
  border: 1px solid #FECDD3;
  border-radius: var(--radius-sm);
  background: var(--grad-rose-soft);
  text-align: center;
}

.absence-total span {
  display: block;
  color: #9F1239;
  font-size: 10.5px;
  font-weight: 700;
}

.absence-total strong {
  color: #9F1239;
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-size: 16px;
}

.absence-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.absence-filter-btn {
  padding: 7px 11px;
  border: 1px solid var(--border-input);
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  transition: all var(--t-fast);
}

.absence-filter-btn:hover,
.absence-filter-btn.is-active {
  border-color: #FDA4AF;
  background: var(--grad-rose-soft);
  color: #9F1239;
}

.absence-custom-range {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.absence-custom-range[hidden] {
  display: none;
}

.absence-custom-range .field {
  flex: 1;
}

.absence-custom-range input[type="date"] {
  padding: 8px 10px;
}

.absence-table-wrap {
  margin-top: 14px;
}

.absence-table {
  min-width: 560px;
}

.absence-hours {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--grad-rose-soft);
  color: #9F1239;
  font-size: 11px;
  font-weight: 700;
}

.absence-empty {
  padding: 22px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* Attendance Check Control */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: #FFFFFF;
}

.check-name {
  font-size: 13.5px;
  font-weight: 600;
}

.toggle-group {
  display: inline-flex;
  padding: 3px;
  background: #F1F5F9;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.toggle-btn {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: all var(--t-fast);
}

.toggle-btn.is-present {
  background: #FFFFFF;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.toggle-btn.is-absent {
  background: #FFFFFF;
  color: #E11D48;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ---------------------------------------------------------
   21. Modern Gradient Toasts
   --------------------------------------------------------- */
.toast-wrap {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 380px;
  padding: 14px 18px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-inline-start: 4px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hover);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  animation: toastIn 320ms var(--ease-spring) both;
}

/* ---------------------------------------------------------
   22. Absence Analytics
   --------------------------------------------------------- */
.analytics-updated {
  padding: 7px 11px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
}

/* Analytics information architecture: compact controls, KPI strip, and composition panel. */
.analytics-control-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.analytics-period-tabs {
  display: inline-flex;
  max-width: 100%;
  gap: 3px;
  overflow-x: auto;
  padding: 3px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--surface-subtle);
}

.analytics-period-tabs button {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 7px;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.analytics-period-tabs button:hover { color: var(--primary); }
.analytics-period-tabs button.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-xs); }
.analytics-period-native { display: none; }

.analytics-filter-controls {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.analytics-filter-controls select {
  width: auto;
  min-width: 122px;
  padding: 8px 28px 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
}

.analytics-custom-range {
  width: 100%;
  align-items: center;
  margin-top: 0;
}

.analytics-custom-range input[type="date"] {
  flex: 1;
  padding: 8px 10px;
}

.analytics-single-day {
  display: flex;
  align-items: center;
  gap: 8px;
}

.analytics-single-day input[type="date"] {
  width: 160px;
  padding: 8px 10px;
}

.analytics-kpi-strip {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.analytics-kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.analytics-kpi > div { min-width: 0; }
.analytics-kpi > div > span,
.analytics-kpi > div > strong,
.analytics-kpi > div > small { display: block; }
.analytics-kpi > div > span { color: var(--text-secondary); font-size: 11px; font-weight: 700; }
.analytics-kpi > div > strong { margin: 2px 0; color: var(--text-main); font-family: 'Plus Jakarta Sans', var(--font-base); font-size: 23px; font-weight: 800; white-space: nowrap; }
.analytics-kpi > div > strong small { font-size: 11px; font-weight: 700; }
.analytics-kpi > div > small { color: var(--text-muted); font-size: 10.5px; white-space: nowrap; }
.analytics-kpi > div > small b { color: var(--text-secondary); }

.analytics-kpi-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 19px;
  font-weight: 800;
}

.analytics-kpi-icon.is-blue { background: #2563EB; }
.analytics-kpi-icon.is-cyan { background: #0284C7; }
.analytics-kpi-icon.is-red { background: #DC2626; }
.analytics-kpi-hero { gap: 14px; }
.analytics-kpi-hero .absence-donut { width: 106px; height: 106px; }
.analytics-kpi-hero .absence-donut::before { width: 82px; height: 82px; }
.analytics-kpi-hero .absence-donut strong { font-size: 17px; line-height: 1.05; }
.analytics-kpi-hero .absence-donut span { font-size: 8.5px; line-height: 1.15; }
.analytics-kpi-hero .absence-donut b { margin-top: 4px; font-size: 12px; line-height: 1.05; }
.analytics-kpi-hero .absence-donut small { display: block; color: #047857; font-size: 8.5px; font-weight: 700; line-height: 1.15; }

.analytics-health-card { margin-bottom: 30px; }
.analytics-health-card:hover { transform: none; }
.analytics-health-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}
.analytics-health-head h3 { color: var(--text-main); font-size: 14px; }
.analytics-health-head > strong { color: #9F1239; font-family: 'Plus Jakarta Sans', var(--font-base); font-size: 12px; }
.analytics-composition-bar { display: flex; height: 18px; overflow: hidden; border-radius: 999px; background: var(--surface-subtle); }
.analytics-composition-bar span { display: block; min-width: 3px; }
.composition-present { width: var(--present); background: var(--primary); }
.composition-absent { width: var(--absent); background: var(--rose); }
.analytics-composition-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.analytics-composition-values > div { display: flex; align-items: center; gap: 7px; min-width: 0; }
.analytics-composition-values span { color: var(--text-secondary); font-size: 11px; font-weight: 600; }
.analytics-composition-values strong { margin-inline-start: auto; color: var(--text-main); font-family: 'Plus Jakarta Sans', var(--font-base); font-size: 11px; white-space: nowrap; }
.analytics-full-card { margin-bottom: 30px; }

.analytics-explorer {
  margin-top: 30px;
  padding: 0;
  overflow: hidden;
}

.analytics-explorer:hover { transform: none; }

.analytics-explorer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--border-light);
}

.analytics-explorer-head h3 { color: var(--text-main); font-size: 15px; }
.analytics-explorer-head span { padding: 4px 9px; border-radius: 999px; background: var(--grad-blue-soft); color: #1D4ED8; font-size: 10.5px; font-weight: 700; }

.analytics-detail-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-light);
  background: #FBFCFE;
}

.analytics-detail-tabs button {
  flex: 0 0 auto;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.analytics-detail-tabs button:hover { color: var(--primary); }
.analytics-detail-tabs button.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-xs); }

.analytics-detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-light);
  background: #FBFCFE;
}

.analytics-detail-toolbar input[type="search"] {
  min-width: 250px;
  flex: 1;
  max-width: 390px;
  padding: 9px 12px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.analytics-detail-toolbar input[type="search"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.analytics-detail-toolbar select { width: auto; min-width: 150px; padding: 9px 30px 9px 10px; border-radius: var(--radius-sm); font-size: 12px; }
.analytics-detail-table { min-width: 840px; }
.analytics-detail-table td strong { display: block; font-size: 12px; }
.analytics-detail-table td small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 10px; }

.analytics-detail-table th .js-detail-column-sort {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
}

.analytics-detail-table th .js-detail-column-sort:hover,
.analytics-detail-table th .js-detail-column-sort.is-sorted { color: var(--primary); }
.analytics-detail-table th .js-detail-column-sort i { color: var(--text-muted); font-family: Arial, sans-serif; font-size: 12px; font-style: normal; }
.analytics-detail-table th .js-detail-column-sort.is-sorted i { color: var(--primary); }

.analytics-filter-card {
  padding-bottom: 20px;
}

.analytics-filter-card:hover {
  transform: none;
}

#panel-absence-analytics .analytics-stats {
  gap: 24px;
  margin-bottom: 30px;
}

#panel-absence-analytics .grid-2,
#panel-absence-analytics .grid-even {
  gap: 28px;
  margin-bottom: 30px;
}

.analytics-filters {
  margin-bottom: 0;
}

.analytics-filter-heading,
.analytics-section-heading,
.analytics-result-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.analytics-filter-heading {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.analytics-filter-heading h3,
.analytics-section-heading h3 {
  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
}

.analytics-filter-heading p,
.analytics-section-heading p {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 11.5px;
}

.analytics-filter-heading > span {
  max-width: 230px;
  padding: 5px 9px;
  border-radius: var(--radius-xs);
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.analytics-custom-range {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.analytics-custom-range[hidden] {
  display: none;
}

.analytics-custom-range .field {
  flex: 1;
}

.analytics-filter-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.analytics-result-summary {
  align-items: center;
  margin: 17px 2px 24px;
}

.analytics-context {
  color: var(--text-secondary);
  font-size: 12px;
}

.analytics-result-summary > span {
  color: var(--text-muted);
  font-size: 10.5px;
}

.analytics-section-heading {
  align-items: center;
  margin: 28px 0 14px;
}

.analytics-section-heading > span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.analytics-stats .stat-value small {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

.analytics-stat-note {
  width: fit-content;
  margin-top: 13px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
}

.analytics-stat-note.is-neutral { background: #EFF6FF; color: #1D4ED8; }
.analytics-stat-note.is-alert { background: #FFF7ED; color: #C2410C; }
.analytics-stat-note.is-good { background: #ECFDF5; color: #047857; }

.analytics-operational-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  margin-top: -8px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: var(--border-card);
}

.analytics-operational-grid > div {
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface);
}

.analytics-operational-grid span,
.analytics-operational-grid strong {
  display: block;
}

.analytics-operational-grid span {
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 600;
}

.analytics-operational-grid strong {
  margin-top: 3px;
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-size: 19px;
  font-weight: 800;
}

.analytics-operational-grid small {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
}

.analytics-insight-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: var(--border-card);
}

.analytics-insight {
  min-width: 0;
  padding: 15px;
  background: var(--surface);
}

.analytics-insight > span,
.analytics-insight > strong,
.analytics-insight > small {
  display: block;
}

.analytics-insight > span {
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 600;
}

.analytics-insight > strong {
  margin: 2px 0;
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-size: 18px;
  font-weight: 800;
}

.analytics-insight > small {
  color: var(--text-muted);
  font-size: 10px;
}

.analytics-insight-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-size: 13px;
  font-weight: 800;
}

.analytics-insight-icon.is-good { background: #ECFDF5; color: #047857; }
.analytics-insight-icon.is-alert { background: #FFF7ED; color: #C2410C; }
.analytics-insight-icon.is-info { background: #EFF6FF; color: #1D4ED8; }
.analytics-insight p { min-width: 0; }
.analytics-insight strong,
.analytics-insight small { display: block; }
.analytics-insight strong { color: var(--text-main); font-size: 11.5px; }
.analytics-insight small { margin-top: 2px; color: var(--text-muted); font-size: 10.5px; line-height: 1.55; }

.analytics-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.analytics-key i,
.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.analytics-key i,
.legend-dot.absent { background: var(--rose); }
.legend-dot.present { background: var(--primary); }
.legend-dot.scheduled { background: #94A3B8; }

.analytics-trend-card:hover {
  transform: none;
}

.analytics-trend-legend {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
}

.analytics-trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.analytics-trend-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--border-light);
}

.analytics-trend-summary > div {
  min-width: 0;
  padding: 9px 11px;
  background: var(--surface-subtle);
}

.analytics-trend-summary span,
.analytics-trend-summary strong { display: block; }
.analytics-trend-summary span { color: var(--text-muted); font-size: 9.5px; font-weight: 600; }
.analytics-trend-summary strong { margin-top: 2px; color: var(--text-main); font-family: 'Plus Jakarta Sans', var(--font-base); font-size: 12px; white-space: nowrap; }

.analytics-trend {
  height: 220px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 0 8px;
  border-bottom: 1px solid var(--border-light);
}

.analytics-trend-col {
  flex: 1;
  min-width: 34px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.analytics-trend-col strong {
  color: #047857;
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-size: 11px;
}

.analytics-trend-col em {
  color: #9F1239;
  font-size: 9.5px;
  font-style: normal;
  font-weight: 600;
}

.analytics-trend-values {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.analytics-trend-stack {
  width: 100%;
  max-width: 38px;
  min-height: 100px;
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  border: 1px solid #E2E8F0;
  border-radius: 7px 7px 2px 2px;
  background: #F1F5F9;
}

.analytics-trend-stack span { display: block; width: 100%; }
.trend-present { background: #10B981; }
.trend-absent { background: #E11D48; min-height: 5px; }

.analytics-trend-track {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.analytics-trend-track span {
  width: 100%;
  max-width: 36px;
  min-height: 20px;
  border-radius: 6px 6px 2px 2px;
  background: #E11D48;
  box-shadow: 0 3px 8px rgba(225, 29, 72, 0.18);
}

.analytics-trend-col small {
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
}

.attendance-overview {
  min-height: 222px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
}

.absence-donut {
  position: relative;
  width: 150px;
  height: 150px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--rose) calc(var(--absence-rate) * 1%), var(--primary) 0);
}

.absence-donut::before {
  content: "";
  position: absolute;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: var(--surface);
}

.absence-donut > div {
  position: relative;
  z-index: 1;
  text-align: center;
}

.absence-donut strong {
  display: block;
  color: #9F1239;
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-size: 21px;
  letter-spacing: -0.04em;
}

.absence-donut span {
  display: block;
  color: var(--text-secondary);
  font-size: 9.5px;
  font-weight: 600;
}

.absence-donut b {
  display: block;
  margin-top: 5px;
  color: #047857;
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-size: 11px;
  font-weight: 800;
}

.attendance-overview-list {
  min-width: 195px;
}

.attendance-overview-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.attendance-overview-list > div:last-child { border-bottom: 0; }

.attendance-overview-list span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 11.5px;
}

.attendance-overview-list strong {
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-size: 12px;
  white-space: nowrap;
}

.analytics-hbar-list .hbar-row {
  grid-template-columns: 106px minmax(0, 1fr) 118px;
}

.analytics-hbar-list .hbar-value {
  font-size: 11px;
  white-space: nowrap;
}

.analytics-ranking {
  display: flex;
  flex-direction: column;
}

.analytics-ranking-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.analytics-ranking-row:last-child { border-bottom: 0; }

.rank {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-size: 11px;
  font-weight: 700;
}

.analytics-ranking-row:first-child .rank {
  background: #FFF7ED;
  color: #C2410C;
}

.analytics-ranking-row strong,
.analytics-ranking-row small {
  display: block;
}

.analytics-ranking-row strong { font-size: 12.5px; }
.analytics-ranking-row small { color: var(--text-muted); font-size: 10.5px; margin-top: 2px; }
.analytics-ranking-row b { color: #9F1239; font-size: 11.5px; white-space: nowrap; }

.analytics-student-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  background: var(--border-card);
}

.analytics-student-summary > div {
  min-width: 0;
  padding: 9px 8px;
  background: var(--surface-subtle);
  text-align: center;
}

.analytics-student-summary span,
.analytics-student-summary strong { display: block; }
.analytics-student-summary span { color: var(--text-muted); font-size: 9.5px; font-weight: 600; white-space: nowrap; }
.analytics-student-summary strong { margin-top: 2px; color: var(--text-main); font-family: 'Plus Jakarta Sans', var(--font-base); font-size: 16px; }

.analytics-breakdown {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.analytics-breakdown > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 92px;
  align-items: center;
  gap: 12px;
}

.analytics-breakdown > div > span {
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
}

.analytics-breakdown-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-subtle);
}

.analytics-breakdown-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #E11D48;
}

.analytics-breakdown strong {
  color: var(--text-secondary);
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-size: 10.5px;
  text-align: left;
  white-space: nowrap;
}

.analytics-alert-card { border-color: #FED7AA; }
.analytics-alert-count {
  min-width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #FFF7ED;
  color: #C2410C;
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-size: 12px;
  font-weight: 700;
}

.analytics-alert-list {
  display: flex;
  flex-direction: column;
}

.analytics-alert-list > div {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-light);
}

.analytics-alert-list > div:last-child { border-bottom: 0; }
.alert-mark { width: 8px; height: 8px; border-radius: 50%; }
.alert-mark.high { background: var(--rose); }
.alert-mark.medium { background: #F59E0B; }
.analytics-alert-list p { min-width: 0; }
.analytics-alert-list strong,
.analytics-alert-list small { display: block; }
.analytics-alert-list strong { font-size: 12px; }
.analytics-alert-list small { color: var(--text-muted); font-size: 10.5px; margin-top: 2px; }
.analytics-alert-list button { color: var(--primary); font-size: 11px; font-weight: 700; }

.analytics-low-absence-card {
  margin-bottom: 30px;
}

.analytics-low-absence-card:hover { transform: none; }

.analytics-low-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: var(--border-card);
}

.analytics-low-list > div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 13px 12px;
  background: var(--surface);
}

.low-rank {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ECFDF5;
  color: #047857;
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-size: 11px;
  font-weight: 800;
}

.analytics-low-list p { min-width: 0; }
.analytics-low-list strong,
.analytics-low-list small { display: block; }
.analytics-low-list strong { overflow: hidden; color: var(--text-main); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.analytics-low-list small { overflow: hidden; margin-top: 2px; color: var(--text-muted); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.analytics-low-list b { color: #047857; font-size: 10.5px; white-space: nowrap; }

.analytics-teachers-card {
  margin-top: 0;
}

.analytics-teachers-card:hover { transform: none; }

.analytics-teachers-table {
  min-width: 920px;
}

.analytics-teachers-table td {
  font-size: 12px;
}

.analytics-rate-badge {
  display: inline-flex;
  min-width: 48px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-family: 'Plus Jakarta Sans', var(--font-base);
  font-size: 11px;
  font-weight: 700;
}

.analytics-rate-badge.is-high { background: #FFF1F2; color: #9F1239; }
.analytics-rate-badge.is-medium { background: #FFF7ED; color: #C2410C; }
.analytics-rate-badge.is-low { background: #ECFDF5; color: #047857; }

/* ---------------------------------------------------------
   23. Keyframe Animations
   --------------------------------------------------------- */
@keyframes panelIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.95) translateY(14px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

@keyframes growBar {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

@keyframes growWidth {
  from { width: 0; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(217, 119, 6, 0); }
}

/* ---------------------------------------------------------
   23. Responsive Layout Adaptations
   --------------------------------------------------------- */
@media (max-width: 1200px) {
  .stats-grid,
  .stats-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .attendance-overview {
    justify-content: flex-start;
  }

  .analytics-insight-strip {
    grid-template-columns: 1fr;
  }

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

  .analytics-low-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-filter-controls {
    justify-content: flex-start;
  }

  .report-builder-fields,
  .report-templates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell {
    padding-right: 0 !important;
  }

  .sidebar {
    width: 280px;
    transform: translateX(100%);
    box-shadow: -8px 0 35px rgba(15, 23, 42, 0.15);
  }

  .sidebar.is-open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .topbar {
    padding: 12px 20px;
  }

  .content {
    padding: 24px 20px 36px;
  }

  .profile-name {
    display: none;
  }

  .profile-btn {
    padding: 4px;
  }
}

@media (max-width: 640px) {
  .badge-outline,
  .year-select,
  .page-desc {
    display: none;
  }

  .stats-grid,
  .stats-grid-4,
  .grid-even,
  .quick-actions,
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .absence-history-head,
  .absence-custom-range {
    align-items: stretch;
    flex-direction: column;
  }

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

  .checkbox-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .hbar-row {
    grid-template-columns: 110px minmax(0, 1fr) 30px;
  }

  .report-builder-fields,
  .report-templates {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-builder-head,
  .report-preview-head,
  .report-history-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding: 15px 16px;
  }

  .report-builder-fields {
    padding: 16px;
  }

  .report-builder-actions {
    padding: 0 16px 16px;
  }

  .attendance-print-sheet {
    padding: 18px 14px;
  }

  .attendance-print-head {
    grid-template-columns: auto 1fr;
  }

  .attendance-print-title {
    grid-column: 1 / -1;
    justify-items: start;
    text-align: right;
  }

  .attendance-print-meta,
  .attendance-print-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .analytics-custom-range,
  .attendance-overview {
    flex-direction: column;
    align-items: stretch;
  }

  .attendance-overview {
    gap: 20px;
  }

  .absence-donut {
    align-self: center;
  }

  .analytics-hbar-list .hbar-row {
    grid-template-columns: 82px minmax(0, 1fr) 100px;
    gap: 8px;
  }

  .analytics-breakdown > div {
    grid-template-columns: 92px minmax(0, 1fr) 78px;
    gap: 8px;
  }

  .analytics-breakdown > div > span,
  .analytics-breakdown strong {
    font-size: 10px;
  }

  .analytics-trend {
    gap: 8px;
  }

  .analytics-trend-summary > div {
    padding: 8px 7px;
  }

  .analytics-trend-summary strong {
    font-size: 10px;
  }

  .analytics-low-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .analytics-control-bar {
    align-items: stretch;
  }

  .analytics-period-tabs {
    width: 100%;
  }

  .analytics-filter-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-filter-controls select,
  .analytics-filter-controls .btn {
    width: 100%;
    min-width: 0;
  }

  .analytics-kpi-strip,
  .analytics-composition-values {
    grid-template-columns: minmax(0, 1fr);
  }

  .analytics-kpi {
    padding: 14px;
  }

  .analytics-composition-values > div {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
  }

  .analytics-composition-values > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .analytics-single-day,
  .analytics-custom-range {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .analytics-single-day input[type="date"] {
    width: 100%;
  }

  .analytics-single-day .btn,
  .analytics-custom-range .btn {
    width: 100%;
  }

  .analytics-detail-toolbar input[type="search"],
  .analytics-detail-toolbar select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .analytics-filter-heading,
  .analytics-section-heading,
  .analytics-result-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .analytics-filter-heading > span {
    max-width: none;
  }

  .analytics-filter-actions {
    justify-content: stretch;
  }

  .analytics-filter-actions .btn {
    flex: 1;
  }

  .content {
    padding: 18px 16px 30px;
  }

  .card {
    padding: 20px 18px;
  }

  .toast-wrap {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

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

/* Reduced Motion Mode for Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Keep the time-only custom range compact inside the analytics control bar. */
#panel-absence-analytics .analytics-control-bar .analytics-custom-range {
  width: 100%;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* The browser print dialog can save this sheet directly as a PDF. */
@media print {
  @page { size: A4 landscape; margin: 12mm; }

  body { background: #FFFFFF !important; }
  body * { visibility: hidden !important; }
  #printableAttendanceReport,
  #printableAttendanceReport * { visibility: visible !important; }

  #printableAttendanceReport {
    position: absolute;
    inset: 0;
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }

  #printableAttendanceReport .table-wrap { overflow: visible; }
  #printableAttendanceReport .attendance-report-table { min-width: 0; }
  #printableAttendanceReport .attendance-report-table th,
  #printableAttendanceReport .attendance-report-table td { padding: 8px 6px; }
}

/* Admin login background image override. */
.login-screen {
  overflow: hidden;
  isolation: isolate;
  background: #064632;
}

.login-gallery {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #064632;
}

.login-gallery::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(145deg, rgba(2, 56, 39, .82), rgba(5, 100, 72, .67) 52%, rgba(4, 68, 48, .82));
}

.login-gallery-grid {
  position: absolute;
  inset: -88px -20px;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  opacity: .7;
  transform: rotate(-2deg) scale(1.05);
}

.login-gallery-column { min-width: 0; }
.login-gallery-track {
  display: grid;
  gap: 16px;
  animation: login-gallery-scroll-down 190s linear infinite;
  will-change: transform;
}
.login-gallery-column-2 .login-gallery-track { animation-duration: 228s; animation-delay: -91s; }
.login-gallery-column-3 .login-gallery-track { animation-duration: 208s; animation-delay: -151s; }
.login-gallery-tile {
  height: clamp(132px, 18vw, 224px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .36);
  border-radius: 14px;
  background: rgba(255, 255, 255, .16);
  box-shadow: 0 10px 26px rgba(0, 35, 23, .24);
}
.login-gallery-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes login-gallery-scroll-down {
  from { transform: translateY(-50%); }
  to { transform: translateY(0); }
}

.login-card {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@media (max-width: 680px) {
  .login-gallery-grid { inset: -64px -52px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .login-gallery-column-3 { display: none; }
  .login-gallery-track { gap: 10px; }
  .login-gallery-tile { height: 142px; border-radius: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-gallery-track { animation: none; transform: translateY(-25%); }
}
