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

:root {
  color-scheme: light;
  --font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --bg-gradient: radial-gradient(at 0% 0%, #ede9fe 0, transparent 45%), radial-gradient(at 100% 0%, #e0e7ff 0, transparent 40%), radial-gradient(at 50% 100%, #f1f5f9 0, transparent 50%), #f8fafc;
  --surface-card: #ffffff;
  --surface-card-subtle: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --border-light: #e2e8f0;
  --border-card: rgba(226, 232, 240, 0.85);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-xs: 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 4px 12px -2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 12px 28px -6px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 20px 40px -10px rgba(15, 23, 42, 0.12), 0 8px 16px -4px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 14px 32px -8px rgba(99, 102, 241, 0.38);
}

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

body.app-mobile {
  margin: 0;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.app-shell {
  max-width: 920px;
  margin: auto;
  padding: 0 24px 115px;
}

/* Header */
.app-mobile header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(248, 250, 252, 0.88);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 8px;
}

.app-mobile h1, .mobile-admin h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: #1e1b4b;
}

.app-mobile h2, .mobile-admin h2 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: #1e1b4b;
}

.app-mobile .app-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.app-mobile .app-brand:hover {
  transform: scale(1.05);
}
.app-brand img, .login-heading img {
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.2);
}

.app-mobile .header-title {
  flex: 1;
  min-width: 0;
}
.app-mobile header h1 {
  font-size: 18px;
  line-height: 1.25;
}
.app-mobile header #account {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}
.app-mobile header #account:not(:empty)::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.app-mobile .icon-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  padding: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: white;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}
.app-mobile .icon-button:hover {
  background: #f8fafc;
  color: var(--primary-color);
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.app-mobile svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Messages */
.app-mobile #app-message, #mobile-status {
  min-height: 22px;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.25s ease;
}
.app-mobile #app-message:empty {
  min-height: 0;
  margin: 0;
}
.app-mobile #app-message:not(:empty) {
  padding: 14px 18px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #ef4444;
  border-radius: var(--radius-sm);
  margin: 14px 0;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.08);
}

/* Login Form */
.login-form {
  max-width: 430px;
  margin: 36px auto;
  padding: 36px 32px;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 20px;
  position: relative;
  overflow: hidden;
}
.login-heading {
  text-align: center;
}
.login-badge-wrap {
  margin-bottom: 14px;
}
.login-heading img {
  display: block;
  margin: 0 auto;
}
.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--primary-light);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.app-mobile .login-heading h2 {
  font-size: 26px;
  margin: 6px 0 4px;
  color: #1e1b4b;
  font-weight: 800;
}
.login-heading p {
  color: var(--text-muted);
  margin: 0;
  font-size: 14px;
}

.login-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  background: #f1f5f9;
  border-radius: var(--radius-md);
  margin: 4px 0;
}
.app-mobile .login-modes label {
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}
.login-modes input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.login-modes span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
  color: #64748b;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.login-modes input:checked + span {
  background: white;
  color: var(--primary-color);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.16);
}
.login-modes input:focus-visible + span {
  outline: 3px solid #6366f1;
}

.app-mobile .login-form > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 0 14px;
  gap: 10px;
  min-height: 52px;
  transition: all 0.2s ease;
}
.input-wrap:focus-within {
  background: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.input-wrap > svg {
  color: #94a3b8;
  width: 18px;
}
.app-mobile .input-wrap input {
  border: 0;
  padding: 12px 0;
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  background: transparent;
  outline: none;
  color: var(--text-main);
}
.app-mobile .input-wrap .icon-button {
  border: 0;
  width: 34px;
  height: 34px;
  background: transparent;
  box-shadow: none;
  color: #94a3b8;
}
.app-mobile .input-wrap .icon-button:hover {
  color: var(--primary-color);
  background: rgba(99, 102, 241, 0.08);
}

.app-mobile button.primary, .app-mobile .login-form .primary {
  min-height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--primary-gradient);
  color: white;
  border: 0;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.app-mobile button.primary:hover, .app-mobile .login-form .primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -8px rgba(99, 102, 241, 0.5);
}
.app-mobile button.primary:active, .app-mobile .login-form .primary:active {
  transform: translateY(0);
}

