@import url('https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

/* ============================================================
   EduHD Credit Bank System - Main Stylesheet
   ============================================================
   Premium dark-theme design with glassmorphism effects,
   micro-animations, and responsive layout.
   ============================================================ */

/* ── CSS Custom Properties (Design Tokens) ─────────────── */
:root {
    /* Primary Palette */
    --primary: #6366F1;
    --primary-light: #818CF8;
    --primary-dark: #4338CA;
    --secondary: #8B5CF6;
    --secondary-light: #A78BFA;

    /* Role Accent Colors */
    --accent-admin: #6366F1;
    --accent-admin-glow: rgba(99, 102, 241, 0.4);
    --accent-instructor: #10B981;
    --accent-instructor-glow: rgba(16, 185, 129, 0.4);
    --accent-learner: #F59E0B;
    --accent-learner-glow: rgba(245, 158, 11, 0.4);

    /* Background */
    --bg-body: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.75);
    --bg-glass-hover: rgba(0, 0, 0, 0.02);

    /* Borders */
    --border-glass: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(15, 23, 42, 0.15);

    /* Text */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.06), 0 4px 6px -4px rgba(15, 23, 42, 0.06);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.08);

    /* Typography */
    --font-heading: 'Sarabun', sans-serif;
    --font-body: 'Sarabun', sans-serif;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 400ms cubic-bezier(0.16, 1, 0.3, 1);

    /* Sidebar */
    --sidebar-width: 280px;
    --sidebar-collapsed: 72px;
    --header-height: 70px;
}

/* ── Global Reset & Base ──────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: var(--primary-light);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary);
}

/* ── Landing Page ─────────────────────────────────────── */
.landing-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

/* Animated Gradient Background */
.landing-wrapper::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(16, 185, 129, 0.03) 0%, transparent 60%),
        linear-gradient(180deg, #F8FAFC 0%, #E2E8F0 50%, #F8FAFC 100%);
    z-index: -2;
    animation: bgShift 15s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(15deg);
    }
}

/* Subtle grid overlay */
.landing-wrapper::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: -1;
}

/* Landing Header / Branding */
.landing-brand {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInUp 0.8s ease-out;
}

.landing-brand .brand-icon {
    width: 150px;
    height: 150px;
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: float 6s ease-in-out infinite;
    overflow: hidden;
}

/* Custom logo styling */
.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
}

.brand-logo-img-sidebar {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

/* Landing background image overlay (30% opacity) */
.landing-bg-image {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../../images/eduhd.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.1;
    z-index: -1.5;
    pointer-events: none;
}

.landing-brand h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #0F172A, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.landing-brand .subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.02em;
}

.landing-brand .tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* Login Cards Container */
.login-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1100px;
    width: 100%;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Individual Login Card */
.login-card {
    background: #FFFFFF;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 36px 28px;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transition: height var(--transition-smooth);
}

.login-card:hover {
    background: #FFFFFF;
    border-color: var(--border-hover);
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.login-card:hover::before {
    height: 4px;
}

/* Role-specific accents */
.login-card.card-admin::before {
    background: linear-gradient(90deg, var(--accent-admin), #818CF8);
}

.login-card.card-admin:hover {
    box-shadow: var(--shadow-xl), 0 0 40px var(--accent-admin-glow);
}

.login-card.card-instructor::before {
    background: linear-gradient(90deg, var(--accent-instructor), #34D399);
}

.login-card.card-instructor:hover {
    box-shadow: var(--shadow-xl), 0 0 40px var(--accent-instructor-glow);
}

.login-card.card-learner::before {
    background: linear-gradient(90deg, var(--accent-learner), #FBBF24);
}

.login-card.card-learner:hover {
    box-shadow: var(--shadow-xl), 0 0 40px var(--accent-learner-glow);
}

/* Card Header */
.login-card .card-header-custom {
    text-align: center;
    margin-bottom: 28px;
}

.login-card .card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 16px;
    transition: transform var(--transition-smooth);
}

.login-card:hover .card-icon {
    transform: scale(1.1);
}

.card-admin .card-icon {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-admin);
}

.card-instructor .card-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-instructor);
}

