/* ==========================================================================
   CLASS MANAGER PRO — DESIGN TOKENS  (Light, modern Android-app theme)
   ========================================================================== */
:root{
  --bg-1:#eef3fc;
  --bg-2:#f7f5ff;
  --bg-3:#eafaf6;
  --surface:#ffffff;
  --ink-950:#19223c;      /* primary text */
  --mist-200:#5b6785;     /* secondary text */
  --mist-400:#8991ab;     /* muted / placeholder text */
  --line:#e7ecf7;         /* card border */
  --line-strong:#d7deed;
  --glass-bg:#ffffff;     /* class kept as "glass" for compatibility — now a solid card surface */
  --glass-bg-strong:#ffffff;
  --glass-border:#e7ecf7;
  --emerald-500:#17bf82;
  --emerald-400:#33d79b;
  --amber-500:#f5a623;
  --amber-400:#ffbe54;
  --coral-500:#f0475d;
  --coral-400:#ff7688;
  --sky-500:#3b7cf6;
  --violet-500:#8b5cf6;
  --shadow-1:0 10px 30px rgba(30,48,95,0.10);
  --shadow-2:0 4px 14px rgba(30,48,95,0.08);
  --radius-xl:28px;
  --radius-lg:20px;
  --radius-md:14px;
  --radius-sm:10px;
  --font-head:'Poppins',sans-serif;
  --font-body:'Inter',sans-serif;
  --font-ml:'Noto Sans Malayalam','Inter',sans-serif;
}

*{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth;}
body{
  font-family:var(--font-body);
  color:var(--ink-950);
  min-height:100vh;
  background:
    radial-gradient(1000px 640px at 10% -8%, rgba(59,124,246,0.10), transparent 60%),
    radial-gradient(900px 560px at 108% 6%, rgba(245,166,35,0.10), transparent 55%),
    radial-gradient(900px 780px at 50% 115%, rgba(23,191,130,0.10), transparent 55%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 55%, var(--bg-3) 100%);
  background-attachment:fixed;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}
[lang="ml"], .ml{ font-family:var(--font-ml); }
h1,h2,h3,h4{ font-family:var(--font-head); font-weight:600; letter-spacing:-0.01em; color:var(--ink-950); }
button{ font-family:inherit; cursor:pointer; }
input,select,textarea{ font-family:inherit; }
a{ color:inherit; text-decoration:none; }
::selection{ background:var(--emerald-500); color:#fff; }

:focus-visible{
  outline:2px solid var(--sky-500);
  outline-offset:2px;
  border-radius:6px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:0.001ms !important; animation-iteration-count:1 !important; transition-duration:0.001ms !important; }
}

::-webkit-scrollbar{ width:10px; height:10px; }
::-webkit-scrollbar-track{ background:transparent; }
::-webkit-scrollbar-thumb{ background:rgba(30,48,95,0.15); border-radius:10px; }
::-webkit-scrollbar-thumb:hover{ background:rgba(30,48,95,0.28); }

/* Ambient background blobs — soft pastel washes, kept subtle on the light page */
.blob{ position:fixed; border-radius:50%; filter:blur(100px); opacity:0.16; z-index:0; pointer-events:none; }
.blob-1{ width:420px; height:420px; background:var(--emerald-500); top:-140px; left:-120px; }
.blob-2{ width:380px; height:380px; background:var(--amber-500); top:30%; right:-160px; }
.blob-3{ width:340px; height:340px; background:var(--violet-500); bottom:-140px; left:20%; }

/* ==========================================================================
   SURFACE CARDS — real glassmorphism (translucent + backdrop blur) for hero
   cards across every section. The dashboard's own module tiles (.dash-tile)
   deliberately don't use this class, so they stay solid/vivid untouched.
   ========================================================================== */
.glass{
  background:rgba(255,255,255,0.62);
  backdrop-filter:blur(18px) saturate(160%);
  -webkit-backdrop-filter:blur(18px) saturate(160%);
  border:1px solid rgba(255,255,255,0.75);
  border-radius:var(--radius-lg);
  box-shadow:0 10px 34px rgba(30,48,95,0.14), inset 0 1px 0 rgba(255,255,255,0.5);
}
.glass-strong{
  background:rgba(255,255,255,0.8);
  backdrop-filter:blur(18px) saturate(160%);
  -webkit-backdrop-filter:blur(18px) saturate(160%);
  border:1px solid rgba(255,255,255,0.85);
}

