/* The Campus Connect design system: light and dark themes, motion scoped under .enter. */
:root {
  --bg: #f4f5fb; --bg-2: #eceefb; --surface: #ffffff; --surface-2: #f3f4fa; --border: #e4e6f1; --text: #171a2b; --muted: #6a7088;
  --primary: #5b5bf0; --primary-2: #8b5cf6; --accent: #ec4899; --primary-ink: #fff; --primary-soft: #eeeeff;
  --grad: linear-gradient(135deg, #5b5bf0 0%, #8b5cf6 55%, #d946ef 100%);
  --grad-soft: linear-gradient(135deg, rgba(91,91,240,.10), rgba(217,70,239,.08));
  --green: #0f8a5f; --green-soft: #e1f7ec; --amber: #a86200; --amber-soft: #fff2d6; --red: #d12b3a; --red-soft: #fde7e9;
  --blue: #1f6fd6; --blue-soft: #e4efff; --gray-soft: #eceef5;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23,26,43,.04), 0 4px 16px rgba(23,26,43,.05);
  --shadow-lg: 0 10px 30px rgba(60,60,160,.14), 0 2px 6px rgba(23,26,43,.06);
  --glass: rgba(255,255,255,.78);
  --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans Bengali", sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e17; --bg-2: #121426; --surface: #151827; --surface-2: #1c2033; --border: #272c42; --text: #e9ebf5; --muted: #9299b3;
    --primary: #8480ff; --primary-2: #a78bfa; --accent: #f472b6; --primary-soft: #23244b;
    --grad-soft: linear-gradient(135deg, rgba(132,128,255,.16), rgba(244,114,182,.10));
    --green: #4fd8a2; --green-soft: #11332a; --amber: #f5bb5c; --amber-soft: #3a2c10; --red: #ff8088; --red-soft: #3f1a20;
    --blue: #84b6ff; --blue-soft: #17294d; --gray-soft: #242941;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 12px 34px rgba(0,0,0,.45); --glass: rgba(21,24,39,.78);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0e17; --bg-2: #121426; --surface: #151827; --surface-2: #1c2033; --border: #272c42; --text: #e9ebf5; --muted: #9299b3;
  --primary: #8480ff; --primary-2: #a78bfa; --accent: #f472b6; --primary-soft: #23244b;
  --grad-soft: linear-gradient(135deg, rgba(132,128,255,.16), rgba(244,114,182,.10));
  --green: #4fd8a2; --green-soft: #11332a; --amber: #f5bb5c; --amber-soft: #3a2c10; --red: #ff8088; --red-soft: #3f1a20;
  --blue: #84b6ff; --blue-soft: #17294d; --gray-soft: #242941;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 12px 34px rgba(0,0,0,.45); --glass: rgba(21,24,39,.78);
  color-scheme: dark;
}

/* ---------- keyframes ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.92) translateY(8px); } 100% { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ring { from { stroke-dashoffset: 327; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); } 50% { transform: translateY(-16px) rotate(calc(var(--rot, 0deg) + 4deg)); } }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(40px, -30px) scale(1.15); } 100% { transform: translate(0, 0) scale(1); } }
@keyframes hue { to { background-position: 200% 50%; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(236,72,153,.55); } 100% { box-shadow: 0 0 0 9px rgba(236,72,153,0); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-16deg); } 30% { transform: rotate(13deg); } 45% { transform: rotate(-9deg); } 60% { transform: rotate(6deg); } 80% { transform: rotate(-3deg); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes checkPop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(16deg); } 20%, 40% { transform: rotate(-10deg); } }
@keyframes shine { from { transform: translateX(-120%) skewX(-20deg); } to { transform: translateX(260%) skewX(-20deg); } }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
body { background:
  radial-gradient(900px 500px at 100% -10%, rgba(139,92,246,.10), transparent 60%),
  radial-gradient(700px 420px at -10% 110%, rgba(91,91,240,.09), transparent 60%), var(--bg); background-attachment: fixed; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.015em; }
h1 { font-size: 24px; font-weight: 800; } h2 { font-size: 17px; font-weight: 700; } h3 { font-size: 15px; font-weight: 700; }
::selection { background: rgba(139,92,246,.28); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "Cascadia Code", SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 16px; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }
.ic.lg { width: 22px; height: 22px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.sidebar { background: var(--glass); backdrop-filter: blur(14px); border-right: 1px solid var(--border); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 16px; font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.brand .logo { width: 38px; height: 38px; border-radius: 12px; background: var(--grad); background-size: 200% 200%; animation: hue 8s linear infinite alternate; display: grid; place-items: center; color: #fff; box-shadow: 0 6px 16px rgba(110,90,240,.38); flex: none; }
.brand .logo .ic { width: 21px; height: 21px; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; letter-spacing: 0; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 16px 12px 6px; font-weight: 700; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 11px; color: var(--text); font-weight: 550; transition: background .18s, color .18s, transform .18s var(--ease); }
.nav a .ic { color: var(--muted); transition: color .18s, transform .25s var(--ease); }
.nav a:hover { background: var(--surface-2); text-decoration: none; transform: translateX(2px); }
.nav a:hover .ic { color: var(--primary); transform: scale(1.12) rotate(-4deg); }
.nav a.active { background: var(--grad-soft); color: var(--primary); }
.nav a.active .ic { color: var(--primary); }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); animation: fadeIn .3s; }
.nav .count { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 7px; font-weight: 700; line-height: 18px; animation: pulse 1.8s infinite; }
.sidebar-foot { margin-top: auto; padding: 12px 0 0; border-top: 1px solid var(--border); }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 12px 28px; border-bottom: 1px solid var(--border); background: var(--glass); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 5; }
.topbar #crumb { font-size: 15px; }
.icon-btn.menu-btn { display: none; }
.icon-btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: transform .18s var(--ease), background .18s, border-color .18s; }
.icon-btn:hover { background: var(--surface-2); transform: translateY(-1px); border-color: var(--primary); text-decoration: none; }
.icon-btn:active { transform: scale(.94); }
.icon-btn .pip { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; animation: pulse 1.8s infinite; }
.icon-btn.wiggle .ic { animation: wiggle .8s var(--ease); transform-origin: 50% 10%; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 12px 4px 4px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; transition: border-color .18s, transform .18s var(--ease); }
.user-chip:hover { border-color: var(--primary); text-decoration: none; transform: translateY(-1px); }
.user-chip small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 600; letter-spacing: .05em; line-height: 1.1; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: 12.5px; flex: none; background: hsl(var(--h, 250) 65% 55%); background: linear-gradient(135deg, hsl(var(--h, 250) 72% 58%), hsl(calc(var(--h, 250) + 40) 72% 52%)); letter-spacing: 0; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.content { padding: 26px 28px 70px; max-width: 1280px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.head-emoji { display: inline-block; margin-left: 8px; font-size: .9em; }
.enter .head-emoji { animation: pop .5s var(--ease) .15s both; }
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s var(--ease) .4s 2; }
.banner { display: flex; gap: 10px; align-items: center; padding: 11px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 550; animation: fadeUp .4s var(--ease) both; }
.banner.warn { background: var(--amber-soft); color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); }
.banner a { font-weight: 700; color: inherit; text-decoration: underline; }

/* ---------- entrance motion (only when navigating to a page) ---------- */
.enter > * { animation: fadeUp .5s var(--ease) both; }
.enter > *:nth-child(2) { animation-delay: .05s; } .enter > *:nth-child(3) { animation-delay: .1s; } .enter > *:nth-child(4) { animation-delay: .15s; }
.enter > *:nth-child(5) { animation-delay: .2s; } .enter > *:nth-child(n+6) { animation-delay: .25s; }
.enter .grid > * { animation: pop .5s var(--ease) both; }
.enter .grid > *:nth-child(2) { animation-delay: .07s; } .enter .grid > *:nth-child(3) { animation-delay: .14s; } .enter .grid > *:nth-child(4) { animation-delay: .21s; }
.enter tr { animation: fadeIn .4s both; }
.enter tr:nth-child(2) { animation-delay: .04s; } .enter tr:nth-child(3) { animation-delay: .08s; } .enter tr:nth-child(4) { animation-delay: .12s; }
.enter tr:nth-child(5) { animation-delay: .16s; } .enter tr:nth-child(6) { animation-delay: .2s; } .enter tr:nth-child(n+7) { animation-delay: .24s; }

/* ---------- cards & grid ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.grid { display: grid; gap: 16px; }
.g21 { grid-template-columns: 2fr 1fr; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { position: relative; overflow: hidden; padding: 18px 20px; transition: transform .25s var(--ease), box-shadow .25s; }
.kpi::after { content: ""; position: absolute; width: 130px; height: 130px; right: -46px; top: -56px; border-radius: 50%; background: var(--grad); opacity: .09; transition: transform .5s var(--ease), opacity .3s; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.kpi:hover::after { transform: scale(1.35); opacity: .15; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kpi .value { font-size: clamp(19px, 1.9vw, 26px); white-space: nowrap; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.warn .value { color: var(--red); }
.kpi-ic { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--grad-soft); color: var(--primary); }
.kpi-ic.green { background: var(--green-soft); color: var(--green); } .kpi-ic.amber { background: var(--amber-soft); color: var(--amber); } .kpi-ic.red { background: var(--red-soft); color: var(--red); } .kpi-ic.blue { background: var(--blue-soft); color: var(--blue); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; }
.card > table tr:first-child th:first-child, .card.table-wrap th:first-child { border-top-left-radius: var(--radius); }
.card > table tr:first-child th:last-child, .card.table-wrap th:last-child { border-top-right-radius: var(--radius); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click td { transition: background .15s; } tr.click:hover td { background: var(--grad-soft); }
.cell-user { display: flex; align-items: center; gap: 10px; }
.empty { padding: 44px 24px; text-align: center; color: var(--muted); }
.empty .big { display: block; font-size: 38px; margin-bottom: 8px; animation: float 4s ease-in-out infinite; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--gray-soft); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.b-green { background: var(--green-soft); color: var(--green); } .b-amber { background: var(--amber-soft); color: var(--amber); }
.b-red { background: var(--red-soft); color: var(--red); } .b-blue { background: var(--blue-soft); color: var(--blue); } .b-primary { background: var(--primary-soft); color: var(--primary); }

/* ---------- buttons & forms ---------- */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 8px 15px; border-radius: 11px; font: inherit; font-weight: 650; cursor: pointer; white-space: nowrap; transition: transform .18s var(--ease), box-shadow .18s, background .18s, border-color .18s, filter .18s; }
.btn:hover { background: var(--surface-2); text-decoration: none; transform: translateY(-1px); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--grad); background-size: 160% 160%; border-color: transparent; color: var(--primary-ink); box-shadow: 0 6px 16px rgba(110,90,240,.32); }
.btn.primary:hover { background: var(--grad); background-size: 160% 160%; background-position: 100% 50%; box-shadow: 0 10px 22px rgba(110,90,240,.42); filter: brightness(1.06); }
.btn.primary::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 40%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); transform: translateX(-120%) skewX(-20deg); }
.btn.primary:hover::after { animation: shine .8s var(--ease); }
.btn.danger { color: var(--red); } .btn.danger:hover { border-color: var(--red); background: var(--red-soft); }
.btn.danger.solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 9px; } .btn.ghost { border-color: transparent; background: transparent; }
label.field { display: block; }
label.field > span { display: block; font-size: 12.5px; font-weight: 650; margin-bottom: 6px; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 9px 12px; transition: border-color .18s, box-shadow .18s; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--primary); padding: 0; box-shadow: none; }
textarea { min-height: 96px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }
.toolbar input[type=search] { min-width: 260px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 99px; padding: 3px 11px; font-size: 12px; cursor: pointer; transition: transform .15s var(--ease), background .15s, border-color .15s; }
.chip:hover { background: var(--primary-soft); border-color: var(--primary); transform: translateY(-1px); }

