/* Student Portal App Design System — Targetzone CRM */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg-primary: #070b14;
  --bg-card: #0f172a;
  --bg-card-hover: #1e293b;
  --bg-card-elevated: #151f32;
  --bg-input: rgba(255, 255, 255, 0.05);
  --border-color: rgba(255, 255, 255, 0.09);
  --border-highlight: rgba(59, 130, 246, 0.35);
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-gradient: linear-gradient(135deg, #3b82f6, #1d4ed8);
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;
  --accent-purple: #a855f7;
  --text-main: #f9fafb;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ── Login Page Layout ────────────────────────── */
.student-login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.15), transparent 45%),
              radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.12), transparent 45%),
              var(--bg-primary);
}

.login-card {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  width: 100%;
  max-width: 420px;
  padding: 40px 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  text-align: center;
}

.login-logo { font-size: 46px; margin-bottom: 12px; }
.login-title { font-size: 24px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.login-sub { font-size: 13px; color: var(--text-muted); margin-top: 6px; margin-bottom: 26px; line-height: 1.4; }

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 20px;
  text-align: left;
}

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; text-align: left; }
.form-group label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input {
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 13px 16px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}
.form-group input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
  transition: all 0.2s;
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5); }
.btn-login:active { transform: translateY(0); }

/* ── Top App Bar ──────────────────────────────── */
.student-header {
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
}

.header-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-title { font-size: 16px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.3px; }
.header-sub { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-logout {
  padding: 7px 14px;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.btn-logout:hover { background: rgba(239, 68, 68, 0.22); color: #fff; }

/* ── Desktop Segmented Top Navigation ─────────── */
.desktop-app-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 6px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.app-nav-btn {
  appearance: none;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
  user-select: none;
}
.app-nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.app-nav-btn.active {
  color: #fff;
  background: var(--primary-gradient);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

/* ── Mobile Fixed Bottom Navigation Bar ───────── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(62px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(11, 15, 25, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  grid-template-columns: repeat(4, 1fr);
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.6);
}

.bottom-nav-item {
  appearance: none;
  background: transparent;
  border: none;
  outline: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px 0 4px;
  position: relative;
  transition: all 0.2s ease;
  user-select: none;
  text-decoration: none;
}
.bottom-nav-item:active { transform: scale(0.92); }
.bottom-nav-icon { font-size: 20px; line-height: 1.2; margin-bottom: 2px; transition: transform 0.2s; }
.bottom-nav-label { font-size: 11px; font-weight: 700; letter-spacing: 0.1px; }

.bottom-nav-item.active {
  color: #60a5fa;
}
.bottom-nav-item.active .bottom-nav-icon {
  transform: translateY(-2px);
}
.bottom-nav-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 28px;
  height: 3px;
  background: #3b82f6;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.8);
}

.nav-alert-dot {
  position: absolute;
  top: 6px;
  right: calc(50% - 14px);
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #070b14;
}

/* ── App Container & View Management ─────────── */
.dashboard-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
}

.app-view {
  display: none;
}
.app-view.active {
  display: block;
  animation: viewFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Profile Hero / Identity Card ─────────────── */
.profile-banner {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.45) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}
.profile-banner::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25), transparent 70%);
  pointer-events: none;
}

.profile-info-group { display: flex; align-items: center; gap: 18px; }
.student-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  object-fit: cover;
  border: 2.5px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, #1e293b, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  color: #60a5fa;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.student-name-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  letter-spacing: -0.4px;
}
.student-meta-pills { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.meta-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ── Today Check-in Live Status Card ──────────── */
.today-checkin-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 16px 20px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.live-pulse-wrapper { display: flex; align-items: center; gap: 12px; }
.pulse-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: relative;
}
.pulse-circle.green { background: #22c55e; }
.pulse-circle.green::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.4);
  animation: pulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.pulse-circle.amber { background: #f59e0b; }
.pulse-circle.amber::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.4);
  animation: pulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulseRing {
  0% { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ── Feature App Blocks Grid (Home Hub) ───────── */
.feature-blocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.feature-block-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 20px;
  padding: 22px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
  position: relative;
  user-select: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.feature-block-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.feature-block-card:active {
  transform: scale(0.98);
}

.block-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.block-icon-badge {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.block-icon-badge.green  { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.25); }
.block-icon-badge.blue   { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.25); }
.block-icon-badge.purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.25); }
.block-icon-badge.amber  { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.25); }

.block-title { font-size: 14px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; }
.block-val { font-size: 26px; font-weight: 900; color: #fff; margin: 4px 0 2px; letter-spacing: -0.5px; }
.block-sub { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

.block-action-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 12px;
}
.block-action-text {
  font-size: 13px;
  font-weight: 700;
  color: #60a5fa;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Interactive Attendance Calendar Card ─────── */
.att-calendar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.att-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}
.att-cal-month-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.3px;
}