/* ==========================================================================
   LAYOUT SHELL
   ========================================================================== */
.app-shell{ position:relative; z-index:1; min-height:100vh; padding-bottom:60px; }
.container{ max-width:1180px; margin:0 auto; padding:0 20px; }

/* Top bar */
.topbar{
  position:sticky; top:0; z-index:40;
  padding:14px 0;
  background:rgba(255,255,255,0.88);
  backdrop-filter:blur(14px);
  border-bottom:1px solid var(--line);
}
.topbar-inner{ display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; }
.brand{ display:flex; align-items:center; gap:10px; cursor:pointer; }
.brand-mark{
  width:38px; height:38px; border-radius:11px; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg, var(--sky-500), var(--violet-500));
  color:#fff; font-size:17px; box-shadow:0 4px 14px rgba(59,124,246,0.35);
}
.brand-text{ line-height:1.15; }
.brand-text strong{ font-family:var(--font-head); font-size:16px; display:block; color:var(--ink-950); }
.brand-text span{ font-size:11.5px; color:var(--mist-400); }

.topbar-actions{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

.btn{
  display:inline-flex; align-items:center; gap:7px; justify-content:center;
  padding:10px 16px; border-radius:var(--radius-sm); border:1px solid transparent;
  font-size:13.5px; font-weight:600; white-space:nowrap;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active{ transform:scale(0.97); }
.btn-primary{ background:linear-gradient(135deg, var(--emerald-500), var(--emerald-400)); color:#fff; box-shadow:0 6px 18px rgba(23,191,130,0.3); }
.btn-primary:hover{ box-shadow:0 8px 22px rgba(23,191,130,0.42); }
.btn-ghost{ background:var(--surface); color:var(--ink-950); border-color:var(--line); box-shadow:var(--shadow-2); }
.btn-ghost:hover{ background:#f6f8fd; }
.btn-outline{ background:transparent; color:var(--ink-950); border-color:var(--line-strong); }
.btn-outline:hover{ background:#f2f5fb; }
.btn-danger{ background:rgba(240,71,93,0.1); color:var(--coral-500); border-color:rgba(240,71,93,0.28); }
.btn-vivid{
  position:relative; color:#fff; border:none; overflow:hidden;
  background:linear-gradient(120deg,#f45fae,#9b6bf5,#f45fae); background-size:200% 100%;
  box-shadow:0 6px 18px rgba(155,107,245,0.35);
  animation:vividShift 4s ease infinite;
}
.btn-vivid:hover{ box-shadow:0 8px 22px rgba(155,107,245,0.48); transform:translateY(-1px); }
.btn-vivid.vivid-blue{
  background:linear-gradient(120deg,#3b7cf6,#1cc6d6,#3b7cf6); background-size:200% 100%;
  box-shadow:0 6px 18px rgba(59,124,246,0.35);
}
.btn-vivid.vivid-blue:hover{ box-shadow:0 8px 22px rgba(59,124,246,0.48); }
@keyframes vividShift{ 0%{ background-position:0% 50%; } 50%{ background-position:100% 50%; } 100%{ background-position:0% 50%; } }
.btn-danger:hover{ background:rgba(240,71,93,0.18); }
.btn-sm{ padding:7px 12px; font-size:12.5px; border-radius:9px; }
.btn-icon{ width:38px; height:38px; padding:0; border-radius:11px; }
.btn:disabled{ opacity:0.45; cursor:not-allowed; }

/* Alarm-style save/import cluster */
.save-cluster{ display:flex; align-items:center; gap:8px; padding:5px; border-radius:16px; background:#f4f7fc; border:1px solid var(--line); }
.btn-alarm{
  position:relative; background:linear-gradient(135deg, var(--amber-500), var(--amber-400));
  color:#2b1600; box-shadow:0 6px 18px rgba(245,166,35,0.38);
}
.btn-alarm::before{
  content:''; position:absolute; inset:-3px; border-radius:inherit; z-index:-1;
  background:linear-gradient(135deg, var(--amber-500), var(--amber-400));
  opacity:0.45; filter:blur(9px);
  animation:alarmPulse 2.2s ease-in-out infinite;
}
@keyframes alarmPulse{
  0%,100%{ opacity:0.25; transform:scale(0.96); }
  50%{ opacity:0.6; transform:scale(1.08); }
}
.bell-btn{
  background:linear-gradient(135deg, var(--amber-500), var(--amber-400));
  color:#2b1600; border-radius:50%;
}
.bell-btn i{ animation:bellRing 3.6s ease-in-out infinite; transform-origin:top center; }
@keyframes bellRing{
  0%,7%,100%{ transform:rotate(0); }
  1%{ transform:rotate(14deg); } 2%{ transform:rotate(-12deg); } 3%{ transform:rotate(9deg); }
  4%{ transform:rotate(-7deg); } 5%{ transform:rotate(4deg); } 6%{ transform:rotate(-2deg); }
}

.hidden{ display:none !important; }
.sr-only{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }

/* ==========================================================================
   VIEWS
   ========================================================================== */
.view{ padding-top:26px; animation:viewIn .35s ease; }
@keyframes viewIn{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:translateY(0); } }
.view-header{ display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin-bottom:22px; }
.view-title-group{ display:flex; align-items:center; gap:12px; }
.back-btn{
  width:40px; height:40px; border-radius:12px; display:flex; align-items:center; justify-content:center;
  background:var(--surface); border:1px solid var(--line); color:var(--ink-950); font-size:15px; box-shadow:var(--shadow-2);
}
.back-btn:hover{ background:#f6f8fd; }
.view-title{ font-size:22px; }
.view-subtitle{ color:var(--mist-400); font-size:13px; margin-top:2px; }
.view-actions{ display:flex; gap:8px; flex-wrap:wrap; }

/* ==========================================================================
   DASHBOARD
   ========================================================================== */
.hero-banner{
  padding:28px 26px; margin-bottom:26px; position:relative; overflow:hidden; border:none;
  background:linear-gradient(135deg, #4f7bf7 0%, #7d5ff2 60%, #9b5cf2 100%);
  box-shadow:0 16px 34px -10px rgba(90,90,240,0.45);
}
.hero-banner h1{ font-size:26px; margin-bottom:6px; color:#fff; }
.hero-banner p{ color:rgba(255,255,255,0.86); font-size:14px; max-width:560px; }
.hero-banner .school-chip{
  display:inline-flex; align-items:center; gap:8px; margin-top:14px; padding:8px 14px;
  background:rgba(255,255,255,0.16); border:1px solid rgba(255,255,255,0.3); border-radius:100px; font-size:12.5px; color:#fff;
}
.hero-banner .school-chip i{ color:#ffe08a; }
.doodle{ position:absolute; width:34px; height:34px; z-index:0; pointer-events:none; }
.doodle-1{ top:16px; right:70px; animation:doodleFloat 5.5s ease-in-out infinite; }
.doodle-2{ bottom:20px; right:140px; width:28px; height:28px; animation:doodleFloat 6.5s ease-in-out infinite .6s; }
.doodle-3{ top:38%; right:22px; width:36px; height:36px; animation:doodleFloat 5s ease-in-out infinite 1.1s; }
@keyframes doodleFloat{
  0%,100%{ transform:translateY(0) rotate(0deg); }
  50%{ transform:translateY(-9px) rotate(8deg); }
}
@media (max-width:640px){ .doodle-2{ display:none; } }

/* Dashboard modules = colorful button tiles, icon + label + chevron, 2 per row (matches reference app) */
.dash-grid{ display:grid; grid-template-columns:repeat(2, 1fr); gap:14px; }
.dash-tile{
  position:relative; display:flex; flex-direction:column; align-items:flex-start; gap:14px;
  padding:18px; border-radius:20px; cursor:pointer; color:#fff; overflow:hidden;
  box-shadow:0 12px 26px -8px rgba(20,30,70,0.35);
  transition:transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease;
  opacity:0; transform:translateY(14px); animation:tileIn .5s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes tileIn{ to{ opacity:1; transform:translateY(0); } }
.dash-tile:hover{ transform:translateY(-4px); box-shadow:0 18px 32px -8px rgba(20,30,70,0.4); }
.dash-tile:active{ transform:translateY(-1px) scale(0.98); }
.dash-tile .dt-icon{
  width:42px; height:42px; border-radius:13px; background:rgba(255,255,255,0.24);
  display:flex; align-items:center; justify-content:center; font-size:18px; color:#fff; flex-shrink:0;
}
.dash-tile .dt-label{ font-family:var(--font-head); font-weight:700; font-size:14px; padding-right:16px; }
.dash-tile .dt-chevron{ position:absolute; right:14px; top:50%; transform:translateY(-50%); color:rgba(255,255,255,0.7); font-size:13px; }
.dash-tile .dt-count{
  position:absolute; top:12px; right:14px; min-width:22px; height:22px; padding:0 6px; border-radius:50%;
  background:#ff4757; color:#fff; font-family:var(--font-head); font-weight:700; font-size:11px;
  display:flex; align-items:center; justify-content:center; border:2px solid rgba(255,255,255,0.9); box-shadow:0 2px 6px rgba(255,71,87,0.5);
}
.dash-tile.wide{ grid-column:1 / -1; flex-direction:row; align-items:center; gap:16px; }
.dash-tile.wide .dt-label{ font-size:15px; padding-right:0; }

.dt-settings{ background:linear-gradient(135deg,#4f8bfb,#2f66e8); }
.dt-students{ background:linear-gradient(135deg,#28c98f,#159a66); }
.dt-attendance{ background:linear-gradient(135deg,#9b6bf5,#7440e0); }
.dt-fees{ background:linear-gradient(135deg,#ffab3d,#f5821a); }
.dt-terminal{ background:linear-gradient(135deg,#f4586a,#d92f47); }
.dt-ce{ background:linear-gradient(135deg,#1cc6d6,#0d9baa); }
.dt-contact{ background:linear-gradient(135deg,#f45fae,#e0308c); }

/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */
.field{ margin-bottom:16px; }
.field label{ display:block; font-size:12.5px; font-weight:600; color:var(--mist-200); margin-bottom:7px; }
.field .hint{ font-size:11.5px; color:var(--mist-400); margin-top:5px; font-weight:400; }
.input, select.input, textarea.input{
  width:100%; padding:11px 14px; border-radius:var(--radius-sm);
  background:#f6f8fc; border:1px solid var(--line); color:var(--ink-950);
  font-size:14px; transition:border-color .15s, background .15s;
}
.input::placeholder{ color:var(--mist-400); }
.input:focus{ border-color:var(--sky-500); background:#fff; outline:none; box-shadow:0 0 0 3px rgba(59,124,246,0.12); }
.input:disabled{ opacity:0.5; cursor:not-allowed; }
select.input{ appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235b6785' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 14px center; padding-right:34px; }
.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.grid-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
@media (max-width:640px){ .grid-2,.grid-3{ grid-template-columns:1fr; } }

.chip-select{ display:flex; flex-wrap:wrap; gap:8px; }
.chip{
  padding:9px 15px; border-radius:100px; font-size:13px; font-weight:600;
  background:#f2f5fb; border:1px solid var(--line); color:var(--mist-200);
  transition:all .15s ease;
}
.chip.active{ background:linear-gradient(135deg,var(--emerald-500),var(--emerald-400)); color:#fff; border-color:transparent; }
.chip-sm{ padding:5px 10px; border-radius:100px; font-size:11px; font-weight:700; background:#f2f5fb; border:1px solid var(--line); color:var(--mist-200); white-space:nowrap; }
.chip-sm.active{ background:linear-gradient(135deg,var(--emerald-500),var(--emerald-400)); color:#fff; border-color:transparent; }
.remarks-input{ width:120px; padding:6px 8px; font-size:12px; border-radius:8px; background:#f6f8fc; border:1px solid var(--line); color:var(--ink-950); }
.chip:hover:not(.active){ background:#e9eefb; }

.checklist{ display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:10px; }
.check-item{
  display:flex; align-items:center; gap:10px; padding:11px 13px; border-radius:var(--radius-sm);
  background:#f6f8fc; border:1px solid var(--line); font-size:13.5px; cursor:pointer; color:var(--ink-950);
}
.check-item input{ accent-color:var(--emerald-500); width:16px; height:16px; }
.check-item.custom-tag{ border-style:dashed; }
.check-item .rm-subject{ margin-left:auto; color:var(--coral-500); opacity:0.75; font-size:12px; }
.check-item .rm-subject:hover{ opacity:1; }

.subject-maxmark{ width:64px; padding:4px 6px; margin-left:auto; text-align:center; border-radius:7px; background:#fff; border:1px solid var(--line); color:var(--ink-950); font-size:12px; }

/* ==========================================================================
   TOOLBAR (search / filters)
   ========================================================================== */
.toolbar{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:18px; padding:14px; }
.search-box{ position:relative; flex:1; min-width:200px; }
.search-box i{ position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--mist-400); font-size:13px; }
.search-box input{ padding-left:38px; }
.filter-row{ display:flex; gap:8px; flex-wrap:wrap; }
.stat-pill{ display:flex; align-items:center; gap:6px; padding:8px 13px; border-radius:100px; background:#f2f5fb; border:1px solid var(--line); font-size:12px; color:var(--mist-200); }
.stat-pill b{ color:var(--ink-950); font-family:var(--font-head); }

/* ==========================================================================
   STUDENT / GENERIC CARDS
   ========================================================================== */
.card-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:14px; }
.student-card{ padding:16px; position:relative; transition:transform .18s ease, box-shadow .18s ease; }
.student-card:hover{ transform:translateY(-3px); box-shadow:0 14px 30px rgba(28,45,84,0.14); }
.student-card .sc-top{ display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.avatar{
  width:44px; height:44px; border-radius:13px; display:flex; align-items:center; justify-content:center;
  font-family:var(--font-head); font-weight:700; font-size:15px; color:#fff; flex-shrink:0;
}
.sc-name{ font-size:14.5px; font-weight:600; line-height:1.3; color:var(--ink-950); }
.sc-adm{ font-size:11.5px; color:var(--mist-400); }
.sc-meta{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
.badge{ padding:4px 10px; border-radius:100px; font-size:10.5px; font-weight:700; letter-spacing:.2px; }
.badge-male{ background:rgba(59,124,246,0.12); color:#2f66e0; }
.badge-female{ background:rgba(244,95,174,0.12); color:#e0308c; }
.badge-caste{ background:rgba(139,92,246,0.12); color:#7440e0; }
.sc-actions{ display:flex; gap:7px; }
.sc-actions .btn{ flex:1; }

.empty-state{ text-align:center; padding:60px 20px; color:var(--mist-400); }
.empty-state i{ font-size:34px; margin-bottom:14px; opacity:0.5; display:block; }
.empty-state p{ font-size:13.5px; max-width:320px; margin:0 auto; }

.dropzone{
  border:1.5px dashed var(--line-strong); border-radius:var(--radius-lg); padding:30px 20px; text-align:center;
  background:#f7f9fd; transition:border-color .15s, background .15s; margin-bottom:18px; cursor:pointer;
}
.dropzone.drag-over{ border-color:var(--emerald-500); background:rgba(23,191,130,0.06); }
.dropzone i{ font-size:26px; color:var(--emerald-500); margin-bottom:10px; display:block; }
.dropzone strong{ font-size:14px; color:var(--ink-950); }
.dropzone span{ display:block; font-size:12px; color:var(--mist-400); margin-top:4px; }

.table-wrap{ overflow-x:auto; border-radius:var(--radius-md); border:1px solid rgba(255,255,255,0.75); background:rgba(255,255,255,0.62); backdrop-filter:blur(18px) saturate(160%); -webkit-backdrop-filter:blur(18px) saturate(160%); }
table.dtable{ width:100%; border-collapse:collapse; font-size:13px; min-width:560px; }
table.dtable th{ text-align:left; padding:12px 14px; background:#f6f8fc; color:var(--mist-200); font-weight:700; font-size:11.5px; text-transform:uppercase; letter-spacing:.4px; white-space:nowrap; }
table.dtable td{ padding:10px 14px; border-top:1px solid var(--line); vertical-align:middle; color:var(--ink-950); }
table.dtable td input.input{ padding:7px 10px; font-size:13px; }
table.dtable tr:hover td{ background:#f9fafe; }

.mark-toggle{ display:inline-flex; gap:6px; }
.mark-btn{
  width:38px; height:38px; border-radius:10px; display:flex; align-items:center; justify-content:center;
  background:#f2f5fb; border:1.5px solid var(--line); color:var(--mist-400); font-size:14px;
  transition:all .15s ease;
}
.mark-btn.present.active{ background:rgba(23,191,130,0.14); border-color:var(--emerald-500); color:var(--emerald-500); }
.mark-btn.absent.active{ background:rgba(240,71,93,0.14); border-color:var(--coral-500); color:var(--coral-500); }
.mark-btn:hover{ filter:brightness(0.97); }

.pay-toggle{ width:34px; height:34px; border-radius:50%; border:1.5px solid var(--line); background:#f2f5fb; display:flex; align-items:center; justify-content:center; color:transparent; transition:all .15s ease; }
.pay-toggle.paid{ background:linear-gradient(135deg,var(--emerald-500),var(--emerald-400)); border-color:transparent; color:#fff; }
.pay-toggle.sm{ width:26px; height:26px; font-size:10px; }

.mini-hero{ padding:18px; cursor:pointer; position:relative; }
.mini-hero:hover{ transform:translateY(-3px); box-shadow:0 14px 30px rgba(28,45,84,0.14); }
.mini-hero .mh-icon{ width:38px; height:38px; border-radius:11px; display:flex; align-items:center; justify-content:center; font-size:16px; color:#fff; margin-bottom:12px; background:linear-gradient(135deg,var(--amber-500),var(--amber-400)); }
.mini-hero h4{ font-size:14.5px; margin-bottom:4px; color:var(--ink-950); }
.mini-hero p{ font-size:11.5px; color:var(--mist-400); }
.mini-hero .mh-stats{ display:flex; gap:12px; margin-top:12px; font-size:11px; color:var(--mist-200); }
.mini-hero .mh-stats b{ display:block; font-family:var(--font-head); font-size:16px; color:var(--ink-950); }

/* ==========================================================================
   MODAL SYSTEM
   ========================================================================== */
.modal-overlay{
  position:fixed; inset:0; z-index:100; display:flex; align-items:center; justify-content:center;
  background:rgba(20,28,50,0.45); backdrop-filter:blur(4px); padding:20px;
  animation:overlayIn .2s ease;
}
@keyframes overlayIn{ from{ opacity:0; } to{ opacity:1; } }
.modal-box{
  width:100%; max-width:560px; max-height:88vh; overflow-y:auto; padding:26px;
  background:#ffffff; border:1px solid var(--line); border-radius:var(--radius-lg); box-shadow:0 24px 60px rgba(20,30,70,0.28);
  animation:modalIn .25s cubic-bezier(.2,.8,.2,1);
}
.modal-box.wide{ max-width:820px; }
@keyframes modalIn{ from{ opacity:0; transform:translateY(16px) scale(0.98); } to{ opacity:1; transform:translateY(0) scale(1); } }
.modal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.modal-head h3{ font-size:17px; }
.modal-close{ width:32px; height:32px; border-radius:10px; background:#f2f5fb; display:flex; align-items:center; justify-content:center; color:var(--mist-200); font-size:14px; }
.modal-close:hover{ background:#e9eefb; }
.modal-foot{ display:flex; justify-content:flex-end; gap:10px; margin-top:22px; flex-wrap:wrap; }

.reminder-modal{ max-width:460px; text-align:center; }
.reminder-modal .r-icon{
  width:60px; height:60px; border-radius:50%; margin:0 auto 16px; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,var(--amber-500),var(--amber-400)); color:#2b1600; font-size:24px;
}
.reminder-modal h3{ font-size:16.5px; margin-bottom:12px; }
.reminder-modal p.ml{ font-size:14.5px; line-height:1.9; color:var(--ink-950); }
.reminder-modal .dont-show{ margin-top:16px; font-size:12px; color:var(--mist-400); display:flex; align-items:center; justify-content:center; gap:7px; }

/* ==========================================================================
   TOAST
   ========================================================================== */
.toast-wrap{ position:fixed; bottom:22px; left:50%; transform:translateX(-50%); z-index:200; display:flex; flex-direction:column; gap:8px; align-items:center; }
.toast{
  padding:12px 20px; border-radius:100px; font-size:13.5px; font-weight:600; display:flex; align-items:center; gap:9px;
  background:#1e2947; color:#fff; box-shadow:0 14px 30px rgba(20,30,70,0.35);
  animation:toastIn .25s cubic-bezier(.2,.8,.2,1);
}
@keyframes toastIn{ from{ opacity:0; transform:translateY(12px); } to{ opacity:1; transform:translateY(0); } }
.toast.success i{ color:var(--emerald-400); }
.toast.error i{ color:var(--coral-400); }
.toast.info i{ color:#7fb0ff; }

/* ==========================================================================
   CALL & MESSAGE CARDS
   ========================================================================== */
.contact-card{ padding:18px; }
.contact-card .cc-top{ display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.contact-card .cc-parent{ font-size:11.5px; color:var(--mist-400); margin-top:2px; }
.contact-card .cc-actions{ display:flex; gap:8px; }
.contact-card .cc-actions .btn{ flex:1; padding:10px; }
.btn-call{ background:rgba(59,124,246,0.1); color:#2f66e0; border:1px solid rgba(59,124,246,0.28); }
.btn-call:hover{ background:rgba(59,124,246,0.18); }
.btn-wa{ background:rgba(23,191,130,0.1); color:#149164; border:1px solid rgba(23,191,130,0.3); }
.btn-wa:hover{ background:rgba(23,191,130,0.18); }

/* ==========================================================================
   PROGRESS CARD PREVIEW
   ========================================================================== */
.progress-card-preview{ padding:22px; background:#fff; border-radius:var(--radius-lg); }
.pc-head{ text-align:center; margin-bottom:18px; padding-bottom:16px; border-bottom:1px solid var(--line); }
.pc-head h2{ font-size:18px; }
.pc-head p{ font-size:12.5px; color:var(--mist-400); margin-top:4px; }
.pc-student-row{ display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; font-size:13px; margin-bottom:16px; color:var(--mist-200); }
.pc-student-row b{ color:var(--ink-950); }
.grade-pill{ display:inline-block; padding:3px 10px; border-radius:100px; font-size:11px; font-weight:700; background:rgba(23,191,130,0.12); color:#149164; }

/* ==========================================================================
   MISC
   ========================================================================== */
.section-note{ display:flex; gap:10px; align-items:flex-start; padding:13px 15px; border-radius:var(--radius-sm); background:rgba(59,124,246,0.07); border:1px solid rgba(59,124,246,0.2); font-size:12.5px; color:#3a5480; margin-bottom:18px; }
.section-note i{ color:var(--sky-500); margin-top:1px; }
.lang-toggle{ display:inline-flex; background:#f2f5fb; border:1px solid var(--line); border-radius:100px; padding:3px; gap:2px; }
.lang-toggle button{ padding:6px 13px; border-radius:100px; font-size:12px; font-weight:600; color:var(--mist-400); background:transparent; }
.lang-toggle button.active{ background:var(--emerald-500); color:#fff; }

.spin{ animation:spin 0.8s linear infinite; }
@keyframes spin{ to{ transform:rotate(360deg); } }

footer.app-footer{ text-align:center; padding:26px 20px 10px; color:var(--mist-400); font-size:11.5px; }

/* Topbar class switcher */
.class-switcher{ display:flex; align-items:center; gap:8px; background:#f4f7fc; border:1px solid var(--line); border-radius:12px; padding:0 4px 0 12px; }
.class-switcher i{ color:var(--sky-500); font-size:14px; }
.class-switcher select{ max-width:190px; border:none; background:transparent; padding:9px 8px; font-size:12.5px; font-weight:600; }
.class-switcher select:focus{ box-shadow:none; }
@media (max-width:720px){ .class-switcher{ flex:1; } .class-switcher select{ max-width:none; width:100%; } }

/* Terminal Evaluation top screen — icon tiles, 3 per row */
.tri-grid{ display:grid; grid-template-columns:repeat(3, 1fr); gap:12px; }
@media (max-width:520px){ .tri-grid{ grid-template-columns:repeat(2, 1fr); } }
.dt-classtest{ background:linear-gradient(135deg,#6c7bfa,#4451e0); }
.dt-term1{ background:linear-gradient(135deg,#3fa8f5,#1c7fd6); }
.dt-term2{ background:linear-gradient(135deg,#1cc6a8,#0e9c85); }
.dt-model{ background:linear-gradient(135deg,#ffab3d,#f5821a); }
.dt-mainexam{ background:linear-gradient(135deg,#f4586a,#d92f47); }

/* Fee card edit affordance */
.mini-hero .mh-edit{ position:absolute; top:14px; right:14px; width:28px; height:28px; border-radius:9px; background:rgba(255,255,255,0.9); border:1px solid var(--line); display:flex; align-items:center; justify-content:center; font-size:12px; color:var(--mist-200); box-shadow:var(--shadow-2); }
.mini-hero .mh-edit:hover{ background:#fff; color:var(--ink-950); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width:720px){
  .topbar-inner{ flex-direction:column; align-items:stretch; }
  .topbar-actions{ justify-content:space-between; }
  .save-cluster{ flex:1; justify-content:space-between; }
  .module-grid{ grid-template-columns:repeat(2,1fr); }
  .hero-banner h1{ font-size:21px; }
  .view-header{ flex-direction:column; align-items:flex-start; }
  .card-grid{ grid-template-columns:1fr; }
}
@media (max-width:420px){
  .module-grid{ grid-template-columns:1fr; }
  .grid-3{ grid-template-columns:1fr; }
}
/* ==========================================================================
   SELECTION STATES — clear ON / OFF look for ticks, checkboxes and toggle buttons
   ========================================================================== */
.check-item{ transition:background .15s ease, border-color .15s ease, box-shadow .15s ease; }
.check-item input{ width:20px; height:20px; flex-shrink:0; }
.check-item.is-checked{ background:rgba(23,191,130,0.14); border-color:var(--emerald-500); box-shadow:0 0 0 1px var(--emerald-500) inset; font-weight:600; }
.check-item:has(input:checked){ background:rgba(23,191,130,0.14); border-color:var(--emerald-500); box-shadow:0 0 0 1px var(--emerald-500) inset; font-weight:600; }
.check-item .toggle-state{ margin-left:auto; flex-shrink:0; font-size:10.5px; font-weight:800; letter-spacing:.4px; padding:3px 10px; border-radius:100px; background:#e3e8f2; color:#5b6785; }
.check-item.is-checked .toggle-state{ background:var(--emerald-500); color:#fff; }

.sel-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:7px 12px; border-radius:10px;
  font-size:11.5px; font-weight:700; white-space:nowrap; cursor:pointer;
  background:#eef2f8; color:#5b6785; border:2px solid #c7d0e0; transition:background .12s ease, border-color .12s ease, transform .08s ease;
}
.sel-btn:active{ transform:scale(.96); }
.sel-btn.tick{ width:32px; height:32px; padding:0; border-radius:9px; font-size:13px; color:#8993a8; }
.sel-btn.on-green{ background:linear-gradient(135deg,#17bf82,#3fd79f) !important; color:#fff !important; border-color:#0f9d6c !important; box-shadow:0 3px 10px rgba(23,191,130,.35); }
.sel-btn.on-blue { background:linear-gradient(135deg,#3b7cf6,#6fa0fa) !important; color:#fff !important; border-color:#2f66e0 !important; box-shadow:0 3px 10px rgba(59,124,246,.35); }
.sel-btn.on-red  { background:linear-gradient(135deg,#f0475d,#ff7688) !important; color:#fff !important; border-color:#d9364c !important; box-shadow:0 3px 10px rgba(240,71,93,.30); }

/* ==========================================================================
   TYPEABLE DATE FIELD (DD/MM/YYYY + calendar picker)
   ========================================================================== */
.date-field{ display:flex; align-items:stretch; gap:8px; }
.date-field > .input{ flex:1; min-width:0; }
.date-field .input.invalid{ border-color:var(--coral-500); box-shadow:0 0 0 3px rgba(240,71,93,0.14); }
.date-cal{ position:relative; width:46px; flex-shrink:0; display:flex; align-items:center; justify-content:center; border-radius:var(--radius-sm); background:#f2f5fb; border:1px solid var(--line-strong); color:var(--sky-500); font-size:16px; cursor:pointer; }
.date-cal:hover{ background:#e9eefb; }
.date-cal input[type="date"]{ position:absolute; inset:0; width:100%; height:100%; opacity:0; pointer-events:none; }

/* ==========================================================================
   INTERNAL ASSESSMENT BADGES
   ========================================================================== */
.late-badge{ display:inline-block; padding:1px 7px; border-radius:100px; font-size:10px; font-weight:800; letter-spacing:.3px; background:rgba(240,71,93,0.12); color:var(--coral-500); border:1px solid rgba(240,71,93,0.3); vertical-align:middle; }
table.dtable.compact th, table.dtable.compact td{ padding:9px 8px; }
table.dtable.compact .sel-btn:not(.tick){ padding:6px 8px; font-size:11px; gap:4px; }
.sub-date{ font-size:11px; color:var(--mist-400); margin-top:2px; min-height:0; }
.sub-date:empty{ display:none; }
.note-btns{ display:flex; gap:4px; justify-content:center; }
@media (max-width:480px){
  table.dtable.compact .sel-btn:not(.tick){ padding:6px 7px; }
  table.dtable.compact .sel-btn:not(.tick) i{ display:none; }
  table.dtable.compact th{ white-space:normal; }
}
@media (max-width:360px){ .note-btns{ flex-direction:column; } }

/* student card flags + view modal */
.badge-flag{ background:rgba(245,130,26,0.14); color:#c25e00; }
.view-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px 16px; margin-bottom:18px; }
.view-item{ min-width:0; }
.view-item.full{ grid-column:1 / -1; }
.view-item label{ display:block; font-size:11px; font-weight:700; letter-spacing:.3px; text-transform:uppercase; color:var(--mist-400); margin-bottom:3px; }
.view-item > div{ font-size:14px; font-weight:600; color:var(--ink-950); word-break:break-word; }
