/* =====================================================================
   PLSE — custom theme  (Bootstrap 5 overrides + components)
   ===================================================================== */
:root{
    /* TPSC brand palette — from the official college logo/seal */
    --plse-primary:#009edb;      /* TPSC blue (official brand colour) */
    --plse-primary-dark:#00779f;
    --plse-accent:#1eb53a;       /* TPSC green (logo ring) */
    --plse-gold:#fcd116;         /* flag gold (torch) */
    --plse-red:#d21034;          /* flag red (torch flame) */
    --plse-ink:#0f231a;
    --plse-muted:#5b6b62;
    --plse-bg:#f2f7f4;
    --plse-card:#ffffff;
    --plse-ring:rgba(0,158,219,.22);
    --plse-grad:linear-gradient(135deg,#009edb 0%,#1eb53a 100%);
    --plse-grad-soft:linear-gradient(135deg,#e6f6fc 0%,#e7f6ec 100%);
}

body{ background:var(--plse-bg); color:var(--plse-ink);
    font-family:'Segoe UI',system-ui,-apple-system,sans-serif; }

a{ text-decoration:none; }

/* ---- buttons / brand colours ---- */
.btn-primary{ --bs-btn-bg:var(--plse-primary); --bs-btn-border-color:var(--plse-primary);
    --bs-btn-hover-bg:var(--plse-primary-dark); --bs-btn-hover-border-color:var(--plse-primary-dark);
    --bs-btn-active-bg:var(--plse-primary-dark); }
.btn-outline-primary{ --bs-btn-color:var(--plse-primary); --bs-btn-border-color:var(--plse-primary);
    --bs-btn-hover-bg:var(--plse-primary); --bs-btn-hover-border-color:var(--plse-primary); }
.text-primary{ color:var(--plse-primary)!important; }
.bg-grad{ background:var(--plse-grad); }
.text-grad{ background:var(--plse-grad); -webkit-background-clip:text; background-clip:text; color:transparent; }

.btn{ border-radius:.65rem; font-weight:600; }
.btn-lg{ padding:.7rem 1.4rem; }
.card{ border:0; border-radius:1rem; box-shadow:0 1px 3px rgba(15,23,42,.06),0 8px 24px -12px rgba(15,23,42,.12); }
.form-control,.form-select{ border-radius:.6rem; padding:.6rem .85rem; }
.form-control:focus,.form-select:focus{ border-color:var(--plse-primary); box-shadow:0 0 0 .25rem var(--plse-ring); }
.badge{ font-weight:600; letter-spacing:.2px; }

/* ---- fixed government header (TPSC logo left, Tanzania emblem right) ---- */
:root{ --gov-offset:128px; }                 /* must clear the fixed header height */
.gov-header{ background:#fff; box-shadow:0 4px 14px rgba(15,23,42,.08); }
.gov-id{ padding:.5rem 0;
    border-bottom:3px solid transparent;
    border-image:linear-gradient(90deg,#1eb53a 0 25%,#fcd116 25% 50%,#00a3dd 50% 75%,#000 75% 100%) 1; }
.gov-logo{ height:100px; width:auto; }
.gov-emblem{ height:64px; width:auto; }
.gov-org{ line-height:1.28; padding:0 .5rem; }
.gov-org-1{ font-size:1.5rem; font-weight:700; letter-spacing:.4px; text-transform:uppercase; color:var(--plse-primary); }
.gov-org-2{ font-size:1rem; color:#3a4a42; }
.gov-org-3{ font-size:2rem; font-weight:800; color:var(--plse-primary-dark); }
.gov-main{ padding-top: 155px; min-height: 69vh; }
@media (max-width:991.98px){
    :root{ --gov-offset:118px; }
    .gov-logo{ height:46px; } .gov-emblem{ height:50px; }
    .gov-org-1{ font-size:.68rem; } .gov-org-2{ font-size:.7rem; } .gov-org-3{ font-size:.9rem; }
}
@media (max-width:575.98px){
    :root{ --gov-offset:108px; }
    .gov-logo{ height:38px; } .gov-emblem{ height:42px; }
    .gov-org-1{ font-size:.6rem; } .gov-org-2{ display:none; } .gov-org-3{ font-size:.76rem; }
}

/* ---- public navbar ---- */
.navbar.plse-nav{ background:rgba(255,255,255,.92); backdrop-filter:blur(10px);
    box-shadow:0 1px 0 rgba(15,23,42,.06); }
.navbar.plse-nav .navbar-brand{ font-weight:800; font-size:1.35rem; }
.brand-badge{ width:38px;height:38px;border-radius:11px; background:var(--plse-grad);
    display:inline-grid;place-items:center;color:#fff;font-weight:800;margin-right:.5rem; }
/* logo image used in the brand lockups */
.brand-logo{ height:38px; width:38px; border-radius:11px; margin-right:.5rem; display:inline-block;
    box-shadow:0 4px 10px -4px rgba(10,138,58,.5); }
.brand-logo-lg{ height:46px; width:46px; border-radius:13px; }

/* ---- hero ---- */
.hero{ background:var(--plse-grad); color:#fff; position:relative; overflow:hidden; border-radius:0 0 2rem 2rem; }
.hero:before{ content:''; position:absolute; inset:0;
    background:radial-gradient(600px 300px at 80% -10%,rgba(255,255,255,.25),transparent); }
.hero h1{ font-weight:800; line-height:1.1; }
.hero .stat{ background:rgba(255,255,255,.15); border-radius:1rem; padding:1rem 1.25rem; backdrop-filter:blur(4px); }

/* ---- course cards ---- */
.course-card{ transition:transform .2s ease, box-shadow .2s ease; height:100%; overflow:hidden; }
.course-card:hover{ transform:translateY(-6px); box-shadow:0 18px 40px -18px rgba(10,138,58,.45); }
.course-thumb{ height:160px; background:var(--plse-grad-soft); display:grid; place-items:center;
    font-size:3rem; color:var(--plse-primary); position:relative; }
.course-thumb img{ width:100%; height:100%; object-fit:cover; }
.course-card .badge-cat{ position:absolute; top:.75rem; left:.75rem; }
.price-tag{ font-weight:800; color:var(--plse-primary); }

/* ---- campus chips ---- */
.campus-chip{ border:1px solid #e2e8f0; border-radius:999px; padding:.35rem .8rem; font-size:.85rem;
    display:inline-flex; gap:.4rem; align-items:center; background:#fff; }

/* ---- campus picker scroll area (keeps form short with many campuses) ---- */
.campus-scroll{ max-height:300px; overflow-y:auto; padding:2px 8px 2px 2px; }
.campus-scroll::-webkit-scrollbar{ width:8px; }
.campus-scroll::-webkit-scrollbar-thumb{ background:#cbd5e1; border-radius:8px; }
.campus-scroll::-webkit-scrollbar-track{ background:transparent; }

/* ---- selectable cards (apply: campus & attendance mode) ---- */
.select-card{ position:relative; border:2px solid #e2e8f0!important; transition:border-color .15s, box-shadow .15s, background .15s, transform .1s; }
.select-card:hover{ border-color:var(--plse-accent)!important; }
.btn-check:checked + .select-card{ border-color:var(--plse-primary)!important;
    background:var(--plse-grad-soft); box-shadow:0 0 0 .2rem var(--plse-ring); }
.btn-check:focus-visible + .select-card{ box-shadow:0 0 0 .2rem var(--plse-ring); }
.btn-check:checked + .select-card .fw-bold{ color:var(--plse-primary-dark); }
/* green tick badge shown only when selected */
.select-card .tick{ position:absolute; top:.55rem; right:.55rem; width:1.5rem; height:1.5rem;
    border-radius:50%; background:var(--plse-primary); color:#fff; display:none;
    align-items:center; justify-content:center; font-size:.95rem; box-shadow:0 2px 6px rgba(10,138,58,.45); }
.btn-check:checked + .select-card .tick{ display:flex; }

/* ---- admin shell ---- */
.admin-wrap{ display:flex; min-height:100vh; }
.admin-side{ width:260px; background:#0f172a; color:#cbd5e1; flex-shrink:0; position:sticky; top:0; height:100vh; overflow-y:auto; }
.admin-side .brand{ padding:1.25rem 1.25rem; font-weight:800; color:#fff; font-size:1.2rem; display:flex; align-items:center; }
.admin-side .nav-link{ color:#cbd5e1; border-radius:.6rem; margin:.15rem .75rem; padding:.65rem .9rem; font-weight:500; display:flex; align-items:center; gap:.7rem; }
.admin-side .nav-link i{ font-size:1.1rem; }
.admin-side .nav-link:hover{ background:rgba(255,255,255,.08); color:#fff; }
.admin-side .nav-link.active{ background:var(--plse-grad); color:#fff; box-shadow:0 8px 20px -10px var(--plse-primary); }
.admin-side .nav-section{ font-size:.7rem; text-transform:uppercase; letter-spacing:.12em; color:#475569; padding:1rem 1.5rem .25rem; }
.admin-main{ flex:1; min-width:0; }
.admin-topbar{ background:#fff; box-shadow:0 1px 0 rgba(15,23,42,.06); padding:.85rem 1.5rem;
    display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:20; }
.admin-content{ padding:1.5rem; }

/* ---- stat cards ---- */
.stat-card{ border-radius:1rem; padding:1.25rem; color:#fff; position:relative; overflow:hidden; }
.stat-card .ico{ position:absolute; right:-6px; bottom:-10px; font-size:4.5rem; opacity:.18; }
.stat-card .num{ font-size:1.9rem; font-weight:800; line-height:1; }
.stat-card .lbl{ opacity:.9; font-size:.85rem; }
.sc-1{ background:linear-gradient(135deg,#0a8a3a,#077030); }
.sc-2{ background:linear-gradient(135deg,#0aa2dc,#0782b3); }
.sc-3{ background:linear-gradient(135deg,#10b981,#059669); }
.sc-4{ background:linear-gradient(135deg,#f59e0b,#d97706); }
.sc-5{ background:linear-gradient(135deg,#ef4444,#dc2626); }
.sc-6{ background:linear-gradient(135deg,#3b82f6,#2563eb); }

/* ---- avatar ---- */
.avatar{ width:40px;height:40px;border-radius:50%; background:var(--plse-grad); color:#fff;
    display:grid;place-items:center;font-weight:700; }

/* ---- timeline ---- */
.steps{ display:flex; gap:0; list-style:none; padding:0; margin:0 0 1.5rem; }
.steps li{ flex:1; text-align:center; position:relative; color:var(--plse-muted); font-size:.85rem; }
.steps li .dot{ width:34px;height:34px;border-radius:50%; background:#e2e8f0; color:#64748b;
    display:grid;place-items:center;margin:0 auto .4rem;font-weight:700; }
.steps li.active .dot{ background:var(--plse-grad); color:#fff; }
.steps li:not(:last-child):after{ content:''; position:absolute; top:17px; left:50%; width:100%; height:2px; background:#e2e8f0; z-index:-1; }

/* ---- invoice ---- */
.invoice-box{ max-width:820px; margin:1.5rem auto; background:#fff; border-radius:1rem; }
.control-number{ font-family:'Courier New',monospace; font-size:1.5rem; font-weight:800; letter-spacing:3px;
    color:var(--plse-primary); }
@media print{
    .no-print{ display:none!important; }
    body{ background:#fff; }
    .invoice-box{ box-shadow:none; margin:0; }
}

/* ---- misc ---- */
.section-title{ font-weight:800; }
.divider{ height:1px; background:#e2e8f0; margin:1.5rem 0; }
.empty-state{ text-align:center; padding:3rem 1rem; color:var(--plse-muted); }
.empty-state i{ font-size:3rem; opacity:.4; }
footer.plse-foot{ background:#0f172a; color:#94a3b8; }
footer.plse-foot a{ color:#cbd5e1; }
.select2-container--default .select2-selection--single{ height:auto; padding:.35rem .25rem; border-radius:.6rem; border-color:#dee2e6; }

/* ---- auth (login / reset password) ---- */
.auth-section{ padding:2.5rem 0 4rem; min-height:calc(100vh - 155px - 260px); display:flex; align-items:center; }
.auth-shell{ border-radius:1.5rem; overflow:hidden; box-shadow:0 20px 50px -20px rgba(15,35,26,.25); background:var(--plse-card); }

.auth-info{ background:var(--plse-grad); color:#fff; position:relative; border-top-left-radius:1.5rem; border-bottom-left-radius:1.5rem; }
.auth-info::after{ content:''; position:absolute; inset:0; border-radius:inherit; background:url('patterns/shattered.png') repeat; opacity:.08; }
.auth-info-inner{ position:relative; padding:3rem 2.5rem; display:flex; flex-direction:column; height:100%; justify-content:center; }
.auth-info-badge{ width:56px; height:56px; border-radius:1rem; background:rgba(255,255,255,.18); display:flex; align-items:center; justify-content:center; font-size:1.5rem; margin-bottom:1.25rem; }
.auth-info-inner h3{ font-weight:800; margin-bottom:.75rem; }
.auth-info-inner p{ opacity:.92; margin-bottom:1.5rem; }
.auth-info-list{ list-style:none; padding:0; margin:0 0 1.75rem; display:flex; flex-direction:column; gap:.65rem; }
.auth-info-list li{ display:flex; align-items:flex-start; gap:.6rem; font-size:.95rem; }
.auth-info-list li i{ margin-top:.2rem; opacity:.9; }
.auth-info-foot{ font-size:.85rem; opacity:.85; border-top:1px solid rgba(255,255,255,.25); padding-top:1rem; }
.auth-policy{ background:rgba(255,255,255,.12); border-radius:1rem; padding:1.25rem 1.5rem; margin-bottom:1.5rem; }
.auth-policy h6{ font-weight:700; margin-bottom:.85rem; }
.auth-policy h6 i{ margin-right:.4rem; }

.auth-card{ background:var(--plse-card); padding:3rem 2.75rem; height:100%; border-top-right-radius:1.5rem; border-bottom-right-radius:1.5rem; }
.auth-card-head{ text-align:center; margin-bottom:1.25rem; }
.auth-logo-box{ width:64px; height:64px; margin:0 auto .9rem; border-radius:50%; background:var(--plse-bg); display:flex; align-items:center; justify-content:center; overflow:hidden; }
.auth-logo{ width:100%; height:100%; object-fit:contain; }
.auth-title{ font-weight:800; color:var(--plse-ink); margin-bottom:.25rem; }
.auth-subtitle{ color:var(--plse-muted); font-size:.9rem; margin-bottom:0; }
.auth-date-badge{ display:flex; width:fit-content; align-items:center; gap:.4rem; background:var(--plse-bg); color:var(--plse-primary-dark); font-size:.8rem; font-weight:600; padding:.35rem .85rem; border-radius:999px; margin:0 auto 1.5rem; }
.auth-form .form-group{ margin-bottom:1.15rem; }
.auth-form .control-label{ font-size:.85rem; font-weight:700; color:var(--plse-ink); margin-bottom:.4rem; display:block; }
.auth-input-group{ position:relative; display:flex; align-items:center; }
.auth-input-group .form-control{ padding-left:2.6rem; border-radius:.7rem; border:2px solid #e2e8f0; height:calc(2.5em + .9rem); }
.auth-input-group .form-control:focus{ border-color:var(--plse-accent); box-shadow:0 0 0 .2rem rgba(10,162,220,.15); }
.auth-input-icon{ position:absolute; left:.9rem; color:var(--plse-muted); z-index:2; }
.auth-toggle-pwd{ position:absolute; right:.6rem; border:none; background:transparent; color:var(--plse-muted); padding:.35rem .5rem; z-index:2; }
.auth-toggle-pwd:hover{ color:var(--plse-primary); }
.auth-remember{ font-size:.9rem; color:var(--plse-ink); margin-bottom:0; }
.auth-btn{ background:var(--plse-grad); color:#fff; font-weight:700; border-radius:.7rem; padding:.75rem 1rem; border:none; }
.auth-btn:hover{ opacity:.92; color:#fff; }
.auth-policy-mobile{ background:var(--plse-bg); border-radius:.7rem; padding:.85rem 1rem; font-size:.85rem; color:var(--plse-ink); margin-bottom:1.15rem; }

.auth-card .alert{ border:none; border-left:5px solid transparent; border-radius:.85rem; padding:.85rem 1rem .85rem 3rem; font-size:.85rem;
    font-weight:600; margin-bottom:1.25rem; position:relative; }
.auth-card .alert:before{ font-family:FontAwesome; position:absolute; left:1.1rem; top:50%;
    transform:translateY(-50%); font-size:1.1rem; }
.auth-card .alert .btn-close{ font-size:.7rem; }
.auth-card .alert-success{ background:#e7f6ec; color:#0f6a2e; border-left-color:var(--plse-accent); }
.auth-card .alert-success:before{ content:"\f058"; color:var(--plse-accent); }
.auth-card .alert-danger{ background:#fdecec; color:#8a1f1f; border-left-color:var(--plse-red); }
.auth-card .alert-danger:before{ content:"\f057"; color:var(--plse-red); }
.auth-card .alert-warning{ background:#fff8e1; color:#7a5b00; border-left-color:var(--plse-gold); }
.auth-card .alert-warning:before{ content:"\f071"; color:var(--plse-gold); }
.auth-card .alert-info{ background:#e6f6fc; color:#075a78; border-left-color:var(--plse-primary); }
.auth-card .alert-info:before{ content:"\f05a"; color:var(--plse-primary); }

@media (max-width: 991.98px){
    .auth-card{ padding:2.5rem 1.5rem; border-radius:1.5rem; }
    .auth-section{ min-height:auto; }
}

.required {
    color: red;
}

/* ---- course details: duration ---- */
.duration-item{ display:flex; align-items:flex-start; gap:.75rem; }
.duration-icon{ width:42px; height:42px; border-radius:.65rem; background:var(--plse-bg); color:var(--plse-primary);
    display:flex; align-items:center; justify-content:center; font-size:1.05rem; flex-shrink:0; }
.duration-label{ font-size:.75rem; color:var(--plse-muted); font-weight:700; text-transform:uppercase; letter-spacing:.03em; }
.duration-value{ font-weight:700; color:var(--plse-ink); }
.duration-deadline-note{ font-size:.75rem; font-weight:700; margin-top:.15rem; }
.duration-deadline-note.text-ok{ color:var(--plse-accent); }
.duration-deadline-note.text-warn{ color:#b45309; }
.duration-deadline-note.text-closed{ color:var(--plse-red); }
.duration-length{ font-size:.85rem; color:var(--plse-muted); border-top:1px solid #e2e8e4; padding-top:.75rem; }

