/* Skill Bridge NB - shared design system.
   A vibrant, modern ERP-style theme: deep indigo sidebar, punchy
   indigo-to-violet accents, soft depth (gradients, glow shadows, smooth
   motion) instead of flat corporate grey - and genuinely responsive down to
   phone width, not just a shrink of the desktop layout. */

:root {
    --sbnb-blue-50: #eff6ff;
    --sbnb-blue-100: #e0e7ff;
    --sbnb-blue-200: #c7d2fe;
    --sbnb-blue-500: #6366f1;
    --sbnb-blue-600: #4f46e5;
    --sbnb-blue-700: #4338ca;
    --sbnb-indigo-500: #6366f1;
    --sbnb-indigo-600: #4f46e5;
    --sbnb-accent: #ec4899;
    --sbnb-accent-2: #f59e0b;
    --sbnb-teal: #0d9488;
    --sbnb-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --sbnb-gradient-hover: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
    --sbnb-gradient-vivid: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #ec4899 100%);
    --sbnb-ink: #0f172a;
    --sbnb-muted: #64748b;
    --sbnb-border: #e6ebf5;
    --sbnb-bg: #f4f6fd;
    --sbnb-surface: #ffffff;
    --sbnb-success: #16a34a;
    --sbnb-warning: #d97706;
    --sbnb-danger: #dc2626;
    --sbnb-radius: 18px;
    --sbnb-radius-sm: 12px;
    --sbnb-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.04);
    --sbnb-shadow-md: 0 8px 24px -8px rgba(79, 70, 229, 0.18), 0 2px 8px rgba(15, 23, 42, 0.04);
    --sbnb-shadow-lg: 0 24px 48px -16px rgba(79, 70, 229, 0.22), 0 4px 12px rgba(15, 23, 42, 0.05);
    --sbnb-glow: 0 8px 24px rgba(99, 102, 241, 0.35);
    --sbnb-sidebar-bg: linear-gradient(195deg, #1a1447 0%, #120f33 60%, #0d0b26 100%);
    --sbnb-sidebar-border: rgba(255, 255, 255, 0.08);
    --sbnb-sidebar-text: rgba(226, 232, 255, 0.72);
    --sbnb-sidebar-text-active: #ffffff;
    --sbnb-sidebar-w: 252px;
    --sbnb-topbar-h: 64px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background:
        radial-gradient(circle at 8% -10%, rgba(139, 92, 246, 0.10), transparent 42%),
        radial-gradient(circle at 92% 0%, rgba(99, 102, 241, 0.12), transparent 45%),
        radial-gradient(circle at 50% 100%, rgba(236, 72, 153, 0.05), transparent 50%),
        var(--sbnb-bg);
    background-attachment: fixed;
    color: var(--sbnb-ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: -0.011em;
    min-height: 100vh;
    overflow-x: hidden;
}

img { max-width: 100%; }

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
}

a {
    color: var(--sbnb-blue-600);
}

/* ---------- Buttons ---------- */
.btn {
    border-radius: var(--sbnb-radius-sm);
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:active {
    transform: translateY(1px);
}
.btn-primary {
    background: var(--sbnb-gradient);
    border: none;
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--sbnb-gradient-hover);
    box-shadow: 0 8px 22px rgba(79, 70, 229, 0.4);
    transform: translateY(-1px);
}
.btn-outline-primary {
    color: var(--sbnb-blue-600);
    border: 1.5px solid var(--sbnb-blue-200);
    background: #fff;
    font-weight: 600;
}
.btn-outline-primary:hover {
    background: var(--sbnb-blue-50);
    border-color: var(--sbnb-blue-500);
    color: var(--sbnb-blue-700);
}
.btn-outline-secondary {
    border-radius: var(--sbnb-radius-sm);
    border: 1.5px solid var(--sbnb-border);
    color: var(--sbnb-muted);
    font-weight: 600;
}
.btn-outline-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--sbnb-ink);
}
.btn-lg-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--sbnb-gradient-vivid);
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 0.9rem 1.9rem;
    border-radius: 999px;
    border: none;
    box-shadow: var(--sbnb-glow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn-lg-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(99, 102, 241, 0.45);
    color: #fff;
}
.btn-lg-cta:active {
    transform: translateY(0);
}

