/* ============================================================
 * DASHBOARD SHELL STYLES (sidebar + topbar + content + tables)
 * ============================================================ */

.app{ display:flex; min-height:100vh; }

/* ---------- Sidebar ---------- */
.sidebar{
  width:var(--sidebar-w); background:var(--surface); border-right:1px solid var(--border);
  position:fixed; inset:0 auto 0 0; display:flex; flex-direction:column; z-index:40;
  transition:transform .3s ease;
}
.sidebar-head{ display:flex; align-items:center; gap:.7rem; padding:1rem 1.1rem; border-bottom:1px solid var(--border); }
.sidebar-head img{ width:42px; height:42px; object-fit:contain; border-radius:50%; }
.sidebar-head .name{ font-weight:800; font-size:1rem; line-height:1.1; }
.sidebar-head .role{ font-size:.72rem; color:var(--accent); font-weight:700; text-transform:uppercase; letter-spacing:.5px; }
.sidebar-nav{ flex:1; overflow-y:auto; padding:.7rem; display:flex; flex-direction:column; gap:.2rem; }
.nav-item{
  display:flex; align-items:center; gap:.8rem; padding:.7rem .85rem; border-radius:var(--radius-sm);
  color:var(--text-soft); font-weight:600; font-size:.9rem; cursor:pointer; border:none; background:none;
  width:100%; text-align:left;
  transition:background-color .22s ease, color .22s ease, transform .22s ease, box-shadow .22s ease;
}
.nav-item i{ width:20px; text-align:center; font-size:1rem; }
.nav-item:hover{ background:var(--surface-2); color:var(--text); transform:translateX(3px); }
.nav-item.active{ background:var(--accent); color:#fff; box-shadow:0 6px 16px var(--accent-soft); }
.sidebar-foot{ padding:.8rem; border-top:1px solid var(--border); }

/* ---------- Nested sidebar groups ----------
   Category (parent) when open = solid accent pill, icon in a soft badge.
   Active sub-item = a very light blue pill with accent text. IMPORTANT: neither
   selected state changes font-weight (only colour/background), so nothing
   reflows on click and every transition stays perfectly smooth. */
.nav-group{ display:flex; flex-direction:column; gap:.15rem; }
.nav-item.nav-parent{ font-weight:700; }
.nav-item.nav-parent>i:first-child{
  width:27px; height:27px; flex:0 0 27px; display:grid; place-items:center;
  border-radius:8px; font-size:.9rem; transition:background-color .22s ease, color .22s ease;
}
.nav-item.nav-parent .nav-caret{ margin-left:auto; font-size:.7rem; transition:transform .28s ease; opacity:.9; }
.nav-group.open>.nav-item.nav-parent .nav-caret{ transform:rotate(180deg); }

/* Open category = filled accent pill. Same font-weight as closed → no jump. */
.nav-group.open>.nav-item.nav-parent,
.nav-group.open>.nav-item.nav-parent:hover{
  background:var(--accent); color:#fff; font-weight:700;
  box-shadow:0 6px 16px var(--accent-soft); transform:none;
}
.nav-group.open>.nav-item.nav-parent>i:first-child{ background:rgba(255,255,255,.22); color:#fff; }

.nav-children{
  position:relative;
  display:flex; flex-direction:column; gap:.34rem;   /* more breathing room between sub-items */
  max-height:0; overflow:hidden; opacity:.35;
  margin-left:.8rem; padding-left:.95rem;             /* slightly less indent → the highlight box reads wider */
  transition:max-height .3s cubic-bezier(.33,1,.68,1), opacity .3s ease, padding .3s ease;
}
/* Vertical rail line drawn inside the box (survives overflow:hidden). */
.nav-children::before{
  content:""; position:absolute; left:5px; top:0; bottom:0;
  width:2px; border-radius:2px; background:var(--border);
}
/* Small accent dot sitting on top of the rail when a group is open. */
.nav-children::after{
  content:""; position:absolute; left:1px; top:2px;
  width:9px; height:9px; border-radius:50%;
  background:var(--accent); box-shadow:0 0 0 3px var(--surface);
}
.nav-group.open .nav-children{ max-height:600px; opacity:1; padding-top:.35rem; padding-bottom:.35rem; }
/* Unselected sub-item text uses the same soft colour as an unselected category. */
.nav-item.nav-child{ color:var(--text-soft); font-size:.85rem; font-weight:600; padding:.55rem .85rem; }
.nav-item.nav-child i{ font-size:.85rem; opacity:.9; transition:color .22s ease; }
.nav-item.nav-child:hover{ background:var(--surface-2); color:var(--text); transform:none; }

/* Active sub-item: very light blue pill + accent text. No bold, no layout
   shift — selecting only changes colour/background, so it feels smooth. */
.nav-item.nav-child.active,
.nav-item.nav-child.active:hover{
  background:rgba(59,130,246,.12); color:var(--accent); font-weight:600; box-shadow:none;
}
.nav-item.nav-child.active i{ color:var(--accent); opacity:1; }

/* Consistent page entrance: the newer module pages gently slide up into place
   on open — the same fadeUp used by the finance/attendance pages — so every
   section feels identical. (Pages already using .fade-up are untouched.) */
.enq-page,
.acad-page,
.syl-page,
.dues-recovery-page,
.acd-page,
.ap-page,
.ex-page{ animation:fadeUp .5s ease both; }

/* ---------- Main ---------- */
.main{ flex:1; margin-left:var(--sidebar-w); display:flex; flex-direction:column; min-width:0; }
.topbar{
  height:var(--topbar-h); background:var(--surface); border-bottom:1px solid var(--border);
  position:sticky; top:0; z-index:30; display:flex; align-items:center; gap:1rem; padding:0 1.2rem;
}
.topbar .menu-btn{ display:none; background:none; border:none; font-size:1.3rem; color:var(--text); cursor:pointer; }
.page-title{ font-size:1.1rem; font-weight:800; }
.topbar-spacer{ flex:1; }
.global-search{ position:relative; max-width:340px; flex:1; }
.global-search i{ position:absolute; left:.8rem; top:50%; transform:translateY(-50%); color:var(--text-soft); }
.global-search input{ width:100%; padding:.55rem .8rem .55rem 2.2rem; border-radius:999px;
  border:1.5px solid var(--border); background:var(--surface-2); color:var(--text); font:inherit; }
.work-context{ position:relative; display:flex; align-items:center; gap:4px; min-width:0; }
.work-context-step{ width:30px; height:38px; border:1px solid var(--border); background:var(--surface-2); color:var(--text-soft); cursor:pointer; display:grid; place-items:center; }
.work-context-step:first-child{ border-radius:10px 0 0 10px; }
.work-context-step:nth-child(3){ border-radius:0 10px 10px 0; }
.work-context-step:hover{ color:#fff; border-color:var(--accent); background:var(--accent); }
.work-context-current{ min-width:190px; max-width:260px; height:42px; padding:5px 10px; border:1px solid var(--border); border-radius:9px; background:var(--surface); color:var(--text); display:flex; align-items:center; gap:8px; cursor:pointer; text-align:left; }
.work-context-current>i:first-child{ color:var(--accent); }
.work-context-current>i:last-child{ margin-left:auto; color:var(--text-soft); font-size:.7rem; }
.work-context-current span{ min-width:0; display:flex; flex-direction:column; }
.work-context-current small{ color:var(--text-soft); font-size:.58rem; font-weight:800; letter-spacing:.08em; line-height:1; }
.work-context-current strong{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.82rem; line-height:1.45; }
.work-context-popover{ position:absolute; display:none; right:30px; top:calc(100% + 9px); width:min(390px,calc(100vw - 24px)); padding:9px; border:1px solid var(--border); border-radius:14px; background:var(--surface); box-shadow:var(--shadow-lg); z-index:80; }
.work-context-popover.open{ display:block; animation:fadeUp .18s ease both; }
.work-context-search{ position:relative; margin-bottom:8px; }
.work-context-search i{ position:absolute; left:11px; top:50%; transform:translateY(-50%); color:var(--text-soft); }
.work-context-search input{ width:100%; border:1px solid var(--border); border-radius:10px; background:var(--surface-2); color:var(--text); padding:10px 10px 10px 34px; font:inherit; }
.work-context-list{ max-height:330px; overflow:auto; display:grid; gap:4px; }
.work-context-option{ display:grid; grid-template-columns:minmax(0,1fr) 38px; border:1px solid transparent; border-radius:10px; }
.work-context-option:hover,.work-context-option.active{ background:var(--surface-2); border-color:var(--border); }
.work-context-option.active{ box-shadow:inset 3px 0 0 var(--accent); }
.work-context-option button{ border:0; background:transparent; color:var(--text); cursor:pointer; }
.work-context-option>[data-context-id]{ min-width:0; padding:8px 9px; display:grid; grid-template-columns:24px minmax(0,1fr) 18px; gap:8px; align-items:center; text-align:left; }
.work-context-option>[data-context-id]>i:first-child{ color:var(--accent); }
.work-context-option span{ min-width:0; display:flex; flex-direction:column; }
.work-context-option strong,.work-context-option small{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.work-context-option small{ color:var(--text-soft); font-size:.72rem; margin-top:2px; }
.work-context-pin{ border-radius:8px; opacity:.35; }
.work-context-pin:hover,.work-context-pin.active{ opacity:1; color:var(--accent); }
.work-context-help{ display:flex; gap:7px; align-items:flex-start; margin-top:8px; padding:8px; border-radius:9px; background:var(--accent-soft); color:var(--text-soft); font-size:.7rem; line-height:1.35; }
.work-context-help i{ color:var(--accent); margin-top:2px; }
.work-context-empty{ padding:20px; text-align:center; color:var(--text-soft); }
.icon-btn{ position:relative; width:42px; height:42px; border-radius:50%; border:1px solid var(--border);
  background:var(--surface-2); color:var(--text); cursor:pointer; display:grid; place-items:center; transition:.2s; }
.icon-btn:hover{ background:var(--accent); color:#fff; }
.icon-btn .dot{ position:absolute; top:8px; right:9px; width:8px; height:8px; background:var(--brand-orange); border-radius:50%; }
.user-chip{ display:flex; align-items:center; gap:.6rem; cursor:pointer; padding:.3rem .5rem; border-radius:999px; }
.user-chip:hover{ background:var(--surface-2); }
.avatar{ width:38px; height:38px; border-radius:50%; background:var(--accent); color:#fff;
  display:grid; place-items:center; font-weight:700; overflow:hidden; }
.avatar img{ width:100%; height:100%; object-fit:cover; }

.content{ padding:1.4rem; flex:1; }

/* ---------- Stat cards ---------- */
.stats-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:1rem; }
.stat-card{ display:flex; align-items:center; gap:1rem; }
.stat-icon{ width:54px; height:54px; border-radius:14px; display:grid; place-items:center; font-size:1.4rem; color:#fff; }
.stat-card .value{ font-size:1.7rem; font-weight:800; }
.stat-card .label{ color:var(--text-soft); font-size:.85rem; }
.stat-card .trend{ font-size:.78rem; font-weight:700; }
.trend.up{ color:var(--success); } .trend.down{ color:var(--error); }

.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
.grid-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:1rem; }
.section-title{ font-size:1.05rem; font-weight:800; margin-bottom:.9rem; display:flex; align-items:center; gap:.5rem; }
.chart-box{ position:relative; height:300px; }

/* ---------- Tables ---------- */
.table-tools{ display:flex; flex-wrap:wrap; gap:.6rem; align-items:center; margin-bottom:1rem; }
.table-tools .grow{ min-width:180px; }
.data-table{ width:100%; border-collapse:collapse; font-size:.9rem; }
.data-table th, .data-table td{ padding:.75rem .9rem; text-align:left; border-bottom:1px solid var(--border); }
.data-table th{ color:var(--text-soft); font-size:.78rem; text-transform:uppercase; letter-spacing:.4px; cursor:pointer; white-space:nowrap; }
.data-table tbody tr{ transition:background .15s; }
.data-table tbody tr:hover{ background:var(--surface-2); }
.table-scroll{ overflow-x:auto; }
.row-actions{ display:flex; gap:.4rem; }
.pagination{ display:flex; gap:.4rem; justify-content:flex-end; margin-top:1rem; align-items:center; }
.pagination button{ min-width:36px; height:36px; border:1px solid var(--border); background:var(--surface);
  border-radius:8px; cursor:pointer; color:var(--text); font-weight:600; }
.pagination button.active{ background:var(--accent); color:#fff; border-color:var(--accent); }
.pagination button[disabled]{ opacity:.4; cursor:not-allowed; }

/* ---------- Modal ---------- */
.modal-backdrop{ position:fixed; inset:0; background:rgba(15,23,42,.55); backdrop-filter:blur(3px);
  z-index:60000; display:none; align-items:center; justify-content:center; padding:1rem; }
.modal-backdrop.open{ display:flex; }
.modal{ background:var(--surface); border-radius:var(--radius); width:100%; max-width:560px;
  max-height:90vh; overflow-y:auto; box-shadow:var(--shadow-lg); animation:fadeUp .3s ease both; }
.modal.lg{ max-width:760px; }
.modal-head{ display:flex; justify-content:space-between; align-items:center; padding:1.1rem 1.3rem; border-bottom:1px solid var(--border); }
.modal-head h3{ font-size:1.15rem; }
.modal-body{ padding:1.3rem; }
.modal-foot{ padding:1rem 1.3rem; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:.6rem; }
.modal-close{ background:none; border:none; font-size:1.6rem; cursor:pointer; color:var(--text-soft); line-height:1; }

/* ---------- Dropdown menu ---------- */
.dropdown{ position:relative; }
.dropdown-menu{ position:absolute; right:0; top:115%; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-sm); box-shadow:var(--shadow-lg); min-width:200px; padding:.4rem; display:none; z-index:50; }
.dropdown-menu.open{ display:block; animation:fadeUp .2s ease both; }
.dropdown-menu button{ display:flex; align-items:center; gap:.7rem; width:100%; padding:.6rem .7rem; border:none;
  background:none; color:var(--text); border-radius:8px; cursor:pointer; font:inherit; text-align:left; }
.dropdown-menu button:hover{ background:var(--surface-2); }
.dropdown-menu hr{ border:none; border-top:1px solid var(--border); margin:.3rem 0; }

/* ---------- Empty / error state ---------- */
.empty-state{ text-align:center; padding:2.5rem 1rem; color:var(--text-soft); }
.empty-state i{ font-size:2.4rem; margin-bottom:.6rem; opacity:.5; }

.list-row{ display:flex; align-items:center; gap:.8rem; padding:.7rem 0; border-bottom:1px solid var(--border); }
.list-row:last-child{ border-bottom:none; }
.list-row .dot-icon{ width:38px; height:38px; border-radius:10px; display:grid; place-items:center; color:#fff; flex-shrink:0; }

/* ---------- Backdrop for mobile sidebar ---------- */
.sidebar-overlay{ position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:35; display:none; }

@media (max-width: 1000px){
  .grid-2,.grid-3{ grid-template-columns:1fr; }
  .sidebar{ transform:translateX(-100%); }
  .sidebar.open{ transform:translateX(0); }
  .sidebar-overlay.open{ display:block; }
  .main{ margin-left:0; }
  .topbar .menu-btn{ display:block; }
  .global-search{ display:none; }
  .work-context-current{ min-width:150px; max-width:200px; }
}
@media (max-width: 560px){
  .user-chip .uname{ display:none; }
  .content{ padding:1rem; }
  .topbar{ gap:.45rem; padding:0 .65rem; }
  .page-title{ display:none; }
  .work-context{ flex:1; }
  .work-context-current{ min-width:0; max-width:none; flex:1; }
  .work-context-step{ width:28px; flex:none; }
  .work-context-popover{ position:fixed; left:10px; right:10px; top:calc(var(--topbar-h) + 7px); width:auto; }
}

/* ---------- Photo upload field (student photo, etc.) ---------- */
.file-field{ display:flex; align-items:center; gap:.8rem; }
.photo-preview{ width:56px; height:56px; border-radius:10px; object-fit:cover; border:1px solid var(--border); flex-shrink:0; }

/* ---------- Compact cascading student filter ---------- */
.student-filter-nav{ position:relative; flex:0 0 auto; display:flex; align-items:center; gap:6px; }
.student-filter-nav>.btn{ min-height:38px; white-space:nowrap; }
.student-filter-count{ min-width:19px; height:19px; display:inline-grid; place-items:center; margin-left:3px; padding:0 5px; border-radius:999px; color:#fff; background:var(--accent); font-size:.68rem; font-weight:850; }
.student-filter-menu{ width:230px; display:none; padding:6px; border:1px solid var(--border); border-radius:7px; background:var(--surface); box-shadow:0 14px 34px rgba(15,23,42,.18); }
.student-filter-root{ position:absolute; z-index:80; top:calc(100% + 7px); right:0; }
.student-filter-root.open,.student-filter-branch.open>.student-filter-submenu{ display:block; }
.student-filter-branch{ position:relative; }
.student-filter-submenu{ position:absolute; z-index:81; top:-6px; right:calc(100% + 6px); }
.student-filter-parent,.student-filter-leaf,.student-filter-clear-all{ width:100%; min-height:38px; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 10px; border:0; border-radius:5px; color:var(--text); background:transparent; font:inherit; font-size:.78rem; font-weight:700; text-align:left; cursor:pointer; }
.student-filter-parent>span{ display:flex; align-items:center; gap:9px; }
.student-filter-parent>span>i{ width:16px; color:var(--text-soft); text-align:center; }
.student-filter-parent>i{ color:var(--text-soft); font-size:.68rem; }
.student-filter-parent:hover,.student-filter-leaf:hover,.student-filter-clear-all:hover,.student-filter-branch.open>.student-filter-parent{ color:var(--accent); background:var(--accent-soft); }
.student-filter-leaf.active{ color:var(--accent); background:var(--accent-soft); }
.student-filter-leaf.active i{ font-size:.7rem; }
.student-filter-divider{ height:1px; margin:5px 3px; background:var(--border); }
.student-filter-clear-all{ justify-content:flex-start; color:#dc2626; }
@media (min-width:701px){
  .student-filter-branch:hover>.student-filter-submenu{ display:block; }
}

/* ---------- Students Database: fixed identity + draggable data rail ---------- */
.student-db-overview{ margin:-2px -2px 16px; padding:14px 14px 12px; border-bottom:1px solid var(--border); background:var(--surface); }
.student-db-overview-head{ display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:11px; }
.student-db-overview-head>div{ display:flex; align-items:center; gap:10px; }
.student-db-overview-head strong{ font-size:.95rem; }
.student-db-overview-head span{ padding:4px 9px; border-radius:999px; color:var(--accent); background:var(--accent-soft); font-size:.7rem; font-weight:800; }
.student-db-overview-head small{ color:var(--text-soft); font-size:.7rem; }
/* 12 cards laid out as 2 rows of 6. Cards are compact so both rows together
   occupy roughly the same vertical space the single 12-up row used to. */
.student-db-metrics{ display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:6px; }
.student-db-overview{ overflow:hidden; }
.student-db-metric{ height:52px; min-height:52px; display:flex; align-items:center; gap:7px; padding:5px 8px; border:1px solid var(--border); border-radius:7px; background:var(--surface); }
.student-db-metric>i{ width:24px; height:24px; flex:0 0 24px; display:grid; place-items:center; border-radius:6px; color:var(--accent); background:var(--accent-soft); font-size:.72rem; }
.student-db-metric>div{ min-width:0; display:flex; flex-direction:column; gap:1px; }
.student-db-metric span{ overflow:hidden; color:var(--text-soft); font-size:.58rem; font-weight:750; line-height:1.15; text-overflow:ellipsis; white-space:nowrap; }
.student-db-metric strong{ font-size:.82rem; line-height:1.1; white-space:nowrap; }
.student-db-metric.green>i{ color:#15803d; background:#dcfce7; }
.student-db-metric.red>i{ color:#dc2626; background:#fee2e2; }
.student-db-metric.orange>i{ color:#c2410c; background:#ffedd5; }
.student-db-metric.blue>i{ color:#2563eb; background:#dbeafe; }
.student-db-metric.cyan>i{ color:#0e7490; background:#cffafe; }
.student-db-scroll{ --sdb-left-width:32%; --sdb-group-width:28%; position:relative; width:100%; padding-top:13px; overflow:visible; }
.student-db-table{ width:100%; border-collapse:separate; border-spacing:0; table-layout:fixed; font-size:.82rem; }
.student-db-table th,.student-db-table td{ height:54px; box-sizing:border-box; padding:9px 8px; overflow:hidden; border-bottom:1px solid var(--border); color:var(--text); text-align:left; text-overflow:ellipsis; white-space:nowrap; }
.student-db-table th{ height:45px; color:var(--text-soft); background:var(--surface); font-size:.68rem; font-weight:800; letter-spacing:0; text-transform:uppercase; cursor:pointer; }
.student-db-table thead th{ position:sticky; top:var(--topbar-h); z-index:8; box-shadow:0 1px 0 var(--border),0 5px 10px rgba(15,23,42,.05); }
.student-db-overlay-table thead th{ z-index:15; }
.student-db-table tbody tr:hover td{ background:var(--surface-2); }
.student-db-table .sdb-sn{ text-align:center; }
.student-db-table .sdb-sec,.student-db-table .sdb-competition,.student-db-table .sdb-gender{ text-align:center; }
.student-db-table td.sdb-competition{ font-weight:400; }
.student-db-table .sdb-father{ box-shadow:9px 0 13px -13px rgba(15,23,42,.72); }
.student-db-table .sdb-service{ text-align:center; }
.student-db-table .sdb-service .badge{ min-width:38px; justify-content:center; }
.student-db-table .sdb-money{ text-align:right; }
.student-db-table .sdb-month{ padding-inline:1px; text-align:center; }
.student-db-table .sdb-pd-pay{ background:color-mix(in srgb,#f59e0b 5%,var(--surface)); }
.student-db-table th.sdb-pd-pay span{ display:block; line-height:1.05; }
.student-db-table .sdb-total{ box-shadow:-9px 0 13px -13px rgba(15,23,42,.72); text-align:right; }
.student-db-table .sdb-actions .row-actions{ justify-content:center; gap:4px; }
.student-db-table .sdb-actions .btn{ width:30px; height:30px; min-width:30px; padding:0; display:grid; place-items:center; }
.student-db-table .fee-month-status{ width:23px; height:23px; border-radius:5px; font-size:.62rem; }
.student-db-table .has-dues{ color:#dc2626; font-size:.88rem; }
.student-db-table .paid{ color:#15803d; font-size:.88rem; }
.sdb-core-overlay{ position:absolute; z-index:12; top:13px; left:var(--sdb-left-width); width:var(--sdb-group-width); background:var(--surface); box-shadow:-10px 0 16px -14px rgba(15,23,42,.72),10px 0 16px -14px rgba(15,23,42,.72); transform:translate3d(0,0,0); transition:transform .34s cubic-bezier(.22,.8,.22,1),box-shadow .2s ease; cursor:grab; touch-action:pan-y; user-select:none; will-change:transform; }
.student-db-view-fees .sdb-core-overlay{ transform:translate3d(100%,0,0); }
.sdb-core-overlay.dragging{ z-index:14; cursor:grabbing; transition:none; box-shadow:-14px 0 22px -14px rgba(15,23,42,.84),14px 0 22px -14px rgba(15,23,42,.84); }
.student-db-overlay-table{ background:var(--surface); }
.student-db-overlay-table th,.student-db-overlay-table td{ background:var(--surface); cursor:grab; }
.sdb-core-overlay.dragging .student-db-overlay-table th,.sdb-core-overlay.dragging .student-db-overlay-table td{ cursor:grabbing; }
.student-db-overlay-table tbody tr:hover td{ background:var(--surface-2); }
.sdb-reg-link{ max-width:100%; padding:0; overflow:hidden; border:0; color:var(--accent); background:transparent; font:inherit; font-weight:800; text-overflow:ellipsis; cursor:pointer; }
.sdb-reg-link:hover{ text-decoration:underline; }
.sdb-sort{ margin-left:3px; color:var(--accent); font-size:.55rem; }

/* Responsive: 6 cards/row on desktop & laptop (2 rows of 6), stepping down to
   4 / 3 / 2 columns as the viewport narrows. The overview head and filter bar
   wrap instead of overflowing, so no element breaks or forces a page-level
   horizontal scroll. */
.student-db-overview-head{ flex-wrap:wrap; }
@media (max-width:1200px){
  .student-db-metrics{ grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media (max-width:768px){
  .student-db-overview-head{ flex-direction:column; align-items:flex-start; gap:6px; }
  .student-db-metrics{ grid-template-columns:repeat(3,minmax(0,1fr)); }
  .student-db-table{ font-size:.78rem; }
  .student-db-table th,.student-db-table td{ padding-inline:5px; }
}
@media (max-width:480px){
  .student-db-overview-head small{ display:none; }
  .student-db-metrics{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .student-db-table th,.student-db-table td{ padding-inline:4px; }
}

/* ---------- Students Database quick profile ---------- */
.modal.student-quick-modal{ width:min(920px,calc(100vw - 32px)); max-width:54vw; overflow-x:hidden; overflow-y:auto; }
.student-quick-modal .modal-body{ padding:14px; overflow:hidden; }
.student-quick-profile{ display:grid; gap:12px; min-width:0; }
.student-quick-hero{ display:grid; grid-template-columns:72px minmax(0,1fr) 170px; align-items:center; gap:13px; padding:12px; border:1px solid var(--border); border-radius:8px; background:var(--surface-2); }
.student-quick-photo{ width:72px; height:72px; display:grid; place-items:center; overflow:hidden; border:3px solid color-mix(in srgb,var(--accent) 24%,var(--border)); border-radius:50%; color:var(--accent); background:var(--accent-soft); font-size:1.5rem; font-weight:850; }
.student-quick-photo img{ width:100%; height:100%; object-fit:cover; }
.student-quick-name{ min-width:0; }
.student-quick-name small,.student-quick-name>strong{ display:block; color:var(--accent); font-size:.7rem; }
.student-quick-name h2{ margin:3px 0; overflow:hidden; font-size:1.12rem; text-overflow:ellipsis; white-space:nowrap; }
.student-quick-name p{ margin:0; color:var(--text-soft); font-size:.75rem; }
.student-quick-dues{ align-self:stretch; display:flex; flex-direction:column; justify-content:center; padding:10px 12px; border:1px solid #fecaca; border-radius:8px; background:#fff1f2; }
.student-quick-dues span,.student-quick-dues small{ color:#b91c1c; font-size:.68rem; }
.student-quick-dues strong{ margin:3px 0; color:#dc2626; font-size:1.25rem; }
.student-quick-details{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border:1px solid var(--border); border-radius:8px; overflow:hidden; }
.student-quick-details>div{ min-width:0; display:flex; align-items:flex-start; gap:8px; padding:9px 10px; border-right:1px solid var(--border); border-bottom:1px solid var(--border); }
.student-quick-details>div:nth-child(3n){ border-right:0; }
.student-quick-details>div:nth-last-child(-n+3){ border-bottom:0; }
.student-quick-details i{ width:16px; margin-top:2px; color:var(--text-soft); text-align:center; }
.student-quick-details span{ min-width:0; color:var(--text-soft); font-size:.66rem; }
.student-quick-details strong{ display:block; margin-top:2px; overflow:hidden; color:var(--text); font-size:.74rem; text-overflow:ellipsis; white-space:nowrap; }
.student-quick-fees{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.student-quick-fees>div{ min-width:0; padding:9px 10px; border:1px solid var(--border); border-radius:8px; }
.student-quick-fees span{ display:block; color:var(--text-soft); font-size:.65rem; }
.student-quick-fees strong{ display:block; margin-top:3px; font-size:.86rem; }
.student-quick-ledger{ min-width:0; border:1px solid var(--border); border-radius:8px; overflow:hidden; }
.student-quick-ledger header{ display:flex; align-items:center; justify-content:space-between; padding:9px 11px; border-bottom:1px solid var(--border); }
.student-quick-ledger h3{ margin:0; font-size:.88rem; }
.student-quick-ledger h3 i{ margin-right:6px; color:var(--accent); }
.student-quick-ledger header span{ color:var(--text-soft); font-size:.65rem; }
.student-quick-ledger>div{ max-height:240px; overflow-y:auto; overflow-x:hidden; }
.student-quick-ledger table{ width:100%; border-collapse:collapse; table-layout:fixed; font-size:.72rem; }
.student-quick-ledger th,.student-quick-ledger td{ padding:8px; overflow:hidden; border-bottom:1px solid var(--border); text-align:left; text-overflow:ellipsis; white-space:nowrap; }
.student-quick-ledger th{ color:var(--text-soft); background:var(--surface-2); font-size:.63rem; text-transform:uppercase; }
.student-quick-ledger th:nth-child(1){ width:74px; }.student-quick-ledger th:nth-child(2){ width:78px; }.student-quick-ledger th:nth-child(4){ width:112px; }.student-quick-ledger th:nth-child(5){ width:90px; }
.student-quick-ledger .income{ color:#15803d; }.student-quick-ledger .expense{ color:#dc2626; }
@media (max-width:1100px){ .modal.student-quick-modal{ max-width:calc(100vw - 32px); } }
@media (max-width:700px){
  .student-quick-hero{ grid-template-columns:58px minmax(0,1fr); }.student-quick-photo{ width:58px;height:58px; }.student-quick-dues{ grid-column:1/-1; }
  .student-quick-details{ grid-template-columns:1fr 1fr; }.student-quick-details>div:nth-child(3n){ border-right:1px solid var(--border); }.student-quick-details>div:nth-child(2n){ border-right:0; }.student-quick-details>div:nth-last-child(-n+3){ border-bottom:1px solid var(--border); }.student-quick-details>div:nth-last-child(-n+2){ border-bottom:0; }
  .student-quick-fees{ grid-template-columns:1fr 1fr; }
}

/* ---------- Professional admission form ---------- */
.admission-form-grid{ display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:12px 16px; }
.admission-form-grid .field{ margin:0; min-width:0; grid-column:span 6; }   /* default = half width */
.admission-form-grid .form-col-2{ grid-column:span 2; }
.admission-form-grid .form-col-3{ grid-column:span 3; }
.admission-form-grid .form-col-4{ grid-column:span 4; }
.admission-form-grid .form-col-6{ grid-column:span 6; }
.admission-form-grid .form-col-8{ grid-column:span 8; }
.admission-form-grid .form-section-title{ grid-column:1/-1; display:flex; align-items:center; gap:9px; margin:9px 0 0; padding:10px 12px; border-left:4px solid var(--accent); border-radius:8px; color:var(--text); background:var(--surface-2); font-size:.86rem; font-weight:850; }
.admission-form-grid .form-section-title:first-child{ margin-top:0; }
.admission-form-grid .form-section-title i{ width:18px; color:var(--accent); text-align:center; }
.hover-multiselect{ position:relative; min-height:44px; outline:none; }
.hover-multiselect-summary{ min-height:44px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 13px; border:1.5px solid var(--border); border-radius:9px; background:var(--surface); cursor:pointer; transition:border-color .18s ease, box-shadow .18s ease; }
.hover-multiselect:focus-within .hover-multiselect-summary,
.hover-multiselect.open .hover-multiselect-summary{ border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.hover-multiselect-summary span{ overflow:hidden; color:var(--text); text-overflow:ellipsis; white-space:nowrap; font-size:.9rem; }
.hover-multiselect-summary i{ color:var(--accent); font-size:.72rem; transition:transform .2s ease; }
.hover-multiselect.open .hover-multiselect-summary i{ transform:rotate(180deg); }
.hover-multiselect select{ position:absolute; z-index:30; top:calc(100% + 5px); left:0; width:100%; min-height:150px; display:none; padding:6px; border:1px solid var(--border); border-radius:10px; box-shadow:0 14px 30px rgba(15,23,42,.18); background:var(--surface); }
.hover-multiselect.open select{ display:block; }
.hover-multiselect select option{ padding:9px 11px; border-radius:6px; cursor:pointer; }
.hover-multiselect select option:hover{ background:var(--accent-soft); }
.hover-multiselect select option:checked{ background:var(--accent); color:#fff; }
.admission-form-grid .form-field-wide{ grid-column:1/-1; }
.admission-form-grid textarea{ resize:vertical; }

/* ---------- Compact, single-screen admission form ---------- */
.form-page .form-page-body{ padding:16px 20px; max-height:calc(100vh - 200px); overflow:auto; }
.admission-form-grid{ gap:10px 14px; }
.admission-form-grid .field{ display:flex; flex-direction:column; }
.admission-form-grid .field label{ margin-bottom:3px; font-size:.72rem; font-weight:650; letter-spacing:.01em; text-transform:uppercase; color:var(--text-soft); }
.admission-form-grid .input,
.admission-form-grid select.input,
.admission-form-grid .hover-multiselect-summary{ padding:8px 10px; font-size:.85rem; min-height:38px; }
.admission-form-grid .hover-multiselect,
.admission-form-grid .hover-multiselect-summary{ min-height:38px; }
.admission-form-grid .form-section-title{ margin:8px 0 2px; padding:7px 11px; font-size:.8rem; }

/* Photo picker + webcam button (webcam opens in a popup, see below) */
.file-field.has-webcam{ align-items:center; }
.file-field-controls{ display:flex; flex:1; min-width:170px; align-items:center; gap:8px; flex-wrap:wrap; }
.file-field-controls input[type="file"]{ flex:1; min-width:150px; padding:.35rem; }
.webcam-btn{ flex:none; }

/* Webcam capture popup — small, centered, doesn't disturb the form layout */
.webcam-pop-backdrop{ position:fixed; inset:0; z-index:1000; display:flex; align-items:center; justify-content:center; padding:16px; background:rgba(15,23,42,.55); }
.webcam-pop{ width:min(420px,100%); display:flex; flex-direction:column; gap:12px; padding:16px; border-radius:14px; background:var(--surface); box-shadow:0 24px 60px rgba(15,23,42,.35); }
.webcam-pop-head{ display:flex; align-items:center; justify-content:space-between; font-weight:800; font-size:.95rem; color:var(--text); }
.webcam-pop-head i{ color:var(--accent); margin-right:6px; }
.webcam-pop-x{ border:0; background:none; font-size:1.4rem; line-height:1; cursor:pointer; color:var(--text-soft); }
.webcam-pop-video{ width:100%; aspect-ratio:4/3; border-radius:10px; border:1px solid var(--border); background:#0b1220; object-fit:cover; }
.webcam-pop-actions{ display:flex; justify-content:flex-end; gap:8px; }

/* ---------- Balance Sheet category flow ---------- */
.balance-sheet-page{ max-width:none; margin:0; }
.balance-sheet-heading{ display:flex; align-items:center; justify-content:space-between; gap:24px; padding:26px 28px; margin-bottom:18px; border-radius:var(--radius); color:#fff; background:linear-gradient(135deg,var(--brand-blue),#075985); box-shadow:var(--shadow); }
.balance-sheet-heading.compact{ padding-block:22px; }
.balance-sheet-heading h2{ margin:4px 0 6px; color:#fff; font-size:clamp(1.65rem,3vw,2.2rem); }
.balance-sheet-heading p{ margin:0; color:rgba(255,255,255,.82); }
.balance-sheet-kicker{ font-size:.76rem; font-weight:800; letter-spacing:.14em; text-transform:uppercase; color:#fed7aa; }
.balance-sheet-icon{ width:68px; height:68px; flex:0 0 68px; display:grid; place-items:center; border-radius:20px; background:rgba(255,255,255,.15); font-size:1.8rem; }
.balance-summary-grid{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:18px; }
.balance-summary-card{ position:relative; overflow:hidden; display:flex; flex-direction:column; gap:5px; padding:18px; border-left:4px solid var(--accent); }
.balance-summary-card::after{ content:""; position:absolute; right:-20px; bottom:-35px; width:80px; height:80px; border-radius:50%; background:currentColor; opacity:.055; }
.balance-summary-card span{ color:var(--text-soft); font-size:.78rem; font-weight:750; text-transform:uppercase; letter-spacing:.06em; }
.balance-summary-card strong{ font-size:1.35rem; line-height:1.15; }
.balance-summary-card small{ color:var(--text-soft); }
.balance-summary-card.income{ border-left-color:#16a34a; color:#16a34a; }
.balance-summary-card.expense{ border-left-color:#dc2626; color:#dc2626; }
.balance-summary-card.net{ border-left-color:#2563eb; color:#2563eb; }
.balance-summary-card.entries{ border-left-color:#ca8a04; color:#ca8a04; }
.balance-summary-card strong,.balance-summary-card small,.balance-summary-card span{ position:relative; z-index:1; }
.balance-summary-card strong{ color:var(--text); }
.balance-sheet-grid{ display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.balance-entry-launcher{ padding:0; margin-bottom:18px; overflow:hidden; }
.balance-entry-launcher>summary{ display:flex; align-items:center; gap:12px; padding:15px 18px; cursor:pointer; list-style:none; }
.balance-entry-launcher>summary::-webkit-details-marker{ display:none; }
.balance-entry-launcher>summary>span:nth-child(2){ display:flex; flex:1; flex-direction:column; gap:2px; }
.balance-entry-launcher>summary strong{ font-size:.92rem; }
.balance-entry-launcher>summary small{ color:var(--text-soft); font-size:.74rem; }
.balance-entry-summary-icon{ width:36px; height:36px; display:grid; place-items:center; border-radius:10px; color:#fff; background:var(--accent); }
.balance-entry-chevron{ color:var(--text-soft); transition:transform .2s; }
.balance-entry-launcher[open] .balance-entry-chevron{ transform:rotate(180deg); }
.balance-entry-content{ padding:0 18px 17px; border-top:1px solid var(--border); }
.balance-sheet-grid.compact{ gap:12px; padding-top:14px; }
.balance-sheet-grid.compact .balance-sheet-field{ padding:0; border:0; }
.balance-sheet-grid.compact .balance-sheet-field:focus-within{ transform:none; }
.balance-sheet-grid.compact .balance-sheet-field label{ margin-bottom:7px; font-size:.78rem; }
.balance-sheet-grid.compact .balance-sheet-field .input{ min-height:42px; }
.balance-sheet-field{ padding:24px; border:1px solid var(--border); transition:border-color .2s,transform .2s; }
.balance-sheet-field:focus-within{ border-color:var(--accent); transform:translateY(-2px); }
.balance-sheet-field label{ display:flex; align-items:center; gap:10px; margin-bottom:14px; font-weight:750; }
.balance-sheet-field label b,.balance-sheet-question b{ color:var(--danger); }
.field-number{ width:28px; height:28px; display:grid; place-items:center; border-radius:8px; color:#fff; background:var(--accent); font-size:.78rem; }
.balance-sheet-field .input{ min-height:50px; }
.balance-sheet-actions{ display:flex; align-items:center; gap:10px; margin-top:18px; }
.balance-sheet-actions .push-right{ margin-left:auto; }
.balance-sheet-error{ display:none; margin-top:11px; color:var(--danger); font-size:.84rem; font-weight:650; }
.balance-sheet-field.invalid,.balance-sheet-options.invalid{ border-color:var(--danger); }
.invalid>.balance-sheet-error{ display:block; }
.balance-sheet-options{ padding:26px; }
.balance-sheet-question{ font-size:1.05rem; font-weight:800; margin-bottom:18px; }
.balance-sheet-radio-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.balance-sheet-radio{ position:relative; display:flex; align-items:center; gap:12px; padding:15px 16px; border:1.5px solid var(--border); border-radius:12px; cursor:pointer; transition:border-color .18s,background .18s,transform .18s; }
.balance-sheet-radio:hover{ transform:translateY(-1px); border-color:var(--accent); background:var(--surface-2); }
.balance-sheet-radio input{ position:absolute; opacity:0; pointer-events:none; }
.radio-mark{ width:20px; height:20px; flex:0 0 20px; border:2px solid var(--text-soft); border-radius:50%; box-shadow:inset 0 0 0 4px var(--surface); }
.balance-sheet-radio input:checked+.radio-mark{ border-color:var(--accent); background:var(--accent); }
.balance-sheet-radio:has(input:checked){ border-color:var(--accent); background:color-mix(in srgb,var(--accent) 8%,var(--surface)); }
.balance-sheet-radio small{ display:inline-block; min-width:28px; color:var(--text-soft); font-size:.7rem; font-weight:800; }
.balance-ledger{ margin-top:22px; padding:0; overflow:hidden; }
.balance-ledger-head{ display:flex; align-items:center; justify-content:space-between; gap:16px; padding:20px 22px; border-bottom:1px solid var(--border); }
.balance-ledger-head h3{ margin:0 0 3px; }
.balance-ledger-head p{ margin:0; color:var(--text-soft); font-size:.84rem; }
.balance-ledger .table-scroll{ border:0; border-radius:0; }
.balance-ledger-filters{ display:grid; grid-template-columns:minmax(150px,.9fr) repeat(2,minmax(130px,.6fr)) minmax(150px,.75fr) minmax(200px,1.1fr) auto auto; gap:8px; padding:14px 18px; border-bottom:1px solid var(--border); background:var(--surface-2); }
.balance-ledger-head-actions{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.bs-gear{ width:36px; padding:0; display:grid; place-items:center; }

/* Current balance card — tinted green/red by sign, no controls inside it. */
.balance-current-box{
  display:grid; grid-template-columns:auto minmax(200px,1fr); grid-template-rows:auto auto; align-items:center; justify-content:center; column-gap:14px;
  min-width:430px; padding:9px 14px; border-radius:12px;
  border:1px solid var(--border); background:var(--surface);
  box-shadow:0 1px 3px rgba(15,23,42,.06);
}
.balance-current-box span{
  font-size:.6rem; letter-spacing:.9px; font-weight:800;
  text-transform:uppercase; color:var(--text-soft); white-space:nowrap;
}
.balance-current-box>span{grid-column:1;grid-row:1;text-align:right}
.balance-current-box strong{
  font-size:1.45rem; font-weight:800; line-height:1.15; margin-top:3px;
  font-variant-numeric:tabular-nums; white-space:nowrap;
}
.balance-current-box>strong{grid-column:1;grid-row:2;text-align:right}
.balance-current-box.neg{ background:rgba(220,38,38,.07); border-color:rgba(220,38,38,.3); }
.balance-current-box.neg strong{ color:#dc2626; }
.balance-current-box.pos{ background:rgba(21,128,61,.07); border-color:rgba(21,128,61,.3); }
.balance-current-box.pos strong{ color:#15803d; }
.balance-daily-summary{ grid-column:2; grid-row:1/3; width:100%; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:center; gap:8px; margin:0; padding:0 0 0 14px; border-top:0; border-left:1px solid color-mix(in srgb,var(--border) 78%,transparent); }
.balance-daily-item{ min-width:0; display:grid; grid-template-columns:28px minmax(0,1fr); align-items:center; gap:7px; text-align:left; }
.balance-daily-item>i{ width:28px; height:28px; display:grid; place-items:center; border-radius:50%; font-size:.7rem; }
.balance-daily-item.income>i{ background:#dcfce7; color:#15803d; }
.balance-daily-item.expense>i{ background:#fee2e2; color:#dc2626; }
.balance-daily-item>div{ min-width:0; display:grid; }
.balance-daily-item small{ overflow:hidden; color:var(--text-soft); font-size:.54rem; font-weight:800; text-overflow:ellipsis; text-transform:uppercase; white-space:nowrap; }
.balance-daily-item b{ margin-top:2px; font-size:.74rem; font-variant-numeric:tabular-nums; white-space:nowrap; }
.balance-daily-item.income b{ color:#15803d; }
.balance-daily-item.expense b{ color:#dc2626; }
.balance-daily-item em{ color:var(--text-soft); font-size:.5rem; font-style:normal; }
.balance-ledger-filters .input{ min-height:40px; padding:8px 10px; }
.balance-ledger-table{ width:100%; font-size:.78rem; }
.balance-ledger-table th,.balance-ledger-table td{ padding:.62rem .7rem; white-space:nowrap; }
.balance-ledger-table .ledger-description{ max-width:310px; overflow:hidden; text-overflow:ellipsis; }

/* Desktop: fit the whole ledger inside 100% width — no horizontal scroll.
   Column widths sum to ~100%; the Detailed Description wraps to fill the rest. */
@media (min-width:701px){
  .balance-ledger .table-scroll{ overflow-x:hidden; }
  .balance-ledger-table{ table-layout:fixed; min-width:0; }
  .balance-ledger-table th,.balance-ledger-table td{ padding:.55rem .5rem; overflow:hidden; text-overflow:ellipsis; }
  .balance-ledger-table th{ white-space:normal; line-height:1.2; vertical-align:bottom; }
  .balance-ledger-table td:nth-child(1),.balance-ledger-table th:nth-child(1){ width:3%; }
  .balance-ledger-table td:nth-child(2),.balance-ledger-table th:nth-child(2){ width:7%; }
  .balance-ledger-table td:nth-child(3),.balance-ledger-table th:nth-child(3){ width:6.5%; }
  .balance-ledger-table td:nth-child(4),.balance-ledger-table th:nth-child(4){ width:9%; }
  .balance-ledger-table td:nth-child(5),.balance-ledger-table th:nth-child(5){ width:9%; }
  .balance-ledger-table td:nth-child(6),.balance-ledger-table th:nth-child(6){ width:9.5%; }
  .balance-ledger-table td:nth-child(7),.balance-ledger-table th:nth-child(7){ width:7%; }
  .balance-ledger-table td:nth-child(8),.balance-ledger-table th:nth-child(8){ width:7%; }
  .balance-ledger-table td:nth-child(10),.balance-ledger-table th:nth-child(10){ width:8%; }
  .balance-ledger-table td:nth-child(11),.balance-ledger-table th:nth-child(11){ width:24%; }
  .balance-ledger-table td:nth-child(12),.balance-ledger-table th:nth-child(12){ width:10%; }
  /* The cell must stay a real table-cell — clamp the inner <span> instead,
     otherwise display:-webkit-box breaks the column layout. */
  .balance-ledger-table .ledger-description{ max-width:none; white-space:normal; vertical-align:middle; }
  .balance-ledger-table .ledger-description span{
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
    overflow:hidden; line-height:1.35; overflow-wrap:anywhere;
  }
  .balance-ledger-table .ledger-actions{ flex-wrap:nowrap; gap:4px; }
  .balance-ledger-table .ledger-actions button{ width:26px; height:26px; }
}
.ledger-income{ color:#15803d; font-weight:800; }
.ledger-expense{ color:#dc2626; font-weight:800; }
.ledger-mobile-amount,.ledger-mobile-subcategory{ display:none; }
.ledger-actions{ display:flex; gap:5px; }
.ledger-actions button{ width:30px; height:30px; display:grid; place-items:center; border:1px solid var(--border); border-radius:7px; color:var(--text-soft); background:var(--surface); cursor:pointer; }
.ledger-actions button:hover{ color:#fff; border-color:var(--accent); background:var(--accent); }
.link-button{ padding:0; border:0; color:var(--accent); background:none; font:inherit; font-weight:750; cursor:pointer; }
.balance-transaction-form{ padding:26px; }
.balance-form-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.balance-form-wide{ grid-column:1/-1; }
.balance-review{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:16px; padding:17px 20px; }
.balance-review div{ display:flex; flex-direction:column; gap:3px; }
.balance-review span{ color:var(--text-soft); font-size:.75rem; font-weight:750; text-transform:uppercase; letter-spacing:.05em; }
.balance-review strong{ font-size:.9rem; }
.balance-transaction-form.invalid{ border-color:var(--danger); }

/* ---------- Transaction date + category picker ---------- */
.transaction-picker-page{ max-width:900px; margin:0 auto; }
.transaction-picker-heading{ display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:18px; }
.transaction-picker-heading h2{ margin:3px 0 5px; font-size:1.65rem; }
.transaction-picker-heading p{ margin:0; color:var(--text-soft); font-size:.84rem; }
.transaction-picker-kicker{ color:var(--accent); font-size:.7rem; font-weight:800; letter-spacing:.11em; text-transform:uppercase; }
.transaction-picker-heading-icon{ width:48px; height:48px; flex:0 0 48px; display:grid; place-items:center; border-radius:14px; color:var(--accent); background:var(--accent-soft); font-size:1.2rem; }
.transaction-picker-card{ padding:0; overflow:hidden; }
.transaction-picker-section{ padding:22px 24px; }
.transaction-picker-section+.transaction-picker-section{ border-top:1px solid var(--border); }
.transaction-picker-section-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:15px; }
.transaction-picker-section-head strong{ display:flex; align-items:center; gap:8px; font-size:.9rem; }
.transaction-picker-section-head strong i{ color:var(--accent); }
.transaction-picker-section-head>span{ color:var(--text-soft); font-size:.7rem; font-weight:700; }
.transaction-date-options{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.transaction-date-choice,.transaction-category-choice{ position:relative; border:1px solid var(--border); color:var(--text); background:var(--surface); cursor:pointer; font:inherit; text-align:left; transition:border-color .18s,background .18s,box-shadow .18s,transform .18s; }
.transaction-date-choice:hover,.transaction-category-choice:hover{ transform:translateY(-1px); border-color:var(--accent); background:var(--surface-2); }
.transaction-date-choice{ min-height:58px; display:flex; align-items:center; gap:11px; padding:10px 13px; border-radius:11px; }
.transaction-date-choice>i:first-child{ width:28px; height:28px; flex:0 0 28px; display:grid; place-items:center; border-radius:8px; color:var(--accent); background:var(--accent-soft); }
.transaction-date-choice span{ min-width:0; }
.transaction-date-choice strong,.transaction-date-choice small,.transaction-category-copy strong,.transaction-category-copy small{ display:block; }
.transaction-date-choice strong{ font-size:.78rem; }
.transaction-date-choice small{ margin-top:2px; color:var(--text-soft); font-size:.66rem; }
.transaction-category-options{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:11px; }
.transaction-category-choice{ min-height:94px; display:flex; align-items:flex-start; gap:11px; padding:14px; border-radius:12px; }
.transaction-category-icon{ width:36px; height:36px; flex:0 0 36px; display:grid; place-items:center; border-radius:10px; color:var(--accent); background:var(--accent-soft); }
.transaction-category-copy{ min-width:0; padding-top:1px; }
.transaction-category-copy strong{ margin-bottom:5px; font-size:.78rem; }
.transaction-category-copy small{ color:var(--text-soft); font-size:.68rem; line-height:1.35; }
.transaction-choice-check{ position:absolute; top:8px; right:8px; display:none; color:var(--accent); font-size:.78rem; }
.transaction-date-choice[aria-pressed="true"],.transaction-category-choice[aria-pressed="true"]{ border-color:var(--accent); background:var(--accent-soft); box-shadow:inset 0 0 0 1px var(--accent); }
.transaction-date-choice[aria-pressed="true"] .transaction-choice-check,.transaction-category-choice[aria-pressed="true"] .transaction-choice-check{ display:block; }
.transaction-category-choice[aria-pressed="true"] .transaction-category-icon{ color:#fff; background:var(--accent); }
.transaction-picker-error{ margin:0; padding:0 24px 13px; }
.transaction-picker-footer{ display:flex; align-items:center; justify-content:space-between; gap:14px; padding:16px 22px; border-top:1px solid var(--border); background:var(--surface-2); }
.transaction-picker-selection{ display:flex; align-items:center; gap:8px; color:var(--text-soft); font-size:.74rem; }
.transaction-picker-selection i{ color:var(--accent); }
.transaction-picker-actions{ display:flex; gap:9px; }
.transaction-picker-actions .btn{ min-height:40px; }

/* ---------- Student combined fee collection ---------- */
.student-search-card{ padding:20px 22px; margin-bottom:14px; }
.student-search-row{ display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:12px; }
.student-search-row .field{ margin:0; }
.student-search-row .btn{ min-height:46px; }
.student-search-placeholder{ display:flex; flex-direction:column; align-items:center; gap:7px; padding:42px 20px; border:1px dashed var(--border); border-radius:var(--radius); color:var(--text-soft); text-align:center; }
.student-search-placeholder i{ font-size:2rem; color:var(--accent); opacity:.7; }
.student-search-placeholder strong{ color:var(--text); }
.student-compact-card{ display:grid; grid-template-columns:auto minmax(150px,1.4fr) repeat(4,minmax(100px,1fr)); align-items:center; gap:16px; padding:16px 18px; margin-bottom:14px; border-left:4px solid var(--accent); }
.student-compact-card>div:not(.student-mini-avatar){ min-width:0; display:flex; flex-direction:column; gap:3px; }
.student-compact-card small{ color:var(--text-soft); font-size:.72rem; }
.student-compact-card strong{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.88rem; }
.student-primary strong{ font-size:1rem; }
.student-mini-avatar{ width:44px; height:44px; display:grid; place-items:center; overflow:hidden; border-radius:12px; color:#fff; background:linear-gradient(135deg,var(--accent),var(--brand-blue)); font-weight:850; }
.student-mini-avatar img{ width:100%; height:100%; object-fit:cover; }
.student-due{ padding:9px 11px; border-radius:10px; background:#fff7ed; }
.student-due strong{ color:#c2410c; }
.student-fee-card{ padding:22px; }
.student-fee-card.invalid{ border-color:var(--danger); }
.student-fee-title{ display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:16px; }
.student-fee-title h3{ margin:0 0 4px; }
.student-fee-title p{ margin:0; color:var(--text-soft); font-size:.84rem; }
.student-fee-heads{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; }
.student-fee-option{ position:relative; display:flex; align-items:center; gap:10px; min-height:48px; padding:10px 12px; border:1.5px solid var(--border); border-radius:11px; cursor:pointer; transition:.18s; }
.student-fee-option:hover{ border-color:var(--accent); background:var(--surface-2); }
.student-fee-option input{ position:absolute; opacity:0; pointer-events:none; }
.student-fee-option:has(input:checked){ border-color:var(--accent); background:color-mix(in srgb,var(--accent) 8%,var(--surface)); }
.fee-checkmark{ width:20px; height:20px; flex:0 0 20px; display:grid; place-items:center; border:2px solid var(--border); border-radius:6px; color:transparent; font-size:.65rem; }
.student-fee-option input:checked+.fee-checkmark{ color:#fff; border-color:var(--accent); background:var(--accent); }
.student-fee-option small{ display:inline-block; min-width:25px; color:var(--text-soft); font-size:.68rem; font-weight:800; }
.student-fee-option>span:last-child{ display:flex; flex-direction:column; gap:2px; }
.student-fee-option.month-paid{ border-color:#86efac; background:#f0fdf4; color:#166534; cursor:default; }
.student-fee-option.month-paid .fee-checkmark{ color:#fff; border-color:#16a34a; background:#16a34a; }
.student-fee-option.month-paid small{ color:#15803d; }
.student-fee-option.month-partial{ border-color:#facc15; background:#fefce8; color:#854d0e; }
.student-fee-option.month-partial small{ color:#a16207; }
.student-fee-option.month-disabled:not(.month-paid){ opacity:.6; cursor:default; background:var(--surface-2); }
.fee-month-status{ width:28px; height:28px; display:inline-grid; place-items:center; border-radius:8px; font-size:.72rem; font-weight:850; }
.fee-month-status.paid{ color:#15803d; background:#dcfce7; }
.fee-month-status.partial{ color:#a16207; background:#fef9c3; }
.fee-month-status.unpaid{ color:#b91c1c; background:#fee2e2; }
.fee-month-status.neutral{ color:var(--text-soft); background:var(--surface-2); }
.fee-month-status.blank{ background:transparent; }
.student-fee-lines{ margin-top:18px; border:1px solid var(--border); border-radius:12px; overflow:hidden; }
.student-fee-line{ display:grid; grid-template-columns:minmax(0,1fr) minmax(150px,220px); align-items:center; gap:14px; padding:11px 14px; border-bottom:1px solid var(--border); }
.student-fee-line:last-child{ border-bottom:0; }
.student-fee-line-head{ color:var(--text-soft); background:var(--surface-2); font-size:.73rem; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.student-fee-line .input{ min-height:40px; text-align:right; }
.student-fee-empty{ padding:22px; color:var(--text-soft); text-align:center; }
.tuition-month-block{ padding:16px; }
.tuition-month-title{ display:flex; flex-direction:column; gap:3px; margin-bottom:12px; }
.tuition-month-title small{ color:var(--text-soft); }
.tuition-month-grid{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.tuition-month-row{ display:grid; grid-template-columns:auto minmax(70px,1fr) 105px; align-items:center; gap:8px; padding:8px 10px; border:1px solid var(--border); border-radius:9px; }
.tuition-month-row>input[type="checkbox"]{ width:17px; height:17px; accent-color:var(--accent); }
.tuition-month-row .input{ min-height:36px; padding:7px 8px; text-align:right; }
.tuition-month-row .input:disabled{ opacity:.45; }
.student-payment-bottom{ display:grid; grid-template-columns:1fr; gap:16px; align-items:end; margin-top:18px; }
.student-payment-fields{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.student-payment-summary{ display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); overflow:hidden; border:1px solid var(--border); border-radius:12px; background:var(--surface-2); }
.student-payment-summary div{ display:flex; flex-direction:column; gap:3px; padding:13px; border-right:1px solid var(--border); }
.student-payment-summary div:last-child{ border-right:0; }
.student-payment-summary span{ color:var(--text-soft); font-size:.68rem; font-weight:750; text-transform:uppercase; }
.student-payment-summary strong{ font-size:.9rem; }
.student-payment-summary strong.advance{ color:#15803d; }
.director-form-tools{ display:flex; justify-content:flex-end; margin:-4px 0 12px; }
.category-option-manager{ padding:20px; margin-bottom:14px; border:1px solid var(--accent); }
.category-option-manager h3{ margin:0 0 3px; }
.category-option-manager p{ margin:0; color:var(--text-soft); font-size:.82rem; }
.category-option-list{ display:flex; flex-wrap:wrap; gap:8px; margin:14px 0; }
.category-option-list span{ display:flex; align-items:center; gap:8px; padding:7px 9px 7px 12px; border:1px solid var(--border); border-radius:999px; background:var(--surface-2); font-size:.82rem; font-weight:700; }
.category-option-list button{ width:22px; height:22px; display:grid; place-items:center; border:0; border-radius:50%; color:var(--danger); background:transparent; cursor:pointer; }
.category-option-list button:hover{ background:#fee2e2; }
.category-option-add{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; }
.employee-salary-box{ padding:16px; border:1px solid var(--border); border-radius:12px; background:var(--surface-2); }
.salary-employee-summary{ display:grid; grid-template-columns:auto auto auto auto; align-items:center; gap:8px 16px; margin-bottom:12px; }
.salary-employee-summary span{ color:var(--text-soft); font-size:.75rem; font-weight:750; text-transform:uppercase; }
.salary-employee-summary strong{ font-size:1rem; }
.salary-month-picker{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.salary-month-picker label{ display:flex; align-items:center; gap:8px; padding:9px 10px; border:1px solid var(--border); border-radius:9px; background:var(--surface); cursor:pointer; font-size:.82rem; }
.salary-month-picker input{ width:17px; height:17px; accent-color:var(--accent); }

/* ---------- Standalone student bill generator ---------- */
.bill-generator-page{ max-width:1220px; margin:0 auto; }
.bill-generator-form{ padding:22px; }
.bill-generator-grid{ display:grid; grid-template-columns:minmax(180px,.7fr) minmax(360px,1.3fr); gap:16px; }
.bill-registration-row{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:9px; }
.bill-registration-row .btn{ min-height:44px; }
.bill-student-preview{ display:grid; grid-template-columns:auto minmax(180px,1.4fr) minmax(130px,.8fr) minmax(130px,.7fr); align-items:center; gap:16px; margin-top:18px; padding:14px 16px; border:1px solid var(--border); border-left:4px solid var(--accent); border-radius:8px; background:var(--surface-2); }
.bill-student-preview.empty{ display:flex; justify-content:center; color:var(--text-soft); border-left-color:var(--border); }
.bill-student-preview>div:not(.bill-student-avatar){ display:flex; min-width:0; flex-direction:column; gap:2px; }
.bill-student-preview small{ color:var(--text-soft); font-size:.7rem; font-weight:750; text-transform:uppercase; }
.bill-student-preview strong,.bill-student-preview span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bill-student-avatar{ width:48px; height:48px; display:grid; place-items:center; overflow:hidden; border-radius:8px; background:var(--accent); color:#fff; font-size:1.1rem; font-weight:850; }
.bill-student-avatar img{ width:100%; height:100%; object-fit:cover; }
.bill-due-value{ color:#c2410c; }
.bill-generator-section{ margin-top:20px; padding-top:18px; border-top:1px solid var(--border); }
.bill-generator-section-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:12px; }
.bill-generator-section-head h3{ margin:0 0 3px; font-size:1rem; }
.bill-generator-section-head p{ margin:0; color:var(--text-soft); font-size:.8rem; }
.bill-generator-section-head>span{ padding:5px 9px; border-radius:999px; background:var(--accent-soft); color:var(--accent); font-size:.72rem; font-weight:800; }
.bill-type-grid{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; }
.bill-type-option{ min-width:0; }
.bill-type-option input{ position:absolute; opacity:0; pointer-events:none; }
.bill-type-option span{ min-height:48px; display:flex; align-items:center; gap:10px; padding:11px 13px; border:1px solid var(--border); border-radius:8px; background:var(--surface); font-weight:700; cursor:pointer; transition:border-color .15s,background .15s,color .15s; }
.bill-type-option span i{ width:18px; color:var(--text-soft); text-align:center; }
.bill-type-option input:checked+span{ border-color:var(--accent); background:var(--accent-soft); color:var(--accent); box-shadow:inset 3px 0 var(--accent); }
.bill-type-option input:checked+span i{ color:var(--accent); }
.bill-type-option input:focus-visible+span{ outline:3px solid color-mix(in srgb,var(--accent) 25%,transparent); outline-offset:2px; }
.bill-generator-details{ display:grid; grid-template-columns:minmax(180px,.55fr) minmax(320px,1.45fr); gap:16px; margin-top:20px; }
.bill-description-field textarea{ resize:vertical; min-height:82px; }
.bill-generator-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:18px; }

/* ---------- Filter-aware bulk student billing modal ---------- */
.modal.bulk-student-bill-modal{ width:min(820px,calc(100vw - 32px)); max-width:min(820px,62vw); overflow-x:hidden; }
.bulk-student-bill-modal .modal-head{ position:sticky; z-index:3; top:0; background:var(--surface); }
.bulk-student-bill-modal .modal-body{ padding:18px 22px; }
.bulk-student-bill-modal .modal-foot{ position:sticky; z-index:3; bottom:0; background:var(--surface); }
.bulk-bill-target{ display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; gap:12px; padding:13px 15px; border-left:4px solid var(--accent); border-radius:7px; color:var(--text); background:var(--surface-2); }
.bulk-bill-target>i{ width:38px; height:38px; display:grid; place-items:center; border-radius:7px; color:var(--accent); background:var(--accent-soft); }
.bulk-bill-target>div{ min-width:0; display:flex; flex-direction:column; gap:2px; }
.bulk-bill-target span,.bulk-bill-target small{ color:var(--text-soft); font-size:.7rem; }
.bulk-bill-target strong{ font-size:.9rem; }
.bulk-bill-target small{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bulk-bill-target>b{ min-width:42px; padding:7px 9px; border-radius:7px; color:var(--accent); background:var(--accent-soft); font-size:1rem; text-align:center; }
.bulk-bill-note{ margin-top:9px; padding:8px 11px; border:1px solid #fed7aa; border-radius:7px; color:#9a3412; background:#fff7ed; font-size:.74rem; }
.bulk-bill-date{ margin-top:15px; }
.bulk-bill-impact{ display:grid; grid-template-columns:auto auto auto auto; justify-content:end; align-items:center; gap:7px 12px; margin-top:14px; padding:10px 12px; border-top:1px solid var(--border); color:var(--text-soft); font-size:.73rem; }
.bulk-bill-impact strong{ color:var(--text); font-size:.88rem; }
@media (max-width:1100px){ .modal.bulk-student-bill-modal{ max-width:calc(100vw - 32px); } }
@media (max-width:700px){
  .bulk-student-bill-modal .modal-body{ padding:14px; }
  .bulk-bill-target{ grid-template-columns:36px minmax(0,1fr); }.bulk-bill-target>b{ grid-column:1/-1; }
  .bulk-bill-impact{ grid-template-columns:1fr auto; justify-content:stretch; }
}

/* ---------- Student account profile ---------- */
.student-account-page{ max-width:1500px; margin:0 auto; }
.student-profile-searchbar{ position:sticky; z-index:30; top:0; display:grid; grid-template-columns:auto minmax(420px,1fr); align-items:end; gap:22px; padding:16px 20px; margin-bottom:16px; border-top:3px solid var(--accent); box-shadow:0 8px 24px rgba(15,23,42,.08); }
.student-profile-search-copy{ display:flex; align-items:center; gap:12px; min-width:220px; }
.student-profile-search-copy>i{ width:40px; height:40px; display:grid; place-items:center; border-radius:8px; color:var(--accent); background:var(--accent-soft); }
.student-profile-search-copy h2{ margin:0; font-size:1.05rem; }
.student-profile-search-copy p{ margin:2px 0 0; color:var(--text-soft); font-size:.76rem; }
.student-profile-search-row{ display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:10px; }
.student-profile-search-row .field{ margin:0; }
.student-profile-search-row .btn{ min-height:44px; }
.student-account-overview{ display:grid; grid-template-columns:minmax(300px,1fr) minmax(520px,1.55fr); gap:14px; margin-bottom:16px; }
.student-account-identity{ min-width:0; display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:16px; padding:20px; border:1px solid var(--border); border-radius:8px; background:var(--surface); }
.student-account-photo{ width:92px; height:108px; display:grid; place-items:center; overflow:hidden; border-radius:8px; background:var(--accent); color:#fff; font-size:1.8rem; font-weight:850; }
.student-account-photo img{ width:100%; height:100%; object-fit:cover; }
.student-account-name{ min-width:0; }
.student-account-name>small{ color:var(--accent); font-size:.72rem; font-weight:800; text-transform:uppercase; }
.student-account-name h2{ margin:3px 0; overflow:hidden; font-size:1.35rem; text-overflow:ellipsis; white-space:nowrap; }
.student-account-name>p{ margin:0 0 10px; color:var(--text-soft); font-size:.84rem; }
.student-parent-lines{ display:flex; flex-direction:column; gap:5px; font-size:.78rem; }
.student-parent-lines span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.student-parent-lines i{ width:16px; color:var(--text-soft); }
.student-account-metrics{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.student-account-metrics>div{ min-width:0; display:flex; flex-direction:column; justify-content:center; gap:5px; padding:16px; border:1px solid var(--border); border-top:3px solid #2563eb; border-radius:8px; background:var(--surface); }
.student-account-metrics>div:nth-child(2){ border-top-color:#16a34a; }
.student-account-metrics>div:nth-child(3){ border-top-color:#d97706; }
.student-account-metrics span{ color:var(--text-soft); font-size:.7rem; font-weight:800; text-transform:uppercase; }
.student-account-metrics strong{ overflow:hidden; font-size:1.08rem; text-overflow:ellipsis; white-space:nowrap; }
.student-account-metrics .student-account-dues{ border:0; border-top:3px solid #dc2626; background:#fff1f2; }
.student-account-metrics .student-account-dues strong{ color:#dc2626; font-size:1.55rem; }
.student-account-metrics .student-account-dues small{ color:#9f1239; font-size:.68rem; }
.student-account-section{ padding:0; margin-bottom:16px; overflow:hidden; }
.student-account-section-head{ display:flex; align-items:center; justify-content:space-between; gap:16px; padding:15px 18px; border-bottom:1px solid var(--border); }
.student-account-section-head h3{ margin:0 0 2px; font-size:1rem; }
.student-account-section-head p{ margin:0; color:var(--text-soft); font-size:.75rem; }
.student-account-section-head>span{ padding:5px 9px; border-radius:999px; color:var(--accent); background:var(--accent-soft); font-size:.7rem; font-weight:800; }
.sp-transaction-scroll{ max-height:590px; overflow:auto; }
.sp-plan-scroll{ max-height:154px; overflow:auto; }
.sp-transaction-scroll thead,.sp-plan-scroll thead{ position:sticky; z-index:2; top:0; background:var(--surface); }
.sp-transaction-table{ min-width:1180px; }
.sp-transaction-table td{ height:54px; }
.sp-description-cell{ min-width:240px; max-width:360px; white-space:normal; }
.student-profile-actions{ display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; margin:0 0 16px; }
.sp-action{ min-height:54px; display:flex; align-items:center; justify-content:center; gap:10px; border:0; border-radius:8px; color:#fff; font-weight:800; cursor:pointer; box-shadow:0 5px 14px rgba(15,23,42,.12); }
.sp-action i{ font-size:1rem; }
.sp-action.collect{ background:#169b62; }
.sp-action.bill{ background:#2563eb; }
.sp-action.edit{ background:#0891b2; }
.sp-action.reminder{ background:#e8790c; }
.sp-action.discount{ background:#7c3aed; }
.sp-action.exit{ background:#dc2626; }
.sp-action.pay{ background:#169b62; }
.sp-action.suspend{ background:#e8790c; }
.sp-action:hover{ filter:brightness(.95); transform:translateY(-1px); }
/* Employee Profile: 3-button action bar + payable (money the school owes) dues box */
.student-profile-actions.emp-actions{ grid-template-columns:repeat(3,minmax(0,1fr)); }
.spx-total-dues.payable.active{ background:linear-gradient(160deg,#0f766e,#0d9488); border-color:#0d9488; }
.spx-total-dues.payable.active>span,
.spx-total-dues.payable.active>strong,
.spx-total-dues.payable.active>small{ color:#fff; }
.spx-total-dues.payable.active>small{ opacity:.85; }
.spx-total-dues.payable.active .spx-dues-tools button{ color:#fff; background:rgba(255,255,255,.18); border-color:rgba(255,255,255,.25); }
/* Employee Profile flows as a normal scrolling page (unlike the student fixed command-centre),
   so every section — including Salary Revision History — stays visible on desktop. */
@media (min-width:1181px){
  .main:has(.emp-profile-page){ height:auto !important; min-height:100vh; overflow:visible !important; }
  .content:has(.emp-profile-page){ height:auto !important; overflow:visible !important; }
  .emp-profile-page{ height:auto !important; overflow:visible !important; display:block !important; }
  .emp-profile-page #spxResult{ height:auto !important; overflow:visible !important; display:block !important; grid-template-rows:none !important; }
  .emp-profile-page .spx-profile-card,
  .emp-profile-page .spx-dashboard-grid{ height:auto !important; overflow:visible !important; }
  .emp-profile-page .spx-transactions{ display:block !important; }
  .emp-profile-page .spx-transaction-scroll{ height:auto !important; max-height:560px; overflow:auto !important; }
  .emp-profile-page .spx-side-panels,
  .emp-profile-page .spx-side-panels>.spx-panel{ overflow:visible !important; }
}

/* ===================== ADMIN DASHBOARD (Employees Command Centre) ===================== */
.adx{ max-width:1720px; margin:0 auto; display:flex; flex-direction:column; gap:16px; }
.adx-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:14px; flex-wrap:wrap; }
.adx-head h2{ margin:0; font-size:1.4rem; }
.adx-head p{ margin:3px 0 0; color:var(--text-soft); font-size:.84rem; }
.adx-filters{ display:flex; gap:8px; flex-wrap:wrap; }
.adx-chip{ padding:7px 13px; border:1px solid var(--border); border-radius:999px; background:var(--surface); font-size:.78rem; font-weight:700; color:var(--text-soft); cursor:pointer; }
.adx-chip.on{ background:var(--accent); border-color:var(--accent); color:#fff; }
.adx-kpis{ display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:13px; }
.adx-kpi{ position:relative; padding:15px; border-radius:14px; background:var(--surface); border:1px solid var(--border); box-shadow:0 4px 14px rgba(15,23,42,.05); overflow:hidden; }
.adx-kpi .ic{ width:38px; height:38px; display:grid; place-items:center; border-radius:11px; font-size:1.05rem; margin-bottom:10px; }
.adx-kpi small{ display:block; color:var(--text-soft); font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.02em; }
.adx-kpi b{ display:block; margin:2px 0 3px; font-size:1.5rem; font-weight:800; line-height:1.1; }
.adx-kpi .sub{ font-size:.72rem; font-weight:700; color:var(--text-soft); }
.adx-trend{ position:absolute; top:15px; right:14px; font-size:.7rem; font-weight:800; padding:2px 7px; border-radius:999px; }
.adx-trend.up{ color:#15803d; background:#dcfce7; } .adx-trend.down{ color:#b91c1c; background:#fee2e2; }
.adx .i-violet{ color:#6d28d9; background:#ede9fe; } .adx .i-green{ color:#16a34a; background:#dcfce7; }
.adx .i-blue{ color:#2563eb; background:#dbeafe; } .adx .i-amber{ color:#d97706; background:#fef3c7; }
.adx .i-red{ color:#dc2626; background:#fee2e2; } .adx .i-teal{ color:#0d9488; background:#ccfbf1; }
.adx-grid{ display:grid; gap:15px; }
.adx-grid.g-3{ grid-template-columns:1.15fr 1fr 1fr; }
.adx-grid.g-2{ grid-template-columns:1.4fr 1fr; }
.adx-grid.g-4{ grid-template-columns:repeat(4,minmax(0,1fr)); }
.adx-panel{ background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:15px 16px; box-shadow:0 4px 14px rgba(15,23,42,.04); display:flex; flex-direction:column; min-height:0; }
.adx-panel > h3{ margin:0 0 2px; font-size:.95rem; display:flex; align-items:center; gap:8px; }
.adx-panel > h3 i{ color:var(--accent); }
.adx-panel > .ps{ margin:0 0 12px; color:var(--text-soft); font-size:.72rem; }
.adx-pill{ margin-left:auto; padding:3px 9px; border-radius:999px; font-size:.66rem; font-weight:800; background:var(--accent-soft); color:var(--accent); }
.adx-pill.warn{ background:#fef3c7; color:#a16207; } .adx-pill.bad{ background:#fee2e2; color:#b91c1c; } .adx-pill.good{ background:#dcfce7; color:#15803d; }
.adx-chartwrap{ position:relative; width:100%; height:206px; }
.adx-rows{ display:flex; flex-direction:column; }
.adx-rl{ display:grid; grid-template-columns:34px 1fr auto; gap:10px; align-items:center; padding:9px 2px; border-bottom:1px solid var(--border); }
.adx-rl:last-child{ border-bottom:0; }
.adx-av{ width:34px; height:34px; border-radius:50%; display:grid; place-items:center; font-weight:800; font-size:.82rem; color:#fff; }
.adx-rl .nm{ font-weight:700; font-size:.85rem; } .adx-rl .nm small{ color:var(--text-soft); font-weight:600; }
.adx-rl .mt{ color:var(--text-soft); font-size:.72rem; }
.adx-rl .amt{ text-align:right; font-weight:800; font-size:.85rem; }
.adx-rl .amt small{ display:block; font-weight:700; font-size:.68rem; color:var(--text-soft); }
.adx-tag{ padding:2px 7px; border-radius:6px; font-size:.66rem; font-weight:800; white-space:nowrap; }
.adx-tag.t-green{ color:#15803d; background:#dcfce7; } .adx-tag.t-red{ color:#b91c1c; background:#fee2e2; }
.adx-tag.t-amber{ color:#a16207; background:#fef3c7; } .adx-tag.t-blue{ color:#1d4ed8; background:#dbeafe; }
.adx-mini{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 2px; border-bottom:1px solid var(--border); font-size:.82rem; }
.adx-mini:last-child{ border-bottom:0; } .adx-mini b{ font-weight:800; } .adx-mini .mt{ color:var(--text-soft); font-size:.72rem; font-weight:700; }
.adx-duerow{ padding:8px 2px; } .adx-duehead{ display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; font-size:.85rem; }
.adx-duehead .nm{ font-weight:700; } .adx-duehead .nm small{ color:var(--text-soft); font-weight:600; } .adx-duehead .amt{ font-weight:800; }
.adx-hbar{ height:7px; border-radius:6px; background:var(--surface-2,#eef2f7); overflow:hidden; }
.adx-hbar i{ display:block; height:100%; border-radius:6px; }
.adx-statline{ display:flex; gap:16px; flex-wrap:wrap; margin-top:4px; }
.adx-statline div{ font-size:.74rem; color:var(--text-soft); font-weight:700; }
.adx-statline b{ color:var(--text); font-size:1rem; display:block; }
.adx-prog{ height:10px; border-radius:6px; background:var(--surface-2,#eef2f7); overflow:hidden; margin-top:8px; display:flex; }
.adx-prog.big{ height:14px; } .adx-prog i{ height:100%; }
.adx-unassigned{ margin-top:11px; font-size:.74rem; color:var(--text-soft); font-weight:700; display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.adx-actions{ margin-top:14px; display:flex; gap:8px; flex-wrap:wrap; }
.adx-empty{ padding:22px 8px; text-align:center; color:var(--text-soft); font-size:.8rem; font-weight:600; }
@media (max-width:1200px){ .adx-kpis{ grid-template-columns:repeat(3,1fr); } .adx-grid.g-3,.adx-grid.g-4,.adx-grid.g-2{ grid-template-columns:1fr 1fr; } }
@media (max-width:700px){ .adx-kpis,.adx-grid.g-3,.adx-grid.g-4,.adx-grid.g-2{ grid-template-columns:1fr; } }
.student-exit-summary{ display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:16px; padding:12px 14px; border:1px solid var(--border); border-radius:8px; background:var(--surface-soft,#f8fafc); }
.student-exit-summary strong{ font-size:1rem; }
.student-exit-summary span{ color:var(--text-soft); font-weight:750; }
.student-exit-fields{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-bottom:14px; }
.student-exit-note{ display:flex; align-items:flex-start; gap:10px; padding:12px 14px; border:1px solid #fed7aa; border-radius:8px; background:#fff7ed; color:#9a3412; font-size:.82rem; line-height:1.45; }
.student-exit-note i{ margin-top:2px; }

@media (max-width:700px){
  .student-exit-fields{ grid-template-columns:1fr; }
  .balance-sheet-grid,.balance-sheet-radio-grid,.balance-form-grid,.balance-review{ grid-template-columns:1fr; }
  .balance-summary-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .balance-form-wide{ grid-column:auto; }
  .balance-sheet-heading{ padding:22px; }
  .balance-sheet-icon{ width:54px; height:54px; flex-basis:54px; border-radius:16px; }
  .balance-sheet-actions{ flex-wrap:wrap; }
  .balance-sheet-actions .push-right{ margin-left:0; }
  .transaction-picker-page{ max-width:none; }
  .transaction-picker-heading{ align-items:flex-start; }
  .transaction-picker-section{ padding:18px; }
  .transaction-picker-section-head{ align-items:flex-start; flex-direction:column; gap:4px; }
  .transaction-date-options,.transaction-category-options{ grid-template-columns:1fr; }
  .transaction-category-choice{ min-height:76px; }
  .transaction-picker-footer{ align-items:stretch; flex-direction:column; }
  .transaction-picker-actions{ display:grid; grid-template-columns:.75fr 1.25fr; }
  .transaction-picker-actions .btn{ width:100%; }
  .balance-ledger-head{ align-items:flex-start; flex-direction:column; }
  .balance-ledger-filters{ grid-template-columns:1fr 1fr; }
  .balance-ledger .table-scroll{ overflow:visible; }
  .balance-ledger-table{ width:100%; min-width:0; table-layout:fixed; font-size:.72rem; }
  .balance-ledger-table th,.balance-ledger-table td{ display:none; padding:.72rem .38rem; white-space:normal; overflow-wrap:anywhere; }
  .balance-ledger-table .ledger-date-col,
  .balance-ledger-table .ledger-category-col,
  .balance-ledger-table .ledger-mobile-amount,
  .balance-ledger-table .ledger-balance-col{ display:table-cell; }
  .balance-ledger-table .ledger-date-col{ width:24%; }
  .balance-ledger-table .ledger-category-col{ width:30%; }
  .balance-ledger-table .ledger-mobile-amount{ width:23%; text-align:right; white-space:nowrap; }
  .balance-ledger-table .ledger-balance-col{ width:23%; text-align:right; white-space:nowrap; }
  .balance-ledger-table .ledger-mobile-subcategory{ display:block; margin-top:3px; color:var(--text-soft); font-size:.64rem; font-weight:600; }
  .student-search-row,.student-payment-bottom,.student-payment-fields{ grid-template-columns:1fr; }
  .student-search-row .btn{ width:100%; }
  .student-compact-card{ grid-template-columns:auto 1fr 1fr; }
  .student-primary{ grid-column:2/-1; }
  .student-fee-heads{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .student-payment-summary{ grid-template-columns:1fr; }
  .student-payment-summary div{ border-right:0; border-bottom:1px solid var(--border); }
  .student-payment-summary div:last-child{ border-bottom:0; }
  .tuition-month-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .category-option-add{ grid-template-columns:1fr; }
  .salary-month-picker{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .salary-employee-summary{ grid-template-columns:1fr 1fr; }
  .student-filter-root{ position:fixed; z-index:120; top:92px; right:12px; left:12px; width:auto; max-height:calc(100vh - 110px); overflow:auto; }
  .student-filter-submenu{ position:static; width:auto; margin:3px 0 6px 12px; border:0; border-left:2px solid var(--border); border-radius:0; box-shadow:none; }
  .admission-form-grid{ grid-template-columns:1fr; }
  .admission-form-grid .field,
  .admission-form-grid .form-field-wide,
  .admission-form-grid [class*="form-col-"]{ grid-column:auto; }
  .bill-generator-form{ padding:16px; }
  .bill-generator-grid,.bill-generator-details{ grid-template-columns:1fr; }
  .bill-registration-row{ grid-template-columns:1fr; }
  .bill-type-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .bill-student-preview{ grid-template-columns:auto 1fr; }
  .bill-student-preview>div:nth-child(n+3){ grid-column:1/-1; }
  .bill-generator-actions{ flex-direction:column-reverse; }
  .bill-generator-actions .btn{ width:100%; }
  .student-profile-searchbar{ position:sticky; grid-template-columns:1fr; gap:10px; padding:13px; }
  .student-profile-search-copy{ display:none; }
  .student-profile-search-row{ grid-template-columns:1fr auto; }
  .student-account-overview{ grid-template-columns:1fr; }
  .student-account-identity{ padding:14px; }
  .student-account-photo{ width:74px; height:88px; }
  .student-account-metrics{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .student-profile-actions{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .sp-transaction-scroll{ max-height:550px; }
}
@media (max-width:420px){
  .balance-summary-grid,.student-fee-heads{ grid-template-columns:1fr; }
  .student-compact-card{ grid-template-columns:auto 1fr; }
  .student-primary{ grid-column:auto; }
  .student-compact-card>div:not(.student-mini-avatar):not(.student-primary){ grid-column:1/-1; }
  .student-fee-line{ grid-template-columns:1fr; gap:7px; }
  .tuition-month-grid{ grid-template-columns:1fr; }
  .salary-month-picker{ grid-template-columns:1fr; }
  .balance-ledger-filters{ grid-template-columns:1fr; }
  .bill-type-grid{ grid-template-columns:1fr; }
  .student-profile-search-row{ grid-template-columns:1fr; }
  .student-profile-search-row .btn{ width:100%; }
  .student-account-metrics{ grid-template-columns:1fr 1fr; }
  .student-account-metrics>div{ padding:12px; }
  .student-account-metrics .student-account-dues strong{ font-size:1.25rem; }
  .student-profile-actions{ grid-template-columns:1fr 1fr; }
  .sp-action{ min-height:50px; padding:8px; font-size:.78rem; }
}

/* ---------- Secure messaging ---------- */
.message-page{ max-width:1000px; margin:0 auto; }
.message-toolbar{ display:flex; align-items:center; justify-content:space-between; gap:20px; padding:22px 24px; }
.message-toolbar h2{ margin:0 0 4px; }
.message-toolbar p{ margin:0; color:var(--text-soft); }
.message-tabs{ display:flex; gap:8px; margin:16px 0 10px; }
.message-tabs button{ display:flex; align-items:center; gap:8px; border:1px solid var(--border); background:var(--surface); color:var(--text-soft); border-radius:10px; padding:10px 14px; font-weight:750; cursor:pointer; }
.message-tabs button.active{ color:#fff; background:var(--accent); border-color:var(--accent); }
.message-tabs button span{ display:grid; place-items:center; min-width:20px; height:20px; padding:0 5px; border-radius:999px; background:#dc2626; color:#fff; font-size:.7rem; }
.message-list{ padding:0; overflow:hidden; }
.message-row{ width:100%; display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; gap:14px; padding:15px 18px; border:0; border-bottom:1px solid var(--border); background:var(--surface); color:var(--text); text-align:left; cursor:pointer; }
.message-row:last-child{ border-bottom:0; }
.message-row:hover{ background:var(--surface-2); }
.message-row.unread{ box-shadow:inset 4px 0 var(--accent); background:color-mix(in srgb,var(--accent) 5%,var(--surface)); }
.message-avatar{ width:40px; height:40px; display:grid; place-items:center; border-radius:12px; background:var(--accent-soft); color:var(--accent); font-weight:850; }
.message-copy{ min-width:0; display:flex; flex-direction:column; gap:3px; }
.message-meta{ display:flex; align-items:center; gap:8px; }
.message-subject{ font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.message-copy small{ color:var(--text-soft); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.message-date{ color:var(--text-soft); font-size:.78rem; white-space:nowrap; }
.message-detail-meta{ display:grid; gap:6px; padding:12px 14px; border-radius:10px; background:var(--surface-2); font-size:.86rem; }
.message-detail-body{ margin-top:16px; white-space:normal; line-height:1.7; }
@media (max-width:600px){
  .message-toolbar{ align-items:flex-start; flex-direction:column; }
  .message-row{ grid-template-columns:38px minmax(0,1fr); }
  .message-date{ grid-column:2; }
}
.photo-preview-empty{ display:grid; place-items:center; background:var(--bg-soft, #f1f5f9); color:var(--muted, #94a3b8); font-size:1.2rem; }
.file-field input[type="file"]{ flex:1; padding:.4rem; }


/* ---------- Student profile command centre ---------- */
.spx-page{ max-width:1680px; margin:0 auto; }
.spx-searchbar{ position:sticky; z-index:30; top:0; display:grid; grid-template-columns:44px minmax(340px,640px) 44px; justify-content:center; align-items:center; gap:0; padding:10px 18px; margin-bottom:16px; border-top:3px solid var(--accent); box-shadow:0 8px 24px rgba(15,23,42,.08); }
.spx-searchbar .field{ margin:0; }
.spx-searchbar .field label{ display:none; }
.spx-searchbar .field small{ display:block; margin-top:4px; color:var(--text-soft); text-align:center; font-size:.68rem; }
.spx-searchbar .input{ height:44px; border-radius:0; text-align:center; }
.spx-nav-button{ width:44px; height:44px; display:grid; place-items:center; border:1px solid var(--border); background:var(--surface); color:var(--text); cursor:pointer; }
.spx-nav-button:first-child{ border-radius:8px 0 0 8px; border-right:0; }
.spx-nav-button:nth-of-type(2){ border-radius:0 8px 8px 0; border-left:0; }
.spx-nav-button:hover{ color:var(--accent); background:var(--accent-soft); }
.spx-profile-card{ display:grid; grid-template-columns:minmax(350px,1.1fr) minmax(390px,1.2fr) minmax(300px,.9fr) 235px; align-items:stretch; gap:18px; padding:22px; margin-bottom:16px; overflow:hidden; }
.spx-identity{ min-width:0; display:grid; grid-template-columns:160px minmax(0,1fr); align-items:center; gap:18px; padding-right:18px; border-right:1px solid var(--border); }
.spx-photo-wrap{ position:relative; width:154px; height:154px; padding:5px; border:4px solid #d1d5db; border-radius:50%; background:var(--surface); }
.spx-photo-wrap.is-present{ border-color:#22c55e; }
.spx-photo-wrap.is-absent{ border-color:#ef4444; }
.spx-photo-wrap.is-unmarked{ border-color:#d1d5db; }
.spx-photo{ width:100%; height:100%; display:grid; place-items:center; overflow:hidden; border-radius:50%; background:#e9eef6; color:var(--accent); font-size:2rem; font-weight:850; }
.spx-photo img{ width:100%; height:100%; object-fit:cover; }
.spx-photo-wrap>span{ position:absolute; right:50%; bottom:-13px; min-width:max-content; padding:5px 10px; border-radius:999px; transform:translateX(50%); color:#fff; background:#9ca3af; font-size:.68rem; font-weight:800; }
.spx-photo-wrap.is-present>span{ background:#16a34a; }
.spx-photo-wrap.is-absent>span{ background:#ef4444; }
.spx-identity-copy{ min-width:0; }
.spx-identity-copy>small{ display:block; color:var(--accent); font-size:.7rem; font-weight:800; }
.spx-identity-copy>strong{ display:block; margin:2px 0 8px; font-size:.82rem; }
.spx-identity-copy h2{ margin:0 0 8px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:1.55rem; }
.spx-identity-copy>p{ display:inline-block; margin:0 0 16px; padding:5px 9px; border-radius:999px; background:var(--accent-soft); color:var(--accent); font-size:.72rem; font-weight:800; }
.spx-identity-copy dl{ margin:0; display:grid; gap:10px; }
.spx-identity-copy dl div{ min-width:0; padding-top:9px; border-top:1px solid var(--border); }
.spx-identity-copy dt{ margin-bottom:2px; color:var(--text-soft); font-size:.65rem; font-weight:750; text-transform:uppercase; }
.spx-identity-copy dd{ margin:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.76rem; font-weight:700; }
.spx-details{ display:grid; grid-template-columns:1fr 1fr; align-content:center; }
.spx-details>div{ min-width:0; display:grid; grid-template-columns:26px minmax(0,1fr); gap:8px; padding:12px 10px; border-bottom:1px solid var(--border); }
.spx-details>div:nth-last-child(-n+2){ border-bottom:0; }
.spx-details i{ margin-top:2px; color:#64748b; text-align:center; }
.spx-details span{ min-width:0; color:var(--text-soft); font-size:.65rem; font-weight:750; }
.spx-details strong{ display:block; margin-top:3px; overflow:hidden; color:var(--text); font-size:.76rem; font-style:normal; text-overflow:ellipsis; white-space:nowrap; }
.spx-details em{ display:inline-block; padding:3px 7px; border-radius:999px; font-style:normal; }
.spx-details .yes,.spx-details .active{ color:#15803d; background:#dcfce7; }
.spx-details .no,.spx-details .inactive{ color:#dc2626; background:#fee2e2; }
.spx-fee-stats{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.spx-fee-stats>div{ min-width:0; display:grid; grid-template-columns:34px minmax(0,1fr); align-items:center; gap:9px; padding:14px 12px; border:1px solid var(--border); border-radius:8px; background:#fbfdff; }
.spx-fee-stats>div>i{ width:34px; height:34px; display:grid; place-items:center; border-radius:8px; color:#7c3aed; background:#ede9fe; }
.spx-fee-stats .discount>i{ color:#d97706; background:#fef3c7; }
.spx-fee-stats .previous>i{ color:#ea580c; background:#ffedd5; }
.spx-fee-stats .after>i{ color:#2563eb; background:#dbeafe; }
.spx-fee-stats span{ min-width:0; color:var(--text-soft); font-size:.65rem; font-weight:750; }
.spx-fee-stats strong{ display:block; margin-top:6px; overflow:hidden; color:var(--text); font-size:.92rem; text-overflow:ellipsis; white-space:nowrap; }
.spx-fee-stats strong small{ font-size:.64rem; }
.spx-total-dues{ min-width:0; display:flex; flex-direction:column; justify-content:center; padding:22px; border:1px solid #fecaca; border-radius:8px; background:#fff1f2; }
.spx-total-dues span{ color:#dc2626; font-size:.78rem; font-weight:800; }
.spx-total-dues strong{ display:block; margin:18px 0; overflow:hidden; color:#dc2626; font-size:2.1rem; text-overflow:ellipsis; white-space:nowrap; }
.spx-total-dues small{ color:#9f1239; font-size:.72rem; }
.spx-total-dues.inactive{ border-color:#d1d5db; background:#f3f4f6; }
.spx-total-dues.inactive span,.spx-total-dues.inactive strong,.spx-total-dues.inactive small{ color:#6b7280; }
.spx-dashboard-grid{ display:grid; grid-template-columns:minmax(0,1.35fr) minmax(460px,.85fr); gap:16px; margin-bottom:16px; }
.spx-side-panels{ min-width:0; display:grid; gap:16px; align-content:start; }
.spx-panel{ padding:0; overflow:hidden; }
.spx-panel>header{ display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 18px; border-bottom:1px solid var(--border); }
.spx-panel>header h3{ margin:0 0 2px; font-size:.98rem; }
.spx-panel>header h3 i{ width:20px; color:var(--accent); }
.spx-panel>header p{ margin:0; color:var(--text-soft); font-size:.7rem; }
.spx-panel>header>span{ flex:none; padding:5px 9px; border-radius:999px; color:var(--accent); background:var(--accent-soft); font-size:.67rem; font-weight:800; }
.spx-panel>header>.spx-fallback{ color:#a16207; background:#fef3c7; }
.spx-transaction-scroll{ height:540px; overflow:auto; }
.spx-transaction-scroll thead,.spx-plan-scroll thead{ position:sticky; z-index:2; top:0; background:var(--surface); }
.spx-transaction-table{ min-width:1120px; }
.spx-transaction-table td{ height:52px; }
.spx-description{ min-width:220px; max-width:340px; white-space:normal; }
.spx-attendance-body{ position:relative; padding:16px; }
.spx-day-list{ width:100%; display:grid; grid-template-columns:repeat(10,minmax(0,1fr)); gap:4px; }
.spx-day-list>div{ display:flex; min-width:0; flex-direction:column; align-items:center; gap:6px; }
.spx-day-list small{ color:var(--text-soft); font-size:.58rem; white-space:nowrap; }
.spx-day-list b{ width:26px; height:26px; display:grid; place-items:center; border-radius:50%; color:#fff; background:#9ca3af; font-size:.68rem; }
.spx-day-list .present b{ background:#22a65a; }
.spx-day-list .absent b{ background:#ef4444; }
.spx-day-list .unmarked b{ color:#64748b; background:#e5e7eb; }
.spx-attendance-totals{ display:flex; justify-content:center; gap:18px; margin-top:16px; color:var(--text-soft); font-size:.68rem; }
.spx-attendance-score{ display:grid; grid-template-columns:auto 1fr; align-items:center; gap:20px; margin-top:16px; padding-top:15px; border-top:1px solid var(--border); }
.spx-donut{ --score:0; width:82px; height:82px; display:grid; place-items:center; border-radius:50%; background:conic-gradient(#7c3aed calc(var(--score) * 1%),#e5e7eb 0); }
.spx-donut:before{ content:""; grid-area:1/1; width:62px; height:62px; border-radius:50%; background:var(--surface); }
.spx-donut strong{ z-index:1; grid-area:1/1; color:#7c3aed; font-size:.82rem; }
.spx-attendance-score>div:last-child{ display:flex; flex-direction:column; gap:4px; }
.spx-attendance-score small{ color:var(--text-soft); font-size:.7rem; }
.spx-attendance-score>div:last-child strong{ color:#7c3aed; font-size:1.45rem; }
.spx-exam-layout{ display:grid; grid-template-columns:minmax(0,1fr) 180px; gap:14px; padding:12px 16px 16px; }
.spx-exam-layout table{ width:100%; border-collapse:collapse; font-size:.69rem; }
.spx-exam-layout th,.spx-exam-layout td{ padding:9px 6px; border-bottom:1px solid var(--border); text-align:left; }
.spx-exam-layout th{ color:var(--text-soft); font-size:.62rem; text-transform:uppercase; }
.spx-exam-layout td:last-child{ display:grid; grid-template-columns:minmax(48px,1fr) 30px; align-items:center; gap:6px; }
.spx-progress{ height:4px; overflow:hidden; border-radius:999px; background:#e5e7eb; }
.spx-progress i{ display:block; height:100%; border-radius:999px; background:var(--bar); }
.spx-exam-averages{ display:grid; gap:8px; }
.spx-exam-averages>div{ display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px; border:1px solid #dbeafe; border-radius:8px; color:#2563eb; background:#eff6ff; }
.spx-exam-averages .tone-1{ color:#7c3aed; border-color:#ddd6fe; background:#f5f3ff; }
.spx-exam-averages .tone-2{ color:#ea580c; border-color:#fed7aa; background:#fff7ed; }
.spx-exam-averages span{ font-size:.68rem; font-weight:750; }
.spx-exam-averages small{ display:block; margin-top:2px; font-size:.58rem; font-weight:600; }
.spx-exam-averages strong{ font-size:.9rem; }
.spx-actions{ position:sticky; z-index:20; bottom:8px; margin-bottom:16px; }
.spx-plan-scroll{ max-height:150px; overflow:auto; }
.spx-plans{ margin-bottom:16px; }

@media (max-width:1450px){
  .spx-profile-card{ grid-template-columns:minmax(350px,1fr) minmax(390px,1.1fr) minmax(440px,1fr); }
  .spx-total-dues{ grid-column:3; min-height:130px; }
  .spx-fee-stats{ grid-column:3; grid-row:1; }
  .spx-total-dues{ grid-row:2; }
  .spx-identity,.spx-details{ grid-row:1/3; }
  .spx-dashboard-grid{ grid-template-columns:1fr; }
  .spx-side-panels{ grid-template-columns:1fr 1fr; }
  .spx-transaction-scroll{ height:470px; }
}
@media (max-width:1100px){
  .spx-profile-card{ grid-template-columns:1fr 1fr; }
  .spx-identity,.spx-details,.spx-fee-stats,.spx-total-dues{ grid-column:auto; grid-row:auto; }
  .spx-identity{ border-right:0; }
  .spx-side-panels{ grid-template-columns:1fr; }
}
@media (max-width:700px){
  .spx-searchbar{ grid-template-columns:40px minmax(0,1fr) 40px; padding:9px; }
  .spx-nav-button{ width:40px; height:44px; }
  .spx-searchbar .field small{ display:none; }
  .spx-profile-card{ grid-template-columns:1fr; gap:14px; padding:14px; }
  .spx-identity,.spx-details,.spx-fee-stats,.spx-total-dues{ grid-column:auto; }
  .spx-identity{ grid-template-columns:108px minmax(0,1fr); padding-right:0; }
  .spx-photo-wrap{ width:104px; height:104px; }
  .spx-photo-wrap>span{ bottom:-10px; padding:4px 7px; font-size:.58rem; }
  .spx-identity-copy h2{ font-size:1.2rem; }
  .spx-details{ grid-template-columns:1fr 1fr; }
  .spx-details>div{ padding:10px 5px; }
  .spx-fee-stats{ grid-template-columns:1fr 1fr; }
  .spx-total-dues{ min-height:120px; }
  .spx-total-dues strong{ margin:10px 0; font-size:1.7rem; }
  .spx-panel>header{ align-items:flex-start; padding:12px; }
  .spx-day-list{ min-width:450px; }
  .spx-attendance-body{ overflow-x:auto; }
  .spx-attendance-totals,.spx-attendance-score{ min-width:450px; }
  .spx-exam-layout{ grid-template-columns:1fr; }
  .spx-exam-averages{ grid-template-columns:repeat(3,minmax(0,1fr)); }
  .spx-exam-averages>div{ align-items:flex-start; flex-direction:column; }
  .spx-actions{ position:static; }
}
@media (max-width:430px){
  .spx-identity{ grid-template-columns:1fr; justify-items:center; text-align:center; }
  .spx-identity-copy{ width:100%; }
  .spx-identity-copy dl{ text-align:left; }
  .spx-details,.spx-fee-stats{ grid-template-columns:1fr; }
  .spx-details>div:nth-last-child(-n+2){ border-bottom:1px solid var(--border); }
  .spx-details>div:last-child{ border-bottom:0; }
  .spx-exam-averages{ grid-template-columns:1fr; }
}


/* Real class attendance register */
.attendance-page{ display:grid; gap:16px; }
.attendance-toolbar{ padding:20px; display:flex; align-items:flex-end; justify-content:space-between; gap:20px; }
.attendance-toolbar h2,.attendance-delegation h3,.attendance-history h3,.attendance-register-head h3{ margin:0; letter-spacing:0; }
.attendance-toolbar h2 i,.attendance-delegation h3 i,.attendance-history h3 i{ color:var(--accent); margin-right:8px; }
.attendance-toolbar p,.attendance-delegation p,.attendance-history p,.attendance-register-head p{ margin:5px 0 0; color:var(--text-soft); }
.attendance-filters{ display:grid; grid-template-columns:145px 165px 115px auto; align-items:end; gap:10px; min-width:min(100%,650px); }
.attendance-filters .field{ margin:0; }
.attendance-delegation{ padding:16px 20px; display:grid; grid-template-columns:minmax(250px,.75fr) minmax(500px,1.25fr); align-items:center; gap:24px; border-left:4px solid #f59e0b; }
.attendance-delegation-form{ display:grid; grid-template-columns:minmax(190px,.75fr) minmax(220px,1fr) auto 44px 44px; gap:10px; align-items:center; }
.attendance-context{ padding:0; overflow:hidden; min-height:180px; }
.attendance-register-head{ padding:17px 20px; display:flex; align-items:center; justify-content:space-between; gap:16px; border-bottom:1px solid var(--border); background:var(--surface-2); }
.attendance-register-head>span{ padding:8px 10px; border:1px solid #bfdbfe; border-radius:7px; background:#eff6ff; color:#1d4ed8; font-weight:700; font-size:.84rem; }
.attendance-bulk{ display:flex; justify-content:space-between; align-items:center; padding:12px 20px; border-bottom:1px solid var(--border); }
.attendance-bulk>span{ color:var(--text-soft); font-weight:700; }
.attendance-roster{ max-height:530px; overflow:auto; }
.attendance-student{ display:grid; grid-template-columns:34px 42px minmax(180px,1fr) auto; align-items:center; gap:12px; min-height:65px; padding:9px 20px; border-bottom:1px solid var(--border); }
.attendance-student:last-child{ border-bottom:0; }
.attendance-student:hover{ background:var(--surface-2); }
.attendance-sn{ color:var(--text-soft); font-size:.83rem; }
.attendance-avatar{ width:38px; height:38px; display:grid; place-items:center; border-radius:50%; overflow:hidden; background:color-mix(in srgb,var(--accent) 13%,var(--surface)); color:var(--accent); font-weight:800; }
.attendance-avatar img{ width:100%; height:100%; object-fit:cover; }
.attendance-student-name{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.attendance-student-name strong{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.attendance-student-name small{ color:var(--text-soft); }
.attendance-choice{ display:grid; grid-template-columns:1fr 1fr; gap:8px; width:240px; }
.attendance-choice input{ position:absolute; opacity:0; pointer-events:none; }
.attendance-choice span{ height:38px; display:flex; align-items:center; justify-content:center; gap:7px; border:1px solid var(--border); border-radius:7px; cursor:pointer; font-weight:700; font-size:.86rem; transition:.15s ease; }
.attendance-choice .present input:checked+span{ border-color:#22c55e; background:#dcfce7; color:#15803d; }
.attendance-choice .absent input:checked+span{ border-color:#ef4444; background:#fee2e2; color:#b91c1c; }
.attendance-savebar{ display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 20px; border-top:1px solid var(--border); background:var(--surface-2); }
#attLiveSummary{ color:var(--text-soft); font-weight:700; }
.attendance-denied{ min-height:180px; display:flex; align-items:center; justify-content:center; gap:16px; padding:24px; text-align:left; }
.attendance-denied>i{ width:48px; height:48px; display:grid; place-items:center; border-radius:8px; background:#fff7ed; color:#c2410c; font-size:1.2rem; }
.attendance-history{ overflow:hidden; }
.attendance-history>header{ padding:16px 20px; border-bottom:1px solid var(--border); }
.attendance-history-table th,.attendance-history-table td{ white-space:nowrap; }
.attendance-count{ min-width:34px; display:inline-grid; place-items:center; padding:5px 8px; border-radius:6px; font-weight:800; }
.attendance-count.present{ background:#dcfce7; color:#15803d; }
.attendance-count.absent{ background:#fee2e2; color:#b91c1c; }
@media(max-width:1100px){
  .attendance-toolbar{ align-items:stretch; flex-direction:column; }
  .attendance-filters{ min-width:0; }
  .attendance-delegation{ grid-template-columns:1fr; }
}
@media(max-width:720px){
  .attendance-toolbar,.attendance-delegation{ padding:14px; }
  .attendance-filters{ grid-template-columns:1fr 1fr; }
  .attendance-filters .btn{ width:100%; }
  .attendance-delegation-form{ grid-template-columns:1fr; }
  .attendance-delegation-form .btn{ width:100%; }
  .attendance-register-head{ align-items:flex-start; flex-direction:column; }
  .attendance-student{ grid-template-columns:24px 38px 1fr; padding:10px 12px; }
  .attendance-choice{ grid-column:2/4; width:100%; }
  .attendance-savebar{ align-items:stretch; flex-direction:column; }
  .attendance-savebar .btn{ width:100%; }
}


/* Student Profile: fixed desktop command centre; only transaction ledger scrolls. */
@media (min-width:1181px){
  .content:has(.spx-page){ height:calc(100vh - var(--topbar-h)); min-height:0; overflow:hidden; padding:12px 18px; }
  .spx-page{ height:100%; min-height:0; display:grid; grid-template-rows:auto minmax(0,1fr); gap:10px; }
  .spx-searchbar{ position:relative; top:auto; min-height:54px; margin:0; padding:6px 14px; }
  .spx-searchbar .input,.spx-nav-button{ height:40px; }
  #spxResult{ min-height:0; display:grid; grid-template-rows:auto minmax(0,1fr) auto; gap:10px; }
  .spx-profile-card{ min-height:0; margin:0; padding:12px 14px; gap:10px; grid-template-columns:minmax(285px,1.08fr) minmax(310px,1.12fr) minmax(270px,.9fr) minmax(175px,.62fr); }
  .spx-identity{ min-width:0; grid-template-columns:116px minmax(0,1fr); gap:12px; padding-right:10px; }
  .spx-photo-wrap{ width:112px; height:112px; border-width:3px; }
  .spx-identity-copy h2{ margin-bottom:5px; font-size:1.25rem; }
  .spx-identity-copy>p{ margin-bottom:8px; padding:4px 7px; }
  .spx-identity-copy dl{ gap:5px; }
  .spx-identity-copy dl div{ padding-top:5px; }
  .spx-details>div{ padding:7px 6px; }
  .spx-fee-stats{ gap:7px; }
  .spx-fee-stats>div{ grid-template-columns:29px minmax(0,1fr); gap:7px; padding:8px; }
  .spx-fee-stats>div>i{ width:29px; height:29px; }
  .spx-fee-stats strong{ margin-top:3px; font-size:.82rem; }
  .spx-total-dues{ min-height:0; padding:14px; }
  .spx-total-dues strong{ margin:10px 0; font-size:1.7rem; }
  .spx-dashboard-grid{ min-height:0; margin:0; gap:10px; grid-template-columns:minmax(0,1.35fr) minmax(390px,.85fr); }
  .spx-transactions{ min-height:0; display:grid; grid-template-rows:auto minmax(0,1fr); }
  .spx-transaction-scroll{ height:auto; min-height:0; overflow:auto; overscroll-behavior:contain; }
  .spx-side-panels{ min-height:0; gap:10px; grid-template-columns:1fr; grid-template-rows:minmax(0,.9fr) minmax(0,1.1fr); overflow:hidden; }
  .spx-side-panels>.spx-panel{ min-height:0; overflow:hidden; }
  .spx-panel>header{ padding:9px 12px; }
  .spx-attendance-body{ min-width:0; padding:10px 12px; overflow:hidden; }
  .spx-attendance-score{ margin-top:9px; padding-top:9px; }
  .spx-donut{ width:68px; height:68px; }
  .spx-donut:before{ width:50px; height:50px; }
  .spx-exam-layout{ padding:7px 12px 10px; gap:10px; grid-template-columns:minmax(0,1fr) 150px; }
  .spx-exam-layout th,.spx-exam-layout td{ padding:5px; }
  .spx-exam-averages{ gap:5px; }
  .spx-exam-averages>div{ padding:7px; }
  .spx-actions{ position:relative; bottom:auto; min-height:50px; margin:0; gap:8px; }
  .spx-action{ min-height:50px; }
}

/* Actual recently opened records, shown before a profile is selected. */
.spx-recent-empty{ min-height:260px; display:flex; flex-direction:column; align-items:center; justify-content:center; color:var(--text-soft); text-align:center; }
.spx-recent-empty i{ margin-bottom:12px; color:var(--accent); font-size:2rem; }
.spx-recent-empty h2{ margin:0 0 6px; color:var(--text); }
.spx-recent-empty p{ margin:0; }
.spx-recent>header{ display:flex; align-items:center; justify-content:space-between; gap:14px; margin:4px 0 10px; }
.spx-recent>header h2{ margin:0; font-size:1rem; }
.spx-recent>header h2 i{ margin-right:8px; color:var(--accent); }
.spx-recent>header p{ margin:3px 0 0; color:var(--text-soft); font-size:.72rem; }
.spx-recent>header>span{ padding:5px 9px; border-radius:999px; color:var(--accent); background:var(--accent-soft); font-size:.7rem; font-weight:800; }
.spx-recent-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.spx-recent-card{ min-width:0; display:grid; grid-template-columns:58px 130px minmax(220px,1fr) 105px 112px; align-items:center; gap:10px; padding:10px; cursor:pointer; transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease; }
.spx-recent-card:hover,.spx-recent-card:focus-visible{ border-color:rgba(124,58,237,.38); box-shadow:0 8px 22px rgba(79,70,229,.1); transform:translateY(-1px); outline:none; }
.spx-recent-photo{ width:56px; height:56px; display:grid; place-items:center; overflow:hidden; border:3px solid #dbe2ea; border-radius:50%; color:var(--accent); background:var(--accent-soft); font-size:1.2rem; }
.spx-recent-photo img{ width:100%; height:100%; object-fit:cover; }
.spx-recent-name{ min-width:0; }
.spx-recent-name h3{ margin:0 0 2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.9rem; }
.spx-recent-name>strong{ display:block; color:var(--text-soft); font-size:.7rem; }
.spx-recent-name>span{ display:inline-block; margin-top:5px; padding:2px 6px; border-radius:999px; font-size:.62rem; font-weight:800; }
.spx-recent-name .active{ color:#15803d; background:#dcfce7; }
.spx-recent-name .inactive{ color:#6b7280; background:#e5e7eb; }
.spx-recent-card dl{ min-width:0; margin:0; display:grid; gap:4px; }
.spx-recent-card dl div{ min-width:0; }
.spx-recent-card dt,.spx-recent-money small,.spx-recent-open small{ color:var(--text-soft); font-size:.58rem; font-weight:750; text-transform:uppercase; }
.spx-recent-card dd{ margin:1px 0 0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.68rem; font-weight:700; }
.spx-recent-money{ display:grid; gap:2px; }
.spx-recent-money strong{ font-size:.78rem; }
.spx-recent-money .due{ color:#dc2626; }
.spx-recent-money .paid{ color:#15803d; }
.spx-recent-open{ display:flex; flex-direction:column; align-items:stretch; gap:7px; text-align:right; }
.spx-row-chevron{ align-self:flex-end; width:30px; height:30px; display:grid; place-items:center; border:1px solid var(--border); border-radius:50%; color:var(--accent); background:var(--surface); transition:transform .18s ease,border-color .18s ease; }
.spx-recent-card:hover .spx-row-chevron,.spx-recent-card:focus-visible .spx-row-chevron{ border-color:var(--accent); transform:translateX(2px); }
@media(max-width:1180px){.spx-recent-grid{ grid-template-columns:1fr; }}
@media(max-width:760px){.spx-recent-card{ grid-template-columns:52px minmax(0,1fr) auto; }.spx-recent-card dl{ grid-column:1/-1; }.spx-recent-money{ grid-column:1/3; }.spx-recent-grid{ grid-template-columns:1fr; }}

@media (min-width:1181px) and (max-width:1550px){.spx-recent-card{grid-template-columns:50px minmax(0,1fr) 105px}.spx-recent-photo{width:48px;height:48px}.spx-recent-card dl{grid-column:1/-1;grid-template-columns:repeat(3,minmax(0,1fr))}.spx-recent-money{grid-column:1/3;grid-template-columns:auto 1fr auto 1fr;align-items:center;gap:7px}.spx-recent-open{grid-column:3;grid-row:2}.spx-recent-grid{grid-template-columns:1fr 1fr}}

@media (min-width:1181px){
  .main:has(.spx-page){height:100vh;min-height:0;overflow:hidden}
  .content:has(.spx-page){height:auto;min-height:0;flex:1;box-sizing:border-box}
  .spx-page,#spxResult{min-height:0;overflow:hidden}
  #spxResult{height:100%;grid-template-rows:clamp(210px,24vh,260px) minmax(0,1fr) 50px}
  .spx-profile-card,.spx-dashboard-grid{height:100%;overflow:hidden}
  .spx-actions{height:50px}
}


/* Student profile reference alignment: compact icon search and ledger dashboard. */
.spx-searchbar{position:relative;display:flex;justify-content:flex-end;min-height:76px;padding:12px 16px;border-top:0;margin-bottom:16px}
.spx-search-controls{display:flex;align-items:center;gap:10px;margin-left:auto}
.spx-nav-button{border:1px solid var(--border)!important;border-radius:50%!important;width:42px;height:42px;background:var(--surface)}
.spx-search-field{position:absolute;right:166px;top:50%;width:min(560px,calc(100% - 205px));display:grid;grid-template-columns:32px minmax(0,1fr);align-items:center;opacity:0;visibility:hidden;transform:translateY(-50%) translateX(12px);transition:.2s ease}
.spx-search-field>i{z-index:1;grid-area:1/1;color:var(--text-soft);text-align:right}
.spx-search-field .input{grid-area:1/1/2/3;height:44px;padding-left:42px;text-align:left;border-radius:8px}
.spx-searchbar.search-open .spx-search-field{opacity:1;visibility:visible;transform:translateY(-50%) translateX(0)}
.spx-searchbar.is-profile{display:flex}
.profile-scope-switch{--scope-color:#16a34a;--scope-soft:rgba(22,163,74,.11);position:relative;width:218px;min-width:218px;height:48px;padding:4px 10px 5px;border:1px solid color-mix(in srgb,var(--scope-color) 32%,var(--border));border-radius:14px;background:linear-gradient(135deg,var(--scope-soft),rgba(255,255,255,.94));box-shadow:0 5px 15px color-mix(in srgb,var(--scope-color) 10%,transparent);transition:opacity .18s ease,transform .18s ease,border-color .18s ease,background .18s ease}
.profile-scope-switch.is-active{--scope-color:#16a34a;--scope-soft:rgba(22,163,74,.11)}
.profile-scope-switch.is-both{--scope-color:#6366f1;--scope-soft:rgba(99,102,241,.11)}
.profile-scope-switch.is-inactive{--scope-color:#dc2626;--scope-soft:rgba(220,38,38,.1)}
.profile-scope-labels{display:grid;grid-template-columns:repeat(3,1fr);align-items:center;gap:2px}
.profile-scope-labels button{min-width:0;padding:0 2px;border:0;background:transparent;color:var(--text-soft);font:800 .66rem/20px inherit;letter-spacing:.01em;cursor:pointer;transition:color .15s ease,transform .15s ease}
.profile-scope-labels button[aria-pressed="true"]{border-radius:7px;background:rgba(255,255,255,.88);color:var(--scope-color);box-shadow:0 2px 6px color-mix(in srgb,var(--scope-color) 13%,transparent);transform:translateY(-1px)}
.profile-scope-switch input[type="range"]{-webkit-appearance:none;appearance:none;display:block;width:calc(100% - 14px);height:13px;margin:0 7px;padding:0;background:transparent;cursor:grab;touch-action:none}
.profile-scope-switch input[type="range"]:active{cursor:grabbing}
.profile-scope-switch input[type="range"]::-webkit-slider-runnable-track{height:5px;border-radius:999px;background:color-mix(in srgb,var(--scope-color) 32%,#e2e8f0)}
.profile-scope-switch input[type="range"]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:15px;height:15px;margin-top:-5px;border:3px solid #fff;border-radius:50%;background:var(--scope-color);box-shadow:0 1px 5px rgba(15,23,42,.3)}
.profile-scope-switch input[type="range"]::-moz-range-track{height:5px;border:0;border-radius:999px;background:color-mix(in srgb,var(--scope-color) 32%,#e2e8f0)}
.profile-scope-switch input[type="range"]::-moz-range-thumb{width:11px;height:11px;border:3px solid #fff;border-radius:50%;background:var(--scope-color);box-shadow:0 1px 5px rgba(15,23,42,.3)}
.profile-scope-switch:focus-within{outline:3px solid color-mix(in srgb,var(--scope-color) 18%,transparent);outline-offset:2px}
.spx-searchbar.search-open .profile-scope-switch{opacity:0;visibility:hidden;pointer-events:none;transform:translateX(10px)}
.spx-identity-copy>p{display:flex;flex-wrap:wrap;gap:0;margin-bottom:14px;padding:0;overflow:hidden;background:var(--accent-soft)}
.spx-identity-copy>p span{padding:5px 8px}
.spx-identity-copy>p span+span:before{content:"·";margin-right:8px;color:var(--accent)}
.spx-identity-copy dl{gap:7px}
.spx-identity-copy dl div{display:grid;grid-template-columns:22px minmax(0,1fr);align-items:center;gap:7px;padding-top:7px}
.spx-identity-copy dl i{color:#111827;text-align:center}
.spx-identity-copy dd{font-size:.74rem}
.spx-details{grid-template-rows:repeat(3,1fr)}
.spx-total-dues{position:relative;padding-top:54px}
.spx-dues-tools{position:absolute;top:12px;right:12px;display:flex;gap:7px}
.spx-dues-tools button,.spx-dues-search button{width:32px;height:32px;display:grid;place-items:center;border:1px solid rgba(100,116,139,.25);border-radius:50%;background:rgba(255,255,255,.82);color:var(--text);cursor:pointer}
.spx-dues-tools button:hover,.spx-dues-search button:hover{color:var(--accent);border-color:var(--accent)}
.spx-dues-search{position:absolute;z-index:2;top:50px;left:12px;right:12px;display:grid;grid-template-columns:minmax(0,1fr) 34px;gap:6px;opacity:0;visibility:hidden;transform:translateY(-5px);transition:.18s ease}
.spx-dues-search .input{height:34px;padding:6px 9px;background:#fff}
.spx-total-dues.search-open .spx-dues-search{opacity:1;visibility:visible;transform:none}
.spx-total-dues.search-open>span,.spx-total-dues.search-open>strong,.spx-total-dues.search-open>small{opacity:.12}
.spx-donut{position:relative;width:92px;height:92px;box-shadow:inset 0 0 0 1px rgba(124,58,237,.08)}
.spx-donut:before{width:68px;height:68px;box-shadow:0 0 0 1px rgba(124,58,237,.08)}
.spx-donut strong{font-size:.9rem;font-weight:850}
.spx-attendance-score{grid-template-columns:92px minmax(0,1fr);gap:18px}
.spx-recent-grid{grid-template-columns:1fr;gap:12px}
.spx-recent-card{grid-template-columns:78px 155px minmax(155px,.8fr) minmax(240px,1.35fr) minmax(185px,1fr) 125px 132px;gap:14px;padding:14px 16px}
.spx-recent-photo{width:72px;height:72px}
.spx-recent-fact{min-width:0;display:grid;grid-template-columns:22px minmax(0,1fr);gap:8px;align-items:start;padding-left:12px;border-left:1px solid var(--border)}
.spx-recent-fact>i{margin-top:2px;color:#334155;text-align:center}
.spx-recent-fact span{min-width:0;display:grid;gap:5px}
.spx-recent-fact b,.spx-recent-fact small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.69rem}
.spx-recent-fact small{color:var(--text-soft)}
.spx-recent-fact small i{width:14px;color:#334155;text-align:center}
.spx-recent-fact em{font-style:normal}.spx-recent-fact .yes{color:#15803d}.spx-recent-fact .no{color:#dc2626}
@media(max-width:1250px){.spx-recent-card{grid-template-columns:66px minmax(130px,1fr) repeat(2,minmax(170px,1fr)) 120px}.spx-recent-photo{width:62px;height:62px}.spx-recent-fact:nth-of-type(5){grid-column:3}.spx-recent-money{grid-column:4}.spx-recent-open{grid-column:5}.spx-recent-fact:nth-of-type(4){display:none}}
@media(max-width:760px){.spx-searchbar{min-height:62px;padding-left:8px;padding-right:8px}.spx-search-field{right:130px;width:calc(100% - 145px)}.spx-search-controls{gap:4px}.spx-nav-button{width:34px;height:34px}.profile-scope-switch{width:166px;min-width:166px;height:44px;padding:3px 6px 4px;border-radius:12px}.profile-scope-labels button{font-size:.57rem;line-height:18px}.profile-scope-switch input[type="range"]{height:12px;margin:0 5px;width:calc(100% - 10px)}.spx-recent-card{grid-template-columns:58px minmax(0,1fr) auto}.spx-recent-photo{width:56px;height:56px}.spx-recent-fact{grid-column:1/-1;border-left:0;border-top:1px solid var(--border);padding:9px 0 0}.spx-recent-money{grid-column:1/3}.spx-recent-open{grid-column:3}.spx-total-dues{padding-top:54px}}
@media(max-width:390px){.profile-scope-switch{width:146px;min-width:146px}.profile-scope-labels button{font-size:.52rem}.spx-nav-button{width:32px;height:32px}}


@media (min-width:1181px){
  .spx-page:has(.spx-searchbar:not(.is-profile)){grid-template-rows:auto minmax(0,1fr)}
  #spxResult:has(.spx-recent),#spxResult:has(.spx-recent-empty){display:block;height:auto;overflow:auto;padding-right:3px}
  .spx-total-dues{padding:54px 14px 14px}
  .spx-donut{width:88px;height:88px}
  .spx-donut:before{width:64px;height:64px}
}
@media (min-width:1181px) and (max-width:1450px){
  .spx-recent-card{grid-template-columns:66px 140px minmax(140px,.8fr) minmax(210px,1.25fr) minmax(165px,1fr) 115px 122px;gap:10px;padding:12px}
  .spx-recent-photo{width:62px;height:62px}
}


/* Recent profile list: compact reference layout with complete facts. */
.spx-recent-subline{margin-top:6px!important;color:var(--text)!important;font-weight:650!important;text-transform:none!important;letter-spacing:0!important}
.spx-recent-subline i{width:15px;color:var(--text-soft)}
.spx-recent-facilities{display:grid!important;grid-template-columns:1fr!important;gap:7px!important}
.spx-facility-line{display:grid;grid-template-columns:18px auto 1fr;align-items:center;gap:5px;min-width:0;font-size:.72rem}
.spx-facility-line>i{color:var(--text-soft);text-align:center}
.spx-facility-line>b{white-space:nowrap}
.spx-facility-line>em{justify-self:start;padding:2px 7px;border-radius:5px;font-style:normal;font-weight:800;line-height:1.35}
.spx-facility-line>em.yes{color:#15803d;background:#dcfce7}
.spx-facility-line>em.no{color:#dc2626;background:#fee2e2}
.spx-facility-line>strong{font-size:.73rem;white-space:nowrap}
.spx-recent-money{gap:9px}
.spx-recent-money>div{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;gap:7px;min-width:0}
.spx-recent-money>div>i{display:grid;place-items:center;width:28px;height:28px;border-radius:6px;color:#2563eb;background:#eff6ff}
.spx-recent-money>div>span{display:grid;gap:1px;min-width:0}
.spx-recent-money>div.due>i{color:#dc2626;background:#fef2f2}
.spx-recent-money>div.paid>i{color:#15803d;background:#f0fdf4}
.spx-recent-money>div.due strong{color:#dc2626}
.spx-recent-money>div.paid strong{color:#15803d}
.spx-last-viewed{display:flex;justify-content:flex-end;align-items:flex-start;gap:6px;color:var(--text-soft)}
.spx-last-viewed>i{margin-top:2px}
.spx-last-viewed>span{display:grid;gap:1px;text-align:left}
.spx-last-viewed strong{font-size:.68rem;color:var(--text);white-space:nowrap;text-transform:none}
@media(max-width:1250px){.spx-recent-fact:nth-of-type(4){display:grid!important}}
@media(max-width:760px){.spx-last-viewed{justify-content:flex-start}.spx-recent-open{align-items:stretch;text-align:left}}


/* Student profile reference: registration under photo and fitted transaction ledger. */
.spx-photo-column{min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:22px}
.spx-registration{display:block;color:var(--text);font-size:.82rem;font-weight:850;letter-spacing:0;text-align:center;white-space:nowrap}
.spx-identity-copy h2{margin-top:0}
.spx-transaction-scroll{overflow-x:hidden!important;overflow-y:auto!important}
.spx-transaction-table{width:100%!important;min-width:0!important;table-layout:fixed}
.spx-transaction-table th,.spx-transaction-table td{padding-left:8px!important;padding-right:8px!important;vertical-align:middle;overflow-wrap:anywhere;word-break:normal}
.spx-transaction-table th:nth-child(1){width:9%}
.spx-transaction-table th:nth-child(2){width:8%}
.spx-transaction-table th:nth-child(3){width:10%}
.spx-transaction-table th:nth-child(4){width:14%}
.spx-transaction-table th:nth-child(5){width:27%}
.spx-transaction-table th:nth-child(6){width:8%}
.spx-transaction-table th:nth-child(7){width:8%}
.spx-transaction-table th:nth-child(8){width:10%}
.spx-transaction-table th:nth-child(9){width:6%}
.spx-description{min-width:0!important;max-width:none!important;white-space:normal!important;line-height:1.45}
.spx-transaction-view{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:5px 7px;border:0;border-radius:5px;color:#7c3aed;background:#f3e8ff;font:inherit;font-size:.66rem;font-weight:800;cursor:pointer;white-space:nowrap}
.spx-transaction-view:hover{color:#fff;background:#7c3aed}
@media(min-width:1181px){
  #spxResult{grid-template-rows:clamp(260px,27vh,290px) minmax(0,1fr) 50px}
  .spx-profile-card{grid-template-columns:minmax(330px,1.15fr) minmax(290px,1.02fr) minmax(255px,.85fr) minmax(180px,.62fr)}
  .spx-identity{grid-template-columns:128px minmax(0,1fr)}
  .spx-dashboard-grid{grid-template-columns:minmax(0,1.62fr) minmax(350px,.72fr)}
  .spx-attendance-body{min-width:0;overflow:hidden}
  .spx-day-list{width:100%;grid-template-columns:repeat(10,minmax(0,1fr));gap:3px}
  .spx-day-list b{width:24px;height:24px}
  .spx-donut{width:68px;height:68px}
  .spx-donut:before{width:50px;height:50px}
  .spx-attendance-score{grid-template-columns:68px minmax(0,1fr);gap:12px}
}
@media(max-width:760px){.spx-photo-column{gap:20px}.spx-transaction-scroll{overflow-x:auto!important}.spx-transaction-table{min-width:760px!important}}

/* Keep Total Dues readable while profile search expands toward the fee cards. */
@media(min-width:1451px){
  .spx-total-dues.search-open{z-index:6}
  .spx-dues-search{top:12px;right:calc(100% + 10px);left:auto;width:min(350px,calc(100vw - 520px));padding:4px;border:1px solid rgba(124,58,237,.2);border-radius:8px;background:rgba(255,255,255,.72);box-shadow:0 8px 22px rgba(15,23,42,.1)}
  .spx-dues-search .input{background:rgba(255,255,255,.78)}
  .spx-profile-card:has(.spx-total-dues.search-open) .spx-fee-stats{opacity:.68;transition:opacity .18s ease}
  .spx-total-dues.search-open>span,.spx-total-dues.search-open>strong,.spx-total-dues.search-open>small{opacity:1}
}

/* ============================================================
 * ATTENDANCE PAGES (Student / Class / Hostel / Teachers)
 * ============================================================ */
.att-page{ display:flex; flex-direction:column; gap:1rem; }

/* --- Stat cards row --- */
.att-stat-row{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:.8rem;
}
.att-stat{
  background:var(--surface); border:1px solid var(--border); border-radius:12px;
  padding:.85rem 1rem; display:flex; align-items:center; gap:.75rem;
  box-shadow:0 2px 6px rgba(15,23,42,.04);
}
.att-stat-icon{
  width:42px; height:42px; border-radius:10px; display:flex; align-items:center;
  justify-content:center; font-size:1.1rem; flex-shrink:0;
}
.att-stat-icon.tint-blue{ background:rgba(37,99,235,.12); color:#2563EB; }
.att-stat-icon.tint-green{ background:rgba(22,163,74,.12); color:#16A34A; }
.att-stat-icon.tint-red{ background:rgba(220,38,38,.12); color:#DC2626; }
.att-stat-icon.tint-slate{ background:rgba(100,116,139,.12); color:#64748B; }
.att-stat-icon.tint-indigo{ background:rgba(79,70,229,.12); color:#4F46E5; }
.att-stat-icon.tint-purple{ background:rgba(147,51,234,.12); color:#9333EA; }
.att-stat-icon.tint-cyan{ background:rgba(8,145,178,.12); color:#0891B2; }
.att-stat-body{ display:flex; flex-direction:column; min-width:0; }
.att-stat-body span{ font-size:.75rem; color:var(--text-soft); font-weight:600; white-space:nowrap; }
.att-stat-body strong{ font-size:1.25rem; font-weight:800; color:var(--text); }

/* --- Toolbar (tabs + filters) --- */
.att-toolbar{
  background:var(--surface); border:1px solid var(--border); border-radius:12px;
  padding:.75rem; display:flex; flex-direction:column; gap:.75rem;
}
.att-tabs{ display:flex; gap:.4rem; }
.att-tab{
  background:transparent; border:1.5px solid var(--border); color:var(--text-soft);
  padding:.55rem 1rem; border-radius:999px; font-weight:600; font-size:.85rem;
  cursor:pointer; display:flex; align-items:center; gap:.5rem; transition:all .18s;
}
.att-tab:hover{ background:var(--surface-2); color:var(--text); }
.att-tab.active{ background:var(--accent); border-color:var(--accent); color:#fff; }

.att-filters{
  display:flex; flex-wrap:wrap; align-items:center; gap:.6rem;
}
.att-search{
  position:relative; flex:1 1 260px; min-width:220px;
}
.att-search i{ position:absolute; left:.75rem; top:50%; transform:translateY(-50%); color:var(--text-soft); font-size:.85rem; }
.att-search .input{ padding-left:2.2rem; }

.att-field{
  display:flex; align-items:center; gap:.4rem;
  background:var(--surface-2); border:1px solid var(--border); border-radius:8px;
  padding:.35rem .6rem; font-size:.82rem;
}
.att-field i{ color:var(--text-soft); font-size:.8rem; }
.att-field label{ color:var(--text-soft); font-weight:600; margin:0; }
.att-field .input{ border:none; background:transparent; padding:.15rem .3rem; font-size:.85rem; min-width:80px; }

/* --- Grid --- */
.att-grid-scroll{ overflow-x:auto; background:var(--surface); border:1px solid var(--border); border-radius:12px; }
.att-grid{ width:100%; border-collapse:collapse; font-size:.82rem; }
.att-grid thead th{
  background:var(--surface-2); color:var(--text-soft); font-weight:700; font-size:.72rem;
  text-transform:uppercase; letter-spacing:.4px; padding:.65rem .5rem; text-align:center;
  border-bottom:2px solid var(--border); white-space:nowrap; position:sticky; top:0; z-index:2;
}
.att-grid th.att-sn, .att-grid th.att-reg{ text-align:center; }
.att-grid th.att-name{ text-align:left; padding-left:.85rem; }
.att-grid tbody td{
  padding:.55rem .5rem; text-align:center; border-bottom:1px solid var(--border);
  color:var(--text); vertical-align:middle;
}
.att-grid tbody tr:hover{ background:var(--surface-2); }
.att-grid .att-sn{ font-weight:700; color:var(--text-soft); }
.att-grid .att-name{ text-align:left; padding-left:.85rem; }
.att-grid .att-name a{ color:var(--accent); font-weight:600; text-decoration:none; }
.att-grid .att-name a:hover{ text-decoration:underline; }
.att-grid .att-reg{ color:var(--text-soft); font-weight:600; }
.att-grid .att-present{ font-weight:700; color:var(--text); white-space:nowrap; }
.att-grid .att-present strong{ color:var(--accent); }

/* Day header cells (M/T/W over 1/2/3…) */
.att-day-head{ padding:.35rem .3rem !important; min-width:32px; }
.att-day-head small{ display:block; font-size:.6rem; color:var(--text-soft); font-weight:600; margin-bottom:.15rem; }
.att-day-head span{ font-size:.85rem; font-weight:700; color:var(--text); }
.att-day-head.is-sun small, .att-day-head.is-sun span{ color:#94A3B8; }
.att-day-head.is-today{ background:rgba(37,99,235,.08); border-bottom-color:#2563EB; }
.att-day-head.is-today span{ color:#2563EB; }

/* Attendance cells */
.att-cell{ font-weight:700; padding:.5rem .3rem !important; min-width:32px; font-size:.85rem; }
.att-cell.is-p{ color:#16A34A; }
.att-cell.is-a{ color:#DC2626; }
.att-cell.is-h{ color:#F59E0B; }
.att-cell.is-sun{ background:rgba(148,163,184,.05); color:#94A3B8; }
.att-cell.is-today{ background:rgba(37,99,235,.06); }

/* Percentage pill */
.att-pct{ font-weight:700; font-size:.82rem; white-space:nowrap; }
.att-pct.pct-good{ color:#16A34A; }
.att-pct.pct-warn{ color:#F59E0B; }
.att-pct.pct-bad{ color:#DC2626; }

/* History table (monthly percents by session) */
.att-grid-history th.is-current{ background:rgba(37,99,235,.1); color:#2563EB; }
.att-grid-history th.is-current small{ display:block; font-size:.55rem; margin-top:.15rem; color:#2563EB; opacity:.85; }
.att-overall{ text-align:right !important; padding-right:.85rem !important; }
.att-overall strong{ display:block; font-weight:800; }
.att-overall small{ display:block; font-size:.7rem; color:var(--text-soft); }

/* Sick / assembly-absent marker for hostel evening */
.att-cell.is-sick{ color:#F59E0B; font-weight:900; }
/* Leave marker for teacher attendance */
.att-cell.is-leave{ color:#9333EA; }

/* Access note banner */
.att-note{ display:flex; align-items:center; gap:.5rem; padding:.6rem .9rem; background:rgba(245,158,11,.1); color:#B45309; border-radius:8px; font-size:.85rem; font-weight:600; margin-top:.4rem; }

/* Leave button in take-modal */
.he-btn.he-l.active{ background:#9333EA; border-color:#9333EA; color:#fff; }

/* --- Attendance Settings page --- */
.as-intro h2{ display:flex; align-items:center; gap:.6rem; font-size:1.3rem; }
.as-intro p{ color:var(--text-soft); margin-top:.3rem; }
.as-card{ background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:1.1rem 1.2rem; box-shadow:0 2px 6px rgba(15,23,42,.04); }
.as-card header{ display:flex; align-items:center; gap:.6rem; margin-bottom:.8rem; }
.as-card header i{ color:var(--accent); font-size:1.05rem; }
.as-card header h3{ font-size:1rem; font-weight:700; }
.as-hint{ font-size:.82rem; color:var(--text-soft); margin-bottom:.7rem; }
.as-row{ display:flex; flex-wrap:wrap; gap:1rem; }
.as-row .field{ flex:1 1 180px; }
.as-chips{ display:flex; flex-wrap:wrap; gap:.5rem; margin-bottom:.7rem; }
.as-chip{ display:inline-flex; align-items:center; gap:.4rem; background:var(--accent-soft); color:var(--accent); padding:.35rem .7rem; border-radius:999px; font-size:.85rem; font-weight:600; }
.as-chip button{ background:none; border:none; color:var(--accent); cursor:pointer; padding:0; display:flex; opacity:.7; }
.as-chip button:hover{ opacity:1; }
.as-empty{ color:var(--text-soft); font-size:.85rem; font-style:italic; }
.as-add{ display:flex; gap:.5rem; flex-wrap:wrap; }
.as-add .input{ flex:1 1 200px; }
.as-days{ display:flex; flex-wrap:wrap; gap:.6rem; }
.as-day{ display:flex; align-items:center; gap:.4rem; padding:.5rem .8rem; background:var(--surface-2); border:1px solid var(--border); border-radius:8px; font-weight:600; font-size:.85rem; cursor:pointer; }
.as-day input{ accent-color:var(--accent); }
.as-holidays{ display:flex; flex-direction:column; gap:.4rem; }
.as-holiday{ display:flex; align-items:center; gap:.8rem; padding:.55rem .8rem; background:var(--surface-2); border:1px solid var(--border); border-radius:8px; }
.as-holiday span{ color:var(--text-soft); font-size:.85rem; min-width:130px; }
.as-holiday strong{ flex:1; font-size:.9rem; }
.as-holiday button{ background:none; border:none; color:#DC2626; cursor:pointer; opacity:.7; }
.as-holiday button:hover{ opacity:1; }
.as-savebar{ display:flex; justify-content:flex-end; padding-top:.4rem; }
.btn-lg{ padding:.75rem 1.5rem; font-size:1rem; }

/* --- Hostel Evening take-modal --- */
.he-modal{ display:flex; flex-direction:column; gap:.6rem; }
.he-bulk{ display:flex; align-items:center; gap:.8rem; padding:.5rem .8rem; background:var(--surface-2); border-radius:8px; }
.he-bulk span{ margin-left:auto; font-size:.85rem; font-weight:600; color:var(--text-soft); }
.he-roster{ display:flex; flex-direction:column; gap:.35rem; max-height:60vh; overflow-y:auto; padding:.2rem; }
.he-row{ display:flex; align-items:center; gap:.75rem; padding:.6rem .8rem; background:var(--surface); border:1px solid var(--border); border-radius:10px; }
.he-sn{ width:28px; text-align:center; font-weight:700; color:var(--text-soft); }
.he-info{ flex:1; display:flex; flex-direction:column; min-width:0; }
.he-info strong{ font-size:.95rem; color:var(--text); }
.he-info small{ font-size:.75rem; color:var(--text-soft); }
.he-choice{ display:flex; gap:.35rem; }
.he-btn{
  width:44px; height:36px; border-radius:8px; border:2px solid var(--border);
  font-weight:800; font-size:1rem; cursor:pointer; background:var(--surface);
  color:var(--text-soft); transition:all .15s;
}
.he-btn:hover{ transform:translateY(-1px); }
.he-btn.he-p.active{ background:#16A34A; border-color:#16A34A; color:#fff; }
.he-btn.he-a.active{ background:#DC2626; border-color:#DC2626; color:#fff; }
.he-btn.he-s.active{ background:#F59E0B; border-color:#F59E0B; color:#fff; }

/* ============================================================
 * ATTENDANCE ROSTER — shared professional take-attendance overlay
 * ============================================================ */
html.attendance-roster-open,
html.attendance-roster-open body{
  overflow:hidden !important;
  overscroll-behavior:none;
}
.ar-overlay{
  position:fixed; inset:0; z-index:200; background:rgba(15,23,42,.55);
  display:flex; align-items:center; justify-content:center; padding:2vh 2vw;
  animation:arFade .18s ease;
}
@keyframes arFade{ from{opacity:0} to{opacity:1} }
.ar-panel{
  background:var(--surface); border-radius:16px; width:min(720px,96vw); max-height:96vh;
  display:flex; flex-direction:column; overflow:hidden; box-shadow:0 24px 60px rgba(15,23,42,.35);
}
.ar-head{
  display:flex; align-items:flex-start; gap:1rem; padding:1.1rem 1.3rem;
  border-bottom:1px solid var(--border); background:var(--accent); color:#fff;
}
.ar-head h2{ font-size:1.15rem; font-weight:800; }
.ar-head p{ font-size:.82rem; opacity:.9; margin-top:.15rem; }
.ar-close{ margin-left:auto; background:rgba(255,255,255,.2); border:none; color:#fff; width:34px; height:34px; border-radius:8px; cursor:pointer; font-size:1rem; flex-shrink:0; }
.ar-close:hover{ background:rgba(255,255,255,.35); }
.ar-toolbar{
  display:flex; flex-wrap:wrap; align-items:center; gap:.6rem;
  padding:.75rem 1.1rem; border-bottom:1px solid var(--border); background:var(--surface-2);
}
.ar-search{ position:relative; flex:1 1 200px; min-width:160px; }
.ar-search i{ position:absolute; left:.7rem; top:50%; transform:translateY(-50%); color:var(--text-soft); font-size:.82rem; }
.ar-search .input{ padding-left:2.1rem; }
.ar-legend{ display:flex; gap:.7rem; flex-wrap:wrap; margin-left:auto; font-size:.75rem; color:var(--text-soft); }
.ar-legend-item{ display:flex; align-items:center; gap:.3rem; }
.ar-dot{ width:11px; height:11px; border-radius:3px; display:inline-block; }
.ar-dot.is-p{ background:#16A34A; } .ar-dot.is-a{ background:#DC2626; }
.ar-dot.is-s{ background:#F59E0B; } .ar-dot.is-l{ background:#9333EA; }
.ar-roster{ flex:1; overflow-y:auto; padding:.7rem 1.1rem; display:flex; flex-direction:column; gap:.4rem; }
.ar-row{
  display:flex; align-items:center; gap:.85rem; padding:.6rem .8rem;
  border:1px solid var(--border); border-radius:12px; background:var(--surface);
  transition:box-shadow .15s, border-color .15s;
}
.ar-row.focused{ border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-soft); }
.ar-sn{ width:26px; text-align:center; font-weight:700; color:var(--text-soft); flex-shrink:0; }
.ar-avatar{
  width:40px; height:40px; border-radius:50%; background:var(--accent-soft); color:var(--accent);
  display:flex; align-items:center; justify-content:center; font-weight:800; flex-shrink:0; overflow:hidden;
}
.ar-avatar img{ width:100%; height:100%; object-fit:cover; }
.ar-info{ flex:1; min-width:0; display:flex; flex-direction:column; }
.ar-info strong{ font-size:.95rem; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ar-info small{ font-size:.75rem; color:var(--text-soft); }
.ar-choice{ display:flex; gap:.4rem; flex-shrink:0; }
.ar-btn{
  min-width:64px; padding:.5rem .7rem; border-radius:9px; border:2px solid var(--border);
  font-weight:700; font-size:.82rem; cursor:pointer; background:var(--surface); color:var(--text-soft);
  transition:all .14s; white-space:nowrap;
}
.ar-btn:hover{ transform:translateY(-1px); }
.ar-btn.is-p.active{ background:#16A34A; border-color:#16A34A; color:#fff; }
.ar-btn.is-a.active{ background:#DC2626; border-color:#DC2626; color:#fff; }
.ar-btn.is-s.active{ background:#F59E0B; border-color:#F59E0B; color:#fff; }
.ar-btn.is-l.active{ background:#9333EA; border-color:#9333EA; color:#fff; }
.ar-savebar{
  display:flex; align-items:center; gap:1rem; padding:.85rem 1.3rem;
  border-top:1px solid var(--border); background:var(--surface-2);
}
.ar-counter{ font-weight:600; font-size:.85rem; color:var(--text-soft); }
.ar-actions{ margin-left:auto; display:flex; gap:.6rem; }
@media(max-width:560px){
  .ar-overlay{
    align-items:stretch; justify-content:stretch; padding:0;
    background:var(--surface); animation:none;
  }
  .ar-panel{
    width:100%; height:100vh; height:100dvh; max-height:none;
    border-radius:0; box-shadow:none;
  }
  .ar-head{
    flex:0 0 auto; align-items:center; gap:.75rem;
    padding:calc(12px + env(safe-area-inset-top)) 14px 12px;
  }
  .ar-head h2{ margin:0; font-size:1.12rem; line-height:1.2; }
  .ar-head p{ margin:.2rem 0 0; font-size:.8rem; line-height:1.25; }
  .ar-close{ width:44px; height:44px; border-radius:10px; font-size:1.05rem; }
  .ar-toolbar{
    flex:0 0 auto; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:8px; padding:10px 12px;
  }
  .ar-search{ grid-column:1/-1; width:100%; min-width:0; }
  .ar-search .input{ min-height:48px; font-size:16px; }
  .ar-toolbar > .btn{
    width:100%; min-width:0; min-height:44px; padding:8px 10px;
    font-size:.88rem; white-space:normal;
  }
  .ar-legend{ display:none; }
  .ar-roster{
    min-height:0; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch; touch-action:pan-y;
    padding:10px 12px; gap:8px; scrollbar-gutter:stable;
  }
  .ar-row{
    display:grid; grid-template-columns:28px 44px minmax(0,1fr);
    grid-template-areas:"sn avatar info" "choice choice choice";
    align-items:center; gap:7px 10px; padding:10px;
  }
  .ar-sn{ grid-area:sn; width:28px; }
  .ar-avatar{ grid-area:avatar; width:44px; height:44px; }
  .ar-info{ grid-area:info; width:100%; }
  .ar-info strong{ font-size:1rem; line-height:1.25; }
  .ar-info small{ margin-top:2px; font-size:.8rem; line-height:1.3; white-space:normal; }
  .ar-choice{
    grid-area:choice; display:grid;
    grid-template-columns:repeat(auto-fit,minmax(74px,1fr));
    gap:7px; width:100%; min-width:0;
  }
  .ar-btn{
    width:100%; min-width:0; min-height:44px; padding:7px 6px;
    font-size:.82rem; line-height:1.18; white-space:normal;
  }
  .ar-btn:hover{ transform:none; }
  .ar-savebar{
    flex:0 0 auto; display:grid; grid-template-columns:1fr;
    gap:8px; padding:9px 12px calc(9px + env(safe-area-inset-bottom));
  }
  .ar-counter{ display:block; min-width:0; font-size:.8rem; line-height:1.35; }
  .ar-actions{
    display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);
    gap:8px; width:100%; margin:0;
  }
  .ar-actions .btn{ width:100%; min-width:0; min-height:48px; padding:9px; font-size:.92rem; white-space:normal; }
}

/* --- Attendance Dashboard ---------------------------------------------
   The whole dashboard is meant to sit inside ONE screen: no page scroll,
   the three rows share the available height and the charts stretch to fill
   whatever is left over. ------------------------------------------------ */
/* flex:none is essential — .content is a flex item with flex:1, which would
   otherwise stretch past this height and push the lower cards off-screen. */
.content:has(.adash-page){
  flex:none; height:calc(100vh - var(--topbar-h)); max-height:calc(100vh - var(--topbar-h));
  min-height:0; overflow:hidden; padding:12px 16px; box-sizing:border-box;
}
.adash-page{ height:100%; min-height:0; display:flex; flex-direction:column; gap:10px; overflow:hidden; }
.adash-page>.adash-trend{ flex:1 1 57%; min-height:0; }
.adash-page>.adash-two-col:first-of-type{ flex:1 1 31%; min-height:0; }
.adash-page>.adash-two-col:last-of-type{ flex:0 0 auto; }

.adash-trend{ padding:0; overflow:hidden; display:flex; flex-direction:column; }
.adash-head{
  display:flex; align-items:center; justify-content:space-between; gap:.9rem;
  flex-wrap:nowrap; padding:9px 16px; flex:0 0 auto;
}
.adash-head h2{ margin:0; font-size:1.02rem; white-space:nowrap; }
.adash-head p{ margin:0; color:var(--text-soft); font-size:.74rem; white-space:nowrap; }
.adash-head-right{ display:flex; align-items:center; gap:.7rem; flex-wrap:nowrap; }
.adash-legend{ display:inline-flex; align-items:center; gap:.35rem; font-size:.74rem; font-weight:600; color:var(--text-soft); white-space:nowrap; }
.adash-dot{ width:14px; height:3px; border-radius:2px; display:inline-block; }
.adash-dot.green{ background:#16a34a; } .adash-dot.blue{ background:#2563eb; }
.adash-period{ min-height:30px; padding:3px 8px; font-size:.76rem; width:auto; }

.adash-charts{ position:relative; padding:0 18px 4px; flex:1; min-height:0; display:flex; flex-direction:column; }
.adash-axis-label{ font-size:.75rem; font-weight:800; margin:0 0 2px; flex:0 0 auto; }
.adash-axis-label.green{ color:#16a34a; }
.adash-axis-label.blue{ color:#2563eb; }
.adash-axis-label.bottom{ margin:2px 0 0; }
.adash-chart-top{ flex:1 1 56%; min-height:0; }
.adash-chart-bottom{ flex:1 1 44%; min-height:0; border-top:1px solid var(--border); padding-top:2px; }

.adash-stats{
  flex:0 0 auto;
  display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:10px;
  padding:6px 16px 7px; border-top:1px solid var(--border); background:var(--surface-2);
}
.adash-stat{ background:var(--surface); border:1px solid var(--border); border-radius:9px; padding:5px 10px; }
.adash-stat-title{ display:flex; align-items:center; gap:.4rem; font-size:.74rem; font-weight:700; margin-bottom:.25rem; }
.adash-stat-row{ display:flex; gap:1rem; }
.adash-stat-row>div{ flex:1; }
.adash-stat-row span{ display:block; font-size:.68rem; color:var(--text-soft); font-weight:600; }
.adash-stat-row strong{ font-size:.92rem; font-weight:800; font-variant-numeric:tabular-nums; }
.adash-note{
  display:flex; align-items:center; gap:.5rem; padding:7px 11px;
  background:var(--surface); border:1px solid var(--border); border-radius:10px;
  font-size:.72rem; color:var(--text-soft);
}
.adash-note i{ color:var(--accent); }

/* --- Attendance Dashboard: lists, highlights, exports --- */
.adash-two-col{ display:grid; grid-template-columns:1fr 1fr; gap:10px; min-height:0; }
.adash-list{ padding:0; overflow:hidden; display:flex; flex-direction:column; min-height:0; }
.adash-list-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; padding:10px 14px; flex:0 0 auto; }
.adash-list-title{ display:flex; align-items:flex-start; gap:.7rem; }
.adash-list-title h3{ margin:0; font-size:1rem; }
.adash-list-title p{ margin:.15rem 0 0; font-size:.78rem; color:var(--text-soft); }
.adash-list-icon{ width:34px; height:34px; flex:0 0 34px; border-radius:10px; display:grid; place-items:center; font-size:.9rem; }
.adash-list-icon.red{ background:rgba(220,38,38,.12); color:#dc2626; }
.adash-list-icon.green{ background:rgba(22,163,74,.12); color:#16a34a; }
.adash-list-icon.violet{ background:var(--accent-soft); color:var(--accent); }
.adash-link{ border:0; background:none; color:var(--accent); font:inherit; font-size:.8rem; font-weight:700; cursor:pointer; white-space:nowrap; display:inline-flex; align-items:center; gap:.35rem; }
.adash-link:hover{ text-decoration:underline; }
.adash-list-foot{ padding:7px 14px; text-align:center; border-top:1px solid var(--border); flex:0 0 auto; }

/* Fixed layout + % widths → the table can never push a column out of view. */
.adash-list .table-scroll{ flex:1; min-height:0; overflow-y:auto; overflow-x:hidden; }
.adash-table{ font-size:.75rem; width:100%; table-layout:fixed; }
.adash-table th{ font-size:.62rem; position:sticky; top:0; background:var(--surface-2); z-index:1; }
.adash-table th,.adash-table td{ padding:.45rem .4rem; vertical-align:middle; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.adash-details{ white-space:normal; color:var(--text-soft); line-height:1.25; font-size:.7rem; }

/* Immediate Follow-up: Student | Class/Room | Issue | Details | Last Att | Actions */
.adash-followup th:nth-child(1),.adash-followup td:nth-child(1){ width:25%; }
.adash-followup th:nth-child(2),.adash-followup td:nth-child(2){ width:14%; }
.adash-followup th:nth-child(3),.adash-followup td:nth-child(3){ width:14%; }
.adash-followup th:nth-child(4),.adash-followup td:nth-child(4){ width:21%; }
.adash-followup th:nth-child(5),.adash-followup td:nth-child(5){ width:14%; }
.adash-followup th:nth-child(6),.adash-followup td:nth-child(6){ width:12%; }

/* Returned Today: Student | Class/Room | Absent | Returned On | Prev Att | Actions */
.adash-returned th:nth-child(1),.adash-returned td:nth-child(1){ width:25%; }
.adash-returned th:nth-child(2),.adash-returned td:nth-child(2){ width:15%; }
.adash-returned th:nth-child(3),.adash-returned td:nth-child(3){ width:12%; }
.adash-returned th:nth-child(4),.adash-returned td:nth-child(4){ width:17%; }
.adash-returned th:nth-child(5),.adash-returned td:nth-child(5){ width:17%; }
.adash-returned th:nth-child(6),.adash-returned td:nth-child(6){ width:14%; }
.adash-student{ display:flex; align-items:center; gap:.55rem; }
.adash-student strong{ display:block; font-size:.82rem; white-space:nowrap; }
.adash-student small{ font-size:.68rem; color:var(--text-soft); }
.adash-avatar{
  width:28px; height:28px; flex:0 0 28px; border-radius:50%; overflow:hidden;
  background:var(--accent-soft); color:var(--accent);
  display:grid; place-items:center; font-weight:800; font-size:.74rem;
}
.adash-avatar img{ width:100%; height:100%; object-fit:cover; }
.adash-issue{ display:inline-block; padding:3px 9px; border-radius:999px; font-size:.68rem; font-weight:800; white-space:nowrap; }
.adash-issue.danger{ background:rgba(220,38,38,.12); color:#dc2626; }
.adash-issue.warn{ background:rgba(234,88,12,.14); color:#c2410c; }
.adash-issue.info{ background:rgba(37,99,235,.12); color:#2563eb; }
.adash-issue.leave{ background:rgba(202,138,4,.16); color:#a16207; }
.adash-issue.muted{ background:var(--surface-2); color:var(--text-soft); }
.adash-absent{ color:#dc2626; }
.adash-acts{ display:flex; gap:.3rem; }
.adash-act{
  width:28px; height:28px; border-radius:8px; border:1px solid var(--border);
  display:grid; place-items:center; background:var(--surface); color:var(--text-soft);
  cursor:pointer; font-size:.78rem; text-decoration:none;
}
.adash-act.wa:hover{ background:#25D366; border-color:#25D366; color:#fff; }
.adash-act.call:hover{ background:#2563eb; border-color:#2563eb; color:#fff; }
.adash-act.view:hover{ background:var(--accent); border-color:var(--accent); color:#fff; }
.adash-act.disabled{ opacity:.35; cursor:not-allowed; }

.adash-tiles{ display:grid; grid-template-columns:repeat(3,1fr); gap:.6rem; padding:0 14px 10px; }
.adash-tile{ display:flex; align-items:flex-start; gap:.6rem; }
.adash-tile-icon{ width:32px; height:32px; flex:0 0 32px; border-radius:10px; display:grid; place-items:center; font-size:.88rem; }
.adash-tile span{ display:block; font-size:.72rem; color:var(--text-soft); font-weight:600; }
.adash-tile strong{ display:block; font-size:.95rem; font-weight:800; margin-top:.1rem; }
.adash-tile strong em{ font-style:normal; font-weight:700; font-size:.9rem; color:var(--text-soft); }
.adash-tile strong em.up{ color:#16a34a; }
.adash-tile small{ display:block; font-size:.7rem; color:var(--text-soft); margin-top:.1rem; }

.adash-exports{ display:grid; grid-template-columns:1fr 1fr; gap:.45rem; padding:0 14px 10px; }
.adash-export{
  display:flex; align-items:center; gap:.45rem; padding:.42rem .65rem;
  border:1px solid var(--border); border-radius:10px; background:var(--surface);
  color:var(--accent); font:inherit; font-size:.76rem; font-weight:700; cursor:pointer; text-align:left;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.adash-export:hover{ background:var(--accent-soft); }

/* Small screens: let it scroll normally rather than squashing everything. */
@media(max-width:1100px){
  .content:has(.adash-page){ height:auto; overflow:visible; }
  .adash-page{ height:auto; overflow:visible; }
  .adash-two-col{ grid-template-columns:1fr; }
  .adash-chart-top{ height:220px; flex:none; }
  .adash-chart-bottom{ height:190px; flex:none; }
  .adash-list .table-scroll{ overflow-x:auto; }
}

/* --- Form-only page (e.g. New Admission): just a heading, the form, and Save --- */
.form-page{ padding:0; overflow:hidden; }
.form-page.admission-form-page-wide{width:100%;max-width:none;margin-inline:auto}
@media(min-width:1100px){.form-page.admission-form-page-wide .form-page-body{padding-left:14px;padding-right:14px}.form-page.admission-form-page-wide .admission-form-grid{column-gap:12px}}
.form-page-head{ padding:18px 22px; border-bottom:1px solid var(--border); background:var(--surface-2); }
.form-page-head h2{ margin:0; font-size:1.15rem; display:flex; align-items:center; gap:.6rem; }
.form-page-head h2 i{ color:var(--accent); }
.form-page-head p{ margin:.25rem 0 0; color:var(--text-soft); font-size:.85rem; }
.form-page-body{ padding:20px 22px; }
.form-page-actions{
  display:flex; justify-content:flex-end; gap:.7rem;
  padding:14px 22px; border-top:1px solid var(--border); background:var(--surface-2);
  position:sticky; bottom:0;
}

/* --- Coming-soon placeholder for menu items not built yet --- */
.empty-state.coming-soon{ padding:2.6rem 1.5rem; }
.empty-state.coming-soon i{ font-size:2.2rem; opacity:.5; }
.empty-state.coming-soon p{ margin:.5rem 0; }
.empty-state.coming-soon .badge{ margin-top:.8rem; display:inline-block; }

/* --- Employee salary month badges (Employees page) --- */
.sal-badge{ display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; border-radius:6px; font-weight:800; font-size:.8rem; }
.sal-badge.paid{ background:rgba(22,163,74,.14); color:#16A34A; }
.sal-badge.due{ background:rgba(220,38,38,.14); color:#DC2626; }
.sal-badge.na{ background:var(--surface-2); color:var(--text-soft); }
.data-table td .has-dues{ color:#DC2626; }
.data-table td .paid{ color:#16A34A; }

/* --- Attendance pagination --- */
.att-pagination{
  display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap;
  padding:.7rem 1rem; background:var(--surface); border:1px solid var(--border); border-top:none;
  border-radius:0 0 12px 12px;
}
.att-page-info{ font-size:.82rem; color:var(--text-soft); font-weight:600; }
.att-page-controls{ display:flex; align-items:center; gap:.35rem; flex-wrap:wrap; }
.att-page-size{ padding:.35rem .5rem; font-size:.82rem; min-width:110px; margin-right:.4rem; }
.att-page-btn{
  min-width:34px; height:34px; padding:0 .5rem; border-radius:8px; border:1px solid var(--border);
  background:var(--surface); color:var(--text); font-weight:600; font-size:.85rem; cursor:pointer; transition:all .14s;
}
.att-page-btn:hover:not([disabled]):not(.active){ background:var(--surface-2); }
.att-page-btn.active{ background:var(--accent); border-color:var(--accent); color:#fff; }
.att-page-btn[disabled]{ opacity:.4; cursor:not-allowed; }
.att-page-dots{ padding:0 .3rem; color:var(--text-soft); }

/* Summary cards on the class-teacher register (before opening roster) */
.attendance-summary-cards{ display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:.7rem; margin:.9rem 0; }
.asum{ background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:.8rem 1rem; text-align:center; }
.asum span{ display:block; font-size:.75rem; color:var(--text-soft); font-weight:600; }
.asum strong{ display:block; font-size:1.5rem; font-weight:800; margin-top:.2rem; }
.asum-p strong{ color:#16A34A; } .asum-a strong{ color:#DC2626; } .asum-u strong{ color:#F59E0B; }
.attendance-take-cta{ display:flex; align-items:center; gap:1rem; flex-wrap:wrap; margin-top:.4rem; }
.attendance-done-note{ display:flex; align-items:center; gap:.4rem; color:#16A34A; font-size:.85rem; font-weight:600; }

/* Sticky identity columns on wide monthly grids */
.att-grid thead th.att-sn, .att-grid tbody td.att-sn{ position:sticky; left:0; z-index:3; background:var(--surface-2); }
.att-grid tbody td.att-sn{ background:var(--surface); }
.att-grid thead th.att-name, .att-grid tbody td.att-name{ position:sticky; left:38px; z-index:3; background:var(--surface-2); }
.att-grid tbody td.att-name{ background:var(--surface); }
.att-grid tbody tr:hover td.att-sn, .att-grid tbody tr:hover td.att-name{ background:var(--surface-2); }

/* Print styles for attendance grids */
@media print{
  .sidebar, .topbar, .att-toolbar, .att-stat-row, .btn{ display:none !important; }
  .main{ margin:0 !important; }
  .att-grid-scroll{ overflow:visible !important; border:none !important; }
  .att-grid{ font-size:.7rem !important; }
  .att-cell.is-p, .att-cell.is-a, .att-cell.is-h, .att-cell.is-sick, .att-cell.is-leave{ color:#000 !important; }
  .att-pct{ color:#000 !important; }
}

/* ============================================================
 * ROLE ACCESS, TEACHER HOME & DIRECTOR USER VIEW
 * ============================================================ */
.user-view-banner {
  position: sticky;
  top: 64px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 30px;
  padding: .12rem .5rem;
  margin: 0 1.25rem;
  border: 1px solid #f59e0b;
  border-top: 0;
  border-radius: 0 0 7px 7px;
  background: #fffbeb;
  color: #78350f;
  box-shadow: 0 3px 10px rgba(120,53,15,.08);
}
[data-theme="dark"] .user-view-banner { background:#422006; color:#fef3c7; border-color:#d97706; }
.user-view-title { font-size:.62rem; font-weight:850; letter-spacing:.065em; line-height:1; }
.user-view-banner .btn {
  flex:0 0 auto;
  min-height:24px;
  padding:.16rem .48rem;
  border-radius:6px;
  background:#92400e;
  color:#fff;
  border-color:#92400e;
  font-size:.62rem;
  line-height:1;
}

.teacher-primary-actions {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1rem;
  margin-bottom:1.15rem;
}
.teacher-main-action {
  min-height:146px;
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:1rem;
  width:100%;
  padding:1.3rem;
  border:1px solid var(--border);
  border-radius:18px;
  background:var(--surface);
  color:var(--text);
  text-align:left;
  box-shadow:var(--shadow-sm);
  cursor:pointer;
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
.teacher-main-action:hover { transform:translateY(-2px); box-shadow:var(--shadow-md); border-color:var(--accent); }
.teacher-main-action > span { width:66px; height:66px; border-radius:17px; display:grid; place-items:center; font-size:1.7rem; color:#fff; }
.teacher-main-action.attendance > span { background:#2563eb; }
.teacher-main-action.syllabus > span { background:#16a34a; }
.teacher-main-action small { display:block; color:var(--text-soft); font-weight:700; text-transform:uppercase; letter-spacing:.08em; margin-bottom:.3rem; }
.teacher-main-action strong { display:block; font-size:1.35rem; line-height:1.15; }
.teacher-main-action p { margin:.4rem 0 0; color:var(--text-soft); }
.teacher-main-action > i { color:var(--text-soft); }

.dashboard-action-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem; }
.dashboard-action {
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:.75rem;
  min-height:72px;
  padding:.85rem;
  border:1px solid var(--border);
  border-radius:13px;
  background:var(--surface);
  color:var(--text);
  cursor:pointer;
  text-align:left;
}
.dashboard-action:hover { border-color:var(--accent); background:var(--accent-soft); }
.dashboard-action-icon { width:40px; height:40px; border-radius:11px; display:grid; place-items:center; background:var(--accent-soft); color:var(--accent); }
.dashboard-action > i { color:var(--text-soft); }

.user-view-controls { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.75rem; margin-top:1rem; }
.user-view-note { display:flex; gap:.55rem; align-items:center; margin-top:.85rem; padding:.65rem .75rem; border-radius:10px; background:var(--accent-soft); color:var(--text-soft); font-size:.86rem; }
.permission-info,.read-only-banner { display:flex; align-items:flex-start; gap:.85rem; padding:1rem; border:1px solid var(--border); border-radius:14px; background:var(--surface-2); }
.permission-info > i,.read-only-banner > i { width:42px; height:42px; flex:0 0 auto; display:grid; place-items:center; border-radius:12px; background:var(--accent-soft); color:var(--accent); }
.permission-info p,.read-only-banner p { margin:.25rem 0 0; color:var(--text-soft); }
.user-role-table-wrap{overflow-x:hidden}
.user-role-table{width:100%;table-layout:fixed}
.user-role-table th,.user-role-table td{white-space:normal;overflow-wrap:anywhere;vertical-align:middle}
.user-role-table th:nth-child(1){width:11%}.user-role-table th:nth-child(2){width:12%}.user-role-table th:nth-child(3){width:10%}
.user-role-table th:nth-child(4){width:15%}.user-role-table th:nth-child(5){width:8%}.user-role-table th:nth-child(6){width:14%}
.user-role-table th:nth-child(7){width:11%}.user-role-table th:nth-child(8){width:19%}
.latest-password{display:inline-block;max-width:100%;padding:.28rem .45rem;border:1px dashed #a78bfa;border-radius:7px;background:#faf5ff;color:#4c1d95;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.76rem;overflow-wrap:anywhere}
.permission-catalog{display:grid;gap:.8rem;max-height:min(62vh,620px);padding-right:.25rem;overflow-y:auto;overflow-x:hidden}
.permission-catalog section{padding:.75rem;border:1px solid var(--border);border-radius:12px;background:var(--surface-2)}
.permission-catalog h4{margin:0 0 .6rem;color:var(--accent)}
.permission-catalog .checkbox{display:flex;align-items:flex-start;gap:.55rem;padding:.45rem;border-radius:8px}
.permission-catalog .checkbox span{display:grid;gap:.08rem}
.permission-catalog .checkbox small{color:var(--text-soft);font-size:.68rem}
.permission-catalog .permission-inherited{background:rgba(148,163,184,.12)}
.permission-catalog .permission-inherited input{accent-color:#64748b}
@media(max-width:1100px){
  .user-role-table{font-size:.72rem}.user-role-table th,.user-role-table td{padding:.45rem .3rem}
  .user-role-table .row-actions{gap:.2rem}.user-role-table .btn-sm{width:28px;height:28px;padding:0}
}
.read-only-banner { margin-bottom:1rem; }
.balance-hidden-note { display:flex; align-items:center; gap:.45rem; padding:.6rem .75rem; border-radius:10px; background:var(--surface-2); color:var(--text-soft); font-weight:700; font-size:.85rem; }

/* Student finance must not appear in profiles that do not have dues access. */
.hide-student-dues .student-account-dues,
.hide-student-dues .spx-total-dues,
.hide-student-dues .student-quick-dues,
.hide-student-dues [data-finance-only="student"],
.hide-student-dues .student-fee-summary { display:none !important; }

/* Guest keeps navigation/view buttons, while table mutation controls stay hidden. */
.role-read-only .table-tools .btn-primary,
.role-read-only .row-actions .btn-danger,
.role-read-only .row-actions [data-edit],
.role-read-only .row-actions [data-delete],
.role-read-only [data-table-add],
.role-read-only [data-table-edit],
.role-read-only [data-table-delete] { display:none !important; }

@media (max-width: 900px) {
  .teacher-primary-actions,.dashboard-action-grid { grid-template-columns:1fr; }
  .teacher-main-action { min-height:124px; }
  .user-view-banner { top:58px; margin:0 .65rem; align-items:center; }
  .user-view-controls { grid-template-columns:1fr; }
}
@media (max-width: 560px) {
  .teacher-main-action { grid-template-columns:auto 1fr; padding:1rem; }
  .teacher-main-action > i { display:none; }
  .teacher-main-action > span { width:54px; height:54px; font-size:1.35rem; }
  .teacher-main-action strong { font-size:1.15rem; }
  .user-view-banner { position:relative; top:auto; flex-direction:row; }
  .user-view-banner .btn { width:auto; }
}

/* Student finance is removed completely from non-finance profiles. */
.hide-student-dues .finance-filter-branch,
.hide-student-dues .form-section-fee-details,
.hide-student-dues [data-field-key="admissionFee"],
.hide-student-dues [data-field-key="academicFee"],
.hide-student-dues [data-field-key="tuitionFee"],
.hide-student-dues [data-field-key="monthlyDiscount"],
.hide-student-dues [data-field-key="hostelFee"],
.hide-student-dues [data-field-key="transportFee"],
.hide-student-dues [data-field-key="previousDues"],
.hide-student-dues [data-field-key="feeEffectiveDate"],
.hide-student-dues .spx-recent-money,
.hide-student-dues .spx-fee-stats,
.hide-student-dues .spx-total-dues,
.hide-student-dues .spx-transactions,
.hide-student-dues .spx-actions,
.hide-student-dues .student-account-metrics,
.hide-student-dues .student-account-section:has(.sp-transaction-table),
.hide-student-dues .student-account-section:has(.sp-plan-scroll),
.hide-student-dues .student-profile-actions { display:none !important; }
.hide-student-dues .spx-dashboard-grid { grid-template-columns:minmax(0,1fr) !important; }
.hide-student-dues .spx-side-panels { width:100%; }

/* Student Ledger Book category colours and inset layout. */
.spx-ledger-inset{min-width:0;min-height:0;padding:10px 14px 14px;display:grid;grid-template-rows:auto minmax(0,1fr);gap:9px}
.spx-ledger-legend{display:flex;gap:6px;overflow-x:auto;padding:1px}.spx-ledger-legend span{flex:none;padding:4px 8px;border-radius:999px;font-size:.62rem;font-weight:850;white-space:nowrap}
.legend-admission{color:#1d4ed8;background:#dbeafe}.legend-monthly{color:#6d28d9;background:#ede9fe}.legend-bill{color:#9a3412;background:#ffedd5}.legend-payment{color:#047857;background:#d1fae5}.legend-reversal{color:#b91c1c;background:#fee2e2}.legend-adjustment{color:#7e22ce;background:#f3e8ff}.legend-void{color:#475569;background:#f1f5f9}
.spx-ledger-inset .spx-transaction-scroll{width:100%;height:100%;min-height:0;overflow:auto!important;border:1px solid var(--border);border-radius:9px;background:var(--surface)}
.spx-ledger-inset .spx-transaction-table{width:100%!important;min-width:1220px!important;table-layout:auto!important}.spx-ledger-inset .spx-transaction-table th,.spx-ledger-inset .spx-transaction-table td{padding:9px 10px!important;overflow-wrap:normal;word-break:normal}
.spx-ledger-row>td{background-clip:padding-box!important}.spx-ledger-row:hover>td{filter:brightness(.975)}.spx-ledger-row>td:first-child{border-left:4px solid transparent}
.ledger-tone-admission>td{background:#eff6ff!important}.ledger-tone-admission>td:first-child{border-left-color:#2563eb}.ledger-tone-opening>td{background:#fffbeb!important}.ledger-tone-opening>td:first-child{border-left-color:#d97706}.ledger-tone-admission-fee>td{background:#eef2ff!important}.ledger-tone-admission-fee>td:first-child{border-left-color:#4f46e5}
.ledger-tone-monthly>td{background:#f5f3ff!important}.ledger-tone-monthly>td:first-child{border-left-color:#7c3aed}.ledger-tone-hostel>td{background:#f0fdfa!important}.ledger-tone-hostel>td:first-child{border-left-color:#0f766e}.ledger-tone-transport>td{background:#ecfeff!important}.ledger-tone-transport>td:first-child{border-left-color:#0891b2}
.ledger-tone-exam>td{background:#fff1f2!important}.ledger-tone-exam>td:first-child{border-left-color:#e11d48}.ledger-tone-books>td{background:#fefce8!important}.ledger-tone-books>td:first-child{border-left-color:#ca8a04}.ledger-tone-uniform>td{background:#fdf2f8!important}.ledger-tone-uniform>td:first-child{border-left-color:#db2777}.ledger-tone-competition>td{background:#f8fafc!important}.ledger-tone-competition>td:first-child{border-left-color:#475569}.ledger-tone-fine>td{background:#fff7ed!important}.ledger-tone-fine>td:first-child{border-left-color:#ea580c}
.ledger-tone-payment>td{background:#ecfdf5!important}.ledger-tone-payment>td:first-child{border-left-color:#059669}.ledger-tone-reversed-payment>td{background:repeating-linear-gradient(135deg,#f0fdf4,#f0fdf4 8px,#f8fafc 8px,#f8fafc 16px)!important}.ledger-tone-reversed-payment>td:first-child{border-left-color:#64748b}.ledger-tone-reversed-payment .spx-income{text-decoration:line-through;color:#64748b!important}.ledger-tone-reversal>td{background:#fef2f2!important}.ledger-tone-reversal>td:first-child{border-left-color:#dc2626}
.ledger-tone-adjustment>td{background:#faf5ff!important}.ledger-tone-adjustment>td:first-child{border-left-color:#9333ea}.ledger-tone-exit>td,.ledger-tone-void>td{background:#f8fafc!important;color:#64748b}.ledger-tone-exit>td:first-child,.ledger-tone-void>td:first-child{border-left-color:#64748b}.ledger-tone-other>td{background:#f8fbff!important}.ledger-tone-other>td:first-child{border-left-color:#60a5fa}
.spx-income{color:#047857!important;font-weight:850}.spx-expense{color:#dc2626!important;font-weight:850}.spx-charge{color:#9a3412!important;font-weight:800}.spx-ledger-status{display:inline-flex;padding:4px 7px;border:1px solid rgba(100,116,139,.2);border-radius:999px;background:rgba(255,255,255,.7);font-size:.61rem;font-weight:850;white-space:nowrap}.ledger-row-status{display:block;margin-top:4px;color:var(--text-soft);font-size:.62rem;font-weight:750}.balance-ledger-table .ledger-reversal-row td{background:#fff7ed}.balance-ledger-table .ledger-reversed-row td{background:#f8fafc;color:#64748b}
@media(max-width:1200px){.student-profile-actions{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:760px){.student-profile-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.spx-ledger-inset{padding:8px 9px 10px}.spx-ledger-inset .spx-transaction-table{min-width:1180px!important}}

/* =====================================================================
 * Priority-series fee collection (Balance Sheet → Collect Student Fee)
 * ===================================================================== */
.collect-series { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 8px; }
.collect-item {
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: var(--surface, #fff);
  overflow: hidden;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.collect-item-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.collect-month > .collect-item-head { cursor: pointer; }
.collect-item-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.collect-item-title strong { font-size: 14px; }
.collect-item-title small { font-size: 11.5px; color: var(--text-soft, #6b7280); }
.collect-item-amt { text-align: right; white-space: nowrap; }
.collect-item-amt strong { font-size: 14px; }
.collect-item-amt small { display: block; font-size: 11px; color: var(--text-soft, #6b7280); }
.collect-caret { color: var(--text-soft, #9ca3af); transition: transform .15s; margin-left: 4px; }
.collect-month .collect-heads:not([hidden]) ~ * .collect-caret,
.collect-month:has(.collect-heads:not([hidden])) .collect-caret { transform: rotate(180deg); }

.collect-tick {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--border, #d1d5db);
  display: inline-flex; align-items: center; justify-content: center;
  color: transparent; font-size: 12px; flex: none; background: transparent;
}
.collect-check { display: inline-flex; }
.collect-check input { display: none; }
.collect-check.is-locked { cursor: not-allowed; opacity: .85; }

/* Fully paid = green */
.collect-item.is-paid { border-color: #16a34a; background: rgba(22,163,74,.08); box-shadow: 0 0 0 1px rgba(22,163,74,.15) inset; }
.collect-item.is-paid .collect-tick, .collect-head.is-paid .collect-head-tick { background: #16a34a; border-color: #16a34a; color: #fff; }
.collect-item.is-paid .collect-item-amt strong { color: #15803d; }
/* Partial = amber */
.collect-item.is-partial { border-color: #f59e0b; background: rgba(245,158,11,.09); }
.collect-item.is-partial .collect-tick, .collect-head.is-partial .collect-head-tick { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.collect-item.is-partial .collect-item-amt strong { color: #b45309; }
/* Excluded (unticked) = muted */
.collect-item.is-excluded { opacity: .55; }
.collect-item.is-excluded .collect-item-title strong { text-decoration: line-through; }

.collect-heads { border-top: 1px dashed var(--border, #e5e7eb); background: rgba(0,0,0,.015); padding: 6px 14px 10px 52px; display: flex; flex-direction: column; gap: 6px; }
.collect-head { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.collect-head span:nth-child(2) { flex: 1; }
.collect-head strong { white-space: nowrap; font-weight: 600; }
.collect-head-tick {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border, #d1d5db);
  display: inline-flex; align-items: center; justify-content: center;
  color: transparent; font-size: 10px; flex: none;
}
.collect-head.is-paid { color: #15803d; }
.collect-head.is-partial { color: #b45309; }

@media (prefers-color-scheme: dark) {
  .collect-item.is-paid { background: rgba(22,163,74,.14); }
  .collect-item.is-partial { background: rgba(245,158,11,.14); }
  .collect-heads { background: rgba(255,255,255,.03); }
}

/* =====================================================================
 * Student list download picker (Students Database → Download List)
 * ===================================================================== */
.download-sheet-intro { margin: 0 0 14px; font-size: 13px; color: var(--text-soft, #6b7280); }
.download-sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.download-sheet-card { border: 1.5px solid var(--border, #e5e7eb); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--surface, #fff); }
.download-sheet-head { display: flex; align-items: flex-start; gap: 12px; }
.download-sheet-head i { font-size: 20px; color: var(--primary, #2563eb); margin-top: 2px; }
.download-sheet-head strong { display: block; font-size: 14px; }
.download-sheet-head small { display: block; font-size: 11.5px; color: var(--text-soft, #6b7280); margin-top: 2px; }
.download-sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.download-sheet-actions .btn { flex: 1; min-width: 84px; }
@media (max-width: 560px) { .download-sheet-grid { grid-template-columns: 1fr; } }

/* ============================================================
 * STUDENT PROFILE — ledger fits inside its box (Status column
 * removed → 10 cols) and the whole profile scrolls with the six
 * action cards frozen at the bottom. Scoped to the student profile
 * only (NOT the employee profile which reuses .spx-page).
 * ============================================================ */

/* ---- Task: ledger fits in box, description < 50% width (desktop/tablet) ---- */
@media (min-width:761px){
  .spx-ledger-inset .spx-transaction-scroll{ overflow-x:hidden !important; }
  .spx-ledger-inset .spx-transaction-table{ min-width:0 !important; width:100% !important; table-layout:fixed !important; }
  .spx-ledger-inset .spx-transaction-table th,
  .spx-ledger-inset .spx-transaction-table td{ overflow-wrap:anywhere; word-break:break-word; white-space:normal; }
  .spx-ledger-inset .spx-transaction-table th:nth-child(1){ width:8% }   /* Date */
  .spx-ledger-inset .spx-transaction-table th:nth-child(2){ width:9% }   /* Type */
  .spx-ledger-inset .spx-transaction-table th:nth-child(3){ width:11% }  /* Category */
  .spx-ledger-inset .spx-transaction-table th:nth-child(4){ width:11% }  /* Receipt */
  .spx-ledger-inset .spx-transaction-table th:nth-child(5){ width:24% }  /* Description (<50%) */
  .spx-ledger-inset .spx-transaction-table th:nth-child(6){ width:9% }   /* Bill/Charge */
  .spx-ledger-inset .spx-transaction-table th:nth-child(7){ width:8% }   /* Income */
  .spx-ledger-inset .spx-transaction-table th:nth-child(8){ width:8% }   /* Expense */
  .spx-ledger-inset .spx-transaction-table th:nth-child(9){ width:8% }   /* Balance */
  .spx-ledger-inset .spx-transaction-table th:nth-child(10){ width:6% }  /* View */
  .spx-ledger-inset .spx-description{ min-width:0 !important; max-width:none !important; }
  .spx-ledger-inset .spx-transaction-view{ padding:4px 6px; white-space:nowrap; }
}

/* ---- Task: profile scrolls as a page; 6 action cards frozen at bottom ---- */
.content:has(.spx-page:not(.emp-profile-page)){ height:auto !important; min-height:0 !important; overflow:visible !important; padding-bottom:24px; }
.main:has(.spx-page:not(.emp-profile-page)){ height:auto !important; overflow:visible !important; }
.spx-page:not(.emp-profile-page){ height:auto !important; min-height:0 !important; display:block !important; }
.spx-page:not(.emp-profile-page) #spxResult{ overflow:visible !important; min-height:0 !important; }
.spx-page:not(.emp-profile-page) .spx-transactions{ display:block !important; }
.spx-page:not(.emp-profile-page) .spx-ledger-inset{ display:block !important; grid-template-rows:none !important; }
.spx-page:not(.emp-profile-page) .spx-ledger-inset .spx-transaction-scroll{ height:auto !important; max-height:520px; min-height:0 !important; overflow-y:auto !important; }
.spx-page:not(.emp-profile-page) .spx-dashboard-grid,
.spx-page:not(.emp-profile-page) .spx-history{ min-height:0 !important; }

/* the frozen bottom bar */
.spx-page:not(.emp-profile-page) .spx-actions{
  position:sticky !important; bottom:10px; z-index:30;
  background:var(--surface); border:1px solid var(--border); border-radius:14px;
  padding:12px; margin:18px 0 8px;
  box-shadow:0 -6px 22px rgba(15,23,42,.16);
  animation:spxActionsRise .38s cubic-bezier(.22,1,.36,1);
}
:root[data-theme="dark"] .spx-page:not(.emp-profile-page) .spx-actions{ box-shadow:0 -6px 22px rgba(0,0,0,.5); }
@keyframes spxActionsRise{ from{ transform:translateY(26px); opacity:0 } to{ transform:translateY(0); opacity:1 } }

/* ensure last content clears the frozen bar */
.spx-page:not(.emp-profile-page) .spx-history{ margin-bottom:2px; }

@media (max-width:760px){
  .spx-page:not(.emp-profile-page) .spx-actions{ bottom:0; border-radius:12px 12px 0 0; margin:14px 0 0; }
}

/* ============================================================
 * STUDENT PROFILE — content-driven sizing after ratings were added.
 * The legacy desktop command-centre used three fixed result rows;
 * the profile now has four blocks, so every block must stay in the
 * normal document flow. The ledger remains the only capped scroller.
 * ============================================================ */
.spx-page:not(.emp-profile-page) #spxResult{
  display:block !important;
  height:auto !important;
  grid-template-rows:none !important;
  overflow:visible !important;
}
.spx-page:not(.emp-profile-page) .spx-profile-card{
  height:auto !important;
  overflow:hidden !important;
}
.spx-page:not(.emp-profile-page) .spx-rating-strip{
  min-height:64px;
}
.spx-page:not(.emp-profile-page) .spx-dashboard-grid{
  height:auto !important;
  overflow:visible !important;
  margin-top:10px;
}
.spx-page:not(.emp-profile-page) .spx-side-panels{
  height:auto !important;
  grid-template-rows:auto auto !important;
  overflow:visible !important;
}
.spx-page:not(.emp-profile-page) .spx-side-panels>.spx-panel{
  height:auto !important;
  overflow:hidden !important;
}
.spx-page:not(.emp-profile-page) .spx-history{
  height:auto !important;
  margin-top:16px;
  margin-bottom:16px !important;
  overflow:hidden !important;
}
.spx-page:not(.emp-profile-page) .spx-actions{
  height:auto !important;
  min-height:70px;
  margin:0 0 8px;
}

@media (max-width:1180px){
  .spx-page:not(.emp-profile-page) .spx-actions{ min-height:66px; }
}

@media (max-width:760px){
  .spx-page:not(.emp-profile-page) .spx-history{ margin-bottom:12px !important; }
  .spx-page:not(.emp-profile-page) .spx-actions{ position:static !important; min-height:0; margin-top:14px; }
}

/* Employee profile uses the same frozen action treatment as Student Profile. */
.emp-profile-page .emp-actions{
  position:sticky !important;
  bottom:10px;
  z-index:30;
  height:auto !important;
  min-height:70px;
  padding:12px;
  margin:16px 0 8px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--surface);
  box-shadow:0 -6px 22px rgba(15,23,42,.16);
}
:root[data-theme="dark"] .emp-profile-page .emp-actions{ box-shadow:0 -6px 22px rgba(0,0,0,.5); }
@media (max-width:760px){
  .emp-profile-page .emp-actions{ position:static !important; min-height:0; border-radius:12px; }
}

/* Balance Sheet ledger category colours mirror the Student Profile ledger. */
.balance-ledger-table .bs-ledger-row>td{ background-clip:padding-box !important; }
.balance-ledger-table .bs-ledger-row>td:first-child{ border-left:4px solid transparent; }
.balance-ledger-table .bs-ledger-row:hover>td{ filter:brightness(.975); }
.balance-ledger-table .bs-tone-student>td{ background:#eff6ff !important; }
.balance-ledger-table .bs-tone-student>td:first-child{ border-left-color:#2563eb; }
.balance-ledger-table .bs-tone-admission>td{ background:#eef2ff !important; }
.balance-ledger-table .bs-tone-admission>td:first-child{ border-left-color:#4f46e5; }
.balance-ledger-table .bs-tone-monthly>td{ background:#f5f3ff !important; }
.balance-ledger-table .bs-tone-monthly>td:first-child{ border-left-color:#7c3aed; }
.balance-ledger-table .bs-tone-payment>td,.balance-ledger-table .bs-tone-income>td,.balance-ledger-table .bs-tone-fund-in>td{ background:#ecfdf5 !important; }
.balance-ledger-table .bs-tone-payment>td:first-child,.balance-ledger-table .bs-tone-income>td:first-child,.balance-ledger-table .bs-tone-fund-in>td:first-child{ border-left-color:#059669; }
.balance-ledger-table .bs-tone-hostel>td{ background:#f0fdfa !important; }
.balance-ledger-table .bs-tone-hostel>td:first-child{ border-left-color:#0f766e; }
.balance-ledger-table .bs-tone-transport>td{ background:#ecfeff !important; }
.balance-ledger-table .bs-tone-transport>td:first-child{ border-left-color:#0891b2; }
.balance-ledger-table .bs-tone-exam>td,.balance-ledger-table .bs-tone-major>td{ background:#fff1f2 !important; }
.balance-ledger-table .bs-tone-exam>td:first-child,.balance-ledger-table .bs-tone-major>td:first-child{ border-left-color:#e11d48; }
.balance-ledger-table .bs-tone-books>td,.balance-ledger-table .bs-tone-minor>td{ background:#fefce8 !important; }
.balance-ledger-table .bs-tone-books>td:first-child,.balance-ledger-table .bs-tone-minor>td:first-child{ border-left-color:#ca8a04; }
.balance-ledger-table .bs-tone-uniform>td{ background:#fdf2f8 !important; }
.balance-ledger-table .bs-tone-uniform>td:first-child{ border-left-color:#db2777; }
.balance-ledger-table .bs-tone-fine>td,.balance-ledger-table .bs-tone-expense>td,.balance-ledger-table .bs-tone-fund-out>td{ background:#fff7ed !important; }
.balance-ledger-table .bs-tone-fine>td:first-child,.balance-ledger-table .bs-tone-expense>td:first-child,.balance-ledger-table .bs-tone-fund-out>td:first-child{ border-left-color:#ea580c; }
.balance-ledger-table .bs-tone-employee>td{ background:#f0f9ff !important; }
.balance-ledger-table .bs-tone-employee>td:first-child{ border-left-color:#0284c7; }
.balance-ledger-table .bs-tone-net-zero{ opacity:.6; filter:saturate(.2); }
.balance-ledger-table .bs-tone-net-zero>td{ color:#94a3b8 !important; background:#f8fafc !important; }
.balance-ledger-table .bs-tone-net-zero>td:first-child{ border-left-color:#cbd5e1; }
.balance-ledger-table .bs-tone-net-zero strong,
.balance-ledger-table .bs-tone-net-zero .ledger-income,
.balance-ledger-table .bs-tone-net-zero .ledger-expense,
.balance-ledger-table .bs-tone-net-zero .ledger-row-status{ color:#94a3b8 !important; }

/* Keep profile actions genuinely frozen while the profile itself scrolls. */
@media (min-width:761px){
  .spx-page:not(.emp-profile-page) .spx-actions,
  .emp-profile-page .emp-actions{
    position:fixed !important;
    left:18px;
    right:18px;
    bottom:10px;
    margin:0;
  }
  .spx-page:not(.emp-profile-page) #spxResult,
  .emp-profile-page #spxResult{ padding-bottom:104px; }
}
@media (min-width:761px) and (max-width:1200px){
  .spx-page:not(.emp-profile-page) #spxResult{ padding-bottom:174px; }
}
@media (min-width:1001px){
  .spx-page:not(.emp-profile-page) .spx-actions,
  .emp-profile-page .emp-actions{ left:calc(var(--sidebar-w) + 18px); }
}

/* Balance Sheet v65: bounded, virtualized infinite ledger.  The browser only
   paints the visible rows while the server streams small pages on demand. */
.balance-ledger .table-scroll.balance-ledger-scroll{
  max-height:min(70vh,760px);
  min-height:320px;
  overflow:auto !important;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  contain:layout paint;
}
.balance-ledger-scroll .balance-ledger-table thead{
  position:sticky;
  top:0;
  z-index:4;
  background:var(--surface-2);
  box-shadow:0 1px 0 var(--border);
}
.balance-ledger-scroll .bs-ledger-row{ height:52px; }
.balance-ledger-scroll .bs-virtual-spacer,
.balance-ledger-scroll .bs-virtual-spacer:hover{ background:transparent !important; }
.balance-ledger-scroll .bs-virtual-spacer td{
  height:inherit;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
}
.balance-ledger-load-status{
  min-height:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:9px 14px;
  border-top:1px solid var(--border);
  color:var(--text-soft);
  background:var(--surface-2);
  font-size:.78rem;
}
.balance-ledger-load-status span{ display:inline-flex; gap:4px; }
.balance-ledger-load-status small{ color:var(--text-soft); }
.bs-ledger-loading{
  min-height:220px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  color:var(--text-soft);
}
.bs-ledger-loading>i{ color:var(--accent); font-size:1.45rem; }
@media(max-width:700px){
  .balance-ledger .table-scroll.balance-ledger-scroll{ max-height:68vh; min-height:300px; overflow:auto !important; }
  .balance-ledger-scroll .bs-ledger-row{ height:50px; }
}

/* Balance Sheet v67: opening identity, invisible progress status and natural
   vertical chain. The non-passive wheel handler in finance JS moves the outer
   page first, then hands the remaining delta to this virtualized scroller. */
.balance-ledger .table-scroll.balance-ledger-scroll{overscroll-behavior-x:contain;overscroll-behavior-y:auto;}
.balance-ledger-load-status{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0,0,0,0) !important;clip-path:inset(50%) !important;white-space:nowrap !important;border:0 !important;}
.balance-ledger-table .bs-tone-opening>td{background:#fffbeb !important;}
.balance-ledger-table .bs-tone-opening>td:first-child{border-left-color:#d97706;}

/* v70: source-backed inactive dues, ID Studio and guided mobile attendance. */
.sdb-old-due{display:inline-flex;align-items:center;min-height:24px;padding:2px 6px;border-radius:999px;background:#fff1f2;color:#be123c;font-size:.68rem;font-weight:900;white-space:nowrap}
.id-studio-page{display:grid;gap:16px}.id-studio-hero{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 22px;border-radius:18px;background:linear-gradient(125deg,#172554,#312e81 52%,#0f766e);color:#fff;box-shadow:0 16px 40px rgba(30,41,59,.18)}.id-studio-hero span,.id-studio-preview header span{font-size:.68rem;font-weight:900;letter-spacing:.15em}.id-studio-hero h2{margin:3px 0;font-size:1.45rem}.id-studio-hero p{margin:0;color:#dbeafe}.id-studio-hero .btn b{display:inline-grid;min-width:22px;height:22px;place-items:center;margin-left:5px;border-radius:99px;background:#fff;color:#3730a3}.id-studio-layout{display:grid;grid-template-columns:minmax(310px,380px) minmax(0,1fr);gap:16px;align-items:start}.id-studio-picker{padding:14px}.id-studio-filters{display:grid;grid-template-columns:1fr 1fr;gap:10px}.id-studio-filters label:first-child{grid-column:1/-1}.id-studio-filters label span{display:block;margin:0 0 5px;font-size:.7rem;font-weight:800;color:#475569}.id-studio-list-head{display:flex;align-items:center;justify-content:space-between;margin:16px 0 8px}.id-studio-list-head button{min-height:40px;padding:0 10px;border:0;border-radius:10px;background:#eef2ff;color:#4338ca;font-weight:800;cursor:pointer}.id-studio-list{display:grid;gap:7px;max-height:640px;overflow:auto}.id-student-row{width:100%;min-height:58px;display:grid;grid-template-columns:24px 42px 1fr 16px;align-items:center;gap:9px;padding:7px 9px;border:1px solid #e2e8f0;border-radius:12px;background:#fff;color:#1e293b;text-align:left;cursor:pointer;transition:.16s}.id-student-row:hover{border-color:#a5b4fc;transform:translateY(-1px)}.id-student-row.is-selected{border-color:#4f46e5;background:#eef2ff}.id-row-check{width:22px;height:22px;display:grid;place-items:center;border:2px solid #cbd5e1;border-radius:7px;color:transparent}.id-student-row.is-selected .id-row-check{border-color:#4f46e5;background:#4f46e5;color:#fff}.id-row-avatar{width:42px;height:42px;display:grid;place-items:center;overflow:hidden;border-radius:11px;background:#e0e7ff;color:#4338ca;font-weight:900}.id-row-avatar img{width:100%;height:100%;object-fit:cover}.id-student-row>span:nth-child(3){min-width:0}.id-student-row strong,.id-student-row small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.id-student-row small{margin-top:2px;color:#64748b}.id-studio-preview{padding:16px}.id-studio-preview>header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px}.id-studio-preview>header h3{margin:3px 0 0}.id-preview-stage{min-height:570px;display:grid;place-content:center;gap:22px;padding:24px;border-radius:16px;background:radial-gradient(circle at 50% 10%,#fff,#eef2ff 54%,#e2e8f0)}.id-studio-card{position:relative;width:342px;height:216px;box-sizing:border-box;overflow:hidden;border-radius:14px;background:#fff;color:#172033;box-shadow:0 12px 28px rgba(15,23,42,.18);font-family:Inter,Arial,sans-serif}.id-front{padding:14px;background:linear-gradient(150deg,#fff 0 69%,#e0f2fe 69%)}.id-front:before{content:"";position:absolute;right:-60px;bottom:-70px;width:170px;height:170px;border-radius:50%;background:linear-gradient(135deg,#0891b2,#4f46e5);opacity:.92}.id-brand{display:flex;align-items:center;gap:8px}.id-brand img{width:34px;height:34px;object-fit:contain}.id-brand strong,.id-brand small{display:block}.id-brand strong{max-width:220px;font-size:.74rem;line-height:1}.id-brand small{margin-top:3px;color:#64748b;font-size:.49rem;font-weight:900;letter-spacing:.12em}.id-student-photo{position:absolute;top:59px;left:14px;width:64px;height:74px;display:grid;place-items:center;overflow:hidden;border:3px solid #fff;border-radius:12px;background:#c7d2fe;color:#3730a3;font-size:1.3rem;font-weight:900;box-shadow:0 5px 14px rgba(15,23,42,.18)}.id-student-photo img{width:100%;height:100%;object-fit:cover}.id-front h3{position:absolute;top:61px;left:90px;right:14px;margin:0;font-size:1rem}.id-code{position:absolute;top:88px;left:90px;color:#4f46e5;font-size:.76rem}.id-primary{position:absolute;top:110px;left:90px;right:12px;display:flex;gap:20px}.id-primary span,.id-primary strong{display:block}.id-primary span{color:#64748b;font-size:.48rem;text-transform:uppercase}.id-primary strong{margin-top:2px;color:#172033;font-size:.65rem}.id-front dl{position:absolute;left:14px;right:14px;bottom:12px;display:grid;grid-template-columns:1.5fr 1fr .7fr;gap:6px;margin:0}.id-front dl div{min-width:0}.id-front dt{color:#64748b;font-size:.46rem;text-transform:uppercase}.id-front dd{margin:2px 0 0;overflow:hidden;font-size:.58rem;font-weight:800;text-overflow:ellipsis;white-space:nowrap}.id-back{padding:15px;background:linear-gradient(145deg,#fff,#f8fafc)}.id-back-band{display:flex;align-items:center;gap:8px;padding-bottom:8px;border-bottom:2px solid #f97316}.id-back-band img{width:27px;height:27px;object-fit:contain}.id-back-band strong{font-size:.68rem}.id-back h4{margin:10px 0 7px;font-size:.72rem}.id-back dl{display:grid;grid-template-columns:1fr 1fr;gap:7px 10px;margin:0}.id-back dt{color:#64748b;font-size:.46rem;text-transform:uppercase}.id-back dd{margin:1px 0 0;overflow:hidden;font-size:.57rem;font-weight:800;text-overflow:ellipsis;white-space:nowrap}.id-back p{margin:8px 0;color:#64748b;font-size:.48rem}.id-sign{position:absolute;right:14px;bottom:11px;text-align:right}.id-sign span,.id-sign b{display:block}.id-sign span{color:#64748b;font-size:.45rem}.id-sign b{margin-top:6px;font-size:.52rem}
.attendance-mobile-page{width:min(100%,820px);margin:0 auto;padding-bottom:36px}.attendance-mobile-shell{overflow:hidden;padding:0}.attendance-mobile-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px;background:linear-gradient(135deg,#312e81,#4f46e5);color:#fff}.attendance-mobile-head span{font-size:.64rem;font-weight:900;letter-spacing:.14em}.attendance-mobile-head h2{margin:3px 0;font-size:1.3rem}.attendance-mobile-head p{margin:0;color:#e0e7ff;font-size:.82rem}.attendance-stepper{display:flex;align-items:center}.attendance-stepper b{width:30px;height:30px;display:grid;place-items:center;border:2px solid rgba(255,255,255,.38);border-radius:50%;color:#c7d2fe}.attendance-stepper b.is-active{border-color:#fff;background:#fff;color:#4338ca}.attendance-stepper i{width:22px;height:2px;background:rgba(255,255,255,.35)}.attendance-scope{display:grid;grid-template-columns:1.25fr 1fr 1fr;gap:10px;padding:14px 16px;border-bottom:1px solid #e2e8f0;background:#f8fafc}.attendance-scope label span{display:block;margin-bottom:4px;color:#475569;font-size:.68rem;font-weight:800}.attendance-mobile-body{min-height:260px}.attendance-mobile-empty,.attendance-mobile-complete{min-height:250px;display:grid;place-items:center;align-content:center;gap:8px;padding:30px;text-align:center;color:#64748b}.attendance-mobile-empty i,.attendance-mobile-complete i{font-size:2rem;color:#4f46e5}.attendance-mobile-empty h3,.attendance-mobile-complete h2,.attendance-mobile-empty p,.attendance-mobile-complete p{margin:0}.attendance-mobile-empty.denied i{color:#dc2626}.attendance-mobile-empty.success i,.attendance-mobile-complete i{color:#16a34a}.attendance-stage>header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:16px}.attendance-stage>header small{color:#4f46e5;font-size:.62rem;font-weight:900;letter-spacing:.12em}.attendance-stage>header h3{margin:3px 0;font-size:1.08rem}.attendance-stage>header p{margin:0;color:#64748b;font-size:.78rem}.attendance-live-counts{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.attendance-live-counts span,.attendance-live-counts b,.attendance-live-counts em,.attendance-big-absent,.attendance-return-count,.attendance-complaint-count{padding:5px 8px;border-radius:999px;font-size:.68rem;font-style:normal}.attendance-live-counts span{background:#f1f5f9}.attendance-live-counts b{background:#dcfce7;color:#15803d}.attendance-live-counts em,.attendance-big-absent{background:#fee2e2;color:#b91c1c}.attendance-return-count{background:#e0e7ff;color:#4338ca}.attendance-complaint-count{background:#ffedd5;color:#c2410c}.attendance-mobile-roster{display:grid;gap:6px;padding:0 12px 12px}.attendance-mobile-row{width:100%;min-height:62px;display:grid;grid-template-columns:32px minmax(0,1fr) auto;align-items:center;gap:10px;padding:7px 10px;border:1px solid #fecaca;border-radius:13px;background:#fff7f7;color:#1e293b;text-align:left;cursor:pointer;touch-action:manipulation}.attendance-mobile-row>b{width:30px;height:30px;display:grid;place-items:center;border-radius:9px;background:#fee2e2;color:#991b1b}.attendance-mobile-row span strong,.attendance-mobile-row span small{display:block}.attendance-mobile-row span small{margin-top:2px;color:#64748b;font-weight:800}.attendance-mobile-row em{min-width:82px;padding:7px 9px;border-radius:10px;background:#fee2e2;color:#b91c1c;font-size:.72rem;font-style:normal;font-weight:900;text-align:center}.attendance-mobile-row.is-present{border-color:#86efac;background:#f0fdf4}.attendance-mobile-row.is-present>b,.attendance-mobile-row.is-present em{background:#dcfce7;color:#15803d}.attendance-review-list{display:grid;gap:8px;padding:0 12px 12px}.attendance-review-list>article,.attendance-talk-row,.attendance-complaint-row{min-height:62px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid #e2e8f0;border-radius:13px;background:#fff}.attendance-review-list strong,.attendance-review-list small{display:block}.attendance-review-list small{margin-top:3px;color:#64748b}.attendance-talk-row,.attendance-complaint-row{cursor:pointer}.attendance-talk-row input,.attendance-complaint-row input{width:23px;height:23px;accent-color:#4f46e5}.attendance-talk-row>span,.attendance-complaint-row>span{flex:1}.attendance-talk-row>b{color:#4f46e5;font-size:.72rem}.attendance-complaint-row{align-items:flex-start}.attendance-complaint-row p{margin:6px 0 0;font-size:.78rem}.attendance-complaint-row>b{padding:4px 7px;border-radius:999px;background:#ffedd5;color:#c2410c;font-size:.62rem}.attendance-mobile-actions{position:sticky;bottom:0;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;border-top:1px solid #e2e8f0;background:rgba(255,255,255,.96);backdrop-filter:blur(10px)}.attendance-mobile-actions .btn{min-height:46px}.attendance-offline-note{margin:0 12px 10px;padding:9px 11px}
@media(max-width:860px){.id-studio-layout{grid-template-columns:1fr}.id-studio-list{max-height:360px}.id-preview-stage{min-height:auto}.id-studio-preview{overflow:auto}.id-preview-stage{place-content:start center}.id-studio-hero{align-items:flex-start}.id-studio-hero p{max-width:30ch}}
@media(max-width:560px){.id-studio-hero{display:grid;padding:15px}.id-studio-hero .btn{width:100%}.id-studio-filters{grid-template-columns:1fr 1fr}.id-preview-stage{padding:12px;transform-origin:top center}.id-studio-card{width:min(342px,calc(100vw - 64px));height:calc(min(342px,calc(100vw - 64px)) * .632)}.attendance-mobile-page{width:100%}.attendance-mobile-head{display:grid;padding:15px}.attendance-stepper{justify-content:center}.attendance-scope{grid-template-columns:1fr 1fr}.attendance-scope label:first-child{grid-column:1/-1}.attendance-stage>header{display:grid}.attendance-live-counts{justify-content:flex-start}.attendance-mobile-row{grid-template-columns:30px minmax(0,1fr)}.attendance-mobile-row em{grid-column:2;justify-self:start;min-width:0;margin-top:-6px;padding:4px 7px}.attendance-review-list>article{align-items:flex-start;flex-direction:column}.attendance-review-list>article .btn{width:100%;min-height:44px}.attendance-talk-row>b{font-size:0}.attendance-talk-row>b i{font-size:1rem}.attendance-mobile-actions .btn{flex:1}.attendance-stepper i{width:18px}}

/* Attendance v70 draft: tap-only rows, five-step review and role-aware scope. */
.attendance-scope.is-assigned{display:block}.attendance-assigned-scope{display:flex;align-items:center;justify-content:center;gap:10px;min-height:58px;padding:10px 14px;border:1px solid #c7d2fe;border-radius:14px;background:#eef2ff;color:#3730a3}.attendance-assigned-scope>i{font-size:1.2rem}.attendance-assigned-scope span{font-size:.7rem;font-weight:800}.attendance-assigned-scope strong{display:block;margin-top:2px;font-size:1rem}.attendance-mobile-row{grid-template-columns:32px minmax(0,1fr);border-color:#dbe3ee;background:#fff}.attendance-mobile-row>b{background:#eef2f7;color:#475569}.attendance-mobile-row.is-present{border-color:#4ade80;background:#ecfdf3;box-shadow:inset 4px 0 #22c55e}.attendance-mobile-row.is-present>b{background:#bbf7d0;color:#166534}.attendance-absentee-roster{padding-bottom:12px}.attendance-talk-row{width:100%;font:inherit;color:#1e293b;text-align:left;appearance:none}.attendance-talk-row>span{min-width:0}.attendance-talk-row>span>em{display:block;margin-top:5px;font-size:.72rem;font-style:normal;font-weight:850}.attendance-absence-days{color:#dc2626!important}.attendance-talk-row>b{display:flex;align-items:center;gap:6px;color:#94a3b8;font-size:.72rem}.attendance-talk-row>b i{font-size:1rem}.attendance-talk-row.is-talked{border-color:#93c5fd;background:#eff6ff;box-shadow:inset 4px 0 #3b82f6}.attendance-talk-row.is-talked>b{color:#15803d}.attendance-talk-row.is-talked>b i{color:#16a34a}.attendance-new-row>span>em{color:#2563eb}.attendance-new-count{padding:5px 8px;border-radius:999px;background:#dbeafe;color:#1d4ed8;font-size:.68rem}.attendance-date-control{min-width:0}
@media(max-width:560px){.attendance-stepper i{width:11px}.attendance-stepper b{width:28px;height:28px}.attendance-scope:not(.is-assigned){grid-template-columns:1fr 1fr}.attendance-scope:not(.is-assigned) .attendance-date-control{grid-column:1/-1}.attendance-mobile-row{grid-template-columns:30px minmax(0,1fr)}.attendance-talk-row>b span{display:none}}
.sp-action.attendance{background:#2563eb}.student-profile-actions.emp-actions:has(.sp-action.attendance){grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:620px){.student-profile-actions.emp-actions:has(.sp-action.attendance){grid-template-columns:repeat(2,minmax(0,1fr))}}

/* v75: compact profile command strip, cross-status search and persistent actions. */
.spx-searchbar{min-height:56px;padding:6px 10px;margin-bottom:10px;border-radius:14px}
.spx-search-controls{gap:7px}
.profile-scope-switch.profile-scope-compact{display:grid;grid-template-columns:44px 40px 54px;align-items:center;gap:2px;width:148px;min-width:148px;height:38px;padding:3px;border-radius:999px}
.profile-scope-switch.profile-scope-compact>button{width:auto;height:30px;display:grid;place-items:center;padding:0 4px;border:0;border-radius:999px;background:transparent;color:var(--text-soft);font:800 .59rem/1 inherit;letter-spacing:-.01em;cursor:pointer;transition:background .18s ease,color .18s ease,box-shadow .18s ease,transform .18s ease}
.profile-scope-switch.profile-scope-compact>button:hover{color:var(--scope-color);transform:translateY(-1px)}
.profile-scope-switch.profile-scope-compact>button[aria-pressed="true"]{background:var(--scope-color);color:#fff;box-shadow:0 4px 10px color-mix(in srgb,var(--scope-color) 28%,transparent)}
.profile-scope-switch.profile-scope-compact>button:focus-visible{outline:3px solid color-mix(in srgb,var(--scope-color) 22%,transparent);outline-offset:2px}
.spx-searchbar.search-open .profile-scope-compact{opacity:0;visibility:hidden;pointer-events:none;transform:translateX(6px)}
.emp-recent-card{grid-template-columns:78px 170px minmax(160px,1fr) minmax(180px,1fr) 145px 132px}
.emp-recent-card .spx-recent-money{grid-template-columns:1fr}

/* Student receivable is calm green; employee salary payable is calm red. */
.spx-page:not(.emp-profile-page) .spx-total-dues{border-color:#bbf7d0;background:linear-gradient(155deg,#f0fdf4,#ecfdf5)}
.spx-page:not(.emp-profile-page) .spx-total-dues>span,.spx-page:not(.emp-profile-page) .spx-total-dues>strong,.spx-page:not(.emp-profile-page) .spx-total-dues>small{color:#15803d}
.emp-profile-page .spx-total-dues.payable{border-color:#fecaca;background:linear-gradient(155deg,#fff1f2,#fff7ed)}
.emp-profile-page .spx-total-dues.payable>span,.emp-profile-page .spx-total-dues.payable>strong,.emp-profile-page .spx-total-dues.payable>small{color:#be123c}
.emp-profile-page .spx-total-dues.payable .spx-dues-tools button{color:#9f1239;background:rgba(255,255,255,.82);border-color:#fecdd3}

/* Full-width action dock stays reachable while the profile scrolls. */
.spx-page:not(.emp-profile-page) .spx-actions,.emp-profile-page .emp-actions{position:fixed!important;z-index:80;left:14px;right:14px;bottom:max(10px,env(safe-area-inset-bottom));width:auto!important;height:auto!important;min-height:64px!important;margin:0!important;padding:10px!important;border:1px solid color-mix(in srgb,var(--accent) 16%,var(--border));border-radius:16px;background:color-mix(in srgb,var(--surface) 92%,transparent);box-shadow:0 -8px 28px rgba(15,23,42,.16),0 8px 24px rgba(15,23,42,.08);backdrop-filter:blur(16px);animation:spxActionsRise .36s cubic-bezier(.22,1,.36,1)}
.spx-page:not(.emp-profile-page) #spxResult,.emp-profile-page #spxResult{padding-bottom:108px!important}
@media(min-width:1001px){.spx-page:not(.emp-profile-page) .spx-actions,.emp-profile-page .emp-actions{left:calc(var(--sidebar-w) + 14px)}}
@media(max-width:760px){
  .spx-searchbar{min-height:50px;padding:4px 6px;margin-bottom:8px}
  .profile-scope-switch.profile-scope-compact{grid-template-columns:41px 36px 50px;width:135px;min-width:135px;height:34px;padding:2px}
  .profile-scope-switch.profile-scope-compact>button{height:28px;padding:0 2px;font-size:.54rem}
  .spx-page:not(.emp-profile-page) .spx-actions,.emp-profile-page .emp-actions{left:7px;right:7px;bottom:max(7px,env(safe-area-inset-bottom));min-height:58px!important;padding:7px!important;border-radius:14px}
  .spx-page:not(.emp-profile-page) #spxResult,.emp-profile-page #spxResult{padding-bottom:142px!important}
  .emp-recent-card{grid-template-columns:58px minmax(0,1fr) auto}
}
:root[data-theme="dark"] .spx-page:not(.emp-profile-page) .spx-total-dues{border-color:#166534;background:linear-gradient(155deg,rgba(20,83,45,.45),rgba(6,78,59,.38))}
:root[data-theme="dark"] .emp-profile-page .spx-total-dues.payable{border-color:#9f1239;background:linear-gradient(155deg,rgba(136,19,55,.42),rgba(124,45,18,.32))}
.spx-page.fade-up{animation:none!important;transform:none!important}

/* Hostel attendance v228: compact daily-register rows. The Sick action owns
   the rightmost 20%; the renderer saves every unselected student as Absent. */
.hostel-attendance-take-page{width:min(100%,760px);min-width:0;margin:0 auto;padding:4px 0 96px;color:var(--text,#172033)}
.har-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin:0 0 9px;padding:3px 2px}.har-head h2{margin:0;font-size:1.28rem;line-height:1.2;letter-spacing:-.018em}.har-head p{margin:4px 0 0;color:var(--text-soft,#64748b);font-size:.78rem;font-weight:650}
.har-counts{display:flex;align-items:center;gap:7px;min-width:0;margin-bottom:11px;overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:none}.har-counts::-webkit-scrollbar{display:none}.har-counts>span{flex:0 0 auto;display:inline-flex;align-items:center;gap:4px;min-height:30px;padding:5px 9px;border-radius:999px;background:#eef2f7;color:#475569;font-size:.72rem;font-weight:750;font-variant-numeric:tabular-nums}.har-counts>span.present{background:#dcfce7;color:#15803d}.har-counts>span.absent{background:#fee2e2;color:#b91c1c}.har-counts>span.sick{background:#ffedd5;color:#c2410c}.har-counts b{font-size:.76rem}
.har-list{display:grid;gap:7px;min-width:0}.har-row{position:relative;min-width:0;min-height:62px;display:grid;grid-template-columns:minmax(0,4fr) minmax(58px,1fr);overflow:hidden;border:1px solid var(--border,#dbe3ee);border-radius:13px;background:var(--surface,#fff);box-shadow:0 2px 8px rgba(15,23,42,.025);transition:border-color .16s ease,background .16s ease,box-shadow .16s ease}.har-row button{min-width:0;border:0;background:transparent;color:inherit;font:inherit;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.har-present{width:100%;display:grid;grid-template-columns:38px minmax(0,1fr);align-items:center;gap:10px;padding:7px 11px;text-align:left}.har-present>span{width:34px;height:36px;display:grid;place-items:center;border-radius:9px;background:#eef2f7;color:#52627a;font-size:.77rem;font-weight:850;font-variant-numeric:tabular-nums;transition:background .16s ease,color .16s ease}.har-present>div{min-width:0}.har-present strong,.har-present small{display:block;min-width:0;overflow-wrap:anywhere}.har-present strong{color:var(--text,#172033);font-size:.94rem;line-height:1.18}.har-present small{margin-top:3px;color:var(--text-soft,#64748b);font-size:.72rem;font-weight:780;letter-spacing:.015em}
.har-sick{width:100%;min-height:100%;display:flex;align-items:center;justify-content:center;gap:6px;padding:6px;border-left:1px solid var(--border,#dbe3ee);color:#a16207;font-size:.71rem;font-weight:850;text-align:center;transition:background .16s ease,color .16s ease}.har-sick i{font-size:.88rem}.har-row.is-present{border-color:#4ade80;background:#ecfdf3;box-shadow:inset 4px 0 #22c55e}.har-row.is-present .har-present>span{background:#bbf7d0;color:#166534}.har-row.is-present .har-present strong{color:#14532d}.har-row.is-sick{border-color:#f7b84b;background:#fff8e8;box-shadow:inset 4px 0 #f59e0b}.har-row.is-sick .har-sick{border-left-color:#f7b84b;background:#f59e0b;color:#fff}.har-row.is-sick .har-present>span{background:#ffedd5;color:#9a3412}.har-present:focus-visible,.har-sick:focus-visible{position:relative;z-index:2;outline:3px solid color-mix(in srgb,var(--accent,#2563eb) 45%,transparent);outline-offset:-3px}
.har-savebar{position:sticky;z-index:12;bottom:0;display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;padding:10px 11px;border:1px solid var(--border,#dbe3ee);border-radius:14px;background:color-mix(in srgb,var(--surface,#fff) 94%,transparent);box-shadow:0 -7px 24px rgba(15,23,42,.11);backdrop-filter:blur(14px)}.har-savebar p{display:flex;align-items:flex-start;gap:7px;min-width:0;margin:0;color:var(--text-soft,#64748b);font-size:.73rem;line-height:1.35}.har-savebar p i{margin-top:2px;color:var(--accent,#2563eb)}.har-savebar .btn{flex:0 0 auto;min-height:46px;padding-inline:18px;white-space:nowrap}
@media(max-width:599px){body.mobile-app-ready .content:has(.hostel-attendance-take-page){min-height:0!important;padding:8px 10px calc(12px + env(safe-area-inset-bottom))!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;scroll-behavior:smooth}.hostel-attendance-take-page{width:100%;padding:0 0 calc(90px + env(safe-area-inset-bottom))}.har-head{margin-bottom:8px}.har-head h2{font-size:1.18rem}.har-head p{font-size:.72rem}.har-counts{gap:5px;margin-bottom:9px}.har-counts>span{min-height:28px;padding:4px 7px;font-size:.66rem}.har-list{gap:6px}.har-row{min-height:59px;grid-template-columns:minmax(0,4fr) minmax(56px,1fr);border-radius:12px}.har-present{grid-template-columns:35px minmax(0,1fr);gap:8px;padding:6px 9px}.har-present>span{width:32px;height:34px;font-size:.72rem}.har-present strong{font-size:.88rem}.har-present small{font-size:.68rem}.har-sick{flex-direction:column;gap:3px;padding:4px;font-size:.66rem;line-height:1}.har-sick i{font-size:.82rem}.har-savebar{bottom:calc(var(--mobile-nav-size,66px) + 5px);display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin-top:9px;padding:8px 9px;border-radius:13px}.har-savebar p{font-size:.64rem}.har-savebar .btn{min-height:44px;padding-inline:13px;font-size:.78rem}}
@media(min-width:600px) and (max-width:1000px){body.mobile-app-ready .content:has(.hostel-attendance-take-page){min-height:0;overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}.hostel-attendance-take-page{padding-bottom:92px}.har-savebar{bottom:12px}}
:root[data-theme="dark"] .har-row{box-shadow:none}:root[data-theme="dark"] .har-row.is-present{background:#0d3022}:root[data-theme="dark"] .har-row.is-sick{background:#3b2b0c}

/* Phase 29A: locked attendance counters, calendar labels and completion state. */
.attendance-footer-counts{display:flex;align-items:center;justify-content:flex-end;gap:6px;min-width:0;margin-left:auto;font-variant-numeric:tabular-nums}
.attendance-footer-counts>span,.attendance-footer-counts>b,.attendance-footer-counts>em{display:inline-flex;align-items:center;gap:4px;min-height:30px;padding:5px 8px;border-radius:999px;font-size:.68rem;font-style:normal;font-weight:800;white-space:nowrap}
.attendance-footer-counts>span{background:#f1f5f9;color:#475569}.attendance-footer-counts>b{background:#dcfce7;color:#15803d}.attendance-footer-counts>em{background:#fee2e2;color:#b91c1c}.attendance-footer-counts strong{font-size:.75rem}
.att-day-head.is-calendar-holiday small,.att-day-head.is-calendar-holiday span{color:#c2410c}.att-day-head.is-calendar-sunday small,.att-day-head.is-calendar-sunday span{color:#64748b}
.att-cell.is-calendar-label{font-weight:900!important;text-align:center}.att-cell.is-calendar-holiday{background:#fff7ed!important;color:#c2410c!important}.att-cell.is-calendar-sunday{background:#f1f5f9!important;color:#64748b!important}
.att-cell.pct-good{color:#16a34a!important}.att-pct.pct-good{color:#16a34a!important}
:root[data-theme="dark"] .attendance-footer-counts>span{background:#253247;color:#cbd5e1}:root[data-theme="dark"] .attendance-footer-counts>b{background:#123d2a;color:#86efac}:root[data-theme="dark"] .attendance-footer-counts>em{background:#4a1d25;color:#fca5a5}:root[data-theme="dark"] .att-cell.is-calendar-holiday{background:#3b2b0c!important;color:#fdba74!important}:root[data-theme="dark"] .att-cell.is-calendar-sunday{background:#1e293b!important;color:#cbd5e1!important}
@media(max-width:560px){.attendance-mobile-actions.has-counts{gap:5px;padding:9px 8px}.attendance-mobile-actions.has-counts .attendance-action-spacer{display:none}.attendance-mobile-actions.has-counts .btn{flex:0 1 auto;min-height:42px;padding-inline:9px;font-size:.68rem;white-space:normal;line-height:1.15}.attendance-mobile-actions.has-counts #attStepBack{flex:0 0 40px;width:40px;padding:0;font-size:0}.attendance-mobile-actions.has-counts #attStepBack i{font-size:.8rem}.attendance-footer-counts{flex:1 1 auto;justify-content:center;gap:3px;margin:0}.attendance-footer-counts>span,.attendance-footer-counts>b,.attendance-footer-counts>em{gap:2px;min-height:27px;padding:4px 5px;font-size:.56rem}.attendance-footer-counts strong{font-size:.65rem}}