.alternate-app {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  color: #6366f1;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}
.alternate-app:hover {
  background: #eef2ff;
}

/* Welcome Card / Parent Hero */
.app-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 30px;
  margin: 18px 0;
  background: linear-gradient(135deg, #3730a3 0%, #4f46e5 45%, #7c3aed 100%);
  border-radius: 26px;
  color: white;
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
}
.app-welcome::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -50px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.app-welcome::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: 20%;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(147, 197, 253, 0.2), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.welcome-text-group {
  position: relative;
  z-index: 2;
  min-width: 0;
}
.welcome-badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.app-welcome .muted {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c7d2fe;
}
.parent-portal-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  color: #fef08a;
  background: rgba(251, 191, 36, 0.22);
  border: 1px solid rgba(251, 191, 36, 0.35);
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.parent-portal-pill svg {
  width: 13px;
  height: 13px;
}
.app-mobile .app-welcome h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 6px 0 4px;
  color: white;
}
.app-welcome p#welcome-detail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  margin: 4px 0 0;
}
.welcome-avatar-container {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}
.account-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.1));
  border: 2px solid rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  color: white;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* Stats Counter Bar */
.app-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 14px;
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-card);
  gap: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: var(--radius-lg);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-light);
}
.stat-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  transition: transform 0.2s ease;
}
.stat-card:hover .stat-icon {
  transform: scale(1.08);
}
.stat-attendance .stat-icon {
  background: #dcfce7;
  color: #15803d;
}
.stat-fees .stat-icon {
  background: #fef3c7;
  color: #b45309;
}
.stat-tasks .stat-icon, .stat-responsibilities .stat-icon {
  background: #ede9fe;
  color: #6d28d9;
}
.stat-classes .stat-icon, .stat-role .stat-icon {
  background: #e0f2fe;
  color: #0369a1;
}

.stat-meta {
  min-width: 0;
  flex: 1;
}
.stat-card strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #1e1b4b;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.stat-card small {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
  display: block;
}

/* Child / Sibling Switcher Bar */
.child-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 24px;
  padding: 14px 20px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  background: white;
  box-shadow: var(--shadow-sm);
}
.child-bar-selector {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.child-bar-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--primary-light);
  color: var(--primary-color);
  border-radius: var(--radius-md);
}
.child-bar-selector label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.child-bar-selector label > span, .child-bar-actions label > span {
  font-size: 11px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.child-bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.month-selector-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.app-mobile .child-bar select, .app-mobile .child-bar input {
  padding: 9px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  background: #f8fafc;
  outline: none;
  transition: all 0.2s ease;
  min-height: 42px;
}
.app-mobile .child-bar select:focus, .app-mobile .child-bar input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
  background: white;
}
#refresh-app {
  border-radius: var(--radius-md);
  color: var(--primary-color);
}
#refresh-app:hover {
  transform: rotate(180deg);
  background: var(--primary-light);
}

/* The 10 Module Cards Grid */
.application-grid, .module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0 36px;
}
.app-mobile .module-grid button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 126px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 22px -4px rgba(15, 23, 42, 0.12), inset 0 1px 1px 0 rgba(255, 255, 255, 0.4);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  text-align: left;
}
.module-icon-wrap {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(4px);
  transition: transform 0.2s ease;
}
.app-mobile .module-grid button:hover:not(:disabled) .module-icon-wrap {
  transform: scale(1.1);
}
.app-mobile .module-grid button svg {
  color: #ffffff !important;
  width: 24px;
  height: 24px;
  stroke-width: 2.2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}