/* ---------- Cards & surfaces ---------- */
.sbnb-card {
    background: var(--sbnb-surface);
    border: 1px solid var(--sbnb-border);
    border-radius: var(--sbnb-radius);
    box-shadow: var(--sbnb-shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.sbnb-card-lg {
    padding: 2.25rem;
    box-shadow: var(--sbnb-shadow-md);
}
.sbnb-card-hover:hover {
    box-shadow: var(--sbnb-shadow-md);
    transform: translateY(-2px);
    border-color: var(--sbnb-blue-200);
}

/* ---------- Top bar ---------- */
.sbnb-topbar {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 0 1.5rem;
    height: var(--sbnb-topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 40;
}
.sbnb-topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--sbnb-ink);
    text-decoration: none;
}
.sbnb-topbar-brand img {
    height: 32px;
    filter: drop-shadow(0 2px 6px rgba(79, 70, 229, 0.25));
}
.sbnb-topbar-user {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font-size: 0.92rem;
    color: var(--sbnb-muted);
}
.sbnb-topbar-user > span {
    font-weight: 600;
    color: var(--sbnb-ink);
}

/* Hamburger toggle - hidden on desktop, shown once the sidebar collapses */
.sbnb-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1.5px solid var(--sbnb-border);
    background: #fff;
    padding: 0 8px;
    cursor: pointer;
    flex-shrink: 0;
}
.sbnb-nav-toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--sbnb-ink);
}

/* ---------- App shell: sidebar + main ---------- */
.sbnb-app-layout {
    display: flex;
    align-items: stretch;
    min-height: calc(100vh - var(--sbnb-topbar-h));
}
.sbnb-sidebar {
    width: var(--sbnb-sidebar-w);
    flex-shrink: 0;
    background: var(--sbnb-sidebar-bg);
    border-right: 1px solid var(--sbnb-sidebar-border);
    position: sticky;
    top: var(--sbnb-topbar-h);
    height: calc(100vh - var(--sbnb-topbar-h));
    overflow-y: auto;
    padding: 1.25rem 0.9rem 2rem;
    z-index: 30;
}
.sbnb-nav-section {
    margin-bottom: 1.4rem;
}
.sbnb-nav-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(199, 210, 254, 0.55);
    padding: 0 0.7rem;
    margin-bottom: 0.5rem;
}
.sbnb-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.62rem 0.7rem;
    border-radius: 10px;
    color: var(--sbnb-sidebar-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 2px;
    transition: background 0.15s ease, color 0.15s ease;
}
.sbnb-nav-icon {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    opacity: 0.85;
}
.sbnb-nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}
.sbnb-nav-link.is-active {
    background: var(--sbnb-gradient-vivid);
    color: #fff;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}
.sbnb-nav-link.is-active .sbnb-nav-icon { opacity: 1; }
.sbnb-nav-link.is-disabled {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.62rem 0.7rem;
    border-radius: 10px;
    color: rgba(226, 232, 255, 0.35);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: default;
}
.sbnb-nav-soon {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}
.sbnb-sidebar-overlay {
    display: none;
}
.sbnb-main {
    flex: 1;
    min-width: 0;
}
.sbnb-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 2.25rem 2rem 3.5rem;
}

