/* ==========================================================================
   THE CENTURY ACADEMY — STUDENT PORTAL DESIGN SYSTEM
   Modern, Ultra-Premium Academic Aesthetic
   ========================================================================== */

:root {
  /* Core Color Palette (Light Mode) */
  --bg-primary: #F8FAFC;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F1F5F9;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.82);

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-inverted: #FFFFFF;

  --border-light: #E2E8F0;
  --border-subtle: #F1F5F9;
  --border-strong: #CBD5E1;

  /* Brand / Academy Accents */
  --brand-navy: #0B132B;
  --brand-sapphire: #1C2541;
  --brand-blue: #2563EB;
  --brand-blue-hover: #1D4ED8;
  --brand-blue-subtle: #EFF6FF;

  --accent-emerald: #10B981;
  --accent-emerald-subtle: #ECFDF5;
  --accent-emerald-border: #A7F3D0;

  --accent-rose: #EF4444;
  --accent-rose-subtle: #FEF2F2;
  --accent-rose-border: #FECACA;

  --accent-amber: #F59E0B;
  --accent-amber-subtle: #FFFBEB;
  --accent-amber-border: #FDE68A;

  --accent-purple: #8B5CF6;
  --accent-purple-subtle: #F5F3FF;

  /* Typography */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Elevation & Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 25px rgba(37, 99, 235, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
  --bg-primary: #0A0F1D;
  --bg-secondary: #111827;
  --bg-tertiary: #1F2937;
  --bg-card: rgba(17, 24, 39, 0.95);
  --bg-glass: rgba(17, 24, 39, 0.85);

  --text-primary: #F9FAFB;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  --text-inverted: #0F172A;

  --border-light: #1F2937;
  --border-subtle: #182234;
  --border-strong: #374151;

  --brand-blue-subtle: rgba(37, 99, 235, 0.15);
  --accent-emerald-subtle: rgba(16, 185, 129, 0.15);
  --accent-rose-subtle: rgba(239, 68, 68, 0.15);
  --accent-amber-subtle: rgba(245, 158, 11, 0.15);
  --accent-purple-subtle: rgba(139, 92, 246, 0.15);

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 30px -5px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.25);
}

/* ==========================================================================
   Base & Resets
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text-primary);
}

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

a {
  color: var(--brand-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Header & Navbar
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition-normal);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.academy-logo-badge {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #0B132B 0%, #1C2541 60%, #3A86FF 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(11, 19, 43, 0.25);
}

.logo-icon {
  width: 24px;
  height: 24px;
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  line-height: 1.15;
}

.brand-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-blue);
  letter-spacing: 0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-student-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  padding: 0.35rem 0.75rem 0.35rem 0.45rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}
.header-student-badge:hover {
  border-color: var(--border-strong);
}

.avatar-mini {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--brand-blue), #60A5FA);
  color: #FFFFFF;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.header-student-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.header-student-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-student-class {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-text-sm {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.btn-text-sm:hover {
  background-color: var(--bg-tertiary);
  color: var(--brand-blue);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.icon-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.icon {
  width: 20px;
  height: 20px;
}
.icon-sm {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   Layout & View Management
   ========================================================================== */

.main-content {
  flex: 1;
  width: 100%;
}

.view-section {
  display: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}
.view-section.active {
  display: block;
  opacity: 1;
}

/* ==========================================================================
   1. Access / Login View
   ========================================================================== */

.login-wrapper {
  max-width: 860px;
  margin: 3.5rem auto 4rem auto;
  padding: 0 1.5rem;
}

.login-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.login-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0B132B, #2563EB, #10B981, #F59E0B);
}

.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background-color: var(--brand-blue-subtle);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-blue);
  margin-bottom: 1.25rem;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--accent-emerald);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.hero-heading {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--brand-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 640px;
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

/* Access Box */
.access-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2.5rem;
}

.access-tab-headers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  background-color: var(--bg-tertiary);
  padding: 0.35rem;
  border-radius: var(--radius-md);
}

.access-tab-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.access-tab-btn.active {
  background-color: var(--bg-secondary);
  color: var(--brand-blue);
  box-shadow: var(--shadow-sm);
}

.tab-icon {
  width: 18px;
  height: 18px;
}

.access-tab-pane {
  display: none;
}
.access-tab-pane.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

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

.search-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.form-select, .form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}
.form-select:focus, .form-input:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px var(--brand-blue-subtle);
  background-color: var(--bg-secondary);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-icon .input-icon {
  position: absolute;
  left: 1rem;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}
.input-with-icon .form-input {
  padding-left: 2.75rem;
}