.module-title {
  display: block;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.app-mobile .module-grid button:hover:not(:disabled) {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 18px 32px -6px rgba(15, 23, 42, 0.22);
}
.app-mobile .module-grid button:active:not(:disabled) {
  transform: translateY(-1px) scale(0.99);
}

/* Distinct Micro-Gradients for each module */
.app-mobile .module-grid [data-module=notices] { background: linear-gradient(135deg, #f97316, #ea580c); box-shadow: 0 10px 22px -5px rgba(249, 115, 22, 0.42); }
.app-mobile .module-grid [data-module=circulars] { background: linear-gradient(135deg, #0284c7, #0369a1); box-shadow: 0 10px 22px -5px rgba(2, 132, 199, 0.42); }
.app-mobile .module-grid [data-module=attendance] { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 10px 22px -5px rgba(16, 185, 129, 0.42); }
.app-mobile .module-grid [data-module=fees] { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 10px 22px -5px rgba(245, 158, 11, 0.42); }
.app-mobile .module-grid [data-module=homework] { background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 10px 22px -5px rgba(139, 92, 246, 0.42); }
.app-mobile .module-grid [data-module=assignment] { background: linear-gradient(135deg, #ec4899, #be185d); box-shadow: 0 10px 22px -5px rgba(236, 72, 153, 0.42); }
.app-mobile .module-grid [data-module=online_test] { background: linear-gradient(135deg, #6366f1, #4338ca); box-shadow: 0 10px 22px -5px rgba(99, 102, 241, 0.42); }
.app-mobile .module-grid [data-module=daily_activity] { background: linear-gradient(135deg, #eab308, #b45309); box-shadow: 0 10px 22px -5px rgba(234, 179, 8, 0.42); }
.app-mobile .module-grid [data-module=live_class] { background: linear-gradient(135deg, #f43f5e, #be123c); box-shadow: 0 10px 22px -5px rgba(244, 63, 94, 0.42); }
.app-mobile .module-grid [data-module=profile] { background: linear-gradient(135deg, #64748b, #334155); box-shadow: 0 10px 22px -5px rgba(100, 116, 139, 0.42); }

.app-mobile .module-grid [aria-current=true] {
  outline: 3px solid #6366f1;
  outline-offset: 3px;
  border-color: #ffffff;
}
.app-mobile .module-grid button:focus-visible {
  outline: 3px solid #6366f1;
  outline-offset: 3px;
}
.app-mobile .module-grid button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(40%);
}

/* Module Content Area */
#module-content {
  margin-top: 28px;
}
.app-mobile #module-content > h2 {
  font-size: 22px;
  font-weight: 800;
  color: #1e1b4b;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 14px;
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.content-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
  color: #1e1b4b;
  margin: 26px 0 14px;
}
.content-subtitle svg {
  color: var(--primary-color);
  width: 18px;
  height: 18px;
}

/* Shared Entry Card Styling */
.app-mobile .entry {
  padding: 18px 22px;
  margin-bottom: 14px;
  background: white;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.app-mobile .entry:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.app-mobile .entry h3 {
  font-size: 16px;
  font-weight: 800;
  margin: 6px 0;
  color: #0f172a;
}
.app-mobile .entry p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 6px 0;
  color: #334155;
  font-size: 14px;
}
.empty-notice {
  padding: 24px;
  text-align: center;
  background: white;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  margin: 16px 0;
}

/* Status Chips */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: 0.03em;
}
.status-chip.status-present, .status-chip.status-paid {
  background: #dcfce7;
  color: #15803d;
}
.status-chip.status-absent, .status-chip.status-due {
  background: #fee2e2;
  color: #b91c1c;
}
.status-chip.status-late {
  background: #fef3c7;
  color: #b45309;
}
.status-chip.status-excused {
  background: #e0f2fe;
  color: #0369a1;
}

/* Fees Module */
.fee-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.fee-stat {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: white;
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.fee-stat.assigned {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}
.fee-stat.paid {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
.fee-stat.outstanding {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.fee-stat.outstanding.cleared {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.fee-stat .stat-title {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.fee-stat strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
}
.fee-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 6px;
  text-transform: uppercase;
}
.fee-stat.outstanding .fee-badge {
  background: #fed7aa;
  color: #9a3412;
}
.fee-stat.outstanding.cleared .fee-badge {
  background: #bbf7d0;
  color: #14532d;
}

.fee-schedule-card .fee-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 10px;
}
.fee-numbers {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: #475569;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.balance-tag {
  color: #dc2626;
}
.due-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}
.due-tag svg {
  width: 13px;
  height: 13px;
}

.payment-receipt-card .receipt-amount {
  font-size: 18px;
  font-weight: 800;
  color: #15803d;
}
.payment-method-chip {
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 999px;
  color: #475569;
}
.receipt-date {
  font-size: 12px;
  color: var(--text-muted);
}
.receipt-split-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f4faf8;
  border: 1px solid #cce4df;
}
.receipt-split-title {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #145e56;
  margin-bottom: 6px;
}
.receipt-split-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--text-main);
}
.receipt-split-row small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}
.receipt-split-row strong {
  color: #145e56;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Attendance Module */
.attendance-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.attendance-stat {
  padding: 14px;
  border-radius: var(--radius-lg);
  text-align: center;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}
.attendance-stat strong {
  display: block;
  font-size: 24px;
  font-weight: 800;
}
.attendance-stat .status-name {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}
.stat-present { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.stat-absent { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.stat-late { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.stat-excused { background: #f0f9ff; border-color: #bae6fd; color: #075985; }

/* Profile Module */
.app-profile-card {
  padding: 24px 28px;
  margin: 18px 0;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.app-profile-card h3 {
  margin: 0 0 18px;
  color: #1e1b4b;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-profile-card h3 svg {
  color: var(--primary-color);
  width: 20px;
  height: 20px;
}
.app-profile-hero {
  text-align: center;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  border: 1px solid #c7d2fe;
}
.app-profile-hero h3 {
  margin: 16px 0 4px;
  font-size: 26px;
  font-weight: 800;
  justify-content: center;
}
.profile-hero-class {
  color: var(--primary-color);
  font-weight: 700;
  margin: 0 0 8px;
  font-size: 15px;
}
.profile-hero-adm {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  background: #e0e7ff;
  color: #4338ca;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.app-profile-photo {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  overflow: hidden;
  background: #e0e7ff;
}
.app-profile-photo.large {
  width: 114px;
  height: 114px;
  border: 4px solid white;
  border-radius: 38px;
  margin: auto;
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.25);
}
.app-profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.app-photo-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}
.app-photo-placeholder svg {
  width: 32px;
  height: 32px;
  fill: #6366f1;
}
.app-profile-photo.large svg {
  width: 58px;
  height: 58px;
}
.app-profile-photo [hidden] {
  display: none !important;
}

.app-profile-person {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}
.app-profile-person:last-child {
  border-bottom: 0;
}
.person-details {
  min-width: 0;
  flex: 1;
}
.person-badge {
  display: inline-block;
  color: var(--primary-color);
  background: #eef2ff;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  margin-bottom: 4px;
}
.person-name {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}
.person-phone {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 0;
}
.call-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}
.call-link:hover {
  text-decoration: underline;
}
.call-link svg {
  width: 13px;
  height: 13px;
}

.app-mobile .profile-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}
.app-mobile .profile-list > div {
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid #f1f5f9;
}
.app-mobile .profile-list dt {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.app-mobile .profile-list dd {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

/* Activity Cards (Homework, Assignments, etc.) */
.activity-card {
  padding: 20px 24px;
}
.activity-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.activity-subject {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6366f1;
  background: #eef2ff;
  padding: 3px 10px;
  border-radius: 999px;
}
.activity-teacher {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.activity-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 10px 0;
  font-size: 12px;
  color: var(--text-muted);
}
.activity-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.activity-meta svg {
  width: 13px;
  height: 13px;
}
.submission-banner {
  margin-top: 12px;
  padding: 12px 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
}
.submission-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.submission-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #15803d;
  font-size: 12px;
  font-weight: 700;
}
.submission-badge svg {
  width: 15px;
  height: 15px;
}
.score-badge {
  font-size: 12px;
  color: #166534;
}
.submission-feedback {
  font-size: 13px;
  color: #14532d;
  margin: 6px 0 0;
}
.join-class-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: #f43f5e;
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
  transition: transform 0.15s ease;
}
.join-class-btn:hover {
  transform: translateY(-1px);
}

/* Notices & Circulars Cards */
.notice-card {
  padding: 20px 24px;
}
.notice-category-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ea580c;
  background: #fff7ed;
  padding: 3px 10px;
  border-radius: 999px;
}
.notice-date {
  font-size: 12px;
  color: var(--text-muted);
}

/* Teacher Application Specifics */
.teacher-class {
  padding: 24px;
  margin: 18px 0;
  background: white;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.app-mobile .teacher-class h2 {
  font-size: 19px;
  font-weight: 800;
  margin: 0 0 16px;
  color: #1e1b4b;
}
.app-mobile .teacher-class .app-tabs a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  border: 1px solid var(--border-light);
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  text-decoration: none;
  transition: all 0.2s ease;
}
.app-mobile .teacher-class .app-tabs a:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.teacher-class .app-tabs {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Bottom Floating Dock Navigation */
.app-mobile .bottom-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 32px), 480px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 20px 48px -8px rgba(15, 23, 42, 0.45);
  box-sizing: border-box;
  z-index: 100;
  gap: 6px;
}
.app-mobile .bottom-nav button {
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 52px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.app-mobile .bottom-nav button svg {
  width: 20px;
  height: 20px;
}
.app-mobile .bottom-nav button:hover {
  color: #ffffff;
}
.app-mobile .bottom-nav [aria-current=page] {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45);
}

/* General Buttons & Tables */
.app-mobile button, .app-mobile input, .app-mobile select, .app-mobile textarea {
  font-family: inherit;
}
.app-mobile button, .app-mobile .action, .app-tabs button, .app-tabs a {
  border: 1px solid #cbd5e1;
  background: white;
  color: #1e293b;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.15s ease;
}
.app-mobile button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.table-scroll {
  overflow-x: auto;
}
.app-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}
.app-table th, .app-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}
.app-mobile [hidden], .mobile-admin [hidden] {
  display: none !important;
}

.publisher-frame {
  width: 100%;
  height: 780px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: #fff;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .application-grid, .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .app-shell {
    padding: 0 16px 105px;
  }
  .app-mobile header {
    padding: 14px 0;
  }
  .login-form {
    padding: 26px 20px;
    margin: 20px auto;
  }
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .app-mobile .module-grid button {
    min-height: 110px;
    padding: 14px;
  }
  .app-mobile .app-welcome h2 {
    font-size: 23px;
  }
  .app-welcome {
    padding: 20px;
  }
  .app-stats {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }
  .fee-summary, .attendance-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .app-mobile .profile-list {
    grid-template-columns: 1fr;
  }
  .child-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }
  .child-bar-actions {
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-mobile * {
    transition: none !important;
    animation: none !important;
  }
}
