:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --secondary: #06b6d4;
  --accent: #f59e0b;
  --success: #16a34a;
  --danger: #dc2626;
  --bg: #f4f5fb;
  --card: #ffffff;
  --text: #1f2333;
  --text-muted: #6b7280;
  --radius: 14px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

/* ---------- Colorful scrollbars, applied everywhere (page + inner scroll areas) ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: #7c3aed #e5e7ff;
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: #e5e7ff;
  border-radius: 20px;
}

*::-webkit-scrollbar-thumb {
  background: #7c3aed;
  border-radius: 20px;
  border: 2px solid #e5e7ff;
}

*::-webkit-scrollbar-thumb:hover {
  background: #6d28d9;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

#root { min-height: 100vh; }

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
  font-size: 16px;
}

.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  font-size: 18px;
  color: var(--text-muted);
}

/* ---------- Auth pages ---------- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  padding: 20px;
}

.auth-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.auth-card h1 {
  margin: 0 0 4px;
  font-size: 24px;
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-card p.subtitle {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.auth-brand-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 22px;
  font-weight: 900;
  color: var(--primary);
  text-align: center;
}

.auth-brand-logo img {
  height: 120px !important;
  max-height: none !important;
  max-width: 100% !important;
  width: auto !important;
  object-fit: contain;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #e2e4ee;
  border-radius: 10px;
  outline: none;
  transition: border-color .15s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 42px;
}

.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
}

.password-toggle-btn:hover {
  color: var(--text);
  background: var(--bg);
}

.btn-primary {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  transition: opacity .15s;
}

.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary:hover:not(:disabled) { opacity: .92; }

.btn-secondary {
  padding: 10px 18px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: transparent;
  color: var(--primary);
  font-weight: 600;
}

.error-banner {
  background: #fef2f2;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
}

.success-banner {
  background: #f0fdf4;
  color: var(--success);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
}

.auth-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-footer a { color: var(--primary); font-weight: 600; }

.dev-credit {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 18px 16px 12px;
}

.dev-credit a { color: var(--primary); font-weight: 700; }

/* ---------- Student app shell ---------- */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 80px;
  position: relative;
  transition: max-width .2s ease;
}

@media (min-width: 640px) {
  .app-shell { max-width: 620px; }
  .app-header { padding: 34px 32px 48px; }
  .class-highlight, .status-banner, .section { margin-left: 32px; margin-right: 32px; }
}

@media (min-width: 1024px) {
  .app-shell {
    max-width: 860px;
    box-shadow: 0 0 60px rgba(0,0,0,0.06);
  }
  .app-header { padding: 40px 48px 56px; }
  .class-highlight, .status-banner, .section { margin-left: 48px; margin-right: 48px; }
  .section-title { font-size: 15px; }
}

.app-header {
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
  color: #fff;
  padding: 28px 20px 40px;
  border-radius: 0 0 28px 28px;
}

.app-header .brand {
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  letter-spacing: .5px;
}

.app-header .welcome {
  font-size: 22px;
  font-weight: 700;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.welcome-rollno {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .4px;
  margin-top: 4px;
  opacity: .9;
}

.class-highlight {
  margin: -22px 20px 20px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  padding: 18px;
  text-align: center;
}

.class-highlight .label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.class-highlight .value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 4px;
}

.status-banner {
  margin: 0 20px 20px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #fffbeb;
  color: #92400e;
  font-size: 14px;
  font-weight: 500;
}

.section {
  margin: 0 20px 20px;
}