.month-nav-btn {
  appearance: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.month-nav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.month-nav-btn:active { transform: scale(0.95); }

/* Calendar Weekday Names Header */
.att-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  text-align: center;
  margin-bottom: 10px;
}
.cal-weekday {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 0;
}
.cal-weekday.sunday { color: #f87171; }

/* Calendar Days Grid */
.att-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.cal-day-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 10px 8px 8px;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  user-select: none;
}
.cal-day-box:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.cal-day-box:active { transform: scale(0.96); }

.cal-day-num {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1;
}

/* Day Cell States */
.cal-day-box.present {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.35);
}
.cal-day-box.present:hover {
  background: rgba(34, 197, 94, 0.14);
  border-color: #22c55e;
}
.cal-day-box.present .cal-day-num { color: #4ade80; }

.cal-day-box.absent {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.35);
}
.cal-day-box.absent:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: #ef4444;
}
.cal-day-box.absent .cal-day-num { color: #f87171; }

.cal-day-box.weekend {
  opacity: 0.75;
  border-color: rgba(255, 255, 255, 0.05);
}
.cal-day-box.weekend .cal-day-num { color: #fca5a5; }

.cal-day-box.future {
  opacity: 0.35;
  background: transparent;
  border-style: dashed;
  cursor: default;
}
.cal-day-box.future:hover {
  transform: none;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.07);
}

.cal-day-box.today {
  box-shadow: 0 0 0 2px #3b82f6, 0 0 16px rgba(59, 130, 246, 0.45);
  border-color: #60a5fa !important;
}

.cal-punch-pill {
  font-size: 13px;
  font-weight: 900;
  padding: 3px 7px;
  border-radius: 8px;
  align-self: flex-start;
  margin-top: auto;
  letter-spacing: 0;
}
.cal-punch-pill.green { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.cal-punch-pill.red   { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.cal-punch-pill.gray  { background: rgba(255, 255, 255, 0.06); color: #94a3b8; }

/* Calendar Legend */
.cal-legend-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 0 0;
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-dot.green { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.6); }
.legend-dot.red   { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
.legend-dot.amber { background: #f59e0b; }
.legend-dot.gray  { background: #4b5563; }

/* ── Punch Details Modal / Sheet ──────────────── */
.punch-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.punch-modal-box {
  background: linear-gradient(145deg, #131d31, #0b101d);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  padding: 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  animation: modalScaleUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.punch-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.punch-modal-title { font-size: 18px; font-weight: 800; color: #fff; }

.punch-stat-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.punch-tile {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px 14px;
}
.punch-tile-lbl { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; }
.punch-tile-val { font-size: 16px; font-weight: 800; color: #fff; margin-top: 4px; font-family: monospace; }

.punch-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.punch-entry-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.punch-time { font-family: monospace; font-size: 15px; font-weight: 700; color: #4ade80; }
.punch-device-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

/* ── Digital Student ID Card (Account Tab) ────── */
.student-id-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid rgba(59, 130, 246, 0.35);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.student-id-card::after {
  content: "CBSE TARGET ZONE";
  position: absolute;
  right: -20px;
  bottom: -10px;
  font-size: 48px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.02);
  letter-spacing: 2px;
  pointer-events: none;
  user-select: none;
}
.id-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.id-org-title { font-size: 18px; font-weight: 900; color: #fff; letter-spacing: 0.5px; }
.id-org-sub { font-size: 11px; color: #60a5fa; font-weight: 700; text-transform: uppercase; }

.id-card-body {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.id-avatar-lg {
  width: 90px;
  height: 90px;
  border-radius: 20px;
  object-fit: cover;
  border: 3px solid #3b82f6;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  font-weight: 900;
  color: #60a5fa;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
}

.id-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 20px;
  flex: 1;
}
.id-field-item label { font-size: 10px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; display: block; }
.id-field-item span { font-size: 14px; font-weight: 700; color: #f1f5f9; display: block; margin-top: 2px; }

/* ── Attendance Stats Tiles Grid ─────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  overflow: hidden;
  min-width: 0;
}

.stat-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.green  { background: rgba(34, 197, 94, 0.12);  border: 1px solid rgba(34, 197, 94, 0.25); }
.stat-icon.blue   { background: rgba(59, 130, 246, 0.12); border: 1px solid rgba(59, 130, 246, 0.25); }
.stat-icon.purple { background: rgba(168, 85, 247, 0.12); border: 1px solid rgba(168, 85, 247, 0.25); }

.stat-val {
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.8px;
  line-height: 1;
}

.stat-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 3px;
}

/* ── Fee Stats Specific Overrides ─────────────── */
.fee-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.fee-stats-grid .stat-card {
  padding: 18px 20px;
  min-width: 0;
}
.fee-stats-grid .stat-val.fee-val {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

@media (max-width: 768px) {
  /* Linear one-upon-another layout for fee cards on mobile */
  .fee-stats-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .fee-stats-grid .stat-card {
    flex-direction: row !important;
    align-items: center !important;
    padding: 16px 18px !important;
    gap: 16px !important;
    border-radius: 18px !important;
    min-width: 0 !important;
  }
  .fee-stats-grid .stat-icon {
    width: 48px !important;
    height: 48px !important;
    font-size: 22px !important;
    border-radius: 14px !important;
    flex-shrink: 0 !important;
  }
  .fee-stats-grid .stat-card-content {
    flex: 1;
    min-width: 0;
  }
  .fee-stats-grid .stat-lbl {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: var(--text-muted) !important;
    margin-bottom: 3px !important;
  }
  .fee-stats-grid .stat-val.fee-val {
    font-size: 22px !important;
    font-weight: 900 !important;
    letter-spacing: -0.5px !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.2 !important;
  }
}

@media (max-width: 480px) {
  .stats-grid:not(.fee-stats-grid) {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .stats-grid:not(.fee-stats-grid) .stat-card {
    padding: 12px 10px;
    border-radius: 14px;
    align-items: flex-start;
  }
  .stats-grid:not(.fee-stats-grid) .stat-icon { width: 34px; height: 34px; font-size: 16px; border-radius: 10px; }
  .stats-grid:not(.fee-stats-grid) .stat-val { font-size: 18px !important; }
  .stats-grid:not(.fee-stats-grid) .stat-lbl { font-size: 10px; }
}

/* ── Notifications Drawer ────────────────────── */
.notif-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 95vw;
  height: 100vh;
  background: #0f172a;
  border-left: 1px solid rgba(255,255,255,.1);
  z-index: 2101;
  transition: right .3s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,.6);
}

.notif-drawer.open {
  right: 0;
}

.notif-drawer-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .notif-drawer {
    /* Full-screen mode on phone */
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    border: none !important;
    border-radius: 0 !important;
    position: fixed !important;
    z-index: 2200 !important;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.16,1,.3,1) !important;
    box-shadow: none !important;
  }
  .notif-drawer.open {
    transform: translateY(0) !important;
    right: 0 !important;
  }
  .notif-drawer-header {
    padding: 16px 20px 14px;
  }

  .notif-popup-overlay {
    padding: 16px !important;
    align-items: center !important;
  }
  .notif-popup-box {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90vh !important;
    border-radius: 22px !important;
    padding: 24px 20px !important;
  }
}

/* ── Notification Links & Badges ─────────────── */
.notif-link {
  color: #38bdf8 !important;
  text-decoration: underline !important;
  font-weight: 700 !important;
  word-break: break-all !important;
  display: inline !important;
  cursor: pointer !important;
  transition: color 0.15s ease !important;
}
.notif-link:hover {
  color: #7dd3fc !important;
  text-decoration: underline !important;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #070b14;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.6);
  pointer-events: none;
}





/* ── Section Cards (Tables & Feeds) ───────────── */
.card-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 24px;
}
.card-sec-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-sec-title { font-size: 16px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 8px; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}
td { padding: 14px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); color: #d1d5db; }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-green  { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.badge-blue   { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-amber  { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

/* ── Mobile Responsive Overrides ──────────────── */
@media (max-width: 768px) {
  .student-header {
    padding: 12px 16px;
    gap: 12px;
  }
  .student-header .btn-logout {
    display: none !important;
  }
  .header-brand {
    flex: 1;
    min-width: 0;
  }
  .header-title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.25;
  }
  .header-sub {
    font-size: 11px;
    margin-top: 1px;
  }

  .desktop-app-nav { display: none; }
  .mobile-bottom-nav { display: grid; }

  .dashboard-container {
    padding: 14px 14px calc(76px + var(--safe-bottom));
  }

  .profile-banner {
    padding: 18px;
    border-radius: 20px;
    gap: 14px;
  }
  .profile-info-group { gap: 14px; }
  .student-avatar-lg { width: 56px; height: 56px; font-size: 24px; border-radius: 16px; }
  .student-name-title { font-size: 18px; }

  .feature-blocks-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 18px;
  }
  .feature-block-card {
    padding: 18px;
    border-radius: 16px;
    min-height: auto;
  }

  .att-calendar-card {
    padding: 16px 12px;
    border-radius: 20px;
  }
  .att-cal-header {
    margin-bottom: 14px;
  }
  .att-cal-month-title { font-size: 17px; }
  .month-nav-btn { padding: 6px 12px; font-size: 12px; }

  .att-cal-weekdays { gap: 3px; }
  .att-cal-grid { gap: 3px; }
  .cal-day-box {
    min-height: 52px;
    padding: 6px 4px 4px;
    border-radius: 10px;
  }
  .cal-day-num { font-size: 12px; }
  .cal-punch-pill { font-size: 11px; padding: 2px 5px; }

  .punch-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .punch-modal-box {
    border-radius: 24px 24px 0 0;
    max-width: 100%;
    animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    padding-bottom: calc(28px + var(--safe-bottom));
  }
  @keyframes modalSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }

  .student-id-card {
    padding: 20px;
    border-radius: 20px;
  }
  .id-card-body { gap: 14px; }
  .id-avatar-lg { width: 68px; height: 68px; font-size: 30px; }
  .id-fields-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  th, td { padding: 10px 12px; font-size: 12px; }
}

@media (max-width: 480px) {
  .header-brand div:first-child { font-size: 22px !important; }
  .header-title { font-size: 14px; max-width: 140px; }
  .header-sub { font-size: 9px; max-width: 140px; }
}

/* ── Avatar Edit & Camera Button ──────────────── */
.avatar-upload-wrapper {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.btn-avatar-cam {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  border: 2px solid #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  transition: all 0.18s ease;
}

.btn-avatar-cam:hover {
  background: #1d4ed8;
  transform: scale(1.1);
}

.btn-avatar-cam-sm {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  border: 2px solid #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  transition: all 0.18s ease;
}

.btn-avatar-cam-sm:hover {
  background: #1d4ed8;
  transform: scale(1.1);
}

/* ── Settings Menu Items ──────────────────────── */
.settings-menu-list {
  display: flex;
  flex-direction: column;
}

.settings-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.18s ease;
}

.settings-menu-item:last-child {
  border-bottom: none;
}

.settings-menu-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.settings-item-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.settings-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.settings-item-title {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
}

.settings-item-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.settings-item-arrow {
  font-size: 16px;
  font-weight: 700;
  color: #64748b;
  transition: transform 0.18s ease, color 0.18s ease;
}

.settings-menu-item:hover .settings-item-arrow {
  transform: translateX(4px);
  color: #60a5fa;
}

/* ── Loading Spinner Overlay ─────────────────── */
.photo-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.photo-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: photoSpin 0.8s linear infinite;
}

@keyframes photoSpin {
  to { transform: rotate(360deg); }
}

/* ── Native Pull-To-Refresh (Mobile Chrome Style) ────────── */
.ptr-container {
  position: fixed;
  top: -65px;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.1, 0.9, 0.2, 1), opacity 0.2s ease;
  opacity: 0;
}

.ptr-box {
  width: 44px;
  height: 44px;
  background: #1e293b;
  border: 1.5px solid rgba(59, 130, 246, 0.4);
  border-radius: 50%;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.ptr-box.ptr-ready {
  border-color: #38bdf8;
  background: #0f172a;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7), 0 0 20px rgba(56, 189, 248, 0.5);
  transform: scale(1.08);
}

.ptr-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255, 255, 255, 0.15);
  border-top-color: #38bdf8;
  border-radius: 50%;
  display: none;
}

.ptr-spinning .ptr-icon {
  display: none;
}

.ptr-spinning .ptr-spinner {
  display: block;
  animation: ptrSpin 0.75s linear infinite;
}

@keyframes ptrSpin {
  to { transform: rotate(360deg); }
}

/* ── Notification Glow & In-App Dropping Toast ─────────── */
@keyframes bellRing {
  0% { transform: rotate(0deg) scale(1); }
  15% { transform: rotate(14deg) scale(1.15); }
  30% { transform: rotate(-14deg) scale(1.15); }
  45% { transform: rotate(10deg) scale(1.1); }
  60% { transform: rotate(-10deg) scale(1.1); }
  75% { transform: rotate(4deg) scale(1.05); }
  100% { transform: rotate(0deg) scale(1); }
}

.bell-glow {
  animation: bellRing 1.2s ease-in-out infinite, bellPulse 2s infinite !important;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.7), 0 0 30px rgba(96, 165, 250, 0.4) !important;
  border-color: #60a5fa !important;
}

@keyframes bellPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.6); }
  50% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
}

/* In-App Drop Notification Banner (Mobile Chrome style) */
.in-app-drop-notif {
  position: fixed;
  top: 14px;
  left: 14px;
  right: 14px;
  max-width: 480px;
  margin: 0 auto;
  z-index: 9998;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.75), 0 0 25px rgba(59, 130, 246, 0.35);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transform: translateY(-150%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.in-app-drop-notif.show {
  transform: translateY(0);
  opacity: 1;
}

.in-app-drop-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  animation: bellRing 1.5s ease;
}

.in-app-drop-body {
  flex: 1;
  min-width: 0;
}

.in-app-drop-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #f9fafb;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.in-app-drop-text {
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.in-app-drop-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.in-app-drop-close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

