/* ==========================================================================
   portal.css — Step 4 (administrator login popup, portal "app" shell, dashboards)
   Loaded last. Remove its <link> in layout.php to go back to the previous look.
   ========================================================================== */

/* ---------- Administrator login popup ---------- */
.al-overlay { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; background: rgba(8, 20, 48, .55); backdrop-filter: blur(4px); animation: alFade .2s ease; }
.al-overlay[hidden] { display: none; }
body.al-open { overflow: hidden; }
.al-card { position: relative; width: 100%; max-width: 400px; background: #fff; border-radius: 22px; padding: 30px 26px 26px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55); animation: alRise .35s cubic-bezier(.2, .8, .2, 1); }
.al-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: 22px 22px 0 0; background: linear-gradient(90deg, var(--primary, #1d4ed8), #38bdf8, var(--primary, #1d4ed8)); background-size: 200% 100%; animation: alSlide 5s linear infinite; }
.al-close { position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f1f5f9; color: #475569; cursor: pointer; transition: background .2s, transform .2s; }
.al-close:hover { background: #e2e8f0; transform: rotate(90deg); }
.al-head { text-align: center; margin-bottom: 18px; }
.al-ic { display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: var(--primary-soft, #eff4ff); color: var(--primary, #1d4ed8); font-size: 24px; margin-bottom: 10px; }
.al-head h2 { font-size: 1.2rem; margin: 0 0 4px; color: #0f172a; }
.al-head p { margin: 0; font-size: .85rem; color: #64748b; }
.al-card label { display: block; font-size: .8rem; font-weight: 600; color: #334155; margin: 14px 0 6px; }
.al-in { position: relative; }
.al-in > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; transition: color .2s; }
.al-in:focus-within > i { color: var(--primary, #1d4ed8); }
.al-in input { width: 100%; height: 48px; padding: 0 44px 0 42px; border: 1.5px solid #d5ddea; border-radius: 14px; background: #f8fafc; font: inherit; font-size: 16px; color: #0f172a; transition: border-color .2s, box-shadow .2s, background .2s; }
.al-in input:focus { outline: none; background: #fff; border-color: var(--primary, #1d4ed8); box-shadow: 0 0 0 4px rgba(37, 99, 235, .14); }
.al-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; color: #64748b; cursor: pointer; border-radius: 10px; }
.al-err { min-height: 20px; margin-top: 10px; font-size: .84rem; color: #b91c1c; }
.al-btn { width: 100%; height: 50px; margin-top: 8px; border: 0; border-radius: 999px; background: #0f172a; color: #fff; font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 14px 26px -14px rgba(15, 23, 42, .8); transition: transform .2s, box-shadow .2s, opacity .2s; }
.al-btn:hover { transform: translateY(-2px); }
.al-btn:disabled { opacity: .7; cursor: progress; transform: none; }
@keyframes alFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes alRise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes alSlide { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .al-overlay, .al-card, .al-card::before { animation: none; } }

/* ---------- Signed-in portal = app shell (dashboard only, no public menu/footer) ---------- */
@media (max-width: 768px) {
  body.portal-mode .top-bar, body.portal-mode .nav-desktop, body.portal-mode .notice-ticker,
  body.portal-mode .footer-main, body.portal-mode .live-visitors, body.portal-mode .mobile-toggle,
  body.portal-mode .live-clock, body.portal-mode .btn-apply-anim, body.portal-mode .mobile-menu,
  body.portal-mode .mobile-overlay, body.portal-mode .newsletter-section, body.portal-mode footer { display: none !important; }
  body.portal-mode .header-main { position: sticky; top: 0; }
  body.portal-mode .header-inner { padding: 6px 0; }
  body.portal-mode .brand-logo { width: 38px; height: 38px; flex-basis: 38px; }
  body.portal-mode .brand-text h1 { font-size: .95rem; -webkit-line-clamp: 1; }
  body.portal-mode .brand-text span, body.portal-mode .brand-text .motto { display: none; }
  body.portal-mode .back-to-top { bottom: 88px; right: 14px; width: 42px; height: 42px; }
}

/* tiles */
.ptiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0 0 26px; }
.ptile { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 18px 16px; border-radius: 18px; background: #fff; border: 1.5px solid #d5ddea; color: #0f172a; text-decoration: none; overflow: hidden; box-shadow: 0 10px 24px -18px rgba(15, 23, 42, .4); transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s, border-color .22s; animation: ptRise .5s cubic-bezier(.2, .8, .2, 1) both; }
.ptile:nth-child(2) { animation-delay: .05s; } .ptile:nth-child(3) { animation-delay: .1s; } .ptile:nth-child(4) { animation-delay: .15s; } .ptile:nth-child(5) { animation-delay: .2s; } .ptile:nth-child(6) { animation-delay: .25s; }
.ptile:hover { transform: translateY(-4px); box-shadow: 0 20px 34px -18px rgba(15, 23, 42, .45); border-color: #b8c4d8; }
.ptile i { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; font-size: 20px; margin-bottom: 8px; background: var(--tb, #eff4ff); color: var(--tc, #1d4ed8); transition: transform .3s; }
.ptile:hover i { transform: scale(1.1) rotate(-5deg); }
.ptile b { font-family: Poppins, 'Noto Sans Bengali', sans-serif; font-weight: 700; font-size: .98rem; line-height: 1.25; }
.ptile small { color: #64748b; font-size: .78rem; line-height: 1.35; }
.ptile::after { content: ""; position: absolute; right: -26px; top: -26px; width: 90px; height: 90px; border-radius: 50%; background: var(--tb, #eff4ff); opacity: .7; transition: transform .45s; }
.ptile:hover::after { transform: scale(1.5); }
.ptile > * { position: relative; z-index: 1; }
.t-blue { --tb: #eaf1ff; --tc: #1d4ed8; } .t-green { --tb: #dcfce7; --tc: #15803d; } .t-amber { --tb: #fef3c7; --tc: #b45309; }
.t-violet { --tb: #ede9fe; --tc: #6d28d9; } .t-sky { --tb: #e0f2fe; --tc: #0369a1; } .t-rose { --tb: #ffe4e6; --tc: #be123c; }
@keyframes ptRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* bottom navigation (phones) */
.pbar { display: none; }
@media (max-width: 768px) {
  body.portal-mode { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  body.portal-mode .pnav { display: none; }                     /* the bottom bar replaces the old tab row */
  .ptiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
  .ptile { padding: 14px 12px; border-radius: 16px; }
  .ptile i { width: 40px; height: 40px; font-size: 18px; }
  .pbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1500; display: grid; grid-template-columns: repeat(5, 1fr); align-items: stretch; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid #d5ddea; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px -18px rgba(15, 23, 42, .35); }
  .pbar a, .pbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; border: 0; background: none; color: #64748b; font: inherit; font-size: .68rem; font-weight: 600; text-decoration: none; border-radius: 12px; cursor: pointer; transition: color .2s, background .2s; }
  .pbar form { display: contents; }
  .pbar i { font-size: 1.15rem; transition: transform .2s; }
  .pbar a.on { color: var(--primary, #1d4ed8); background: var(--primary-soft, #eff4ff); }
  .pbar a.on i { transform: translateY(-2px) scale(1.1); }
  .pbar button { color: #be123c; }
}
@media (min-width: 769px) and (max-width: 1000px) { .ptiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .ptile { animation: none; transition: none; } }

/* ---------- Teacher: take attendance ---------- */
.ta-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; border: 1.5px solid #d5ddea; }
.ta-f label { display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: #334155; margin-bottom: 6px; }
.ta-f label i { color: var(--primary, #1d4ed8); }
.ta-load { min-height: 46px; border-radius: 999px; }
.ta-hint { margin: 12px 2px 16px; font-size: .8rem; color: #64748b; }
.ta-empty { padding: 34px 16px; text-align: center; color: #64748b; background: #fff; border: 1.5px dashed #d5ddea; border-radius: 16px; }
.ta-empty i { display: block; font-size: 1.6rem; margin-bottom: 8px; color: #94a3b8; }
.ta-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; margin-bottom: 12px; font-size: .88rem; }
.ta-note.info { background: #e0f2fe; color: #075985; } .ta-note.ok { background: #dcfce7; color: #166534; }
.ta-teacher { margin: 0 2px 10px; font-size: .88rem; color: #334155; }
.ta-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; font-size: .85rem; color: #475569; }
.ta-bulk button { border: 1.5px solid #d5ddea; background: #fff; border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; transition: transform .15s, background .15s, color .15s, border-color .15s; }
.ta-bulk button:active { transform: scale(.96); }
.ta-bulk .b-p:hover { background: #16a34a; color: #fff; border-color: #16a34a; } .ta-bulk .b-l:hover { background: #f59e0b; color: #fff; border-color: #f59e0b; } .ta-bulk .b-a:hover { background: #dc2626; color: #fff; border-color: #dc2626; }
.ta-sum { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ta-list { display: grid; gap: 10px; }
.ta-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; background: #fff; border: 1.5px solid #d5ddea; border-radius: 16px; }
.ta-av { width: 48px; height: 48px; border-radius: 14px; overflow: hidden; background: #eef2f7; display: grid; place-items: center; color: #94a3b8; font-size: 1.2rem; }
.ta-av img { width: 100%; height: 100%; object-fit: cover; }
.ta-who { min-width: 0; } .ta-who b { display: block; font-size: .95rem; overflow-wrap: anywhere; } .ta-who small { color: #64748b; }
.ta-opts { display: flex; gap: 6px; }
.ta-opts label { position: relative; cursor: pointer; }
.ta-opts input { position: absolute; opacity: 0; width: 0; height: 0; }
.ta-opts span { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 66px; padding: 9px 8px; border-radius: 10px; border: 1.5px solid #d5ddea; background: #fff; color: #64748b; font-size: .78rem; font-weight: 600; transition: all .15s; }
.ta-opts input:focus-visible + span { outline: 3px solid rgba(37, 99, 235, .35); outline-offset: 2px; }
.ta-opts input:checked + span { color: #fff; transform: translateY(-1px); box-shadow: 0 8px 14px -8px rgba(15, 23, 42, .5); }
.ta-opts input:checked + span::before { content: "✓"; font-weight: 800; }
.ta-opts input:checked + .P { background: #16a34a; border-color: #16a34a; } .ta-opts input:checked + .L { background: #f59e0b; border-color: #f59e0b; }
.ta-opts input:checked + .A { background: #dc2626; border-color: #dc2626; } .ta-opts input:checked + .V { background: #0ea5e9; border-color: #0ea5e9; }
.ta-fixed { display: inline-block; padding: 7px 12px; border-radius: 10px; color: #fff; font-size: .78rem; font-weight: 700; }
.ta-fixed.P { background: #16a34a; } .ta-fixed.L { background: #f59e0b; } .ta-fixed.A { background: #dc2626; } .ta-fixed.V, .ta-fixed.H { background: #0ea5e9; }
.ta-savebar { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); margin-top: 14px; z-index: 5; }
.ta-savebar .btn { width: 100%; min-height: 52px; border-radius: 999px; justify-content: center; font-weight: 700; box-shadow: 0 16px 30px -14px rgba(29, 78, 216, .85); }
.ta-toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 3000; max-width: 92vw; padding: 12px 18px; border-radius: 14px; background: #0f172a; color: #fff; font-size: .9rem; box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .6); animation: alRise .3s ease; }
.ta-toast.bad { background: #b91c1c; } .ta-toast.out { opacity: 0; transition: opacity .35s; }
@media (max-width: 768px) {
  .ta-filters { grid-template-columns: 1fr 1fr; } .ta-load { grid-column: 1 / -1; }
  .ta-row { grid-template-columns: 44px minmax(0, 1fr); } .ta-av { width: 44px; height: 44px; }
  .ta-st { grid-column: 1 / -1; } .ta-opts { width: 100%; } .ta-opts label { flex: 1 1 0; min-width: 0; } .ta-opts span { width: 100%; min-width: 0; padding: 11px 4px; }
  .ta-fixed { display: block; text-align: center; }
}

/* ---------- Verification pages (QR scans) ---------- */
.vf-school { margin: 0 0 12px; font-weight: 700; color: var(--primary, #1d4ed8); letter-spacing: .02em; text-transform: uppercase; font-size: .9rem; }
.vf-photo { width: 120px; height: 150px; object-fit: cover; border-radius: 16px; border: 3px solid var(--primary-soft, #eaf1ff); box-shadow: 0 16px 30px -18px rgba(15, 23, 42, .5); margin: 6px auto 0; display: block; }
.vf-ph { display: grid; place-items: center; background: #eef2f7; color: #94a3b8; }
.vf-ok { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 5px 12px; border-radius: 999px; background: #dcfce7; color: #166534; font-size: .82rem; font-weight: 600; }

/* ---------- Teacher tools (students / marks / results) ---------- */
.tt-filters { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tt-filters .ta-load { grid-column: 1 / -1; }
.tt-reps { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.tt-reps .btn { flex: 1 1 150px; min-height: 46px; border-radius: 999px; justify-content: center; }
.tt-head { margin-bottom: 14px; }
.tt-stu { grid-template-columns: 48px minmax(0, 1fr) auto; }
.tt-call { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #dcfce7; color: #15803d; text-decoration: none; transition: transform .15s; }
.tt-call:active { transform: scale(.92); }
.tt-mk { display: block; }
.tt-mk .ta-who { margin-bottom: 10px; }
.tt-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.tt-part label { display: block; font-size: .78rem; font-weight: 600; color: #475569; margin-bottom: 4px; }
.tt-part .mark-inp { width: 100%; min-height: 46px; font-size: 16px; text-align: center; border-radius: 12px; }
.tt-part .mark-inp:disabled { background: #f1f5f9; }
.tt-ae { display: flex; gap: 14px; margin-top: 6px; font-size: .78rem; color: #475569; }
.tt-ae label { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-weight: 600; cursor: pointer; }
.tt-ae input { width: 18px; height: 18px; }
@media (max-width: 768px) { .tt-filters { grid-template-columns: 1fr 1fr; } .tt-parts { grid-template-columns: 1fr 1fr; } .tt-stu { grid-template-columns: 44px minmax(0, 1fr) auto; } .tt-stu .ta-st { display: none; } }

/* ---------- Install-app pill (PWA) ---------- */
.pwa-install { position: fixed; left: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 1400; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 0; border-radius: 999px; background: #0f172a; color: #fff; font: inherit; font-size: .82rem; font-weight: 600; box-shadow: 0 14px 28px -12px rgba(0, 0, 0, .55); cursor: pointer; animation: alRise .35s ease; }
.pwa-install span { margin-left: 4px; opacity: .7; font-size: 1.1rem; line-height: 1; }
body.portal-mode .pwa-install { bottom: calc(84px + env(safe-area-inset-bottom)); }


/* ==========================================================================
   Step 7 — clean "wallet-app" look for the teacher & student portals
   Phones: compact app screens. Desktop: the normal website header/footer with a tidy dashboard.
   ========================================================================== */
.pa { --pa-r: 20px; }
.pa .wrap { max-width: 1100px; }

/* hero (like the balance card of a wallet app) */
.pa-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center; padding: 22px; border-radius: 24px; color: #fff;
  background: linear-gradient(135deg, var(--primary-dark, #0b2f7a) 0%, var(--primary, #1d4ed8) 60%, #38bdf8 135%); box-shadow: 0 24px 40px -26px rgba(15, 40, 100, .8); }
.pa-hero::before { content: ""; position: absolute; right: -50px; top: -60px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255, 255, 255, .10); }
.pa-hero::after { content: ""; position: absolute; left: 40%; bottom: -70px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.pa-hero > * { position: relative; z-index: 1; }
.pa-avatar { width: 68px; height: 68px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: rgba(255, 255, 255, .22); border: 3px solid rgba(255, 255, 255, .9); color: #fff; font-size: 1.6rem; flex: none; }
.pa-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pa-hero-text { min-width: 0; }
.pa-hero-text small { display: block; opacity: .85; font-size: .8rem; }
.pa-hero-text h2 { margin: 1px 0 2px; font-family: Poppins, 'Noto Sans Bengali', sans-serif; font-size: 1.2rem; font-weight: 700; line-height: 1.25; color: #fff; overflow-wrap: anywhere; }
.pa-hero-text span { font-size: .84rem; opacity: .9; }
.pa-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pa-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .17); border: 1px solid rgba(255, 255, 255, .25); font-size: .76rem; font-weight: 600; color: #fff; line-height: 1.2; }
.pa-chip.gold { background: rgba(250, 204, 21, .25); border-color: rgba(250, 204, 21, .6); }
.pa-chip.dark { color: #713f12; background: #fef3c7; border-color: #fcd34d; }

.pa-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 6px; }
.pa-stats > div { background: #fff; border: 1.5px solid #e2e8f0; border-radius: 16px; padding: 12px 8px; text-align: center; }
.pa-stats b { display: block; font-family: Poppins, sans-serif; font-size: 1.35rem; line-height: 1.1; color: var(--primary, #1d4ed8); }
.pa-stats small { color: #64748b; font-size: .72rem; }

.pa-title { margin: 22px 2px 12px; font-family: Poppins, 'Noto Sans Bengali', sans-serif; font-size: 1rem; font-weight: 700; color: #0f172a; }

/* service tiles */
.pa-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pa-tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 14px 6px 12px; border-radius: 18px; background: #fff; border: 1.5px solid #e2e8f0; color: #0f172a; text-decoration: none; transition: transform .2s, box-shadow .2s, border-color .2s; }
.pa-tile:active { transform: scale(.96); }
.pa-ic { width: 52px; height: 52px; border-radius: 17px; display: grid; place-items: center; font-size: 1.3rem; background: var(--tb); color: var(--tc); margin-bottom: 4px; transition: transform .25s; }
.pa-tile b { font-family: Poppins, 'Noto Sans Bengali', sans-serif; font-size: .8rem; font-weight: 600; line-height: 1.25; }
.pa-tile small { display: none; color: #64748b; font-size: .76rem; line-height: 1.35; }
.tone-green { --tb: #dcfce7; --tc: #15803d; } .tone-blue { --tb: #dbeafe; --tc: #1d4ed8; } .tone-amber { --tb: #fef3c7; --tc: #b45309; }
.tone-rose { --tb: #ffe4e6; --tc: #be123c; } .tone-violet { --tb: #ede9fe; --tc: #6d28d9; } .tone-sky { --tb: #e0f2fe; --tc: #0369a1; }
.tone-teal { --tb: #ccfbf1; --tc: #0f766e; } .tone-slate { --tb: #e2e8f0; --tc: #475569; } .tone-dark { --tb: #0f172a; --tc: #fff; }

/* cards & rows */
.pa-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; align-items: start; }
.pa-card { background: #fff; border: 1.5px solid #e2e8f0; border-radius: var(--pa-r); padding: 16px; min-width: 0; }
.pa-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pa-card-h h3 { margin: 0; font-family: Poppins, 'Noto Sans Bengali', sans-serif; font-size: 1rem; font-weight: 700; }
.pa-card-h a { font-size: .8rem; font-weight: 600; color: var(--primary, #1d4ed8); text-decoration: none; white-space: nowrap; }
.pa-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid #eef2f7; color: inherit; text-decoration: none; min-width: 0; }
.pa-card-h + .pa-row, .pr-dayname + .pa-row { border-top: 0; }
.pa-row.link:active { background: #f8fafc; }
.pa-no, .pa-date { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 14px; background: var(--primary-soft, #eaf1ff); color: var(--primary, #1d4ed8); display: grid; place-items: center; align-content: center; text-align: center; line-height: 1.05; }
.pa-no b, .pa-date b { font-family: Poppins, sans-serif; font-size: 1.05rem; } .pa-no small, .pa-date small { font-size: .58rem; text-transform: uppercase; letter-spacing: .04em; }
.pa-no.soft { font-size: 1.1rem; }
.pa-row-t { min-width: 0; flex: 1; } .pa-row-t b { display: block; font-size: .92rem; line-height: 1.3; overflow-wrap: anywhere; }
.pa-row-t small { display: block; color: #64748b; font-size: .78rem; line-height: 1.4; margin-top: 2px; overflow-wrap: anywhere; }
.pa-empty { margin: 8px 0 2px; padding: 14px 8px; text-align: center; color: #94a3b8; font-size: .88rem; }
.pa-empty i { display: block; font-size: 1.4rem; margin-bottom: 6px; }
.pa-btn { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; min-height: 46px; border-radius: 999px; background: var(--primary, #1d4ed8); color: #fff; font-weight: 600; text-decoration: none; }

/* profile */
.pa-prof { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 8px 0 18px; }
.pa-prof-av { width: 104px; height: 104px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #eef2f7; color: #94a3b8; font-size: 2.4rem; border: 4px solid #fff; box-shadow: 0 16px 30px -16px rgba(15, 23, 42, .5), 0 0 0 3px var(--primary-soft, #dbeafe); }
.pa-prof-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pa-prof h2 { margin: 8px 0 0; font-family: Poppins, 'Noto Sans Bengali', sans-serif; font-size: 1.25rem; font-weight: 700; overflow-wrap: anywhere; }
.pa-prof-role { color: #64748b; font-size: .9rem; }
.pa-info { margin: 0; }
.pa-info > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid #eef2f7; }
.pa-info > div:first-child { border-top: 0; }
.pa-info dt { margin: 0; color: #64748b; font-size: .82rem; display: flex; gap: 8px; align-items: center; flex: none; } .pa-info dt i { color: var(--primary, #1d4ed8); width: 16px; text-align: center; }
.pa-info dd { margin: 0; font-weight: 600; font-size: .9rem; text-align: right; min-width: 0; overflow-wrap: anywhere; } .pa-info dd a { color: inherit; text-decoration: none; }

/* routine */
.pr-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; -webkit-overflow-scrolling: touch; scrollbar-width: none; } .pr-tabs::-webkit-scrollbar { display: none; }
.pr-tabs button, .pr-chips button { flex: none; border: 1.5px solid #d5ddea; background: #fff; color: #475569; border-radius: 999px; padding: 9px 16px; font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; transition: all .15s; }
.pr-tabs button.on, .pr-chips button.on { background: var(--primary, #1d4ed8); border-color: var(--primary, #1d4ed8); color: #fff; box-shadow: 0 10px 18px -12px rgba(29, 78, 216, .9); }
.pr-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; scrollbar-width: none; } .pr-chips::-webkit-scrollbar { display: none; }
.pr-chips button { padding: 8px 14px; min-width: 56px; } .pr-chips button.today:not(.on) { border-color: var(--primary, #1d4ed8); color: var(--primary, #1d4ed8); }
.pr-note { margin: 0 2px 10px; color: #64748b; font-size: .84rem; }
.pr-dayname { margin: 0 0 4px; font-family: Poppins, sans-serif; font-size: .95rem; display: flex; align-items: center; gap: 8px; } .pr-dayname span { font-size: .66rem; font-weight: 700; background: #dcfce7; color: #166534; padding: 3px 9px; border-radius: 999px; }
.pr-day { background: #fff; border: 1.5px solid #e2e8f0; border-radius: var(--pa-r); padding: 14px 16px 6px; margin-bottom: 12px; }
.pr.js .pr-group { display: none; } .pr.js .pr-group.on { display: block; }
.pr.js .pr-day { display: none; } .pr.js .pr-day.on { display: block; }
.pr-table { display: none; }
@media (min-width: 900px) { .pr-chips, .pr-days { display: none !important; } .pr-table { display: block; overflow-x: auto; } }

/* tool pages (attendance, marks, students, results) inside the app shell */
body.portal-mode .ta-savebar { bottom: calc(10px + env(safe-area-inset-bottom)); }
.tt-stu .ta-av { width: 46px; height: 46px; overflow: hidden; border-radius: 14px; } .tt-stu .ta-av img, .ta-row .ta-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 768px) {
  /* slim page title instead of the big blue banner */
  body.portal-mode .pagehead { padding: 14px 0 12px; }
  body.portal-mode .pagehead .crumbs { display: none; }
  body.portal-mode .pagehead h1 { font-size: 1.15rem; margin: 0; }
  body.portal-mode .pagehead p { margin: 3px 0 0 !important; font-size: .8rem; }
  body.portal-mode:has(.pa-hero) .pagehead { display: none; }
  body.portal-mode .section.pa, body.portal-mode .section { padding-top: 16px; padding-bottom: 16px; }
  body.portal-mode .wrap { padding-left: 14px; padding-right: 14px; }
  /* buttons that live at the bottom must sit ABOVE the bottom bar */
  body.portal-mode .ta-savebar { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .pa-two { grid-template-columns: 1fr; gap: 12px; margin-top: 14px; }
  .pa-hero { padding: 18px 16px; border-radius: 22px; }
  .pa-card { padding: 14px; }
  .pa-tile { padding: 12px 4px 10px; }
}
@media (min-width: 769px) {
  .pa-hero { grid-template-columns: auto 1fr auto; padding: 26px 30px; }
  .pa-avatar { width: 84px; height: 84px; font-size: 2rem; }
  .pa-hero-text h2 { font-size: 1.5rem; }
  .pa-chips { grid-column: auto; margin: 0; justify-content: flex-end; max-width: 380px; }
  .pa-stats { gap: 16px; margin-top: 18px; } .pa-stats > div { padding: 16px; } .pa-stats b { font-size: 1.6rem; }
  .pa-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .pa-tile { padding: 22px 16px 20px; gap: 6px; border-radius: 20px; } .pa-tile small { display: block; }
  .pa-tile:hover { transform: translateY(-4px); box-shadow: 0 22px 36px -22px rgba(15, 23, 42, .45); border-color: #b8c4d8; } .pa-tile:hover .pa-ic { transform: scale(1.1) rotate(-4deg); }
  .pa-ic { width: 58px; height: 58px; font-size: 1.45rem; } .pa-tile b { font-size: .95rem; }
  .pa-card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { .pa-tile, .pa-ic, .pr-chips button { transition: none; } }

.pa-tiles + .sp-stats, .pa-tiles + .sp-grid, .pa-tiles + .pa-two { margin-top: 20px; }
.ta-list { padding-bottom: 6px; }