.fee-reminder-banner {
  margin: 0 20px 20px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  font-size: 14px;
  font-weight: 700;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.update-item {
  padding: 12px 0;
  border-bottom: 1px solid #f0f1f6;
}
.update-item:last-child { border-bottom: none; }
.update-item .title { font-weight: 600; font-size: 14px; }
.update-item .msg { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ---------- Colorful notice cards (student Updates feed) ---------- */
.notice-card {
  display: flex;
  gap: 14px;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.07);
  position: relative;
  overflow: hidden;
}

.notice-card::after {
  content: '';
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  top: -30px;
  right: -24px;
  background: rgba(255,255,255,0.25);
}

.notice-card-0 { background: linear-gradient(135deg, #7c3aed, #db2777); color: #fff; }
.notice-card-1 { background: linear-gradient(135deg, #0ea5e9, #22d3ee); color: #fff; }
.notice-card-2 { background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; }
.notice-card-3 { background: linear-gradient(135deg, #16a34a, #4ade80); color: #fff; }

.notice-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  position: relative;
}

.notice-body { flex: 1; position: relative; }
.notice-title { font-weight: 800; font-size: 15px; margin-bottom: 4px; }
.notice-msg { font-size: 13px; line-height: 1.5; opacity: .95; }
.notice-date { font-size: 11px; opacity: .8; margin-top: 8px; }

.bottom-nav {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  gap: 6px;
  padding: 8px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 12px 32px rgba(31, 35, 51, 0.14);
  transition: max-width .2s ease;
}

@media (min-width: 640px) {
  .bottom-nav { max-width: 420px; }
}

@media (min-width: 1024px) {
  .bottom-nav { max-width: 460px; }
}

.nav-item {
  flex: 1;
  display: flex;
  justify-content: center;
  color: var(--text-muted);
  border-radius: 16px;
}

.nav-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 11px 0;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  transition: background .2s ease, color .2s ease;
}

.nav-item svg { transition: transform .2s ease; flex-shrink: 0; }

.nav-item.active .nav-pill {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.nav-item:not(.active):hover .nav-pill {
  background: #f1f2fb;
  color: var(--text);
}

.nav-item.active svg { transform: scale(1.05); }

.verified-badge { vertical-align: middle; }

.profile-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f1f6;
  font-size: 14px;
}
.profile-row:last-child { border-bottom: none; }
.profile-row .k { color: var(--text-muted); }
.profile-row .v { font-weight: 600; }

/* ---------- Admin / Staff dashboards ---------- */
.dashboard-outer {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.dashboard-shell {
  display: flex;
  flex: 1;
  min-height: 0;
}

.sidebar {
  width: 240px;
  background: #0a0b1e;
  color: #fff;
  padding: 18px 14px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.sidebar .brand {
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 6px;
  color: #fff;
  padding: 0 8px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-panel-label {
  text-align: center;
  margin: -6px 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-panel-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: linear-gradient(90deg, #a78bfa, #60a5fa, #34d399);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sidebar-panel-name {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  margin-top: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 18px;
  border-radius: 14px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #8688b3;
  cursor: pointer;
}

.sidebar-link-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-link-label {
  flex: 1;
}

.sidebar-badge {
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  min-width: 18px;
  width: fit-content;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.05);
  color: #c7c8ea;
}

.sidebar-link.active {
  background: #4b3cf0;
  color: #fff;
  font-weight: 700;
}

.sidebar-logout {
  margin-top: auto;
  width: 100%;
  padding: 12px 18px;
  border: none;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  color: #c7c8ea;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}

.sidebar-logout:hover {
  background: rgba(255,255,255,0.09);
}

.dashboard-main {
  flex: 1;
  min-width: 0;
  padding: 28px 32px;
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar-hamburger {
  display: none;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .sidebar-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -280px;
    width: 260px;
    z-index: 300;
    overflow-y: auto;
    transition: left 0.25s ease;
    box-shadow: 0 0 40px rgba(0,0,0,0.35);
  }

  .sidebar.sidebar-open {
    left: 0;
  }

  .sidebar-backdrop.active {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(10,11,30,0.55);
    z-index: 290;
  }

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

  .dashboard-brand-logo-img { height: 44px; }
  .dashboard-brand-hindi { font-size: 30px; }
  .dashboard-brand-eng { font-size: 23px; }
}

@media (max-width: 480px) {
  .admin-topbar {
    padding: 10px 14px;
  }

  .admin-topbar-search {
    min-width: 0;
    flex: 1 1 100%;
    order: 3;
  }

  .admin-topbar-lastlogin {
    display: none;
  }

  .dashboard-main {
    padding: 16px 12px;
  }

  .dashboard-brand-logo-img { height: 34px; }
  .dashboard-brand-hindi { font-size: 22px; }
  .dashboard-brand-eng { font-size: 17px; }

  .admin-chat-thread {
    min-width: 0;
    flex-basis: 100%;
  }

  .chat-profile-sidebar {
    width: 100%;
  }
}

.dashboard-main h1 { margin-top: 0; }

.subtitle-text {
  color: var(--text-muted);
  font-size: 13px;
  margin: -14px 0 18px;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  border-left: 5px solid var(--primary);
}

.stat-card.accent { border-left-color: var(--accent); }
.stat-card.success { border-left-color: var(--success); }

.stat-card .num { font-size: 26px; font-weight: 800; }
.stat-card .lbl { font-size: 13px; color: var(--text-muted); }

/* ---------- Colorful fee stat tiles ---------- */
.fee-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.fee-stat-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 18px 20px;
  color: #1f2333;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.fee-stat-card::after {
  content: '';
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  top: -34px;
  right: -24px;
  background: rgba(255,255,255,0.35);
}

.fee-stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255,255,255,0.65);
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
  position: relative;
}

.fee-stat-card .num { font-size: 22px; font-weight: 800; position: relative; }
.fee-stat-card .lbl {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 4px;
  position: relative;
}

.fee-stat-paid { background: linear-gradient(135deg, #ede9fe, #ddd6fe); }
.fee-stat-balance { background: linear-gradient(135deg, #fee2e2, #fecaca); }
.fee-stat-final { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }
.fee-stat-nextdate { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }

.fee-stat-paid .lbl { color: #6d28d9; }
.fee-stat-balance .lbl { color: #b91c1c; }
.fee-stat-final .lbl { color: #047857; }
.fee-stat-nextdate .lbl { color: #1d4ed8; }

.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius);
}

table.data-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

table.data-table th, table.data-table td {
  text-align: left;
  padding: 12px 14px;
  font-size: 14px;
  border-bottom: 1px solid #f0f1f6;
}

table.data-table th {
  background: #f8f9fd;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
}

/* Full grid lines, like a printed Excel sheet. */
#due-table {
  border: 1px solid #d1d5db;
}
#due-table th, #due-table td {
  border: 1px solid #d1d5db;
}
#due-table th {
  background: #eef1fb;
  color: var(--text);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.pagination-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid #e2e4ee;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pagination-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination-btn:disabled { opacity: .4; cursor: not-allowed; }
.pagination-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination-ellipsis { color: var(--text-muted); padding: 0 4px; }

/* ---------- Admin top bar ---------- */
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #6d28d9, #7c3aed);
  color: #fff;
  padding: 12px 26px;
}

.admin-topbar-clock {
  font-size: 13px;
  font-weight: 600;
  opacity: .95;
}

.dashboard-main-brand-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.dashboard-brand-logo { font-size: 9px; color: #888; }
.dashboard-brand-logo-img { height: 60px; width: auto; object-fit: contain; }

.dashboard-brand-title {
  font-family: 'Baloo 2', 'Segoe UI', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: .3px;
  line-height: 1.1;
}

.dashboard-brand-hindi { font-size: 41px; color: #c0392b; }
.dashboard-brand-eng { font-size: 32px; color: #c0392b; }

.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.admin-topbar-lastlogin {
  font-size: 12px;
  opacity: .85;
}

.admin-topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 8px 14px;
  min-width: 220px;
}

.admin-topbar-search input {
  border: none;
  background: transparent;
  outline: none;
  color: #fff;
  font-size: 13px;
  width: 100%;
}

.admin-topbar-search input::placeholder { color: rgba(255,255,255,0.75); }

.admin-topbar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}

.admin-topbar-name { font-size: 13px; font-weight: 700; }
.admin-topbar-role { font-size: 11px; opacity: .8; }

/* ---------- Overview page ---------- */
.overview-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.overview-stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.overview-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.overview-stat-icon-blue { background: #dbeafe; color: #2563eb; }
.overview-stat-icon-green { background: #d1fae5; color: #059669; }
.overview-stat-icon-orange { background: #ffedd5; color: #ea580c; }
.overview-stat-icon-purple { background: #ede9fe; color: #7c3aed; }

.overview-stat-num { font-size: 24px; font-weight: 800; }
.overview-stat-lbl { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.quick-actions-panel {
  background: linear-gradient(135deg, #6d28d9, #4f46e5);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 22px;
}

.quick-actions-title {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 16px;
}

.quick-actions-grid {
  display: flex;
  gap: 8px;
}

.quick-action-card {
  flex: 1 1 0;
  min-width: 0;
  background: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text);
}

.quick-action-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.12); }

.quick-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.quick-action-icon svg { width: 22px; height: 22px; stroke-width: 2; }

.quick-action-icon-0 { color: #7c3aed; }
.quick-action-icon-1 { color: #2563eb; }
.quick-action-icon-2 { color: #ea580c; }
.quick-action-icon-3 { color: #059669; }
.quick-action-icon-4 { color: #db2777; }
.quick-action-icon-5 { color: #dc2626; }
.quick-action-icon-6 { color: #16a34a; }

.quick-action-label { font-size: 11.5px; font-weight: 600; text-align: center; }

.recent-admissions-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

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

.view-all-link {
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.top-classes-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.top-class-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-class-rank {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  width: 22px;
  flex-shrink: 0;
}

.top-class-name {
  font-size: 13px;
  font-weight: 700;
  width: 150px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-class-bar-track {
  flex: 1;
  height: 10px;
  background: #f1f2f8;
  border-radius: 6px;
  overflow: hidden;
}

.top-class-bar {
  height: 100%;
  border-radius: 6px;
}

.top-class-bar-0 { background: linear-gradient(90deg, #7c3aed, #db2777); }
.top-class-bar-1 { background: linear-gradient(90deg, #0ea5e9, #22d3ee); }
.top-class-bar-2 { background: linear-gradient(90deg, #f59e0b, #f97316); }
.top-class-bar-3 { background: linear-gradient(90deg, #16a34a, #4ade80); }

.top-class-count {
  font-size: 13px;
  font-weight: 800;
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

.students-toolbar-card {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  background: linear-gradient(135deg, #ede9fe, #e0f2fe);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
}

.students-table tr:hover td { background: #f8f9ff; }
.clickable-row { cursor: pointer; }

.student-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.student-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.student-avatar-photo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.roll-no {
  font-weight: 800;
  color: var(--primary);
}

.student-name-main {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.student-name-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.fee-status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.fee-status-pill.due { background: #fee2e2; color: #b91c1c; }
.fee-status-pill.paid { background: #d1fae5; color: #047857; }
.fee-status-pill.pending { background: #fef3c7; color: #92400e; }

.att-pill-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.att-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
  border: 1px solid #e2e4ee;
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
}

button.att-pill:hover { border-color: #c7cadd; }

.att-pill-present.active, span.att-pill-present { background: #d1fae5; color: #047857; border-color: #d1fae5; }
.att-pill-absent.active, span.att-pill-absent { background: #fee2e2; color: #b91c1c; border-color: #fee2e2; }
.att-pill-leave.active, span.att-pill-leave { background: #fef3c7; color: #b45309; border-color: #fef3c7; }

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

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e2e4ee;
  background: #fff;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn-view { color: var(--success); }
.icon-btn-edit { color: var(--primary); }
.icon-btn-delete { color: var(--danger); background: #fee2e2; border-color: #fecaca; }
.icon-btn-delete:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.icon-btn-reset { color: #d97706; cursor: pointer; }
.icon-btn-download { color: #0891b2; }
.icon-btn-print { color: #7c3aed; }

/* ---------- Class list (horizontal rows) ---------- */
.class-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.class-row {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  padding: 14px 18px 14px 0;
  overflow: hidden;
  transition: opacity .12s;
}

.class-row-dragging { opacity: .4; }

.class-row-grip {
  cursor: grab;
  color: var(--text-muted);
  font-size: 16px;
  padding: 0 4px 0 12px;
  flex-shrink: 0;
  user-select: none;
}

.class-row-accent {
  width: 5px;
  align-self: stretch;
  border-radius: 4px;
  flex-shrink: 0;
}

.class-row-accent-0 { background: #7c3aed; }
.class-row-accent-1 { background: #0ea5e9; }
.class-row-accent-2 { background: #f59e0b; }
.class-row-accent-3 { background: #16a34a; }

.class-row-name { flex: 1.4; min-width: 160px; }

.class-row-edit {
  flex: 1.4;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.class-row-edit-input {
  width: 100%;
  border: 1px solid #e2e4ee;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
}

.class-row-edit-actions {
  display: flex;
  gap: 8px;
}

.class-row-stat {
  min-width: 90px;
  text-align: center;
}

.class-row-stat-num { font-size: 15px; font-weight: 800; }
.class-row-stat-lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }

.class-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.class-row-actions .btn-secondary {
  padding: 7px 12px;
  font-size: 12px;
}

.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge.pending { background: #fffbeb; color: #92400e; }
.badge.approved { background: #f0fdf4; color: var(--success); }
.badge.rejected { background: #fef2f2; color: var(--danger); }
.badge.active { background: #f0fdf4; color: var(--success); }
.badge.disabled { background: #f3f4f6; color: var(--text-muted); }

.btn-approve, .btn-reject {
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-right: 6px;
}

.btn-approve { background: var(--success); color: #fff; }
.btn-reject { background: var(--danger); color: #fff; }

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
}

.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 24px;
}

.inline-form .form-group { margin-bottom: 0; min-width: 180px; }

.wa-mode-toggle {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.wa-mode-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.wa-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wa-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  flex-wrap: wrap;
}

.wa-card-info { flex: 1; min-width: 180px; }

.wa-card-due { text-align: right; min-width: 100px; }

.wa-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25d366;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  border: none;
  border-radius: 24px;
  box-shadow: 0 4px 12px rgba(37,211,102,0.35);
  flex-shrink: 0;
}

.wa-send-btn:hover { background: #20bd5a; }

.wa-send-btn-disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
}

.setfee-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  max-width: 560px;
}

.setfee-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid #f0f1f6;
}

.setfee-form-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.setfee-save-btn {
  width: auto;
  padding: 11px 28px;
}

.setfee-installment-dates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 12px;
  margin: 16px 0;
}

.setfee-installment-dates:empty { margin: 0; }

.setfee-installment-row {
  display: flex;
  gap: 12px;
  padding: 10px;
  background: var(--bg-soft, #f7f8fc);
  border-radius: 10px;
}

.setfee-installment-row .form-group { flex: 1; margin: 0; }

.fee-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  max-width: 1100px;
}

.fee-choice-card {
  background: var(--card);
  border: none;
  border-radius: var(--radius);
  padding: 28px 22px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  border-left: 5px solid var(--primary);
  transition: transform .15s ease, box-shadow .15s ease;
}

.fee-choice-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.1);
}

.fee-choice-card:nth-child(2) { border-left-color: var(--success); }

.fee-choice-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 6px;
}

.fee-choice-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.balance-reminder {
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}

/* ---------- Fee battery indicator ---------- */
.fee-battery-row {
  padding: 10px 0;
  border-bottom: 1px solid #f0f1f6;
}

.fee-battery-row-top {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 8px;
}

.fee-battery-row-top .k { color: var(--text-muted); }
.fee-battery-row-top .v { font-weight: 600; }

.fee-battery {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fee-battery-shell {
  flex: 1;
  height: 22px;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  padding: 3px;
  background: #f8f9fd;
}

.fee-battery-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}

.fee-battery-low { background: var(--danger); }
.fee-battery-mid { background: var(--accent); }
.fee-battery-high { background: var(--success); }

.fee-battery-nub {
  width: 4px;
  height: 12px;
  background: #d1d5db;
  border-radius: 0 3px 3px 0;
  margin-left: -8px;
}

.fee-battery-pct {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---------- Fee payment history (popup) ---------- */
.fee-history-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: 12px;
  margin-bottom: 10px;
  border-left: 5px solid var(--primary);
  background: #f8f9ff;
}

.fee-history-row-pending { border-left-color: var(--accent); background: #fffbeb; }
.fee-history-row-approved { border-left-color: var(--success); background: #f0fdf4; }
.fee-history-row-rejected { border-left-color: var(--danger); background: #fef2f2; }

.fee-history-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fee-history-serial {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.fee-history-amount {
  font-weight: 700;
  font-size: 15px;
}

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

.fee-history-view-btn {
  display: block;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.fee-history-original-btn {
  margin-top: 8px;
  border-color: #0d9488;
  color: #0d9488;
}

.fee-history-list {
  max-height: 340px;
  overflow-y: auto;
  padding-right: 6px;
}

/* ---------- Admission Form ---------- */
.admission-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #ede9fe 0%, #e0f2fe 50%, #fef3c7 100%);
  padding: 24px 16px 60px;
  display: flex;
  justify-content: center;
}

.admission-form {
  width: 100%;
  max-width: 720px;
  background: var(--card);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(79, 70, 229, 0.15);
}

.institute-brand {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}

.institute-brand-center {
  text-align: center;
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 12px;
}

.brand-logo-img,
.brand img,
.institute-brand img,
.institute-brand-center img,
.app-header .brand img,
.sidebar .brand img,
.admission-header .institute-brand img {
  height: 22px;
  max-height: 22px;
  max-width: 160px;
  width: auto;
  object-fit: contain;
  display: block;
}

.institute-brand .brand-logo-img,
.institute-brand img { height: 20px; max-height: 20px; }

.institute-brand-center .brand-logo-img,
.institute-brand-center img { height: 36px; max-height: 36px; margin: 0 auto; }

.app-header .brand .brand-logo-img,
.app-header .brand img { height: 20px; max-height: 20px; margin: 0 auto; }

.sidebar .brand .brand-logo-img,
.sidebar .brand img { height: 100%; max-height: 64px; max-width: 100%; width: auto; object-fit: contain; }

.pr-org-logo-img { height: 24px; max-height: 24px; width: auto; }

.admission-header h1 {
  margin: 0 0 4px;
  font-size: 26px;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.admission-header p {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.form-section {
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 16px;
  border-left: 4px solid var(--primary);
  background: var(--card);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.section-heading {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-heading::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.section-heading-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.toggle-arrow {
  font-size: 11px;
}

.section-session { border-left-color: #7c3aed; }
.section-session .section-heading { color: #7c3aed; }

.section-personal { border-left-color: #06b6d4; }
.section-personal .section-heading { color: #0891b2; }

.section-family { border-left-color: #f59e0b; }
.section-family .section-heading { color: #b45309; }

.section-university { border-left-color: #0d9488; }
.section-university .section-heading { color: #0f766e; }

.section-contact { border-left-color: #16a34a; }
.section-contact .section-heading { color: #15803d; }

.section-payment-history { border-left-color: #ca8a04; }
.section-payment-history .section-heading { color: #a16207; }

.section-address { border-left-color: #ec4899; }
.section-address .section-heading { color: #be185d; }

.section-address-alt { border-left-color: #f43f5e; }
.section-address-alt .section-heading { color: #be123c; }

.section-declaration { border-left-color: #4f46e5; }
.section-declaration .section-heading { color: #4338ca; }

.section-qualifications { border-left-color: #0ea5e9; }
.section-qualifications .section-heading { color: #0369a1; }

.section-declaration-info { border-left-color: #4f46e5; }
.section-declaration-info .section-heading { color: #4338ca; }

.declaration-info-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
  line-height: 1.5;
  font-size: 13.5px;
}

.declaration-info-check {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
}

.declaration-info-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
  color: #555;
  font-size: 13px;
  line-height: 1.5;
}

.signature-docs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.signature-doc-box {
  background: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  min-width: 160px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.signature-doc-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
  margin-bottom: 8px;
}

.signature-doc-img {
  max-width: 140px;
  max-height: 70px;
  object-fit: contain;
}

.signature-doc-empty {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 4px 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 4px 16px;
}

.photo-upload-box {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px dashed #d1d5db;
}

.photo-preview {
  width: 90px;
  height: 100px;
  border-radius: 10px;
  background: #fff;
  border: 2px dashed #c7d2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview-signature { width: 140px; height: 70px; }
.photo-preview-signature img { object-fit: contain; }

.photo-preview-thumb { width: 80px; height: 80px; }
.photo-preview-thumb img { object-fit: contain; }

.photo-choose-btn {
  display: inline-block;
}

.original-receipt-upload-btn {
  padding: 6px 12px;
  font-size: 12px;
  white-space: nowrap;
}

.photo-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  margin: 10px 0;
}

.checkbox-row input { width: auto; }

.declaration-box {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  border: 1px solid #e0e7ff;
}

.declaration-box .checkbox-row {
  align-items: flex-start;
}

.declaration-note {
  margin: 12px 0 0;
}

.admission-submit {
  margin-top: 4px;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
}

/* ---------- Student home session line ---------- */
.session-value {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- Admin student detail modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 100;
}

/* The `hidden` HTML attribute normally sets display:none via the browser's
   default stylesheet, but that loses to any author rule that also sets
   `display` (like .modal-overlay above) regardless of selector order.
   This restores `hidden` so JS can toggle modals with it. */
[hidden] {
  display: none !important;
}

.receipt-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid #e5e7eb;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

.receipt-title-block { text-align: center; margin-top: 12px; }
.receipt-title-block h2 { margin: 0; color: var(--primary); font-size: 18px; letter-spacing: 1px; }
.receipt-title-block .receipt-meta { color: var(--text-muted); font-size: 13px; margin-top: 6px; }

.receipt-student-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.receipt-photo, .receipt-photo-fallback {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.receipt-photo-fallback {
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
}

.receipt-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.receipt-table tr:nth-child(even) td { background: #f9fafb; }
.receipt-table tr:last-child td { border-bottom: none; }

.receipt-table td {
  padding: 7px 12px;
  border-bottom: 1px solid #eef0f4;
  font-size: 12.5px;
}

.receipt-table td:first-child { color: var(--text-muted); }
.receipt-table td:last-child { text-align: right; font-weight: 600; }

.receipt-table tr.receipt-highlight td {
  background: #eef2ff;
  font-size: 13.5px;
  color: var(--primary);
  font-weight: 700;
}

.receipt-table tr.receipt-amount-row td {
  background: #f0fdf4;
}

.receipt-table tr.receipt-amount-row td:last-child {
  font-size: 15px;
  font-weight: 800;
  color: #047857;
}

.receipt-screenshot-block {
  margin-bottom: 20px;
}

.receipt-screenshot-img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  margin: 10px auto 0;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  object-fit: contain;
}

.receipt-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px dashed #d1d5db;
  padding-top: 14px;
}

@media print {
  .receipt-card { box-shadow: none; border: none; zoom: 0.65; }
}

.modal-card {
  background: var(--card);
  border-radius: 18px;
  width: 100%;
  max-width: 560px;
  padding: 24px 26px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.3);
}

.modal-card-wide {
  max-width: 920px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.modal-header h2 { margin: 0; font-size: 19px; }

.modal-close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  padding: 4px 8px;
}

.modal-body .section-heading {
  margin-top: 16px;
  color: var(--primary);
}

.modal-photo {
  flex-shrink: 0;
}

.modal-photo img {
  width: 100px;
  height: 118px;
  object-fit: cover;
  border-radius: 10px;
  border: 3px solid #e0e7ff;
}

.photo-placeholder {
  width: 100px;
  height: 118px;
  border-radius: 10px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
}

.detail-topbar {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
  border-left: none !important;
}

.detail-topbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #7c3aed, #db2777, #f59e0b, #16a34a);
}

@media (max-width: 480px) {
  .modal-card {
    padding: 18px 16px;
  }

  .detail-topbar {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-identity-flat h2 {
    justify-content: center;
    font-size: 19px;
    flex-wrap: wrap;
  }

  .profile-badges {
    justify-content: center;
  }

  .modal-photo img, .photo-placeholder {
    width: 90px;
    height: 106px;
  }
}

.detail-topbar .detail-grid {
  flex: 1;
}

.profile-identity-flat {
  flex: 1;
}

.profile-identity-flat h2 {
  margin: 0 0 2px;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-identity-flat h2 .verified-badge {
  width: 28px;
  height: 28px;
}

.profile-meta {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 10px;
  text-transform: capitalize;
}

.profile-meta strong {
  color: var(--primary);
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
}

.pill-id { background: #fef3c7; color: #92400e; }
.pill-course { background: #ede9fe; color: #6d28d9; }
.pill-session { background: #d1fae5; color: #047857; }

.pill-status-pending { background: #fef3c7; color: #92400e; }
.pill-status-approved { background: #d1fae5; color: #047857; }
.pill-status-rejected { background: #fee2e2; color: #b91c1c; }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Qualification sections (Matric/Inter/Graduation) ---------- */
.qualification-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid #e0f2fe;
}

.qualification-open {
  padding: 18px;
}

.qualification-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
}

.qualification-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}

.subject-rows {
  margin: 14px 0;
}

.subject-entry {
  border: 1px solid #e2e4ee;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
}

.subject-entry-top {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.subject-entry-top input {
  flex: 1;
  min-width: 0;
}

.subject-entry-marks {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.subject-entry-marks .form-group {
  margin-bottom: 0;
}

.subject-entry-marks label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--text-muted);
}

.subject-entry input {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e2e4ee;
  border-radius: 8px;
  font-size: 13px;
}

.subject-remove {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 16px;
  line-height: 1;
}

.subject-remove:disabled {
  opacity: .4;
}

.qualification-totals {
  display: flex;
  gap: 24px;
  font-size: 14px;
  background: #f0f9ff;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.qualification-save {
  width: auto;
  padding: 10px 20px;
}

.qualification-view-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.qualification-view-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.qualification-subject-table {
  margin: 10px 0;
  box-shadow: none;
  border: 1px solid #f0f1f6;
}

.detail-grid {
  display: grid;
  gap: 18px 24px;
  margin-bottom: 6px;
}

.detail-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  font-size: 13px;
}

.detail-field .k {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
}

.detail-field .v {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  text-transform: uppercase;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------- Print (Student Application A4) ---------- */
.print-only { display: none; }

.pr-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-bottom: 2px solid #1e3a8a;
  padding-bottom: 5px;
  margin-bottom: 7px;
}

.pr-header-brand {
  display: grid;
  grid-template-columns: 120px 1fr 120px;
  align-items: center;
  width: 100%;
}

.pr-header-logo {
  grid-column: 1;
  justify-self: start;
  font-size: 9px;
  color: #888;
}
.pr-header-text { grid-column: 2; justify-self: center; }
.pr-header-logo-img { height: 115px; width: auto; object-fit: contain; }

.pr-header-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.pr-header-title {
  text-align: center;
  white-space: nowrap;
  font-weight: 700;
  letter-spacing: .3px;
  line-height: 1.1;
}

.pr-header-hindi { font-size: 32px; color: #c0392b; vertical-align: middle; margin-right: 6px; }
.pr-header-eng { font-size: 25px; color: #c0392b; vertical-align: middle; }

.pr-header-address-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
}

.pr-header-address {
  font-size: 11px;
  font-weight: 700;
  color: #111;
}

.pr-header-contacts {
  display: flex;
  flex-direction: row;
  gap: 14px;
  font-size: 11px;
  font-weight: 800;
}

.pr-contact-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pr-contact-dual { color: #111; }
.pr-contact-dual .pr-contact-icon:nth-of-type(1) { color: #1e3a8a; }
.pr-contact-dual .pr-contact-icon:nth-of-type(2) { color: #128c3e; }
.pr-contact-icon { width: 12px; height: 12px; flex-shrink: 0; }

.pr-badge {
  background: #1e3a8a;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .5px;
  margin-bottom: 4px;
  padding: 4px 10px;
  border-radius: 5px;
}

.pr-reg-no {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 8px;
  font-weight: 700;
  color: #1e3a8a;
  background: #eef1fb;
  padding: 2px 8px;
  border-radius: 4px;
}

.pr-grid-top {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 8px;
  margin-bottom: 6px;
}

.pr-photo-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 90px;
}

.pr-photo-box {
  width: 90px;
  height: 100px;
  border: 1px solid #1e3a8a;
  overflow: hidden;
}

.pr-photo-box img { width: 100%; height: 100%; object-fit: cover; }

.pr-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #999;
  text-align: center;
}

.pr-sign-mini {
  width: 90px;
  height: 26px;
  border: 1px solid #93a3c7;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pr-sign-mini img { max-width: 100%; max-height: 100%; object-fit: contain; }

.pr-sign-mini-label {
  font-size: 8px;
  color: #555;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: .2px;
}

.pr-grid-mid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

.pr-box {
  border: 1px solid #93a3c7;
  border-radius: 4px;
  padding: 5px 10px;
}

.pr-full { margin-bottom: 6px; }

.pr-box-title {
  font-size: 10.5px;
  font-weight: 700;
  color: #1e3a8a;
  text-transform: uppercase;
  letter-spacing: .3px;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 3px;
  margin-bottom: 3px;
}

.pr-row {
  display: flex;
  gap: 6px;
  font-size: 10px;
  line-height: 1.4;
}

.pr-label { color: #555; min-width: 95px; flex-shrink: 0; text-transform: uppercase; }
.pr-colon { color: #555; }
.pr-value { font-weight: 700; color: #111; word-break: break-word; text-transform: uppercase; }

.pr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9.5px;
}

.pr-table th, .pr-table td {
  border: 1px solid #cbd5e1;
  padding: 2px 6px;
  text-align: left;
}

.pr-table td {
  text-transform: uppercase;
}

.pr-table th {
  background: #eef1fb;
  font-size: 8px;
  text-transform: uppercase;
}

.pr-declaration-box { font-size: 9px; }

.pr-declaration-item {
  display: flex;
  gap: 5px;
  align-items: flex-start;
  margin-bottom: 2px;
  line-height: 1.25;
}

.pr-declaration-item .pr-check {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.2;
}

.pr-declaration-note {
  margin-top: 2px;
  padding-top: 2px;
  border-top: 1px dashed #cbd5e1;
  color: #333;
  line-height: 1.25;
}

.pr-footer-note {
  font-size: 8.5px;
  color: #666;
  text-align: center;
  border-top: 1px solid #cbd5e1;
  padding-top: 3px;
  margin-top: auto;
}

.due-print-only { display: none; }

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  html, body {
    background: #fff !important;
  }

  body * {
    visibility: hidden;
  }

  #printable-admission, #printable-admission * {
    visibility: visible;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
  }

  #printable-admission {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  #due-printable, #due-printable * {
    visibility: visible;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
  }

  #due-printable {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 12mm 15mm;
    box-sizing: border-box;
  }

  .due-print-only {
    display: block !important;
  }

  #due-table thead {
    display: table-header-group;
  }

  #due-table th, #due-table td {
    padding: 2px 6px;
    font-size: 8px;
    white-space: nowrap;
  }

  #due-printable .pr-header-logo-img { height: 45px; }
  #due-printable .pr-header-hindi { font-size: 18px; }
  #due-printable .pr-header-eng { font-size: 14px; }
  #due-printable .pr-header-address { font-size: 8px; }
  #due-printable .pr-header-contacts { font-size: 8px; }
  #due-printable .pr-header { margin-bottom: 3px; padding-bottom: 3px; }
  #due-printable .due-print-only > div:last-child { margin: 4px 0 6px !important; }
  #due-printable .due-print-only h2 { font-size: 14px !important; }
  #due-printable .due-print-only p { font-size: 9px !important; }

  .no-print, .no-print *, .screen-only {
    display: none !important;
  }

  .modal-overlay {
    position: static !important;
    inset: auto !important;
    padding: 0 !important;
    background: none !important;
  }

  .print-only {
    display: flex !important;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    height: 297mm;
    padding: 12mm 15mm;
    overflow: hidden;
    font-size: 10px;
    color: #111;
  }
}

/* ---------- Student AI Assistant ---------- */
.ai-fab {
  position: fixed;
  bottom: 92px;
  right: 18px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  box-shadow: 0 8px 20px rgba(79,70,229,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.ai-chat-panel {
  position: fixed;
  bottom: 156px;
  right: 18px;
  width: min(320px, calc(100vw - 36px));
  height: 420px;
  max-height: 60vh;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 60;
}

.ai-chat-header {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-chat-back {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  margin-right: 6px;
}

.ai-suggestion-chip-care {
  background: #dcfce7;
  color: #15803d;
}

.admin-chat-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.admin-chat-thread {
  background: var(--card);
  border-radius: var(--radius);
  border: 3px solid #38bdf8;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  max-width: 900px;
  flex: 2;
  min-width: 320px;
  overflow: hidden;
}

.chat-profile-sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  padding: 20px;
}

.chat-profile-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.chat-profile-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8f9fd;
  margin-bottom: 6px;
  cursor: grab;
}

.chat-profile-field:hover { background: #ede9fe; }

.chat-profile-field-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
}

.chat-profile-field-value {
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.admin-chat-body {
  height: 380px;
  min-height: 280px;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-chat-thread .ai-chat-input-row {
  border-top: 1px solid #f0f1f6;
}

.ai-chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.ai-chat-reset {
  background: none;
  border: none;
  color: #fff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  margin-right: 10px;
}

.ai-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.4;
}

.ai-msg-bot {
  background: #f1f2f8;
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.ai-msg-user {
  background: var(--primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.ai-msg-wrap {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

.ai-msg-wrap .ai-msg { max-width: 100%; }

.ai-msg-wrap-left { align-self: flex-start; }
.ai-msg-wrap-right { align-self: flex-end; }

.ai-msg-sender-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 2px 0 0 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.ai-suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.ai-suggestion-chip {
  background: #ede9fe;
  color: #6d28d9;
  border: none;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.ai-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #f0f1f6;
}

.ai-chat-input-row input {
  flex: 1;
  border: 1px solid #e2e4ee;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
}

.ai-chat-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  flex-shrink: 0;
}

/* ---------- Toast notifications ---------- */
#toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 90vw;
  padding: 13px 20px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(-16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success { background: #16a34a; }
.toast-error { background: #dc2626; }
.toast-icon { font-size: 16px; flex-shrink: 0; }
