/* ==========================================================
   Institute of Science of Mind - College Management System
   ========================================================== */
:root{
  /* Brand palette. Every value below is overridden at run time by
     brand_head() from the "brand_color" setting, so the whole system
     can be recoloured from Admin > Settings > Brand colour.        */
  --ism-primary:#b4f72d;        /* the brand colour itself          */
  --ism-on-primary:#101a04;     /* text drawn on top of it          */
  --ism-primary-dark:#93ca25;   /* hover / pressed                  */
  --ism-primary-text:#537215;   /* the brand colour, readable on white */
  --ism-deep:#253309;           /* dark surfaces: nav strip, hero   */
  --ism-deeper:#152003;         /* darkest surface: footer          */
  --ism-soft:#f3fde2;           /* tinted panel background          */

  /* legacy aliases so older rules keep working */
  --ism-maroon:var(--ism-primary-text);
  --ism-maroon-dark:var(--ism-deep);
  --ism-gold:var(--ism-primary);
  --ism-ink:#1f2430;
  --ism-muted:#6b7280;
  --ism-bg:#f5f6f8;
  --ism-line:#e6e8ec;
}
body{font-family:"Segoe UI",system-ui,-apple-system,"Helvetica Neue",Arial,sans-serif;color:var(--ism-ink)}
a{text-decoration:none}
.text-maroon,.text-primary-brand{color:var(--ism-primary-text)!important}
.bg-maroon{background:var(--ism-primary)!important;color:var(--ism-on-primary)!important}
.bg-gold{background:var(--ism-primary)!important;color:var(--ism-on-primary)!important}
.bg-deep{background:var(--ism-deep)!important;color:#fff!important}
.btn-maroon{background:var(--ism-primary);border-color:var(--ism-primary);color:var(--ism-on-primary);font-weight:600}
.btn-maroon:hover,.btn-maroon:focus{background:var(--ism-primary-dark);border-color:var(--ism-primary-dark);color:var(--ism-on-primary)}
.btn-maroon:focus-visible{outline:3px solid var(--ism-primary-text);outline-offset:2px}
.btn-outline-maroon{border-color:var(--ism-primary-text);color:var(--ism-primary-text)}
.btn-outline-maroon:hover{background:var(--ism-primary);border-color:var(--ism-primary);color:var(--ism-on-primary)}

/* ---------------- PUBLIC SITE ---------------- */
.topbar-info{background:var(--ism-deeper);color:#e8eedd;font-size:.82rem;padding:.4rem 0}
.topbar-info a{color:#e8eedd}.topbar-info a:hover{color:var(--ism-primary)}
.site-nav{background:#fff;border-bottom:3px solid var(--ism-primary)}
.site-nav .navbar-brand{font-weight:700;color:var(--ism-primary-text)}
.site-nav .nav-link{font-weight:600;color:#333;padding:.85rem .8rem!important;font-size:.9rem;letter-spacing:.2px}
.site-nav .nav-link:hover,.site-nav .nav-link.active{color:var(--ism-primary-text)}
.site-nav .nav-link.active{box-shadow:inset 0 -3px 0 var(--ism-primary)}
.logo-badge{width:46px;height:46px;border-radius:50%;background:var(--ism-primary);color:var(--ism-on-primary);display:flex;
  align-items:center;justify-content:center;font-weight:700;letter-spacing:.5px;border:2px solid var(--ism-deep)}
.hero-slider .carousel-item{height:480px;background-size:cover;background-position:center;position:relative}
.hero-slider .carousel-item::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(10,16,4,.80),rgba(10,16,4,.28))}
.hero-slider .carousel-caption{z-index:2;left:8%;right:8%;bottom:26%;text-align:left}
.hero-slider .carousel-caption h2{font-size:2.6rem;font-weight:700;text-shadow:0 2px 14px rgba(0,0,0,.5)}
.hero-slider .carousel-caption p{font-size:1.08rem;max-width:640px}
@media(max-width:768px){.hero-slider .carousel-item{height:320px}.hero-slider .carousel-caption h2{font-size:1.5rem}}
.quick-strip{margin-top:-46px;position:relative;z-index:3}
.quick-card{background:#fff;border-radius:10px;padding:1.15rem;box-shadow:0 8px 26px rgba(20,20,40,.10);height:100%;
  border-bottom:3px solid transparent;transition:.2s}
.quick-card:hover{transform:translateY(-4px);border-bottom-color:var(--ism-primary)}
.quick-card i{font-size:1.7rem;color:var(--ism-primary-text)}
.section-title{position:relative;font-weight:700;margin-bottom:1.6rem}
.section-title:after{content:"";display:block;width:56px;height:4px;background:var(--ism-primary);margin-top:.55rem;border-radius:2px}
.post-card{border:1px solid var(--ism-line);border-radius:10px;overflow:hidden;background:#fff;height:100%;transition:.2s}
.post-card:hover{box-shadow:0 10px 26px rgba(20,20,40,.09);transform:translateY(-3px)}
.post-card img{height:190px;object-fit:cover;width:100%}
.stat-band{background:var(--ism-deep);color:#fff;padding:2.6rem 0}
.stat-band .h2{color:var(--ism-primary);font-weight:700}
.site-footer{background:var(--ism-deeper);color:#c8d2ba;padding:3rem 0 1rem}
.site-footer h6{color:#fff;letter-spacing:.4px}
.site-footer a{color:#c8d2ba}.site-footer a:hover{color:var(--ism-primary)}
.page-head{background:linear-gradient(120deg,var(--ism-deep),var(--ism-deeper));color:#fff;padding:2.4rem 0;border-bottom:4px solid var(--ism-primary)}

/* ---------------- PANEL ---------------- */
.panel-body{background:var(--ism-bg)}
.topbar{background:#fff;height:58px;position:sticky;top:0;z-index:1030}
.brand-mark{width:34px;height:34px;border-radius:8px;background:var(--ism-primary);color:var(--ism-on-primary);display:inline-flex;
  align-items:center;justify-content:center;font-weight:700;font-size:.82rem}
.brand-text{font-size:.95rem;font-weight:600;color:var(--ism-ink)}
.avatar-sm{width:34px;height:34px;border-radius:50%;object-fit:cover;border:2px solid var(--ism-line)}
.panel-wrap{display:flex;min-height:calc(100vh - 58px)}
.sidebar{width:250px;background:#fff;border-right:1px solid var(--ism-line);flex-shrink:0;overflow-y:auto;
  height:calc(100vh - 58px);position:sticky;top:58px}
.side-section{font-size:.68rem;text-transform:uppercase;letter-spacing:.9px;color:#9aa0ab;padding:.9rem 1.1rem .3rem;font-weight:700}
.side-list{list-style:none;margin:0;padding:0}
.side-list a{display:flex;align-items:center;gap:.65rem;padding:.5rem 1.1rem;color:#414753;font-size:.88rem;border-left:3px solid transparent}
.side-list a:hover{background:var(--ism-soft);color:var(--ism-primary-text)}
.side-list a.active{background:var(--ism-soft);color:var(--ism-primary-text);border-left-color:var(--ism-primary);font-weight:600}
.side-list i{font-size:1rem;width:18px;text-align:center}
.content{flex:1;padding:1.4rem;min-width:0}
@media(max-width:991.98px){
  .sidebar{position:fixed;left:-260px;transition:.25s;z-index:1040;box-shadow:0 0 30px rgba(0,0,0,.2)}
  .sidebar.show{left:0}
}
.card{border:1px solid var(--ism-line);border-radius:10px}
.card-header{background:#fff;border-bottom:1px solid var(--ism-line);font-weight:600}
.stat-tile{border-radius:10px;padding:1rem 1.1rem;background:#fff;border:1px solid var(--ism-line);height:100%}
.stat-tile .ico{width:42px;height:42px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:1.2rem}
.stat-tile .val{font-size:1.6rem;font-weight:700;line-height:1.1}
.stat-tile .lbl{font-size:.78rem;color:var(--ism-muted);text-transform:uppercase;letter-spacing:.4px}
.table>:not(caption)>*>*{padding:.55rem .6rem}
.table thead th{font-size:.75rem;text-transform:uppercase;letter-spacing:.4px;color:#6b7280;background:#fafbfc;white-space:nowrap}
.table-sm td,.table-sm th{font-size:.86rem}
.form-label{font-size:.82rem;font-weight:600;color:#414753;margin-bottom:.25rem}
.required:after{content:" *";color:#c0392b}
.att-btn input{display:none}
.att-btn span{display:inline-block;min-width:34px;text-align:center;padding:.25rem .1rem;border:1px solid var(--ism-line);
  border-radius:6px;cursor:pointer;font-size:.8rem;font-weight:600}
.att-btn input:checked + span.p{background:#198754;color:#fff;border-color:#198754}
.att-btn input:checked + span.a{background:#dc3545;color:#fff;border-color:#dc3545}
.att-btn input:checked + span.l{background:#fd7e14;color:#fff;border-color:#fd7e14}
.att-btn input:checked + span.e{background:#0d6efd;color:#fff;border-color:#0d6efd}
.progress{height:8px}
.nav-tabs .nav-link{font-size:.88rem;font-weight:600}

/* ---------------- PRINT DOCUMENTS ---------------- */
.doc{background:#fff;max-width:900px;margin:1.2rem auto;padding:44px 52px;box-shadow:0 0 18px rgba(0,0,0,.08);position:relative}
.doc-head{text-align:center;border-bottom:3px solid var(--ism-primary);padding-bottom:14px;margin-bottom:22px}
.doc-head h2{color:var(--ism-primary-text);font-weight:700;margin:0;letter-spacing:.5px}
.doc-head .sub{color:#555;font-size:.9rem}
.doc-title{text-align:center;font-weight:700;letter-spacing:2px;text-transform:uppercase;margin:18px 0;font-size:1.12rem}
.doc table{width:100%;border-collapse:collapse;font-size:.87rem}
.doc table th,.doc table td{border:1px solid #b9bcc3;padding:6px 8px}
.doc table th{background:#f2f2f4}
.sign-row{display:flex;justify-content:space-between;margin-top:64px;font-size:.86rem}
.sign-row div{text-align:center;min-width:190px;border-top:1px solid #444;padding-top:5px}
.watermark{position:absolute;top:38%;left:50%;transform:translate(-50%,-50%) rotate(-28deg);font-size:5.4rem;
  color:var(--ism-soft);opacity:.75;font-weight:800;letter-spacing:8px;pointer-events:none}
@media print{
  body{background:#fff}
  .no-print,.topbar,.sidebar{display:none!important}
  .doc{box-shadow:none;margin:0;max-width:100%;padding:16px 20px}
  .panel-wrap{display:block}.content{padding:0}
  a[href]:after{content:""}
}

/* ---------------- brand accents ---------------- */
.progress-bar.bg-maroon{background:var(--ism-primary)!important}
.form-control:focus,.form-select:focus{border-color:var(--ism-primary);box-shadow:0 0 0 .2rem rgba(0,0,0,.06)}
.nav-tabs .nav-link.active{color:var(--ism-primary-text);border-bottom-color:#fff;box-shadow:inset 0 -3px 0 var(--ism-primary)}
.list-group-item.active{background:var(--ism-primary);border-color:var(--ism-primary);color:var(--ism-on-primary)}
.list-group-item.active small,.list-group-item.active .text-white-50{color:var(--ism-on-primary)!important;opacity:.75}
a{color:var(--ism-primary-text)}
a:hover{color:var(--ism-deep)}
.card-header{color:var(--ism-ink)}
::selection{background:var(--ism-primary);color:var(--ism-on-primary)}
.doc-section{color:var(--ism-primary-text);font-weight:700}
.notice-body p:last-child{margin-bottom:0}
.notice-body ul,.notice-body ol{padding-left:1.2rem;margin-bottom:.5rem}
.post-body img,.page-content img,.notice-body img{max-width:100%;height:auto;border-radius:6px}
.post-body h2,.post-body h3,.post-body h4,.page-content h2,.page-content h3,.page-content h4{color:var(--ism-primary-text);margin-top:1.4rem}
.post-body blockquote,.page-content blockquote{border-left:4px solid var(--ism-primary);padding-left:1rem;color:#555;margin:1rem 0}
.ql-align-center{text-align:center}.ql-align-right{text-align:right}.ql-align-justify{text-align:justify}
.ql-indent-1{padding-left:2rem}.ql-indent-2{padding-left:4rem}.ql-indent-3{padding-left:6rem}

/* ---------------- logos ---------------- */
.logo-img{display:inline-block;border-radius:6px;background:transparent;vertical-align:middle}
.logo-badge-dark{background:var(--ism-deep);color:#fff;border-color:var(--ism-primary)}
.logo-pair{display:inline-flex;align-items:center;gap:.6rem}
.logo-pair img{height:38px;width:auto;object-fit:contain}
/* On a dark panel the emblems are line art in dark ink, so they sit on a
   light disc rather than disappearing into the background. */
.logo-pair.on-dark img{background:#fff;border-radius:50%;padding:5px;
  box-shadow:0 1px 4px rgba(0,0,0,.28)}
.site-footer .logo-pair img{height:34px;background:#fff;border-radius:50%;padding:4px}
/* the printed letterhead - see includes/branding.php for the sizing rules */
.doc-head{text-align:center;margin-bottom:14px}
.doc-head h2{color:var(--ism-primary-text);font-weight:700;margin:0;letter-spacing:.5px}

/* ============================================================
   v8 additions
   ============================================================ */

/* ---------- preloader ---------- */
#ism-preloader{position:fixed;inset:0;z-index:20000;background:#fff;display:flex;
  align-items:center;justify-content:center;flex-direction:column;gap:1rem;
  transition:opacity .45s ease,visibility .45s ease}
#ism-preloader.done{opacity:0;visibility:hidden}
.ism-pre-mark{width:78px;height:78px;object-fit:contain;animation:ism-breathe 1.6s ease-in-out infinite}
.ism-pre-badge{width:78px;height:78px;border-radius:50%;background:var(--ism-primary);
  color:var(--ism-on-primary);display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:1.3rem;letter-spacing:1px;animation:ism-breathe 1.6s ease-in-out infinite}
.ism-pre-bar{width:180px;height:4px;border-radius:4px;background:var(--ism-soft);overflow:hidden}
.ism-pre-bar span{display:block;height:100%;width:40%;border-radius:4px;background:var(--ism-primary);
  animation:ism-slide 1.1s ease-in-out infinite}
.ism-pre-text{font-size:.78rem;letter-spacing:2px;text-transform:uppercase;color:#8a9080}
@keyframes ism-breathe{0%,100%{transform:scale(1);opacity:.85}50%{transform:scale(1.07);opacity:1}}
@keyframes ism-slide{0%{transform:translateX(-100%)}100%{transform:translateX(350%)}}
@media (prefers-reduced-motion:reduce){
  .ism-pre-mark,.ism-pre-badge,.ism-pre-bar span{animation:none}
  #ism-preloader{transition:none}
}

/* content fades in once the page is ready */
.ism-fade{opacity:0;transform:translateY(6px);transition:opacity .4s ease,transform .4s ease}
body.ism-ready .ism-fade{opacity:1;transform:none}

/* ---------- message modal ---------- */
.ism-msg-icon{width:64px;height:64px;border-radius:50%;display:flex;align-items:center;
  justify-content:center;font-size:1.9rem;margin:0 auto .9rem}
.ism-msg-success{background:#e7f7e3;color:#2a7d2e}
.ism-msg-danger{background:#fbe9e9;color:#b02a2a}
.ism-msg-warning{background:#fdf3e0;color:#946a10}
.ism-msg-info{background:#e8f1fb;color:#1c5fa8}

/* ---------- attendance grid ---------- */
.att-grid{font-size:.8rem}
.att-grid th,.att-grid td{padding:.25rem .3rem!important;text-align:center;vertical-align:middle}
.att-grid td.name-cell,.att-grid th.name-cell{text-align:left;white-space:nowrap;position:sticky;left:0;
  background:#fff;z-index:2;box-shadow:1px 0 0 var(--ism-line)}
.att-grid thead th{position:sticky;top:0;background:#f4f6f0;z-index:3}
.att-grid thead th.name-cell{z-index:4}
.att-cell{width:30px}
.att-pick{width:34px;height:30px;border:1px solid var(--ism-line);border-radius:5px;
  text-align:center;font-weight:600;padding:0;background:#fff;font-size:.8rem}
.att-pick[data-m="P"]{background:#e7f7e3;border-color:#a9dca2;color:#22661f}
.att-pick[data-m="A"]{background:#fbe9e9;border-color:#e8b4b4;color:#8f2020}
.att-pick[data-m="L"]{background:#fdf3e0;border-color:#eed6a4;color:#7a5709}
.att-pick[data-m="E"]{background:#e8f1fb;border-color:#b5cfe9;color:#174e88}
.att-legend span{display:inline-flex;align-items:center;gap:.3rem;margin-right:.9rem;font-size:.8rem}
.att-legend i{width:12px;height:12px;border-radius:3px;display:inline-block}

/* ---------- small polish ---------- */
.table-sticky thead th{position:sticky;top:0;background:#f4f6f0;z-index:2}
.stat-tile{border:1px solid var(--ism-line);border-radius:12px;padding:1rem 1.1rem;background:#fff;height:100%}
.stat-tile .v{font-size:1.6rem;font-weight:700;line-height:1.1;color:var(--ism-ink)}
.stat-tile .l{font-size:.72rem;letter-spacing:1px;text-transform:uppercase;color:#7b8172}
.stat-tile .ico{width:38px;height:38px;border-radius:10px;display:flex;align-items:center;
  justify-content:center;font-size:1.05rem;background:var(--ism-soft);color:var(--ism-primary-text)}
.empty-state{text-align:center;padding:2.6rem 1rem;color:#8a9080}
.empty-state i{font-size:2.4rem;opacity:.5;display:block;margin-bottom:.6rem}
.req:after{content:" *";color:#c0392b}
.table td .btn-sm{--bs-btn-padding-y:.15rem;--bs-btn-padding-x:.4rem}

/* ---------- daily attendance register ---------- */
/* Clicking a student's name highlights the whole row, so the eye does not
   lose its place part way across a long list. */
.att-name{cursor:pointer;user-select:none}
tr.att-row.on > *{background-color:var(--ism-primary)!important;color:var(--ism-on-primary)!important}
tr.att-row.on .text-muted{color:var(--ism-on-primary)!important;opacity:.8}
tr.att-row.on .form-control{border-color:var(--ism-primary-dark)}
tr.att-row:hover > *{background-color:var(--ism-soft)}
tr.att-row.on:hover > *{background-color:var(--ism-primary)!important}
.att-status .btn{min-width:38px;font-weight:600}

/* The Settings page keeps its first three tabs inside one <form>, so the
   form sits between .tab-content and the panes and Bootstrap's own rule
   cannot reach them. Without this every one of those tabs showed at once. */
.tab-content > form > .tab-pane { display: none; }
.tab-content > form > .tab-pane.active { display: block; }
