
:root {
    --primary: #198754;
    --primary-dark: #12663f;
    --primary-soft: #eaf7f0;
    --secondary: #0d6efd;
    --navy: #183153;
    --teal: #20c997;
    --warning: #ffb64d;
    --danger: #dc3545;
    --purple: #7c6ee6;
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #243746;
    --muted: #6f7f90;
    --border: #e7edf3;
    --sidebar-width: 268px;
    --topbar-height: 76px;
    --radius: 14px;
    --shadow: 0 6px 18px rgba(31, 45, 61, .07);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--text);
    background: #fff;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; }
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
}

/* Public website */
.container { width: min(1180px, 92%); margin: auto; }
.topbar { background: var(--navy); color: #dce8f2; font-size: 13px; padding: 8px 0; }
.topbar .container, .nav .container { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.nav { background: #fff; box-shadow: 0 3px 20px rgba(0,0,0,.08); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; padding: 13px 0; }
.brand-mark {
    width: 48px; height: 48px; border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--teal));
    display: grid; place-items: center; color: #fff; font-weight: 800;
}
.brand strong { display: block; color: var(--navy); font-size: 14px; max-width: 410px; }
.brand small { color: var(--primary); }
.navlinks { display: flex; align-items: center; gap: 18px; font-size: 14px; font-weight: 600; }
.navlinks a:hover { color: var(--primary); }
.portal-btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; padding: 10px 16px; background: var(--primary); color: #fff; font-weight: 700; }
.hero {
    min-height: 520px;
    background: linear-gradient(90deg, rgba(9,50,44,.92), rgba(16,42,67,.55)), url('../Content/campus-placeholder.svg') center/cover;
    display: flex; align-items: center; color: #fff;
}
.hero h1 { font-size: clamp(36px,5vw,64px); line-height: 1.04; margin: 0 0 18px; max-width: 850px; }
.hero p { font-size: 19px; line-height: 1.7; max-width: 720px; color: #e9f6f0; }
.section { padding: 72px 0; }
.section.alt { background: var(--bg); }
.section-title { text-align: center; margin-bottom: 36px; }
.section-title h2 { font-size: 34px; color: var(--navy); margin: 0 0 8px; }
.section-title p { color: var(--muted); }
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card img { width: 100%; border-radius: 12px; object-fit: cover; }
.officer { text-align: center; }
.avatar { width: 130px !important; height: 130px; border-radius: 50% !important; margin: auto; object-fit: cover; background: #e8efed; }
.footer { background: #081f33; color: #d8e4ec; padding: 55px 0 20px; }
.footer h4 { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 30px; padding-top: 20px; color: #93a7b7; }
.page-hero { padding: 90px 0; background: linear-gradient(135deg,var(--primary),var(--navy)); color: #fff; }
.gallery-grid { columns: 3 260px; column-gap: 18px; }
.gallery-grid img { width: 100%; margin: 0 0 18px; border-radius: 16px; }

/* Login */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.login-brand { background: linear-gradient(135deg,var(--primary),var(--navy)); color: #fff; padding: 8vw; display: flex; align-items: center; }
.login-card-wrap { display: grid; place-items: center; background: var(--bg); padding: 30px; }
.login-card { background: #fff; width: min(460px,100%); padding: 38px; border-radius: 18px; box-shadow: var(--shadow); }

/* Portal shell */
.portal-body { background: var(--bg); overflow-x: hidden; }
body.sidebar-open { overflow: hidden; }
.portal-layout { min-height: 100vh; width: 100%; }
.portal-sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #198754 0%, #147347 68%, #0f5d39 100%);
    color: #fff;
    z-index: 1040;
    box-shadow: 3px 0 18px rgba(20, 55, 36, .15);
    overflow: hidden;
    transition: transform .24s ease;
}
.sidebar-brand { padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.14); }
.sidebar-brand-link { display: flex; align-items: center; gap: 12px; color: #fff; }
.sidebar-logo {
    width: 45px; height: 45px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; color: var(--primary); font-weight: 800; font-size: 16px;
    box-shadow: 0 5px 15px rgba(0,0,0,.12);
}
.sidebar-brand-copy { min-width: 0; }
.sidebar-brand-copy strong { display: block; font-size: 18px; line-height: 1.1; letter-spacing: .3px; }
.sidebar-brand-copy small { display: block; color: rgba(255,255,255,.78); margin-top: 4px; font-size: 11px; }
.sidebar-user {
    display: flex; align-items: center; gap: 11px;
    margin: 14px 14px 4px;
    padding: 12px 13px;
    border-radius: 11px;
    background: rgba(255,255,255,.09);
}
.sidebar-user-avatar {
    width: 39px; height: 39px; border-radius: 50%;
    background: rgba(255,255,255,.95); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13px; flex: 0 0 39px;
}
.sidebar-user-copy { min-width: 0; }
.sidebar-user-copy strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-copy span { display: block; margin-top: 2px; font-size: 11px; color: rgba(255,255,255,.72); }
.sidebar-nav-wrap { height: calc(100vh - 154px); overflow-y: auto; padding: 10px 0 26px; -webkit-overflow-scrolling: touch; }
.sidebar-nav-wrap::-webkit-scrollbar { width: 6px; }
.sidebar-nav-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); border-radius: 10px; }
.sidebar-section-title { padding: 11px 22px 7px; font-size: 10px; letter-spacing: 1.3px; color: rgba(255,255,255,.55); font-weight: 700; }
.portal-nav-list, .portal-submenu { margin: 0; padding: 0; list-style: none; }
.portal-nav-item { list-style: none; }
.portal-nav-link {
    min-height: 47px;
    display: flex; align-items: center; gap: 11px;
    padding: 11px 17px 11px 20px;
    margin: 2px 9px;
    color: rgba(255,255,255,.93);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all .18s ease;
    border-left: 3px solid transparent;
}
.portal-nav-link:hover, .portal-nav-link.active, .portal-nav-link.active-parent {
    color: #fff;
    background: rgba(255,255,255,.13);
    border-left-color: #77b6ff;
}
.portal-nav-link.active { font-weight: 700; }
.menu-label { min-width: 0; flex: 1; }
.nav-icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; color: rgba(255,255,255,.78); flex: 0 0 20px; }
.nav-icon svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.portal-nav-link:hover .nav-icon, .portal-nav-link.active .nav-icon { color: #fff; }
.menu-chevron {
    width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg); margin-left: 5px; transition: transform .18s ease; opacity: .8;
}
.menu-toggle.expanded .menu-chevron { transform: rotate(225deg); margin-top: 5px; }
.portal-submenu { display: none; margin: 1px 9px 6px 24px; padding: 5px 0; background: rgba(0,0,0,.08); border-radius: 8px; }
.portal-submenu.show { display: block; }
.portal-submenu-link {
    display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.83);
    padding: 9px 12px 9px 18px; font-size: 13px; border-radius: 6px; margin: 1px 5px;
}
.portal-submenu-link:hover, .portal-submenu-link.active { color: #fff; background: rgba(255,255,255,.11); }
.submenu-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.45); flex: 0 0 6px; }
.portal-submenu-link.active .submenu-dot { background: #8ec5ff; box-shadow: 0 0 0 3px rgba(142,197,255,.14); }

.portal-main { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); min-height: 100vh; }
.portal-topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 11px 26px;
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    position: sticky; top: 0; z-index: 900;
    box-shadow: 0 2px 10px rgba(31,45,61,.03);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title { font-size: 16px; font-weight: 700; color: #26384d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 730px; }
.topbar-context { font-size: 12px; color: #8290a0; margin-top: 3px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-user { text-align: right; }
.topbar-user-name { display: block; font-size: 13px; font-weight: 700; color: #34465a; }
.topbar-user-role { display: block; font-size: 11px; color: #8996a5; margin-top: 2px; }
.mobile-menu-btn {
    display: none; align-items: center; justify-content: center;
    border: 0; background: var(--primary); color: #fff;
    width: 40px; height: 40px; border-radius: 8px; padding: 0;
}
.hamburger-icon { display: flex; width: 18px; height: 14px; flex-direction: column; justify-content: space-between; }
.hamburger-icon i { display: block; height: 2px; width: 18px; background: currentColor; border-radius: 2px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(14,25,38,.48); z-index: 1030; }
.sidebar-overlay.show { display: block; }
.portal-content { padding: 26px; max-width: 100%; overflow-x: hidden; }

/* Page components */
.page-head {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    margin-bottom: 22px;
}
.page-head h1 { margin: 0; color: #26384d; font-size: 24px; font-weight: 700; }
.page-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.page-eyebrow { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; color: var(--primary); margin-bottom: 5px; }
.welcome-banner {
    background: linear-gradient(100deg, #198754 0%, #20a66a 46%, #0d6efd 100%);
    color: #fff; border-radius: 16px; padding: 23px 26px; margin-bottom: 22px;
    box-shadow: 0 10px 25px rgba(25,135,84,.12);
    position: relative; overflow: hidden;
}
.welcome-banner:after { content: ""; position: absolute; width: 180px; height: 180px; border: 30px solid rgba(255,255,255,.07); border-radius: 50%; right: -45px; top: -65px; }
.welcome-banner h2, .welcome-banner h3 { margin: 0 0 7px; font-weight: 700; color: #fff; }
.welcome-banner p { margin: 0; color: rgba(255,255,255,.9); font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; margin-bottom: 22px; }
.metric, .summary-card {
    position: relative; overflow: hidden;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 3px 12px rgba(31,45,61,.055);
    padding: 19px 20px; min-height: 128px;
    border-top: 3px solid var(--teal);
}
.metric:nth-child(1), .summary-blue { border-top-color: #4099ff; }
.metric:nth-child(2), .summary-green { border-top-color: #2ed8b6; }
.metric:nth-child(3), .summary-orange { border-top-color: #ffb64d; }
.metric:nth-child(4), .summary-purple { border-top-color: #9c88ff; }
.metric span, .summary-title { display: block; color: #7b8998; font-size: 12px; margin-bottom: 10px; }
.metric strong, .summary-value { display: block; color: #26384d; font-size: 25px; font-weight: 700; line-height: 1.15; }
.summary-note { color: #98a3af; font-size: 11px; margin-top: 8px; }
.summary-icon {
    position: absolute; right: 16px; top: 16px; width: 33px; height: 33px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center; opacity: .14; background: currentColor;
}
.summary-icon svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2; }

.panel, .portal-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 22px;
}
.panel h3, .portal-card-title { color: #33465a; font-size: 16px; font-weight: 700; margin: 0 0 16px; }
.card-header-soft {
    margin: -20px -20px 19px;
    padding: 14px 20px;
    border-bottom: 1px solid #edf1f5;
    background: #fbfcfe;
    border-radius: 12px 12px 0 0;
}
.card-header-soft h3 { margin: 0; }
.section-heading { font-size: 15px; color: #33465a; font-weight: 700; margin-bottom: 14px; }
.soft-divider { height: 1px; background: #edf1f5; margin: 18px 0; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: #657487; }
.input, .form-control, select.input, textarea.input {
    width: 100%;
    height: 40px;
    border: 1px solid #dbe3ea;
    border-radius: 7px;
    background: #fff;
    color: #34465a;
    padding: 8px 11px;
    font-size: 13px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.input { min-height: 95px; height: auto; }
.input:focus, .form-control:focus { border-color: #6cbf93; box-shadow: 0 0 0 3px rgba(25,135,84,.09); }
.input-help { font-size: 11px; color: #929dab; margin-top: 5px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 14px;
    background: #198754;
    color: #fff;
    border: 1px solid #198754;
    box-shadow: none !important;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: #157347; border-color: #146c43; color: #fff; text-decoration: none; }
.btn.light { background: #eef7f2; color: #157347; border: 1px solid #dceee3; }
.btn.secondary { background: #183153; color: #fff; border: 1px solid #183153; }
.btn.danger { background: #dc3545; color: #fff; border: 1px solid #dc3545; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.search-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 20px;
}
.search-panel-title { font-weight: 700; font-size: 14px; color: #34465a; margin-bottom: 13px; }
.universal-search { position: relative; }
.universal-search .input { padding-left: 37px; }
.search-glyph {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    width: 15px; height: 15px; border: 2px solid #94a2b0; border-radius: 50%;
}
.search-glyph:after {
    content: ""; position: absolute; width: 7px; height: 2px; background: #94a2b0;
    transform: rotate(45deg); right: -5px; bottom: -2px; border-radius: 2px;
}

.table-wrap, .table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; margin-bottom: 0; font-size: 12.5px; color: #405266; }
.table th {
    border-top: none !important;
    border-bottom: 1px solid #dfe7ed !important;
    background: #f7f9fc;
    color: #68788b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .25px;
    font-weight: 700;
    padding: 11px 10px !important;
    white-space: nowrap;
}
.table td { border-top: 1px solid #edf1f4 !important; padding: 11px 10px !important; vertical-align: middle !important; }
.table tbody tr:hover { background: #fbfdfc; }
.table .btn { padding: 5px 9px; font-size: 11px; }

.badge, .badge-soft {
    display: inline-block; padding: 5px 9px; border-radius: 20px; font-size: 11px; font-weight: 700;
}
.badge-success, .badge-soft-success { background: rgba(25,135,84,.12); color: #198754; }
.badge-warning, .badge-soft-warning { background: rgba(255,182,77,.18); color: #9b660d; }
.badge-danger, .badge-soft-danger { background: rgba(220,53,69,.12); color: #c63848; }
.badge-info, .badge-soft-info { background: rgba(13,110,253,.11); color: #0d6efd; }
.badge-neutral { background: #edf1f5; color: #657487; }

.message { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.message.success { background: #e9f7ef; color: #17653c; border: 1px solid #cfeada; }
.message.warn { background: #fff6e6; color: #8a6218; border: 1px solid #f8e2b5; }
.message.error { background: #fdebec; color: #a83542; border: 1px solid #f4d1d5; }

/* Profile and details */
.profile-shell { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 20px; }
.profile-side-card {
    background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
    padding: 22px; text-align: center; align-self: start;
}
.profile-passport {
    width: 145px; height: 175px; object-fit: cover; background: #f0f3f6;
    border: 5px solid #fff; box-shadow: 0 0 0 1px #dde5eb, 0 7px 18px rgba(0,0,0,.08);
    border-radius: 10px;
}
.profile-name { font-size: 17px; font-weight: 700; margin: 14px 0 4px; color: #2d4054; }
.profile-sub { font-size: 12px; color: #8290a0; margin-bottom: 4px; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 20px; }
.detail-row { display: flex; gap: 10px; justify-content: space-between; border-bottom: 1px dashed #edf0f3; padding: 10px 0; font-size: 13px; }
.detail-label { color: #7d8a99; font-weight: 600; }
.detail-value { color: #34465a; font-weight: 600; text-align: right; word-break: break-word; }
.profile-summary-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.mini-summary { padding: 13px 14px; border-radius: 9px; background: #f7faf8; border: 1px solid #e4eee8; }
.mini-summary span { display: block; color: #7c8997; font-size: 10px; text-transform: uppercase; letter-spacing: .35px; }
.mini-summary strong { display: block; color: #2d4054; font-size: 14px; margin-top: 4px; }
.tab-cards { display: grid; gap: 18px; }

/* Registration */
.registration-hero {
    display: flex; justify-content: space-between; align-items: center; gap: 18px;
    padding: 18px 20px; border-radius: 12px; background: linear-gradient(100deg,#f4fbf7,#eef5ff); border: 1px solid #e1ece6; margin-bottom: 19px;
}
.registration-steps { display: flex; gap: 8px; flex-wrap: wrap; }
.registration-step { padding: 5px 9px; border-radius: 20px; background: #fff; color: #657487; font-size: 10px; border: 1px solid #e1e8ee; }
.registration-step.active { background: #e9f7ef; color: #198754; border-color: #cce8d7; font-weight: 700; }
.upload-box {
    min-height: 118px; border: 1px dashed #bfcbd5; border-radius: 10px; background: #fbfcfd; padding: 15px;
    display: flex; align-items: center; gap: 15px;
}
.upload-preview { width: 72px; height: 86px; object-fit: cover; border-radius: 7px; background: #eef1f4; }

/* Dashboard specific */
.dashboard-two-col { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(290px,.85fr); gap: 20px; }
.quick-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.quick-action {
    display: flex; align-items: center; gap: 11px; padding: 13px;
    border: 1px solid #e7edf3; border-radius: 10px; background: #fff;
    transition: all .16s ease; color: #3b4e62;
}
.quick-action:hover { border-color: #cbe5d6; background: #f9fdfb; transform: translateY(-1px); }
.quick-action-icon {
    width: 37px; height: 37px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
    background: #eaf7f0; color: #198754; flex: 0 0 37px;
}
.quick-action-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.quick-action strong { display: block; font-size: 12px; }
.quick-action small { display: block; font-size: 10px; color: #8a97a5; margin-top: 2px; }
.progress-shell { height: 8px; border-radius: 10px; background: #eaf0f4; overflow: hidden; }
.progress-bar-custom { height: 100%; background: linear-gradient(90deg,#198754,#20c997); border-radius: 10px; }

/* Printable documents */
.document { width: 210mm; min-height: 297mm; background: #fff; margin: 20px auto; padding: 18mm; box-shadow: var(--shadow); }
.doc-header { text-align: center; border-bottom: 3px solid var(--primary); padding-bottom: 14px; }
.qr-box { width: 130px; height: 130px; margin-left: auto; }
.score-input { width: 78px !important; padding: 7px !important; }

/* Mobile */
@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .form-grid.three, .form-grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .dashboard-two-col { grid-template-columns: 1fr; }
}
@media (max-width: 991.98px) {
    .navlinks { display: none; }
    .portal-sidebar { transform: translateX(-100%); width: 270px; }
    .portal-sidebar.show { transform: translateX(0); }
    .portal-main { margin-left: 0; width: 100%; }
    .mobile-menu-btn { display: inline-flex; }
    .portal-topbar { padding: 10px 14px; }
    .portal-content { padding: 15px; }
    .topbar-title { font-size: 14px; max-width: 62vw; }
    .topbar-user { display: none; }
    .profile-shell { grid-template-columns: 1fr; }
    .profile-side-card { text-align: left; display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; }
    .profile-passport { width: 110px; height: 132px; }
    .profile-name { margin-top: 0; }
}
@media (max-width: 767.98px) {
    .grid-3, .grid-4, .form-grid, .form-grid.three, .form-grid.four { grid-template-columns: 1fr; }
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 11px; }
    .metric { min-height: 112px; padding: 15px; }
    .metric strong { font-size: 20px; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .page-head .actions { width: 100%; }
    .profile-summary-strip { grid-template-columns: 1fr 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
    .portal-sidebar { width: 84%; max-width: 295px; }
    .portal-content { padding: 10px; }
    .topbar-title { max-width: 65vw; font-size: 12px; }
    .topbar-context { font-size: 10px; }
    .portal-logout { padding: 5px 8px; font-size: 10px; }
    .metric-grid { grid-template-columns: 1fr; }
    .profile-side-card { display: block; text-align: center; }
    .profile-summary-strip { grid-template-columns: 1fr; }
    .table { min-width: 660px; }
    .document { width: 100%; margin: 0; box-shadow: none; padding: 14px; }
    .registration-hero { align-items: flex-start; flex-direction: column; }
}
@media print {
    .portal-sidebar, .portal-topbar, .no-print, .sidebar-overlay { display: none !important; }
    .portal-main { margin: 0 !important; width: 100% !important; }
    .portal-content { padding: 0 !important; }
    .document { box-shadow: none; margin: 0; padding: 10mm; }
    .btn { display: none !important; }
}

/* Public page compatibility helpers */
.stats { margin-top: -55px; position: relative; z-index: 3; }
.stat-card { text-align: center; padding: 22px; }
.stat-card strong { display: block; font-size: 32px; color: var(--primary); }
.stat-card span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.content-body { line-height: 1.8; color: #516375; }

/* Encoding-safe success icon */
.status-icon { display: inline-block; vertical-align: -2px; margin-right: 6px; }
.status-icon.ok { width: 17px; height: 17px; border-radius: 50%; background: #198754; position: relative; }
.status-icon.ok:after { content: ""; position: absolute; left: 5px; top: 3px; width: 4px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* GridView pager */
.grid-pager td { padding: 10px !important; }
.grid-pager a, .grid-pager span { display: inline-flex; min-width: 30px; height: 30px; align-items: center; justify-content: center; margin: 0 2px; border-radius: 6px; border: 1px solid #dfe6ec; font-size: 11px; }
.grid-pager span { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Local Bootstrap-style fallbacks so core portal styling remains usable if the CDN is unavailable */
.card { padding: 22px; }
.card > .card-header, .card > .card-footer { margin-left: -22px; margin-right: -22px; }
.btn-sm { padding: 6px 10px; font-size: 11px; }
.btn-success { background: #198754; border: 1px solid #198754; color: #fff; }
.btn-success:hover { background: #157347; border-color: #146c43; color: #fff; }
.btn-primary { background: #183153; border: 1px solid #183153; color: #fff; }
.btn-primary:hover { background: #10263f; border-color: #10263f; color: #fff; }
.btn-outline-success { background: transparent; border: 1px solid #198754; color: #198754; }
.btn-outline-success:hover { background: #198754; color: #fff; }
.btn-outline-primary { background: transparent; border: 1px solid #183153; color: #183153; }
.btn-outline-primary:hover { background: #183153; color: #fff; }
.btn-outline-secondary { background: transparent; border: 1px solid #758395; color: #667689; }
.btn-outline-secondary:hover { background: #667689; color: #fff; }
.btn-outline-danger { background: transparent; border: 1px solid #dc3545; color: #dc3545; }
.btn-outline-danger:hover { background: #dc3545; color: #fff; }
.btn-warning { background: #ffc107; border: 1px solid #ffc107; color: #382d00; }
.btn-danger { background: #dc3545; border: 1px solid #dc3545; color: #fff; }
.table-bordered th, .table-bordered td { border: 1px solid #e6ecf1; }
.table-hover tbody tr:hover { background: #f8fbf9; }
.text-muted { color: var(--muted) !important; }

.sidebar-school-logo{width:48px;height:48px;object-fit:contain;border-radius:50%;background:#fff;padding:2px;box-shadow:0 5px 14px rgba(0,0,0,.16);flex:0 0 48px}
