/* ==========================================================================
   NBS Alumni Portal — Design System
   NUST/NBS institutional identity + modern SaaS dashboard.
   Palette: NUST navy (#0b3d6b), deep teal accents, gold highlight.
   Layered on top of Bootstrap 5.
   ========================================================================== */

:root {
    --nbs-navy: #0b3d6b;
    --nbs-navy-dark: #072a4b;
    --nbs-navy-light: #12558f;
    --nbs-gold: #c9a227;
    --nbs-teal: #1a7f8e;
    --nbs-bg: #f4f6f9;
    --nbs-surface: #ffffff;
    --nbs-border: #e5e8ee;
    --nbs-muted: #6b7280;
    --nbs-text: #1f2937;
    --nbs-radius: 12px;
    --nbs-radius-sm: 8px;
    --nbs-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
    --nbs-shadow-md: 0 4px 16px rgba(16, 24, 40, .08);
    --nbs-sidebar-w: 256px;

    --bs-primary: var(--nbs-navy);
    --bs-primary-rgb: 11, 61, 107;
    --bs-body-bg: var(--nbs-bg);
    --bs-body-color: var(--nbs-text);
    --bs-link-color: var(--nbs-navy-light);
    --bs-link-hover-color: var(--nbs-navy);
    --bs-border-color: var(--nbs-border);
}

body {
    background: var(--nbs-bg);
    color: var(--nbs-text);
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
}

a { text-decoration: none; }
a:hover { text-decoration: none; }

/* Buttons ---------------------------------------------------------------- */
.btn-primary {
    --bs-btn-bg: var(--nbs-navy);
    --bs-btn-border-color: var(--nbs-navy);
    --bs-btn-hover-bg: var(--nbs-navy-dark);
    --bs-btn-hover-border-color: var(--nbs-navy-dark);
    --bs-btn-active-bg: var(--nbs-navy-dark);
    --bs-btn-disabled-bg: var(--nbs-navy);
    --bs-btn-disabled-border-color: var(--nbs-navy);
}
.btn-outline-primary {
    --bs-btn-color: var(--nbs-navy);
    --bs-btn-border-color: var(--nbs-navy);
    --bs-btn-hover-bg: var(--nbs-navy);
    --bs-btn-hover-border-color: var(--nbs-navy);
}
.btn { border-radius: var(--nbs-radius-sm); font-weight: 500; }
.text-nbs-gold { color: var(--nbs-gold) !important; }
.bg-nbs-navy { background: var(--nbs-navy) !important; }