/* ---------- tabs ---------- */
.tabs { display: inline-flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px; padding: 4px; margin-bottom: 18px; max-width: 100%; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 7px 14px; font: inherit; font-weight: 650; color: var(--muted); cursor: pointer; border-radius: 9px; white-space: nowrap; transition: color .18s, background .18s, box-shadow .18s; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--primary); background: var(--surface); box-shadow: var(--shadow); }

/* ---------- modal, toast, confetti ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(12, 14, 26, .5); backdrop-filter: blur(5px); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; z-index: 50; padding: 16px; animation: fadeIn .2s; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 30px 70px rgba(0,0,0,.35); animation: pop .32s var(--ease); }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 20px 20px; }
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast { position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: 12px 16px; border-radius: 14px; font-weight: 600; box-shadow: var(--shadow-lg); max-width: 400px; animation: toastIn .35s var(--ease); }
.toast .toast-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); flex: none; }
.toast .toast-ic .ic { width: 15px; height: 15px; stroke-width: 3; }
.toast::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--grad); transform-origin: left; animation: toastBar var(--life, 3.5s) linear forwards; }
.toast.error .toast-ic { background: var(--red-soft); color: var(--red); }
.toast.error::after { background: var(--red); }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 70; }
.secret { background: var(--amber-soft); border: 1px dashed var(--amber); padding: 14px; border-radius: 12px; }

/* ---------- skeleton ---------- */
.skeleton { border-radius: 12px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.sk-title { height: 30px; width: 240px; margin-bottom: 20px; } .sk-kpi { height: 104px; } .sk-block { height: 280px; margin-top: 16px; }

/* ---------- inbox ---------- */
.inbox { display: grid; grid-template-columns: 350px 1fr; height: calc(100vh - 190px); min-height: 480px; overflow: hidden; }
.inbox-list { border-right: 1px solid var(--border); overflow-y: auto; }
.conv { padding: 13px 16px; border-bottom: 1px solid var(--border); cursor: pointer; display: block; color: inherit; transition: background .15s, padding-left .2s var(--ease); }
.conv:hover { background: var(--surface-2); text-decoration: none; padding-left: 20px; }
.conv.active { background: var(--grad-soft); box-shadow: inset 3px 0 0 var(--primary); }
.conv .top { display: flex; gap: 8px; align-items: center; }
.conv .name { font-weight: 650; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .subj { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .prev { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.unread .subj, .conv.unread .name { font-weight: 800; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); display: inline-block; animation: pulse 1.8s infinite; flex: none; }
.thread { display: flex; flex-direction: column; min-width: 0; }
.thread-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.thread-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; background: var(--grad-soft), var(--bg); }
.bubble { max-width: 72%; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--surface); border: 1px solid var(--border); white-space: pre-wrap; word-wrap: break-word; box-shadow: var(--shadow); }
.bubble.mine { align-self: flex-end; background: var(--grad); color: #fff; border-color: transparent; border-radius: 18px 18px 6px 18px; }
.bubble.internal { align-self: flex-end; background: var(--amber-soft); border: 1px dashed var(--amber); color: var(--text); border-radius: 14px; }
.bubble.system { align-self: center; background: var(--gray-soft); font-size: 12.5px; border-radius: 99px; }
.bubble .meta { font-size: 11px; opacity: .75; margin-top: 4px; }
.bubble.new { animation: pop .35s var(--ease); }
.enter .bubble { animation: pop .4s var(--ease) both; }
.composer { border-top: 1px solid var(--border); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.composer textarea { min-height: 64px; }

/* ---------- charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar .fill { width: 100%; max-width: 44px; background: var(--grad); border-radius: 9px 9px 3px 3px; min-height: 3px; transform-origin: bottom; transition: filter .2s, transform .25s var(--ease); }
.bar:hover .fill { filter: brightness(1.15) saturate(1.2); transform: scaleX(1.08); }
.enter .bar .fill { animation: grow .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + .15s); }
.bar .lbl { font-size: 11px; color: var(--muted); font-weight: 600; }
.meter { height: 9px; background: var(--gray-soft); border-radius: 99px; overflow: hidden; }
.meter > div { height: 100%; background: linear-gradient(90deg, #10b981, #34d399); border-radius: 99px; transform-origin: left; }
.enter .meter > div { animation: growX 1s var(--ease) .2s both; }
.ring-wrap { position: relative; width: 150px; height: 150px; margin: 0 auto 6px; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--gray-soft); stroke-width: 12; }
.ring-val { fill: none; stroke: url(#ringGrad); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 327; }
.enter .ring-val { animation: ring 1.2s var(--ease) .15s both; }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }

/* ---------- sign-in ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(135deg, #4338ca, #7c3aed 50%, #c026d3 100%); background-size: 200% 200%; animation: hue 14s ease-in-out infinite alternate; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: drift 14s ease-in-out infinite; }
.blob.b1 { width: 380px; height: 380px; background: #38bdf8; top: -120px; left: -80px; }
.blob.b2 { width: 320px; height: 320px; background: #f472b6; bottom: -100px; right: -60px; animation-duration: 18s; animation-direction: reverse; }
.blob.b3 { width: 220px; height: 220px; background: #fbbf24; top: 40%; right: 20%; opacity: .3; animation-duration: 22s; }
.auth-hero > :not(.blob):not(.float-tile) { position: relative; }
.auth-hero h1 { font-size: 42px; line-height: 1.08; letter-spacing: -.03em; max-width: 12em; animation: fadeUp .7s var(--ease) both; }
.auth-hero p { font-size: 16px; opacity: .9; max-width: 30em; margin: 16px 0 0; animation: fadeUp .7s var(--ease) .1s both; }
.feats { display: grid; gap: 10px; margin-top: 34px; max-width: 420px; }
.feat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(8px); font-weight: 600; animation: fadeUp .6s var(--ease) both; transition: transform .25s var(--ease), background .25s; }
.feat:hover { transform: translateX(6px); background: rgba(255,255,255,.2); }
.feat:nth-child(1) { animation-delay: .2s; } .feat:nth-child(2) { animation-delay: .3s; } .feat:nth-child(3) { animation-delay: .4s; } .feat:nth-child(4) { animation-delay: .5s; }
.feat span { font-size: 20px; }
.float-tile { position: absolute; width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 28px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(6px); box-shadow: 0 10px 30px rgba(0,0,0,.18); animation: float 6s ease-in-out infinite; }
.auth-panel { display: grid; place-items: center; padding: 28px; }
.auth-card { width: min(400px, 100%); animation: pop .55s var(--ease) both; }
.auth-card h2 { font-size: 26px; font-weight: 800; }
.demo { margin-top: 20px; font-size: 12.5px; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 12px; padding: 12px 14px; }
.demo button { margin: 6px 4px 0 0; }
.err-box { display: flex; gap: 8px; align-items: center; background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: 11px; font-weight: 600; margin-bottom: 14px; animation: wiggle .5s var(--ease); }

/* ---------- documents (invoice / receipt) ---------- */
.doc { max-width: 820px; margin: 0 auto; padding: 40px; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.doc-title { font-size: 28px; font-weight: 800; letter-spacing: .02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.doc table td, .doc table th { padding: 10px 12px; }
.totals { margin-left: auto; width: min(320px, 100%); margin-top: 12px; }
.totals div { display: flex; justify-content: space-between; padding: 5px 12px; }
.totals .grand { font-weight: 800; font-size: 16px; border-top: 2px solid var(--text); margin-top: 4px; padding-top: 9px; }
.stamp { display: inline-block; border: 3px solid var(--green); color: var(--green); font-weight: 800; padding: 4px 14px; border-radius: 8px; transform: rotate(-6deg); letter-spacing: .1em; }
.enter .stamp { animation: checkPop .6s var(--ease) .5s both; }
.amount-hero { text-align: center; padding: 22px; background: var(--grad-soft); border-radius: 16px; margin-bottom: 22px; }
.amount-hero .amt { font-size: 36px; font-weight: 800; letter-spacing: -.02em; }
.success-check { width: 76px; height: 76px; margin: 0 auto 10px; display: block; animation: checkPop .6s var(--ease) both; }
.success-check circle { fill: var(--green-soft); stroke: var(--green); stroke-width: 3; }
.success-check path { fill: none; stroke: var(--green); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .5s var(--ease) .35s forwards; }
.checkout { max-width: 460px; margin: 30px auto; }
.balance-hero { background: var(--grad); background-size: 200% 200%; animation: hue 10s ease-in-out infinite alternate; color: #fff; border: 0; box-shadow: 0 14px 34px rgba(110,90,240,.35); }
.balance-hero .label, .balance-hero .sub { color: rgba(255,255,255,.88); }
.balance-hero::after { background: #fff; opacity: .14; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
@media print {
  .sidebar, .topbar, .no-print, #toasts, .banner, .confetti, .success-check { display: none !important; }
  *, *::before, *::after { animation: none !important; }
  .shell { display: block; } .content { padding: 0; max-width: none; }
  .card { border: 0; box-shadow: none; }
  body { background: #fff; color: #000; }
  .doc-title { color: #000; background: none; }
}
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3, .g21 { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 1fr; height: auto; }
  .inbox.has-thread .inbox-list { display: none; }
  .inbox:not(.has-thread) .thread { display: none; }
  .thread-body { min-height: 50vh; }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 32px 24px; min-height: 0; }
  .auth-hero h1 { font-size: 28px; } .feats, .float-tile { display: none; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; width: 270px; transform: translateX(-100%); transition: transform .28s var(--ease); background: var(--surface); }
  .shell.nav-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .icon-btn.menu-btn { display: grid; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .g2, .form-grid { grid-template-columns: 1fr; }
  .toolbar input, .toolbar select, .toolbar input[type=search] { min-width: 0; flex: 1 1 140px; }
  .doc { padding: 18px; }
  .bubble { max-width: 90%; }
  .user-chip span.who { display: none; } .user-chip { padding: 4px; }
}

/* ================= TTA CRM on this design ================= */
[hidden] { display: none !important; }
.content { margin: 0 auto; width: 100%; }
.content h1 { margin: 0 0 6px; }
.content h2 { margin: 28px 0 12px; }
p { margin: 6px 0; }
.soft { color: var(--muted); }
.grow { flex: 1; min-width: 160px; }
.row.end { justify-content: flex-end; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.msg { white-space: pre-wrap; overflow-wrap: anywhere; }
.back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; font-weight: 650; }
.card { padding: 20px; margin: 0 0 16px; }
.card.table-wrap { padding: 0; }
.card.empty { padding: 34px 24px; }
.content > .row { margin-bottom: 14px; }
.grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
label { display: block; font-size: 12.5px; font-weight: 650; }
label > input, label > select, label > textarea { margin-top: 6px; font-weight: 400; font-size: 14px; }
label > input[type=checkbox] { margin: 0 8px 0 0; vertical-align: -3px; }
input.narrow { width: 110px; }
.line { margin: 0 0 8px; }

/* Buttons: a plain button is the main action; .quiet is the second choice; .danger undoes something. */
button:not(.icon-btn), a.button { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; background: var(--grad); background-size: 160% 160%; color: var(--primary-ink); padding: 8px 15px; border-radius: 11px;
  font: inherit; font-weight: 650; cursor: pointer; text-align: center; text-decoration: none; box-shadow: 0 6px 16px rgba(110,90,240,.32);
  transition: transform .18s var(--ease), box-shadow .18s, background .18s, border-color .18s, filter .18s; }
button:not(.icon-btn):hover, a.button:hover { background-position: 100% 50%; filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(110,90,240,.42); text-decoration: none; }
button:not(.icon-btn):active, a.button:active { transform: scale(.96); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
button.quiet, a.button.quiet, button.danger, .chips button { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: none; }
button.quiet:hover, a.button.quiet:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); filter: none; box-shadow: none; }
button.danger { color: var(--red); }
button.danger:hover { border-color: var(--red); background: var(--red-soft); filter: none; box-shadow: none; }
button.small, a.button.small { padding: 5px 11px; font-size: 12.5px; border-radius: 9px; }
.chips { margin: 0 0 16px; }
.chips button { border-radius: 99px; padding: 5px 13px; font-size: 12.5px; }
.chips button:hover { background: var(--primary-soft); border-color: var(--primary); filter: none; box-shadow: none; }
.chips button.on { background: var(--grad-soft); color: var(--primary); border-color: var(--primary); }

/* Figures at the top of a page. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin: 0 0 18px; }
.tile { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; transition: transform .25s var(--ease), box-shadow .25s; }
.tile::after { content: ""; position: absolute; width: 130px; height: 130px; right: -46px; top: -56px; border-radius: 50%; background: var(--grad); opacity: .09; transition: transform .5s var(--ease), opacity .3s; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tile:hover::after { transform: scale(1.35); opacity: .15; }
.tile .soft { font-size: 12.5px; font-weight: 600; }
.tile strong { display: block; font-size: clamp(19px, 1.9vw, 26px); font-weight: 800; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile.good strong { color: var(--green); }
.tile.warn strong { color: var(--amber); }
.tile.bad strong { color: var(--red); }
.enter .tiles > * { animation: pop .5s var(--ease) both; }
.enter .tiles > *:nth-child(2) { animation-delay: .07s; } .enter .tiles > *:nth-child(3) { animation-delay: .14s; } .enter .tiles > *:nth-child(4) { animation-delay: .21s; }

/* Something staff should read before going on. */
.note { display: block; padding: 11px 16px; border-radius: 12px; margin: 10px 0 16px; font-weight: 550; background: var(--amber-soft); color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); }
.note.bad { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.note button { margin-left: 8px; }

/* A conversation. */
.thread { gap: 10px; padding: 20px; margin: 14px 0; border-radius: var(--radius); border: 1px solid var(--border); background: var(--grad-soft), var(--bg); }
.bubble.out { align-self: flex-end; background: var(--grad); color: #fff; border-color: transparent; border-radius: 18px 18px 6px 18px; }
.bubble.out .soft { color: rgba(255,255,255,.82); }
.bubble.note { align-self: flex-end; background: var(--amber-soft); border: 1px dashed var(--amber); color: var(--text); border-radius: 14px; }
.bubble .soft { font-size: 11.5px; }
.bubble > div + div { margin-top: 4px; }

/* A receipt to print. */
.receipt { max-width: 640px; margin: 0 auto 16px; padding: 34px; }
.receipt h1 { font-size: 28px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.receipt th { display: none; }
.receipt .card.table-wrap { box-shadow: none; margin-top: 16px; }

/* Sign-in. */
.gbox { display: flex; justify-content: center; margin: 18px 0; min-height: 4px; }
.demo button { margin: 8px 6px 0 0; }
.auth-card p { margin: 6px 0 0; }

@media print { .noprint { display: none !important; } .receipt h1 { color: #000; background: none; } }
@media (max-width: 760px) { .content > .row > h1 { min-width: 100%; } }

/* A figure on the home page is a link to where the work is. */
a.tile { display: block; color: inherit; text-decoration: none; }
a.tile:hover { text-decoration: none; border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
/* A list of students to tick. */
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; max-height: 260px; overflow-y: auto; padding: 12px; margin: 12px 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.picks label { font-weight: 500; font-size: 13.5px; }
.picks input { margin-right: 8px; vertical-align: -3px; }
/* One saved reply being edited. */
.reply { display: grid; gap: 8px; margin: 0 0 14px; padding: 0 0 14px; border-bottom: 1px solid var(--border); }
.reply textarea { min-height: 70px; }
.reply button { justify-self: start; }
@media print { button, .back, .chips { display: none !important; } }
