/* ============================================================
   GEMS – Graduate Employability Management System
   Main Stylesheet – Phase A
   ============================================================ */

:root {
    --primary:       #0A2540;
    --primary-light: #103559;
    --accent:        #00B4D8;
    --accent-dark:   #0096C7;
    --success:       #06D6A0;
    --warning:       #FFB703;
    --danger:        #EF233C;
    --info:          #48CAE4;

    --bg:            #F0F4F8;
    --surface:       #FFFFFF;
    --surface-2:     #F7FAFC;
    --border:        #E2E8F0;

    --text-primary:  #1A202C;
    --text-secondary:#4A5568;
    --text-muted:    #718096;

    --sidebar-w:     260px;
    --topbar-h:      64px;
    --radius:        12px;
    --radius-sm:     8px;
    --shadow:        0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --shadow-lg:     0 8px 32px rgba(0,0,0,.12);

    --font-sans:     'DM Sans', system-ui, sans-serif;
    --font-mono:     'DM Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
}

/* ---- LAYOUT ---- */
.gems-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--primary);
    display: flex; flex-direction: column;
    z-index: 1000;
    transition: transform .3s ease;
}

.gems-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex; flex-direction: column;
    transition: margin .3s ease;
}

/* ---- SIDEBAR ---- */
.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-icon {
    width: 40px; height: 40px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: white;
    flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: -.3px; }
.brand-sub  { font-size: 10px; font-weight: 500; color: var(--accent); letter-spacing: 1.5px; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.nav-section-label {
    font-size: 10px; font-weight: 600; letter-spacing: 1.2px;
    text-transform: uppercase; color: rgba(255,255,255,.35);
    padding: 12px 10px 4px;
    margin-top: 4px;
}

.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    color: rgba(255,255,255,.7);
    font-weight: 500; font-size: 13.5px;
    text-decoration: none;
    transition: all .18s ease;
    margin-bottom: 2px;
}

.sidebar-nav .nav-link i { font-size: 15px; width: 18px; flex-shrink: 0; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--accent); color: #fff; }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; gap: 10px;
}

.user-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--accent); color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.user-details { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: rgba(255,255,255,.5); text-transform: capitalize; }

.btn-logout {
    color: rgba(255,255,255,.5); font-size: 18px;
    text-decoration: none; padding: 4px;
    transition: color .2s;
}
.btn-logout:hover { color: var(--danger); }

/* ---- TOPBAR ---- */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 16px;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 900;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.sidebar-toggle {
    background: none; border: none; cursor: pointer;
    color: var(--text-secondary); font-size: 22px;
    padding: 4px; border-radius: 6px;
    display: none;
}

.topbar-title { font-size: 16px; font-weight: 600; color: var(--text-primary); flex: 1; }
.badge-role {
    background: var(--primary); color: var(--accent);
    font-size: 10px; font-weight: 700; letter-spacing: .8px;
    text-transform: uppercase; padding: 4px 10px;
    border-radius: 20px;
}

/* ---- PAGE CONTENT ---- */
.page-content { padding: 28px 28px 40px; flex: 1; }

/* ---- STAT CARDS ---- */
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    display: flex; align-items: center; gap: 16px;
    border: 1px solid var(--border);
    transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-icon {
    width: 52px; height: 52px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; flex-shrink: 0;
}