/* ==========================================================================
   App shell: sidebar + topbar
   ========================================================================== */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
    width: var(--nbs-sidebar-w);
    background: linear-gradient(180deg, var(--nbs-navy) 0%, var(--nbs-navy-dark) 100%);
    color: #dbe4ee;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    display: flex; flex-direction: column;
    z-index: 1040;
    transition: transform .25s ease;
}
.app-sidebar .brand {
    padding: 18px 20px;
    display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.app-sidebar .brand img { height: 34px; }
.app-sidebar .brand .brand-name { font-weight: 700; color: #fff; font-size: 16px; line-height: 1.1; }
.app-sidebar .brand .brand-sub { font-size: 11px; color: var(--nbs-gold); letter-spacing: .04em; text-transform: uppercase; }

.sidebar-nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.sidebar-nav .nav-section {
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
    color: #7d97b3; padding: 14px 12px 6px; font-weight: 600;
}
.sidebar-nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; border-radius: var(--nbs-radius-sm);
    color: #cdd8e6; font-size: 14px; font-weight: 500; margin-bottom: 2px;
    transition: background .15s, color .15s;
}
.sidebar-nav a svg, .sidebar-nav a .ic { width: 18px; height: 18px; flex: none; opacity: .85; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar-nav a.active { background: rgba(201, 162, 39, .16); color: #fff; box-shadow: inset 3px 0 0 var(--nbs-gold); }
.sidebar-nav a .badge { margin-left: auto; }

.app-main {
    flex: 1;
    margin-left: var(--nbs-sidebar-w);
    display: flex; flex-direction: column; min-width: 0;
}
.app-topbar {
    height: 62px; background: var(--nbs-surface);
    border-bottom: 1px solid var(--nbs-border);
    display: flex; align-items: center; gap: 16px;
    padding: 0 24px; position: sticky; top: 0; z-index: 1030;
}
.app-topbar .page-title { font-weight: 600; font-size: 18px; margin: 0; }
.app-topbar .spacer { flex: 1; }
.app-content { padding: 24px; flex: 1; }

.sidebar-toggle { display: none; }
.sidebar-backdrop { display: none; }

/* ==========================================================================
   Cards, tables, stat widgets
   ========================================================================== */
.card {
    border: 1px solid var(--nbs-border);
    border-radius: var(--nbs-radius);
    box-shadow: var(--nbs-shadow);
    background: var(--nbs-surface);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--nbs-border);
    font-weight: 600; padding: 16px 20px;
}
.card-body { padding: 20px; }

.stat-card { display: flex; align-items: center; gap: 16px; padding: 20px; }
.stat-card .stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(11, 61, 107, .09); color: var(--nbs-navy); flex: none;
}
.stat-card .stat-icon.g { background: rgba(201, 162, 39, .16); color: #9a7a10; }
.stat-card .stat-icon.t { background: rgba(26, 127, 142, .12); color: var(--nbs-teal); }
.stat-card .stat-icon.r { background: rgba(220, 53, 69, .1); color: #c02a3a; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; line-height: 1; color: var(--nbs-navy); }
.stat-card .stat-label { font-size: 13px; color: var(--nbs-muted); margin-top: 4px; }

.table { --bs-table-hover-bg: #f7f9fc; margin-bottom: 0; }
.table > thead th {
    font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--nbs-muted); font-weight: 600; border-bottom: 1px solid var(--nbs-border);
    background: #fafbfd; white-space: nowrap;
}
.table > tbody td { vertical-align: middle; border-color: #eef1f6; }
.table-card { border-radius: var(--nbs-radius); overflow: hidden; }

.badge { font-weight: 600; padding: .35em .6em; border-radius: 6px; }

/* Avatars ---------------------------------------------------------------- */
.avatar {
    width: 40px; height: 40px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--nbs-navy); color: #fff; font-weight: 600; font-size: 14px;
    object-fit: cover; overflow: hidden; flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 96px; height: 96px; font-size: 32px; }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }

/* Forms ------------------------------------------------------------------ */
.form-label { font-weight: 500; font-size: 13.5px; color: #374151; margin-bottom: 5px; }
.form-control, .form-select {
    border-radius: var(--nbs-radius-sm); border-color: var(--nbs-border);
    padding: .5rem .75rem; font-size: 14.5px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--nbs-navy-light);
    box-shadow: 0 0 0 3px rgba(18, 85, 143, .12);
}
.form-text { font-size: 12.5px; }
.input-hint { font-size: 12.5px; color: var(--nbs-muted); }

/* Auth pages: two-column split (branding left, form + footer right) ------- */
.auth-split { display: flex; min-height: 100vh; }

.auth-brand-panel {
    flex: 1 1 50%;
    background: radial-gradient(1000px 700px at 15% 0%, #14639e 0%, var(--nbs-navy) 45%, var(--nbs-navy-dark) 100%);
    color: #fff; position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: center;
    padding: 56px 64px;
}
.auth-brand-panel::after {
    content: ''; position: absolute; right: -140px; bottom: -140px;
    width: 380px; height: 380px; border-radius: 50%;
    background: radial-gradient(circle at center, rgba(201,162,39,.28), transparent 65%);
}
.auth-brand-panel .brand-mark { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-brand-panel .brand-mark img { height: 44px; }
.auth-brand-panel .brand-mark .b-name { font-weight: 800; font-size: 20px; line-height: 1.1; }
.auth-brand-panel .brand-mark .b-sub { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--nbs-gold); }
.auth-brand-panel h2 { font-size: 30px; font-weight: 800; line-height: 1.2; margin-bottom: 14px; max-width: 460px; }
.auth-brand-panel p.lead { color: rgba(255,255,255,.78); font-size: 15.5px; max-width: 440px; }
.auth-features { list-style: none; padding: 0; margin: 30px 0 0; max-width: 440px; }
.auth-features li { display: flex; align-items: center; gap: 12px; padding: 9px 0; color: rgba(255,255,255,.9); font-size: 14.5px; }
.auth-features li .fi { width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.12); display: inline-flex; align-items: center; justify-content: center; color: var(--nbs-gold); flex: none; }

.auth-form-panel { flex: 1 1 50%; background: #fff; display: flex; flex-direction: column; }
.auth-form-scroll { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 40px 20px; }
.auth-form-inner { width: 100%; max-width: 400px; margin: 0 auto; }
.auth-form-inner .auth-logo { text-align: center; margin-bottom: 22px; }
.auth-form-inner .auth-logo img { height: 46px; }
.auth-form-inner h1 { font-size: 24px; font-weight: 700; color: var(--nbs-navy); margin-bottom: 4px; }
.auth-form-inner .subtitle { color: var(--nbs-muted); font-size: 14px; margin-bottom: 22px; }
.auth-form-footer { padding: 14px 20px 26px; }

@media (max-width: 991px) {
    .auth-brand-panel { display: none; }
    .auth-form-panel { min-height: 100vh; }
}

/* Password visibility toggle */
.pw-toggle { border-color: var(--nbs-border); color: var(--nbs-muted); }
.pw-toggle:hover { color: var(--nbs-navy); }

/* Footer (shared partial) */
.site-footer .credit-row a:hover { text-decoration: underline; }
.site-footer .footer-row { opacity: .85; }
.site-footer .footer-mail-ic { width: 15px; height: 15px; display: block; }
.public-footer { background: var(--nbs-navy-dark); color: #cdd8e6; border-top: 3px solid var(--nbs-gold); }

/* Profile ---------------------------------------------------------------- */
.profile-header {
    background: linear-gradient(120deg, var(--nbs-navy), var(--nbs-navy-light));
    color: #fff; border-radius: var(--nbs-radius); padding: 28px; position: relative;
}
.profile-header .avatar-lg { border: 4px solid rgba(255, 255, 255, .25); }
.profile-section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--nbs-muted); font-weight: 600; }
.timeline-item { border-left: 2px solid var(--nbs-border); padding: 0 0 20px 20px; position: relative; }
.timeline-item::before {
    content: ''; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--nbs-navy); border: 2px solid #fff;
}
.completeness-ring { --pct: 0; }

/* Empty states ----------------------------------------------------------- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--nbs-muted); }
.empty-state .empty-icon { font-size: 42px; opacity: .3; margin-bottom: 12px; }

/* Public site ------------------------------------------------------------ */
.public-hero {
    background: linear-gradient(120deg, var(--nbs-navy), var(--nbs-navy-dark));
    color: #fff; padding: 64px 0;
}
.public-navbar { background: var(--nbs-navy) !important; }

/* Misc ------------------------------------------------------------------- */
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 22px; font-weight: 700; margin: 0; }
.breadcrumb { font-size: 13px; margin-bottom: 4px; }
.dropdown-menu { border-color: var(--nbs-border); box-shadow: var(--nbs-shadow-md); border-radius: var(--nbs-radius-sm); }
.notif-item { border-bottom: 1px solid var(--nbs-border); padding: 12px 16px; }
.notif-item.unread { background: #f3f8ff; }
.chart-bar { height: 10px; border-radius: 6px; background: var(--nbs-navy); }
.progress { background: #eef1f6; border-radius: 6px; }
.progress-bar { background: var(--nbs-navy); }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 992px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .sidebar-toggle { display: inline-flex; }
    .sidebar-backdrop.show {
        display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 1035;
    }
}
@media (max-width: 576px) {
    .app-content { padding: 16px; }
    .app-topbar { padding: 0 14px; }
    .stat-card { padding: 16px; }
}

/* Responsive tables: allow horizontal scroll instead of breaking layout. */
.table-responsive { border-radius: var(--nbs-radius); }
