:root {
  --cyan-50: #ecfeff;
  --cyan-100: #cffafe;
  --cyan-200: #a5f3fc;
  --cyan-300: #67e8f9;
  --cyan-400: #22d3ee;
  --cyan-500: #06b6d4;
  --cyan-600: #0891b2;
  --cyan-700: #0e7490;
  --cyan-800: #155e75;
  --cyan-900: #164e63;
  --bg: #f7fbfc;
  --surface: #ffffff;
  --ink: #0b1220;
  --muted: #6b7280;
  --accent: #469de5;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-1: 0 6px 20px rgba(6, 145, 178, 0.08);
  --shadow-2: 0 20px 50px rgba(6, 145, 178, 0.12);
  --container: 100vw;
  --header-h: 72px;
}


* { box-sizing: border-box; 
    scrollbar-width: thin;
}
html, body { height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Add an overlay for mobile nav */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.6);
    /* --gray-900 with opacity */
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out;
    backdrop-filter: blur(4px);
}
body.no-scroll {
    overflow: hidden;
}
body.no-scroll .ht-content{
    overflow: hidden;
}
body.no-scroll::after {
    opacity: 1;
    visibility: visible;
    z-index: 20;
}
tr:has(th) {
    background-color: var(--cyan-700) !important;
}
tr:has(th) th {
    color: var(--surface) !important;
}

body.no-scroll { overflow: hidden; }

@font-face { font-family: 'nexalight'; src: url('../fonts/Nexa-ExtraLight.ttf'); }
@font-face { font-family: 'nexabold'; src: url('../fonts/Nexa-Heavy.ttf'); }