.card-learner .card-icon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-learner);
}

.login-card .card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.login-card .card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Feature List Styles */
.login-card .card-features {
    list-style: none;
    padding: 0;
    margin: 24px 0 28px 0;
    text-align: left;
}

.login-card .card-features li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-card .card-features li i {
    font-size: 1.05rem;
}

.card-admin .card-features li i {
    color: var(--accent-admin);
}

.card-instructor .card-features li i {
    color: var(--accent-instructor);
}

.card-learner .card-features li i {
    color: var(--accent-learner);
}

/* Prevent hover text color overrides on links used as buttons */
.btn-login:hover {
    color: #fff !important;
    text-decoration: none;
}

.btn-login.btn-learner:hover {
    color: #1F2937 !important;
    text-decoration: none;
}

/* Form Styles */
.form-floating-custom {
    position: relative;
    margin-bottom: 16px;
}

.form-floating-custom input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-body);
    transition: all var(--transition-fast);
    outline: none;
}

.form-floating-custom input::placeholder {
    color: var(--text-muted);
}

.form-floating-custom input:focus {
    border-color: var(--primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-floating-custom .input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 13px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    margin-top: 4px;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login.btn-admin {
    background: linear-gradient(135deg, var(--accent-admin), #818CF8);
}

.btn-login.btn-instructor {
    background: linear-gradient(135deg, var(--accent-instructor), #34D399);
}

.btn-login.btn-learner {
    background: linear-gradient(135deg, var(--accent-learner), #FBBF24);
    color: #1F2937;
}

/* Landing Footer */
.landing-footer {
    text-align: center;
    margin-top: 50px;
    color: var(--text-muted);
    font-size: 0.8rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.landing-footer a {
    color: var(--text-secondary);
}

/* Alert Messages */
.alert-floating {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    min-width: 320px;
    max-width: 500px;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideDown 0.5s ease-out, fadeOut 0.5s ease-in 4s forwards;
    box-shadow: var(--shadow-lg);
}

.alert-floating.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
}

.alert-floating.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6EE7B7;
}

.alert-floating .alert-icon {
    margin-right: 8px;
}

/* ── Dashboard Layout ─────────────────────────────────── */

/* Sidebar */
.sidebar {
    /* Scope dark theme variables for sidebar */
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --border-glass: rgba(255, 255, 255, 0.08);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    --bg-glass: rgba(255, 255, 255, 0.04);

    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-smooth);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    padding: 24px 16px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    transition: all var(--transition-smooth);
}

.sidebar-brand .brand-logo {
    width: 128px;
    height: 128px;
    background: #FFFFFF;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-smooth);
}

.sidebar-brand .brand-text h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.sidebar-brand .brand-text span {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.sidebar-nav .nav-section {
    margin-bottom: 24px;
}

.sidebar-nav .nav-section-title {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0 12px;
    margin-bottom: 8px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
}

.sidebar-nav .nav-link i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.sidebar-nav .nav-link.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-light);
}

.sidebar-nav .nav-link.active i {
    color: var(--primary);
}

/* Sidebar Footer (User Info) */
.sidebar-user {
    padding: 16px;
    border-top: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user .user-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user .user-avatar.avatar-admin {
    background: linear-gradient(135deg, var(--accent-admin), #818CF8);
}

.sidebar-user .user-avatar.avatar-instructor {
    background: linear-gradient(135deg, var(--accent-instructor), #34D399);
}

.sidebar-user .user-avatar.avatar-learner {
    background: linear-gradient(135deg, var(--accent-learner), #FBBF24);
    color: #1F2937;
}

.sidebar-user .user-info {
    flex: 1;
    overflow: hidden;
}

.sidebar-user .user-info .user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-info .user-role {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ── Collapsible Sidebar Desktop Styles ───────────────── */
@media (min-width: 993px) {
    body.sidebar-collapsed .sidebar {
        width: var(--sidebar-collapsed);
    }

    body.sidebar-collapsed .top-header {
        left: var(--sidebar-collapsed);
    }

    body.sidebar-collapsed .main-content {
        margin-left: var(--sidebar-collapsed);
    }

    body.sidebar-collapsed .sidebar-brand {
        padding: 24px 0;
        justify-content: center;
    }

    body.sidebar-collapsed .sidebar-brand .brand-logo {
        width: 42px;
        height: 42px;
        border-radius: var(--radius-sm);
    }

    body.sidebar-collapsed .sidebar-brand .brand-text {
        display: none;
    }

    body.sidebar-collapsed .sidebar-nav {
        padding: 16px 8px;
    }

    body.sidebar-collapsed .sidebar-nav .nav-section-title {
        text-align: center;
        font-size: 0;
        height: 1px;
        background: var(--border-glass);
        margin: 16px 8px;
        padding: 0;
    }

    body.sidebar-collapsed .sidebar-nav .nav-link {
        padding: 12px 0;
        justify-content: center;
    }

    body.sidebar-collapsed .sidebar-nav .nav-link span {
        display: none;
    }

    body.sidebar-collapsed .sidebar-nav .nav-link i {
        font-size: 1.35rem;
        margin: 0;
        width: auto;
    }

    body.sidebar-collapsed .sidebar-user {
        padding: 16px 0;
        justify-content: center;
    }

    body.sidebar-collapsed .sidebar-user .user-info {
        display: none;
    }
}

/* Top Header Bar */
.top-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 999;
    transition: left var(--transition-smooth);
}

.top-header .header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-header .header-left h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.top-header .header-left .breadcrumb-text {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.top-header .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-logout {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #EF4444;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #DC2626;
}

.btn-portal {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-portal:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--primary-dark) !important;
    text-decoration: none;
}

/* Sidebar Toggle Button (Mobile/Desktop) */
.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 6px;
    transition: color var(--transition-fast);
}

.sidebar-toggle:hover {
    color: var(--text-primary);
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
    min-height: 100vh;
    transition: margin-left var(--transition-smooth);
}

.content-inner {
    padding: 32px 28px;
}

/* ── Stat Cards ───────────────────────────────────────── */
.stat-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}

.stat-card .stat-value {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Stat Card Variants */
.stat-card.stat-primary::before {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.stat-card.stat-primary .stat-icon {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
}

.stat-card.stat-success::before {
    background: linear-gradient(90deg, #10B981, #34D399);
}

.stat-card.stat-success .stat-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #34D399;
}

.stat-card.stat-warning::before {
    background: linear-gradient(90deg, #F59E0B, #FBBF24);
}

.stat-card.stat-warning .stat-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #FBBF24;
}

.stat-card.stat-info::before {
    background: linear-gradient(90deg, #06B6D4, #22D3EE);
}

.stat-card.stat-info .stat-icon {
    background: rgba(6, 182, 212, 0.15);
    color: #22D3EE;
}

/* ── Welcome Banner ───────────────────────────────────── */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: 15%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
}

.welcome-banner h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.welcome-banner p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.92rem;
    max-width: 600px;
    position: relative;
    z-index: 1;
}

/* ── Content Card ─────────────────────────────────────── */
.content-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.content-card .card-header-section {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.content-card .card-header-section h6 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.content-card .card-body-section {
    padding: 24px;
}

/* ── Data Table ───────────────────────────────────────── */
.table-custom {
    width: 100%;
    border-collapse: collapse;
}

.table-custom thead th {
    padding: 12px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
}

.table-custom tbody td {
    padding: 14px 16px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-glass);
}

.table-custom tbody tr {
    transition: background var(--transition-fast);
}

.table-custom tbody tr:hover {
    background: rgba(0, 0, 0, 0.015);
}

/* ── Badges ───────────────────────────────────────────── */
.badge-role {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-admin {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
}

.badge-instructor {
    background: rgba(16, 185, 129, 0.15);
    color: #34D399;
}

.badge-learner {
    background: rgba(245, 158, 11, 0.15);
    color: #FBBF24;
}

/* ── Quick Action Cards ───────────────────────────────── */
.quick-action {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.quick-action:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.quick-action .action-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 14px;
}

.quick-action h6 {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.quick-action p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
}

/* ── Animations ───────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        pointer-events: none;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.animate-fade-in {
    animation: fadeInUp 0.5s ease-out both;
}

.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

.animate-delay-4 {
    animation-delay: 0.4s;
}

/* ── Responsive Design ────────────────────────────────── */

/* Tablet */
@media (max-width: 992px) {
    .login-cards {
        grid-template-columns: 1fr;
        max-width: 420px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .top-header {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

/* Tablet / Mobile Header adjustment */
@media (max-width: 768px) {

    .btn-portal span,
    .btn-logout span {
        display: none;
    }

    .btn-portal,
    .btn-logout {
        padding: 8px 12px;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .top-header {
        padding: 0 12px;
    }

    .top-header .header-left h5 {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 140px;
    }

    .landing-brand h1 {
        font-size: 1.8rem;
    }

    .landing-brand .subtitle {
        font-size: 0.95rem;
    }

    .login-card {
        padding: 28px 22px;
    }

    .content-inner {
        padding: 20px 16px;
    }

    .welcome-banner {
        padding: 24px 20px;
    }

    .welcome-banner h2 {
        font-size: 1.3rem;
    }

    .stat-card {
        padding: 18px;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* ── Tailwind Utility Replacements (Local) ────────────── */
/* These replace the few tw-* classes used, avoiding the 3MB+ Tailwind CDN */
.tw-text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.tw-font-semibold {
    font-weight: 600;
}

.tw-text-slate-400 {
    color: #94A3B8;
}

.tw-uppercase {
    text-transform: uppercase;
}

.tw-tracking-wider {
    letter-spacing: 0.05em;
}

.tw-mb-3 {
    margin-bottom: 0.75rem;
}

/* ============================================================
   Common UI Components (Admin & Forms)
   ============================================================ */
.um-input {
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: .88rem;
    font-family: var(--font-body);
    width: 100%;
    outline: none;
    transition: all .2s ease;
}
.um-input:hover {
    border-color: var(--primary-light);
}
.um-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
    background: #fff;
}
select.um-input {
    cursor: pointer;
}
.um-label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.um-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    background: linear-gradient(135deg, #1E3A8A, #3B82F6);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.2s ease;
    text-decoration: none;
}
.um-btn-primary:hover {
    opacity: .9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}
.um-btn-primary:active {
    transform: translateY(0);
}

.um-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    text-decoration: none;
    transition: all 0.2s ease;
}
.um-btn-ghost:hover {
    background: rgba(99, 102, 241, 0.04);
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.2);
}

.um-btn-add {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.2s ease;
}
.um-btn-add:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Premium Icon Buttons styling */
.um-icon-btn {
    width: 34px;
    height: 34px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    text-decoration: none;
}
.um-icon-btn:hover {
    transform: translateY(-2px);
}
.um-icon-btn:active {
    transform: translateY(0);
}

.um-icon-users {
    background: rgba(59, 130, 246, 0.08);
    color: #3B82F6;
    border-color: rgba(59, 130, 246, 0.15);
}
.um-icon-users:hover {
    background: #3B82F6;
    color: #ffffff;
    border-color: #3B82F6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.um-icon-edit {
    background: rgba(16, 185, 129, 0.08);
    color: #10B981;
    border-color: rgba(16, 185, 129, 0.15);
}
.um-icon-edit:hover {
    background: #10B981;
    color: #ffffff;
    border-color: #10B981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.um-icon-del {
    background: rgba(239, 68, 68, 0.08);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
}
.um-icon-del:hover {
    background: #EF4444;
    color: #ffffff;
    border-color: #EF4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}