/* ---------- Status badges ---------- */
.sbnb-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.sbnb-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.sbnb-badge-blue { background: var(--sbnb-blue-100); color: var(--sbnb-blue-700); }
.sbnb-badge-warning { background: #fef3c7; color: #92400e; }
.sbnb-badge-success { background: #dcfce7; color: #166534; }
.sbnb-badge-danger { background: #fee2e2; color: #991b1b; }
.sbnb-badge-muted { background: #f1f5f9; color: var(--sbnb-muted); }

/* ---------- Step track (admission wizard) ---------- */
.sbnb-track {
    display: flex;
    align-items: flex-start;
    margin: 0 0 2.25rem;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.sbnb-track-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    min-width: 84px;
}
.sbnb-track-node {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    background: #eef1f8;
    color: var(--sbnb-muted);
    border: 2px solid #eef1f8;
    transition: all 0.25s ease;
    flex-shrink: 0;
}
.sbnb-track-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sbnb-muted);
    text-align: center;
    max-width: 100px;
}
.sbnb-track-line {
    flex: 1;
    height: 3px;
    background: #e6ebf5;
    border-radius: 999px;
    margin: 19px 0.35rem 0;
    transition: background 0.25s ease;
    min-width: 16px;
}
.sbnb-track-line.done {
    background: var(--sbnb-gradient);
}
.sbnb-track-step.done .sbnb-track-node {
    background: var(--sbnb-blue-100);
    border-color: var(--sbnb-blue-200);
    color: var(--sbnb-blue-700);
}
.sbnb-track-step.active .sbnb-track-node {
    background: var(--sbnb-gradient-vivid);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.15), 0 6px 16px rgba(79, 70, 229, 0.35);
    transform: scale(1.08);
}
.sbnb-track-step.active .sbnb-track-label {
    color: var(--sbnb-ink);
}
.sbnb-mobile-step {
    display: none;
    margin: 0 0 1.5rem;
}
.sbnb-mobile-step-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.85rem;
    color: var(--sbnb-muted);
    margin-bottom: 0.4rem;
}
.sbnb-mobile-step-row strong {
    color: var(--sbnb-ink);
    font-size: 0.95rem;
}
.sbnb-mobile-step-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--sbnb-border);
    overflow: hidden;
}
.sbnb-mobile-step-fill {
    height: 100%;
    background: var(--sbnb-gradient-vivid);
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* ---------- Forms ---------- */
.form-control, .form-select {
    border-radius: var(--sbnb-radius-sm);
    border: 1.5px solid var(--sbnb-border);
    padding: 0.65rem 0.9rem;
    background: #fbfcfe;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    font-size: 1rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--sbnb-blue-500);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
    background: #fff;
}
label.form-label {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--sbnb-ink);
    margin-bottom: 0.4rem;
}
.alert {
    border-radius: var(--sbnb-radius-sm);
    border: none;
}
.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}
.alert-warning {
    background: #fffbeb;
    color: #92400e;
}
.alert-success {
    background: #ecfdf5;
    color: #065f46;
}
.alert-info {
    background: var(--sbnb-blue-50);
    color: var(--sbnb-blue-700);
}

/* ---------- Landing / login pages ---------- */
.sbnb-auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.sbnb-auth-wrap .sbnb-card-lg {
    box-shadow: var(--sbnb-shadow-lg);
}

/* ---------- Admissions dashboard: stat tiles + application rows ---------- */
.sbnb-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}
.sbnb-stat-tile {
    background: var(--sbnb-surface);
    border: 1px solid var(--sbnb-border);
    border-radius: var(--sbnb-radius-sm);
    box-shadow: var(--sbnb-shadow-sm);
    padding: 1rem 1.1rem;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.sbnb-stat-tile:hover {
    box-shadow: var(--sbnb-shadow-md);
    transform: translateY(-2px);
    border-color: var(--sbnb-blue-200);
}
.sbnb-stat-tile.is-active {
    border-color: var(--sbnb-blue-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16), var(--sbnb-shadow-md);
}
.sbnb-stat-tile-count {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: var(--sbnb-gradient-vivid);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.sbnb-stat-tile-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--sbnb-muted);
}