.stat-icon.blue   { background: #EBF8FF; color: #3182CE; }
.stat-icon.green  { background: #F0FFF4; color: #38A169; }
.stat-icon.orange { background: #FFFAF0; color: #DD6B20; }
.stat-icon.purple { background: #FAF5FF; color: #805AD5; }
.stat-icon.teal   { background: #E6FFFA; color: #319795; }
.stat-icon.red    { background: #FFF5F5; color: #E53E3E; }

.stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* ---- CARD ---- */
.gems-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.gems-card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}

.gems-card-title {
    font-size: 15px; font-weight: 600; color: var(--text-primary);
    display: flex; align-items: center; gap: 8px;
}

.gems-card-body { padding: 22px; }

/* ---- TABLES ---- */
.table { font-size: 13.5px; }
.table th { font-weight: 600; font-size: 12px; letter-spacing: .3px; color: var(--text-secondary); border-top: none; }
.table td { vertical-align: middle; }

/* ---- BADGES ---- */
.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 600; white-space: nowrap;
}

.status-badge.got, .status-badge.employed, .status-badge.completed {
    background: #F0FFF4; color: #276749;
}
.status-badge.applying, .status-badge.furthering {
    background: #EBF8FF; color: #2C5282;
}
.status-badge.not-applied, .status-badge.seeking {
    background: #FFF5F5; color: #9B2C2C;
}
.status-badge.undecided, .status-badge.entrepreneur {
    background: #FFFFF0; color: #744210;
}

/* ---- FORMS ---- */
.form-label { font-weight: 500; font-size: 13px; color: var(--text-secondary); }
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border);
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,180,216,.15);
}

/* ---- BUTTONS ---- */
.btn-gems-primary {
    background: var(--primary); color: #fff;
    border: none; border-radius: var(--radius-sm);
    padding: 9px 20px; font-weight: 600; font-size: 13.5px;
    cursor: pointer; transition: background .2s, transform .1s;
    display: inline-flex; align-items: center; gap: 6px;
    text-decoration: none;
}
.btn-gems-primary:hover { background: var(--primary-light); color: #fff; transform: translateY(-1px); }

.btn-gems-accent {
    background: var(--accent); color: #fff;
    border: none; border-radius: var(--radius-sm);
    padding: 9px 20px; font-weight: 600; font-size: 13.5px;
    cursor: pointer; transition: background .2s;
    display: inline-flex; align-items: center; gap: 6px;
    text-decoration: none;
}
.btn-gems-accent:hover { background: var(--accent-dark); color: #fff; }

/* ---- ALERTS ---- */
.gems-alert {
    border-radius: var(--radius-sm); padding: 12px 16px;
    font-size: 13.5px; border: 1px solid transparent;
    display: flex; align-items: flex-start; gap: 10px;
}
.gems-alert.success { background: #F0FFF4; border-color: #9AE6B4; color: #276749; }
.gems-alert.error   { background: #FFF5F5; border-color: #FEB2B2; color: #9B2C2C; }
.gems-alert.info    { background: #EBF8FF; border-color: #90CDF4; color: #2C5282; }
.gems-alert.warning { background: #FFFFF0; border-color: #FAF089; color: #744210; }

/* ---- PROGRESS BAR ---- */
.gems-progress { height: 8px; border-radius: 10px; background: var(--border); overflow: hidden; }
.gems-progress-bar { height: 100%; border-radius: 10px; transition: width .6s ease; }

/* ---- EMPTY STATE ---- */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state i { font-size: 48px; color: var(--border); margin-bottom: 16px; }
.empty-state h5 { color: var(--text-secondary); font-weight: 600; }
.empty-state p { color: var(--text-muted); font-size: 13px; }

/* ---- PAGE HEADER ---- */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.page-header p  { font-size: 13px; color: var(--text-muted); margin: 2px 0 0; }

/* ---- MONITORING RISK ---- */
.risk-row-high   { background: #FFF5F5 !important; }
.risk-row-medium { background: #FFFFF0 !important; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .gems-sidebar {
        transform: translateX(-100%);
    }
    .gems-sidebar.open {
        transform: translateX(0);
    }
    .gems-content { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .page-content { padding: 16px; }
}

/* ---- DATATABLES OVERRIDES ---- */
.dataTables_wrapper .dataTables_filter input {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border) !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
}
.dataTables_wrapper .dataTables_length select {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border) !important;
    padding: 4px 8px !important;
}

/* ---- LOGIN PAGE ---- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--primary); }
.login-box {
    background: white; border-radius: 16px; padding: 48px 40px;
    width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo-icon {
    width: 64px; height: 64px; background: var(--primary);
    border-radius: 16px; display: inline-flex;
    align-items: center; justify-content: center;
    font-size: 32px; color: var(--accent); margin-bottom: 12px;
}
.login-logo h1 { font-size: 28px; font-weight: 800; color: var(--primary); }
.login-logo p  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