h1, .h1 { font-family: nexabold; font-size: clamp(32px, 5vw, 48px); line-height: 1.15; margin: 0 0 10px; }
h2, .h2 { font-family: nexabold; font-size: clamp(24px, 3.6vw, 34px); line-height: 1.2; margin: 0 0 8px; }
h3, .h3 { font-family: nexabold; font-size: clamp(18px, 2.4vw, 22px); line-height: 1.25; margin: 6px 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.bg-body { background: var(--bg); color: var(--ink); }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.section { padding: 20px 0; }
.center { text-align: center; }
.grid { display: grid; gap: 32px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 992px) {
  /* .section { padding: 64px 0; } */
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .section { padding: 0; }
  
}

.hidden { 
    height: 0;
    width: 0;
    overflow: hidden;
 }
 .full:not(.hidden){
    height: auto;
    width: 100%;
    overflow: auto;
    transition: all 0.3s ease-in-out;
 }


.header-school-name{
    /* background-color: red;
    padding: 100px; */
    width: 100%;
    height: 100%;
    left: 0px;
    transition: 0.5s all;
}
@media screen and (max-width: 600px) {
    .header-school-name{
        /* /* width: 0; */
        height: 0;
        overflow: hidden; 
        position: relative;
        left: -300%;
    }
}
.annDropdown{
    z-index: 999;
}
/* Compact header on scroll */
.site-header{transition:box-shadow .25s ease, background .25s ease}
.nav-container{transition:height .2s ease}
.brand img{transition:height .2s ease}
.site-header.stuck .nav-container{height:56px}
.site-header.stuck .brand img{height:36px}

/* Adjust sidebar when header is stuck */
.ht-sidebar{transition:top .2s ease}
/* body:has(.site-header.stuck) .ht-sidebar{top:-170px !important} */

/* Two-column layout for pages that include .left-side and .right-side */
.section .container .left-side{display:block}
.section .container .right-side{display:none}

@media (min-width: 900px){
  /* Float-based split to avoid affecting other pages using .container */
  .section .container::after{content:"";display:table;clear:both}
  .section .container .left-side{float:left;width:58%;margin-right:2%;}
  .section .container .right-side{float:right;width:38%;display:block}
  /* Keep right card visible when scrolling (nice UX for tips) */
  .section .container .right-side > div{position:sticky; top:96px}
}
/* Minor tweaks for forms inside left-side */
.section .container .left-side .contact-form{margin-top:8px}

/* Optional: subtle entrance animation if .aos is present */
/* opacity:0; */
.aos{transform:translateY(12px);transition:opacity .35s ease, transform .35s ease}
.aos.in{opacity:1;transform:none}
/* Footer */
.site-footer{background:var(--surface);box-shadow:0 -6px 16px rgba(0,0,0,.04);padding:18px 0;margin-top:20px}
.site-footer .copyright{color:var(--muted);text-align:center;font-size:.95rem}
/* Section padding when using dashboard layout */
/* .section:has(.ht-layout){padding:5px} */

/* Headings */
.section-title{margin:6px 0 6px}
.section-lead{margin:0 0 14px;color:var(--muted)}

  /* Active sidebar item */
  .ht-menu .item.active{background:#f4fbfd;border-color:#d9eef3;color:var(--cyan-800)}

  @media (max-width: 640px){
    .ht-quick .links{flex-direction:column}
  }

  /* Tabs (students page) */
  .tab-heads{display:flex;gap:8px;margin:8px 0 12px; flex-wrap: wrap;}
  .tab-head, .tab-header{appearance:none;border:1px solid #eaf3f6;background:#fff;padding:8px 12px;border-radius:10px;cursor:pointer;color:var(--ink);display:inline-flex;align-items:center;gap:6px}
  .tab-head:hover, .tab-header:hover{background:#f7fdff;border-color:#e4f4f8}
  .tab-head.active, .tab-header.active{
        background: var(--cyan-600);
    color: #fff;
    border-color: var(--cyan-600);
    border-color:#d9eef3;
    box-shadow:var(--shadow-1)
}
  .tab-contents .tab-content, .billing-tab-contents .billing-tab-content{display:none}
  .tab-contents .tab-content.active, .billing-tab-contents .billing-tab-content.active{display:block}
  .tab-headers{margin-bottom:8px}

  /* Buttons (used in actions, filters, etc.) */
  .btn{display:inline-flex;align-items:center;gap:6px;border:1px solid #eaf3f6;background:#fff;color:var(--ink);border-radius:10px;padding:8px 10px;text-decoration:none;cursor:pointer;line-height:1;transition:transform .15s ease, box-shadow .2s ease, background-color .2s ease}
  .btn i{pointer-events:none}
  .btn:hover{transform:translateY(-1px);box-shadow:var(--shadow-1)}
  .btn:active{transform:translateY(0)}
  .btn-primary{background:var(--cyan-600);color:#fff;border-color:var(--cyan-600)}
  .btn-primary:hover{background:var(--cyan-700);border-color:var(--cyan-700);box-shadow:0 8px 22px rgba(8,145,178,.18)}
  .btn-light{background:#fff}
  .btn-light:hover{background:#f7fdff;border-color:#e4f4f8}
  .btn-accent{background:#0ea5e9;border-color:#0ea5e9;color:#fff}
  /* Form grid (students add/filter) */
  .form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}
  .form-grid .full{grid-column:1/-1}
  .form-actions{margin-top:10px;display:flex;gap:10px;flex-wrap:wrap}
  /* Tables */
  .table th,.table td{font-size:.96rem}
  .table tr:hover{background:#fafcff}
    .table thead th{color:#475569}
  .table{border-collapse:collapse}
  .table th,.table td{padding:8px 10px;border-bottom:1px solid #eef2f7}
    /* Settings page polish */
  #settingsFlash{margin-bottom:10px}
  .contact-form h3.full{grid-column:1/-1;font-size:1.02rem;margin:6px 0;color:var(--ink)}
  .contact-form hr.full{grid-column:1/-1;border:0;border-top:1px dashed #e8f1f5;margin:6px 0}
  .contact-form label > span{display:block;font-weight:600;margin-bottom:4px;color:var(--ink)}
  .tab-head + .tab-head{margin-left:8px}


/* Layout with sidebar */
.ht-menu .item.active{background:var(--cyan-50);border-color:var(--cyan-200);color:var(--cyan-800)}
.ht-menu .menu-section{font-size:.75rem;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.5px;margin-top:12px;margin-bottom:4px;padding:0 10px}
/* Layout with sidebar */
.ht-layout{
    /* position: relative; */
    display:grid;
    grid-template-columns:auto 1fr;
    gap:18px;align-items:start
}
.ht-content{
    min-width:0;
    padding-top: 10px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
}
/* .ht-sidebar{background:#fff;border:1px solid #eaf3f6;border-radius:14px;box-shadow:var(--shadow-1);position:sticky;top:96px;height:max-content} */
.ht-sidebar{background:#fff;border:1px solid #eaf3f6;border-radius:14px;box-shadow:var(--shadow-1);position:sticky;top:50px;height:max-content}
.ht-sidebar .ht-sidebar-inner{padding:14px}
.ht-user{display:flex;gap:10px;align-items:center;padding:6px 6px 12px;border-bottom:1px dashed #e8f1f5;margin-bottom:10px}
.ht-user .avatar{width:40px;height:40px;border-radius:999px;display:grid;place-items:center;background:var(--cyan-50);color:var(--cyan-700)}
.ht-user .name{font-weight:700}
.ht-user .role{color:var(--muted);font-size:.9rem}
/* .ht-menu{display:flex;flex-direction:column;gap:6px} */
.ht-menu{
    display:flex;flex-direction:column;gap:6px;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: thin;
}
.ht-menu .item{display:flex;align-items:center;/*gap:10px*/;padding:10px 10px;border-radius:10px;color:var(--ink);text-decoration:none;border:1px solid transparent;transition:.2s}
.ht-menu .item:hover{background:#f7fdff;border-color:#e4f4f8}
.ht-menu .item span{margin-left: 10px;} /*account for the gap removed from the flex parent*/
@media (max-width: 1000px){
  /* Mobile nav: slide-in drawer from the right */
  .nav{
    position:fixed;
    top:0;
    right:-320px;
    bottom:0;
    width:280px;
    flex-direction:column;
    background:var(--surface);
    padding:18px 16px;
    box-shadow:var(--shadow-2);
    transition:right .28s ease-in-out;
    z-index:30;
  }
  .nav.open{right:0;}
  .nav-list{flex-direction:column}
  .nav-actions{flex-direction:column;align-items:stretch}
  .nav-toggle{display:inline-flex;flex-direction:column}
}
/* Header (top nav) */
.site-header{position:sticky;top:0;z-index:60;background:var(--surface);box-shadow:var(--shadow-1)}
.site-header.stuck{box-shadow:var(--shadow-2)}
.nav-container{display:flex;align-items:center;justify-content:space-between;height:var(--header-h,64px)}
.brand img{height:44px}
.nav{display:flex;align-items:center;gap:22px}
.nav-list{display:flex;gap:18px;list-style:none;margin:0;padding:0}
.nav-link{display:flex;align-items:center;gap:8px;padding:6px 10px;border-radius:10px;color:var(--ink);text-decoration:none;transition:.2s}
.nav-link:hover{background:#f4fbfd;color:var(--cyan-800)}
.nav-actions{display:flex;gap:10px}
.nav-toggle{display:none;background:none;border:0;cursor:pointer;padding:4px}
.nav-toggle span{
  display:block;
  width:24px;
  height:2.5px;
  background:var(--ink);
  border-radius:2px;
  transition:transform .2s ease, opacity .2s ease;
}
.nav-toggle span+span{margin-top:5px}
/* Hamburger -> X animation */
.nav-toggle.active span:nth-child(1){transform:translateY(7px) rotate(45deg)}
.nav-toggle.active span:nth-child(2){opacity:0}
.nav-toggle.active span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

/* Optional label inside mobile drawer */
.nav-label{
  display:none;
  font-size:0.7rem;
  text-transform:uppercase;
  letter-spacing:0.08em;
  color:var(--muted);
  margin-bottom:10px;
}
@media (max-width: 1000px){
  .nav-label{display:block;}
}

/* Back to top */
#backtotop{position:fixed;bottom:20px;right:20px;width:44px;height:44px;border-radius:999px;border:0;background:var(--cyan-600);color:#fff;display:grid;place-items:center;box-shadow:var(--shadow-2);opacity:0;transform:translateY(6px);transition:.25s ease;z-index:80}
#backtotop.show{opacity:1;transform:none}
#backtotop:hover{background:var(--cyan-700)}
/* Dashboard cards */
.ht-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px;margin:14px 0}
.ht-card, .cardup{background:#fff;border:1px solid #eaf3f6;border-radius:14px;box-shadow:var(--shadow-1);padding:16px;display:flex;align-items:center;gap:14px;transition:.2s}
.ht-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-2)}
.ht-card .icon{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;background:#f4fbfd;color:var(--cyan-700);flex:0 0 auto}
.ht-card .stat{font-size:1.6rem;font-weight:800;line-height:1;color:var(--ink)}
.ht-card .label{color:var(--muted);margin-top:2px}
/* Card badge counters */
.ht-card{position:relative}
.ht-card .badge{position:absolute;top:10px;right:10px;background:var(--cyan-600);color:#fff;border-radius:999px;padding:2px 8px;font-size:.75rem;line-height:1;border:1px solid rgba(0,0,0,.05);box-shadow:var(--shadow-1)}
/* Quick actions */
.ht-quick{margin:18px 0}
.ht-quick h2{font-size:1.05rem;margin:0 0 10px;color:var(--ink)}
.ht-quick .links{display:flex;flex-wrap:wrap;gap:10px}
.ht-quick .q{display:inline-flex;align-items:center;gap:8px;padding:10px 12px;border:1px solid #eaf3f6;border-radius:10px;background:#fff;color:var(--ink);text-decoration:none;transition:.2s}
  .ht-quick .q:hover{background:#f7fdff;border-color:#e4f4f8}
/* Right side info card */
.section .container .right-side > div{background:#fff;border:1px solid #eaf3f6;border-radius:14px;padding:16px;box-shadow:var(--shadow-1)}
.section .container .right-side h2{margin:0 0 8px;font-size:1.15rem;color:var(--ink)}
.section .container .right-side p{margin:0 0 12px;color:var(--muted);line-height:1.5}
.section .container .right-side .imgbox{margin-top:6px;display:block}
.section .container .right-side .imgbox img{max-width:100%;height:auto;border-radius:10px;display:block}



/* Slide-in panels */
.ann-panel{position:fixed;inset:0;pointer-events:none;z-index:3000}
.ann-panel .ann-overlay{position:absolute;inset:0;background:rgba(0,0,0,.35);opacity:0;transition:.2s;pointer-events:none}
.ann-panel .ann-aside{position:absolute;top:0;right:-520px;width:min(520px,92vw);height:100%;background:#fff;border-left:1px solid #eaf3f6;box-shadow:var(--shadow-2);transition:right .25s ease;display:flex;flex-direction:column}
.ann-panel.open{pointer-events:auto}
.ann-panel.open .ann-overlay{opacity:1;pointer-events:auto}
.ann-panel.open .ann-aside{right:0}
  /* Inputs/selects inside forms */
  .contact-form input[type="text"],
  .contact-form input[type="tel"],
  .contact-form input[type="email"],
  .contact-form input[type="password"],
  .contact-form input[type="date"],
  .contact-form input[type="number"],
  .contact-form input[type="time"],
  .contact-form select,
  td:has(select) select, textarea#pr_notes,
  .contact-form textarea{
    width:100%;
    box-sizing:border-box;
    padding:10px 12px;
    border:1px solid #eaf3f6;
    border-radius:10px;
    background:#fff;
    color:var(--ink);
    outline:none;
    transition:border-color .15s ease, box-shadow .15s ease, background .15s ease;
  }
    .contact-form textarea{min-height:88px;resize:vertical}
  .contact-form select{appearance:none;background-image:linear-gradient(45deg,transparent 50%,#94a3b8 50%),linear-gradient(135deg,#94a3b8 50%,transparent 50%);background-position:calc(100% - 18px) calc(1em + 2px),calc(100% - 13px) calc(1em + 2px);background-size:5px 5px,5px 5px;background-repeat:no-repeat;padding-right:34px}
  .contact-form input::placeholder,
  .contact-form textarea::placeholder{color:#9aa8b4}
  .contact-form select:focus,
  .contact-form textarea:focus{border-color:#cdebf3;box-shadow:0 0 0 3px rgba(0,156,181,.12)}
  .contact-form input[aria-invalid="true"],
  .contact-form select[aria-invalid="true"],
  .contact-form textarea[aria-invalid="true"]{border-color:#fecaca;box-shadow:0 0 0 3px rgba(239,68,68,.08)}
  .contact-form small{color:var(--muted)}
  /* Materials list cards */
  .material-card{display:block;margin:14px 0}
  .material-card .material-header{display:flex;align-items:center;justify-content:space-between}
  .material-card .material-title{margin:0 0 4px;font-size:1.02rem;color:var(--ink)}
  .material-card .material-meta{margin:2px 0}
  .material-card .material-date{margin:2px 0}
  .material-card .material-actions{display:flex;align-items:center;justify-content:space-between;margin-top:8px}
  .material-card .material-actions .left{display:flex;gap:8px;align-items:center}
  .material-card .uploader{background:#f4fbfd;color:var(--cyan-800)}
  /* Materials pager */
  .materials-pager{display:flex;gap:10px;justify-content:flex-end;margin-top:10px}
  /* Visual polish */
  .grid .material-card.card{border:1px solid #eaf3f6;border-radius:14px;background:#fff;box-shadow:var(--shadow-1);padding:14px}
  .material-card{transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease}
  .material-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-2);border-color:#d9eef3}
  .material-header .left{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
  .materials-summary{margin-bottom:8px}
  .material-actions .btn{background:#fff;border-color:#eaf3f6}
  .materials-pager .btn{background:#fff;border-color:#eaf3f6}
  .materials-pager .btn:hover{background:#f7fdff;border-color:#e4f4f8}
    /* Ensure consistent spacing inside grid */
  #list.grid{gap:14px}
  /* File type pill colors */
  .mat-type{margin-left:8px;display:inline-flex;align-items:center;border-radius:10px;padding:4px 8px;font-size:.8rem;border:1px solid #eaf3f6}
  .mat-type.type-pdf{background:#fef2f2;color:#991b1b}
  .mat-type.type-doc{background:#eff6ff;color:#1e3a8a}
  .mat-type.type-xls{background:#ecfdf5;color:#065f46}
  .mat-type.type-ppt{background:#fff7ed;color:#9a3412}
  .mat-type.type-img{background:#f5f3ff;color:#5b21b6}
  .mat-type.type-csv{background:#ecfeff;color:#164e63}
  .mat-type.type-txt{background:#f8fafc;color:#334155}
  .mat-type.type-file{background:#f1f5f9;color:#334155}
  .subject-chip{background:#eef2ff;color:#3730a3;border:1px solid #c7d2fe}

/* Announcements: dropdown + slide-in panels (align teacher with headteacher styles) */

  .ann-wrap{position:relative}
.ann-badge{display:none;margin-left:6px;background:#ef4444;color:#fff;border-radius:999px;padding:1px 6px;font-size:.75rem}
.ann-dropdown{display:none;position:absolute;right:0;top:calc(100% + 6px);background:#fff;border:1px solid #eaf3f6;border-radius:12px;box-shadow:var(--shadow-2);width:min(92vw,420px);z-index:2000}
.ann-dropdown.show{display:block}
.ann-list{padding:8px}
.ann-items{list-style:none;margin:0;padding:0;max-height:60vh;overflow:auto}
.ann-item{padding:8px;border-bottom:1px solid #eef2f7;cursor:pointer}
.ann-pager{display:flex;gap:6px;justify-content:flex-end;margin-top:6px}
/* Adding a chevron icon for toggling sidebar in mobile view */

#sidebar-toggler{
    position: relative;
    /* top: 20px; */
    right: 0px;
    /* top: 40vh; */
    z-index: 1000;
    
    /* width: 40px;
    height: 40px; */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 100%;
    height: 0;
}


.sidebar-toggler .toggler-icon{
    position: absolute;
    top: 100px;
    width: 40px;
    height: 40px;
    right: -20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--cyan-50);
    color: var(--cyan-800);
    border: 2px solid var(--cyan-500);
    border-radius: 50%;
    z-index: 999;
    transition: 0.5s all;
}
.toggler-icon:hover{
    filter: brightness(1.2);
}
.sidebar-toggler .toggler-icon.open{
    transform: rotate(180deg);
}
.sidebar-toggler .toggler-icon.close{
    transform: rotate(0deg);
}
.ht-sidebar{
    transition: 0.5s all;
    width: max-content;
}

@media screen and (min-width: 600px) {
    .sidebar-toggler{
        width: 0px !important;
        height: 0px !important;
        overflow: hidden;
     }
}
@media screen and (max-width: 1000px) {
    .nav-toggle{display:block;}
}
.ht-menu .item span { /*.ht-user*/
    transition: 0.5s all;
}
@media screen and (max-width: 600px) {
    
    .container{
        padding-inline-start: unset;
    }
    .ht-sidebar{
        top: 5px;
    }
    /* recent add */

    .ht-layout:has(.toggler-icon.close){
        grid-template-columns: 1fr !important;
        .ht-sidebar{
            z-index: 99999;
            position: fixed;
            top: 0px;
            left: 0px;
        }
    }
    .ht-sidebar:has(.toggler-icon.open){
        /* background-color: red !important; */
        .ht-sidebar-inner{
            height: max-content;
            overflow-y: auto;
            padding: 8px;
        }
        .ht-menu .item span{
            text-wrap: nowrap;
            /* display: none; */
            width: 0px;
            height: 0px;
            transform: translateX(-100%);
            overflow: hidden;
            margin: 0;
            padding: 0;
        }
        .menu-section{
            display: none;
        }
        .ht-menu .item{
            justify-content: center;
        }
        .ht-user{
            /* display: none; */
            width: 0px;
            height: 0px;
            overflow: hidden;
            margin: 0;
            padding: 0;
        }
    }
    
    .nav-toggle{display:block;}
}
@media screen and (max-width: 350px) {
    .resp-grid{
        grid-template-columns:1fr !important;
    }
}
/* ========================================
   Payment Alert Modal Styles
   ======================================== */

.payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    overflow: auto;
}

.payment-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.payment-modal-dialog {
    position: relative;
    margin: 30px auto;
    max-width: 800px;
    z-index: 2;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.payment-modal-content {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-2);
    overflow: hidden;
}

.payment-modal-header {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: var(--ink);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.payment-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--ink);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.payment-modal-close:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.1);
}

.payment-modal-close:disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

.payment-modal-body {
    padding: 24px;
    max-height: 500px;
    overflow-y: auto;
}

.payment-alert-box {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 16px;
    border-radius: var(--radius-sm);
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.payment-alert-box i {
    font-size: 24px;
    color: #f59e0b;
    flex-shrink: 0;
}

.payment-alert-box strong {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
}

.payment-alert-box p {
    margin: 0;
    color: var(--muted);
}

.payment-info-box {
    background: var(--cyan-50);
    border-left: 4px solid var(--cyan-600);
    padding: 12px;
    border-radius: var(--radius-sm);
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.payment-info-box i {
    color: var(--cyan-600);
    flex-shrink: 0;
}

.payment-info-box a {
    color: var(--cyan-700);
    text-decoration: underline;
}

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

.student-card {
    background: var(--surface);
    border: 1px solid #eaf3f6;
    border-left: 4px solid #f59e0b;
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: start;
    transition: all 0.2s;
    cursor: pointer;
}

.student-card:hover {
    box-shadow: var(--shadow-1);
    transform: translateY(-2px);
}

.student-card.overdue {
    border-left-color: #ef4444;
}

.student-card-info {
    flex: 1;
}

.student-card-info h6 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
}

.student-card-info p {
    margin: 0 0 8px 0;
    color: var(--muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.payment-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: var(--cyan-100);
    color: var(--cyan-800);
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-dark {
    background: #374151;
    color: #fff;
}

.student-card-amount {
    text-align: right;
}

.amount-owed {
    font-size: 24px;
    font-weight: 700;
    color: #dc2626;
    margin: 0;
}

.amount-paid {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.payment-modal-footer {
    background: var(--bg);
    padding: 16px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid #eaf3f6;
}

.payment-btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.payment-btn-secondary {
    background: #6b7280;
    color: #fff;
}

.payment-btn-secondary:hover:not(:disabled) {
    background: #4b5563;
}

.payment-btn-secondary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.payment-btn-primary {
    background: var(--cyan-600);
    color: #fff;
}

.payment-btn-primary:hover {
    background: var(--cyan-700);
}

body.payment-modal-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .payment-modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .student-card {
        flex-direction: column;
        gap: 12px;
    }
    
    .student-card-amount {
        text-align: left;
    }
    
    .payment-modal-footer {
        flex-direction: column;
    }
    
    .payment-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   Debtors Page Styles
   ======================================== */

.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.page-header {
    background: linear-gradient(135deg, var(--cyan-600) 0%, var(--cyan-700) 100%);
    color: white;
    padding: 30px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    box-shadow: var(--shadow-2);
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header p {
    opacity: 0.9;
    font-size: 15px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 8px;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-1);
    border-left: 4px solid var(--cyan-600);
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
}

.stat-card.danger {
    border-left-color: #ef4444;
}

.stat-card.warning {
    border-left-color: #f59e0b;
}

.stat-card.success {
    border-left-color: #10b981;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
}

.stat-card.danger .stat-card-icon {
    background: #fee2e2;
    color: #dc2626;
}

.stat-card.warning .stat-card-icon {
    background: #fef3c7;
    color: #d97706;
}

.stat-card.success .stat-card-icon {
    background: #d1fae5;
    color: #059669;
}

.stat-card-label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--ink);
    margin-top: 4px;
}

.filters-section {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    box-shadow: var(--shadow-1);
}

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

.filters-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
}

.filter-input,
.filter-select {
    padding: 10px 14px;
    border: 1px solid #eaf3f6;
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--surface);
    color: var(--ink);
    transition: all 0.2s;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--cyan-600);
    box-shadow: 0 0 0 3px var(--cyan-50);
}

.filter-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.debtors-container {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-1);
    overflow: hidden;
}

.debtors-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eaf3f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.debtors-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-count {
    font-size: 14px;
    color: var(--muted);
}

.table-wrapper {
    overflow-x: auto;
}

.debtors-table {
    width: 100%;
    border-collapse: collapse;
}

.debtors-table thead {
    background: var(--cyan-50);
}

.debtors-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--cyan-800);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--cyan-200);
}

.debtors-table td {
    padding: 16px;
    border-bottom: 1px solid #eaf3f6;
}

.debtors-table tbody tr {
    transition: background 0.2s;
}

.debtors-table tbody tr:hover {
    background: var(--cyan-50);
}

.student-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.student-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan-600) 0%, var(--cyan-700) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.student-details {
    display: flex;
    flex-direction: column;
}

.student-name {
    font-weight: 600;
    color: var(--ink);
}

.student-class {
    font-size: 13px;
    color: var(--muted);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-partial {
    background: var(--cyan-100);
    color: var(--cyan-800);
}

.status-overdue {
    background: #fee2e2;
    color: #991b1b;
}

.status-locked {
    background: #f3f4f6;
    color: #374151;
}

.amount-cell {
    font-weight: 600;
    font-size: 15px;
}

.amount-danger {
    color: #dc2626;
}

.amount-warning {
    color: #d97706;
}

.days-overdue {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon.btn-view {
    background: #ede9fe;
    color: #6366f1;
}

.btn-icon.btn-view:hover {
    background: #ddd6fe;
}

.btn-icon.btn-notify {
    background: var(--cyan-100);
    color: var(--cyan-700);
}

.btn-icon.btn-notify:hover {
    background: var(--cyan-200);
}

.empty-state {
    padding: 60px 20px;
    text-align: center;
}

.empty-state-icon {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--ink);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--muted);
}

.loading-state {
    padding: 60px 20px;
    text-align: center;
}

.loading-spinner {
    font-size: 48px;
    color: var(--cyan-600);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .page-container {
        padding: 12px;
    }
    
    .page-header {
        padding: 20px;
    }
    
    .page-header h1 {
        font-size: 22px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .btn {
        /* width: 100%; */
        justify-content: center;
    }
    
    .debtors-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .table-wrapper {
        overflow-x: scroll;
    }
    
    .debtors-table {
        min-width: 800px;
    }
}
.repose-up{
    top: 0px !important;
}
.stack-vertical-flex{
    display: flex !important;
    flex-direction: column !important;
}

.cards-4{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.cards-3{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
/* Stat Cards - Generic gradient cards for statistics */
.stat-card {
    background: white;
    color: var(--ink);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
  }
  .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  .stat-card.gradient {
    color: white;
  }
  /* intentionally commenting this out to avoid too much colorful stuff */
  /* .stat-card.gradient-purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
  }
  .stat-card.gradient-pink {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
  }
  .stat-card.gradient-sunset {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
  }
  .stat-card.gradient-cyan {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
  } */
  .stat-card .stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 8px;
  }
  .stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
  }

/* Table scroll wrapper - prevents table overflow */
.table-scroll-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}
.table-scroll-wrapper table {
  min-width: 600px;
  margin-bottom: 0;
}

/* Subtle scrollbar styling */
.table-scroll-wrapper::-webkit-scrollbar {
  height: 8px;
}
.table-scroll-wrapper::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}
.table-scroll-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.table-scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Firefox scrollbar */
.table-scroll-wrapper {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

/* @media screen and (max-width: 600px) {
    .cards-4{
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
} */

  /* Generic cards (used in My Periods) */
.card{background:#fff;border:1px solid #eaf3f6;border-radius:14px;box-shadow:var(--shadow-1);padding:12px;margin:10px 0}
.card-title{margin:0 0 8px;font-weight:700;color:var(--ink);display:flex;align-items:center;gap:8px}
.card-body{color:var(--ink)}
.cards-2{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px}

.ht-content-header{
    background:#fff;
    padding:14px;
    border-radius:12px;
    box-shadow:0 2px 8px rgba(0,0,0,0.05);
    margin-bottom:24px;
}

/* Page Header Components */
.page-header-inner{
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:16px;
}

.page-header-left{
    display:flex;
    align-items:center;
    gap:16px;
}

.page-icon{
    width:56px;
    height:56px;
    background:linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    border-radius:12px;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
}

.page-icon i{
    font-size:28px;
    color:#fff;
}

.page-header-text{
    flex:1;
}

.page-title{
    margin:0;
    font-size:1.75rem;
    font-weight:600;
    color:#0f172a;
}

.page-subtitle{
    margin:4px 0 0;
    color:#64748b;
    font-size:0.95rem;
}

.page-header-btn{
    padding:10px 20px;
    background:#f8fafc;
    color:#0891b2;
    text-decoration:none;
    border-radius:8px;
    font-weight:600;
    border:2px solid #e2e8f0;
    transition:all 0.3s;
    display:inline-flex;
    align-items:center;
    gap:8px;
}

.page-header-btn:hover{
    background:#e0f2fe;
    border-color:#0891b2;
    transform:translateY(-2px);
}

/* Responsive Grid System */
.row{
    display:flex;
    flex-wrap:wrap;
    margin-left:-12px;
    margin-right:-12px;
}

.row > *{
    padding-left:12px;
    padding-right:12px;
}

/* Mobile first: All columns full width by default */
[class*="col-"]{
    width:100%;
    box-sizing:border-box;
}

/* Medium screens and up (768px+) */
@media (min-width: 768px){
    .col-md-1{width:8.333333%}
    .col-md-2{width:16.666667%}
    .col-md-3{width:25%}
    .col-md-4{width:33.333333%}
    .col-md-5{width:41.666667%}
    .col-md-6{width:50%}
    .col-md-7{width:58.333333%}
    .col-md-8{width:66.666667%}
    .col-md-9{width:75%}
    .col-md-10{width:83.333333%}
    .col-md-11{width:91.666667%}
    .col-md-12{width:100%}
}

/* Large screens (1024px+) */
@media (min-width: 1024px){
    .col-lg-1{width:8.333333%}
    .col-lg-2{width:16.666667%}
    .col-lg-3{width:25%}
    .col-lg-4{width:33.333333%}
    .col-lg-5{width:41.666667%}
    .col-lg-6{width:50%}
    .col-lg-7{width:58.333333%}
    .col-lg-8{width:66.666667%}
    .col-lg-9{width:75%}
    .col-lg-10{width:83.333333%}
    .col-lg-11{width:91.666667%}
    .col-lg-12{width:100%}
}

/* Form group for spacing */
.form-group{
    margin-bottom:16px;
}

.form-label{
    display:block;
    margin-bottom:6px;
    font-weight:600;
    color:var(--ink);
}

.form-control{
    width:100%;
    padding:10px 14px;
    border:1px solid #d1d5db;
    border-radius:8px;
    font-size:1rem;
    transition:all 0.2s;
}

.form-control:focus{
    outline:none;
    border-color:#0891b2;
    box-shadow:0 0 0 3px rgba(8,145,178,0.1);
}
/* hidding this, class for container used to display class insights toast for 
headteachers to set their academic year and term start well, when we didnt enforce */
.toast-container{ 
    display: none;
}

/* #asmModal{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.35);
    z-index:9999;
    align-items:center;
    justify-content:center;
    padding:14px
} */
 .simple-modal{
    display:none;position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:9999;
    /* align-items:center; */
    justify-content:center;padding:14px;
 }
 .simple-modal-inner{
    background:#fff;border-radius:12px;box-shadow:var(--shadow-2);max-width:640px;width:100%;padding:14px;
    overflow-y: auto;
 }
 .resp-grid{
    display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:20px;
 }