.sbnb-table-responsive {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.sbnb-app-row {
    display: grid;
    grid-template-columns: 2fr 1.4fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0.9rem 1rem;
    border-radius: var(--sbnb-radius-sm);
    border: 1px solid transparent;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.sbnb-app-row:hover {
    background: var(--sbnb-blue-50);
    border-color: var(--sbnb-blue-200);
}
.sbnb-app-row-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.sbnb-app-row-status {
    text-align: right;
}

/* ---------- Misc ---------- */
.sbnb-shell h1, .sbnb-auth-wrap h1 {
    font-weight: 800;
}
::selection {
    background: var(--sbnb-blue-100);
}

/* =======================================================================
   Responsive breakpoints
   Desktop: sidebar always visible, docked left.
   Tablet (<=991px): sidebar becomes an off-canvas drawer, hamburger shown.
   Phone (<=575px): tighter spacing, full-width controls, stacked layouts.
   ========================================================================= */

/* ---- Tablet and below: collapse the sidebar into a drawer ---- */
@media (max-width: 991px) {
    .sbnb-nav-toggle { display: inline-flex; }

    .sbnb-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        padding-top: calc(var(--sbnb-topbar-h) + 0.75rem);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 0 0 0 rgba(0,0,0,0);
        z-index: 60;
    }
    .sbnb-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 24px 0 48px rgba(15, 23, 42, 0.25);
    }
    .sbnb-sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(10, 10, 30, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 50;
    }
    .sbnb-sidebar-overlay.is-visible {
        opacity: 1;
        pointer-events: auto;
    }
    body.sbnb-nav-locked { overflow: hidden; }

    .sbnb-shell {
        padding: 1.75rem 1.25rem 3rem;
    }
    .sbnb-card-lg {
        padding: 1.5rem;
    }
}

/* ---- Narrow tablet / large phone ---- */
@media (max-width: 767px) {
    .sbnb-topbar {
        padding: 0 1rem;
    }
    .sbnb-topbar-user span:not(.btn *) {
        display: none;
    }
    .sbnb-topbar-user {
        gap: 0.5rem;
    }
    .sbnb-card-lg {
        padding: 1.25rem;
        border-radius: var(--sbnb-radius-sm);
    }
    .sbnb-shell {
        padding: 1.25rem 1rem 2.5rem;
    }
    h1.h4, h1.h5 { font-size: 1.25rem; }

    .sbnb-app-row {
        grid-template-columns: 1fr;
        text-align: left;
        gap: 0.35rem;
    }
    .sbnb-app-row-status {
        text-align: left;
    }
    .sbnb-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .sbnb-track { display: none; }
    .sbnb-track + .sbnb-mobile-step {
        display: block !important;
    }
}

/* ---- Phone ---- */
@media (max-width: 575px) {
    .sbnb-topbar-brand span { display: none; }
    .sbnb-topbar-brand img { height: 28px; }
    .sbnb-stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .sbnb-stat-tile {
        padding: 0.8rem 0.85rem;
    }
    .sbnb-stat-tile-count { font-size: 1.35rem; }
    .sbnb-card-lg {
        padding: 1rem;
    }
    .btn, .btn-lg-cta {
        width: 100%;
        justify-content: center;
    }
    .d-flex.gap-2 > .btn, .d-flex.flex-wrap.gap-2 > .btn, .d-flex.flex-wrap.gap-2 > a.btn {
        width: auto;
    }
    .sbnb-auth-wrap {
        padding: 1rem 0.75rem;
    }
    .sbnb-auth-wrap .sbnb-card-lg {
        padding: 1.5rem 1.25rem;
    }
    table { font-size: 0.9rem; }
}

/* Prevent horizontal scroll traps on small screens from wide inline tables
   or textareas used across the staff admin screens. */
@media (max-width: 767px) {
    .table-responsive, textarea, pre {
        max-width: 100%;
    }
    .row.g-2 > [class^="col-"], .row.g-3 > [class^="col-"] {
        margin-bottom: 0.5rem;
    }
}