.field-help {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.remember-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.remember-checkbox input {
  accent-color: var(--brand-blue);
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-blue) 0%, #1D4ED8 100%);
  color: #FFFFFF;
  border: none;
  padding: 0.95rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: all var(--transition-fast);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-sm-primary {
  background-color: var(--brand-blue);
  color: #FFFFFF;
  border: none;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.btn-sm-primary:hover {
  background-color: var(--brand-blue-hover);
}

.btn-outline-gold {
  background-color: var(--accent-amber-subtle);
  border: 1px solid var(--accent-amber-border);
  color: #B45309;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}
.btn-outline-gold:hover {
  background-color: #FEF3C7;
  transform: translateY(-1px);
}

/* Features Bar */
.hero-features-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  border-top: 1px solid var(--border-light);
  padding-top: 2rem;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.feature-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.feature-icon svg {
  width: 18px;
  height: 18px;
}
.feature-icon.green {
  background-color: var(--accent-emerald-subtle);
  color: var(--accent-emerald);
}
.feature-icon.blue {
  background-color: var(--brand-blue-subtle);
  color: var(--brand-blue);
}
.feature-icon.gold {
  background-color: var(--accent-amber-subtle);
  color: var(--accent-amber);
}

.feature-text {
  display: flex;
  flex-direction: column;
}
.feature-text strong {
  font-size: 0.85rem;
  color: var(--text-primary);
}
.feature-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   2. Dashboard Layout
   ========================================================================== */

.dashboard-wrapper {
  max-width: 1280px;
  margin: 2rem auto 4rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Profile Banner */
.student-profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.profile-main {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #0B132B 0%, #2563EB 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.profile-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.class-pill {
  background-color: var(--brand-blue-subtle);
  color: var(--brand-blue);
  border: 1px solid rgba(37, 99, 235, 0.2);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.type-pill {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.enrolled-pill {
  background-color: var(--accent-emerald-subtle);
  color: var(--accent-emerald);
  border: 1px solid var(--accent-emerald-border);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.student-name {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.profile-meta-grid {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.meta-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* 4-Stat Highlight Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.stat-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.stat-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.stat-icon-wrapper {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-icon {
  width: 18px;
  height: 18px;
}

.stat-icon-wrapper.green { background-color: var(--accent-emerald-subtle); color: var(--accent-emerald); }
.stat-icon-wrapper.blue { background-color: var(--brand-blue-subtle); color: var(--brand-blue); }
.stat-icon-wrapper.purple { background-color: var(--accent-purple-subtle); color: var(--accent-purple); }
.stat-icon-wrapper.amber { background-color: var(--accent-amber-subtle); color: var(--accent-amber); }

.stat-number-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
}

.stat-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}
.stat-tag.green { background-color: var(--accent-emerald-subtle); color: var(--accent-emerald); }
.stat-tag.neutral { background-color: var(--bg-tertiary); color: var(--text-secondary); }

.stat-grade-pill {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--brand-blue);
  background-color: var(--brand-blue-subtle);
  padding: 0.15rem 0.65rem;
  border-radius: var(--radius-md);
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.65rem;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.progress-bar-fill.green { background: linear-gradient(90deg, #10B981, #34D399); }
.progress-bar-fill.blue { background: linear-gradient(90deg, #2563EB, #60A5FA); }

.stat-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-metrics-inline {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  margin-right: 3px;
}
.dot.green { background-color: var(--accent-emerald); }
.dot.red { background-color: var(--accent-rose); }

/* ==========================================================================
   Navigation Tabs Bar
   ========================================================================== */

.portal-nav-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0.4rem;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.portal-tab-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.portal-tab-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}
.portal-tab-btn.active {
  background: linear-gradient(135deg, var(--brand-blue) 0%, #1D4ED8 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.portal-tab-content {
  display: none;
}
.portal-tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ==========================================================================
   Content Cards & Tables
   ========================================================================== */

.content-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.card-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.card-title-group {
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-body {
  padding: 1.5rem 1.75rem;
}

.header-filters {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.filter-select {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Overview Layout */
.overview-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

.content-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.attendance-week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.day-badge-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.65rem 0.25rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-light);
}

.day-box-name {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}
.day-box-date {
  font-size: 0.8rem;
  font-weight: 800;
  margin: 0.2rem 0;
}
.day-box-status {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
}
.day-box-status.present { background-color: var(--accent-emerald); color: #FFF; }
.day-box-status.absent { background-color: var(--accent-rose); color: #FFF; }
.day-box-status.leave { background-color: var(--accent-amber); color: #FFF; }

.notice-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}
.notice-icon {
  width: 32px;
  height: 32px;
  background-color: var(--brand-blue);
  color: #FFFFFF;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notice-icon svg { width: 18px; height: 18px; }
.notice-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.25rem; }
.notice-desc { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.data-table th {
  padding: 0.85rem 1rem;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-light);
}

.data-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:hover td {
  background-color: var(--bg-primary);
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-status.present {
  background-color: var(--accent-emerald-subtle);
  color: var(--accent-emerald);
  border: 1px solid var(--accent-emerald-border);
}
.badge-status.absent {
  background-color: var(--accent-rose-subtle);
  color: var(--accent-rose);
  border: 1px solid var(--accent-rose-border);
}
.badge-status.leave {
  background-color: var(--accent-amber-subtle);
  color: var(--accent-amber);
  border: 1px solid var(--accent-amber-border);
}

.badge-grade {
  display: inline-block;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-tertiary);
  color: var(--brand-blue);
}
.badge-grade.A-plus { background-color: #ECFDF5; color: #047857; }
.badge-grade.A { background-color: #EFF6FF; color: #1D4ED8; }
.badge-grade.B { background-color: #F5F3FF; color: #6D28D9; }
.badge-grade.C { background-color: #FFFBEB; color: #B45309; }
.badge-grade.F { background-color: #FEF2F2; color: #B91C1C; }

/* Attendance Stats Bar in Tab */
.attendance-stat-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  padding: 1.25rem 1.75rem;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
}

.att-stat-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
}
.att-stat-count {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
}
.att-stat-pill.green .att-stat-count { color: var(--accent-emerald); }
.att-stat-pill.red .att-stat-count { color: var(--accent-rose); }
.att-stat-pill.amber .att-stat-count { color: var(--accent-amber); }
.att-stat-pill.blue .att-stat-count { color: var(--brand-blue); }

.att-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ==========================================================================
   Printable Report Card Styles
   ========================================================================== */

.report-controls-bar {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.printable-card {
  background-color: #FFFFFF;
  color: #0F172A;
  border: 2px solid #CBD5E1;
  border-radius: var(--radius-lg);
  padding: 3rem;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: var(--shadow-xl);
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.report-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.report-logo {
  width: 54px;
  height: 54px;
  background: #0B132B;
  color: #FFFFFF;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
}

.report-academy-name {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 900;
  color: #0B132B;
  line-height: 1.1;
}

.report-academy-sub {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}

.report-academy-contact {
  font-size: 0.75rem;
  color: #64748B;
}

.report-type-badge {
  background-color: #0B132B;
  color: #FFFFFF;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.report-divider {
  height: 2px;
  background: linear-gradient(90deg, #0B132B 0%, #2563EB 50%, #0B132B 100%);
  margin-bottom: 1.5rem;
}

.report-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 2rem;
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.report-meta-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.report-meta-label {
  font-weight: 700;
  color: #475569;
  min-width: 120px;
}

.report-meta-val {
  font-weight: 800;
  color: #0F172A;
}

.report-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0B132B;
  margin-bottom: 0.75rem;
  border-left: 4px solid #2563EB;
  padding-left: 0.65rem;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  font-size: 0.85rem;
}

.report-table th {
  background-color: #0B132B;
  color: #FFFFFF;
  padding: 0.65rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  text-align: left;
  border: 1px solid #0B132B;
}

.report-table td {
  padding: 0.65rem 0.85rem;
  border: 1px solid #CBD5E1;
  color: #0F172A;
}

.report-total-row td {
  background-color: #F1F5F9;
  font-weight: 800;
  font-size: 0.9rem;
}

.report-summary-box {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  margin-bottom: 3.5rem;
}

.summary-col strong {
  display: block;
  font-size: 0.8rem;
  color: #475569;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.report-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  text-align: center;
}

.sig-line {
  border-top: 1px dashed #64748B;
  margin-bottom: 0.5rem;
}

.sig-block span {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
}

/* Fines Grid */
.fines-breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 800px) {
  .fines-breakdown-grid {
    grid-template-columns: 1fr;
  }
}
.sub-table-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.app-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: 1.5rem 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.version-tag {
  background-color: var(--bg-tertiary);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background-color: #0F172A;
  color: #FFFFFF;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInUp 0.3s ease;
}
.toast.success { background-color: #065F46; }
.toast.error { background-color: #991B1B; }

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

/* Utility Helpers */
.hidden { display: none !important; }
.text-center { text-align: center; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

/* ==========================================================================
   Print Stylesheet (@media print)
   ========================================================================== */

@media print {
  body {
    background-color: #FFFFFF !important;
    color: #000000 !important;
  }
  .app-header, .portal-nav-bar, .report-controls-bar, .app-footer, .toast-container, .student-profile-card, .stats-grid {
    display: none !important;
  }
  .printable-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
  .report-table th {
    background-color: #E2E8F0 !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
  }
  .report-table td {
    border: 1px solid #000000 !important;
    color: #000000 !important;
  }
}
