:root {
    --brand: #0d6efd;
    --brand-light: #e8f0fe;
    --text-muted: #6c757d;
    --border: #e9ecef;
    --bs-body-font-family: 'Avenir Next', Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --bs-body-font-size: 16px;
}

body {
    font-family: var(--bs-body-font-family);
    font-size: 16px;
    background-color: var(--bs-secondary-bg);
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Heading scale — everything else stays 12px */
h1, .h1 { font-size: 22px; }
h2, .h2 { font-size: 18px; }
h3, .h3 { font-size: 15px; }
h4, .h4, h5, .h5, h6, .h6 { font-size: 13px; }

/* Normalize all Bootstrap size variants to 16px base */
.small, small { font-size: 16px; }
.lead        { font-size: 16px; font-weight: 400; }
.form-text   { font-size: 16px; }
.form-control-lg, .form-select-lg { font-size: 16px; }
.form-control-sm, .form-select-sm { font-size: 16px; }
.btn-lg      { font-size: 16px; }
.btn-sm      { font-size: 16px; }
.btn-outline-secondary:hover { background-color: #fff !important; color: #6c757d !important; border-color: #6c757d !important; }
body > .container-fluid {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.auth-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* Cards */
.card {
    border-radius: 10px;
    border: 1px solid var(--border);
}
.card-header {
    background-color: var(--bs-tertiary-bg);
    color: #333;
    border-bottom-color: var(--border);
    font-weight: 600;
}
.card-header a:not(.btn) { color: var(--brand); }
.card-header a:not(.btn):hover { color: var(--brand); }
.card-body { background-color: #fff; }
.card-footer {
    background-color: var(--bs-tertiary-bg);
    color: #333;
    border-top-color: var(--border);
}
.card-footer a { color: var(--brand); }
.card-footer a:hover { color: var(--brand); }
.card-hover:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    transform: translateY(-2px);
    transition: all .2s ease;
}

/* Auth pages */
.auth-card {
    max-width: 440px;
    width: 100%;
}

/* Webinar page hero */
.webinar-hero {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 40px 0;
}

/* Dashboard topbar */
.dashboard-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    z-index: 1030;
}
.dashboard-topbar-brand {
    font-weight: 700;
    font-size: 18px;
    color: var(--brand);
    text-decoration: none;
    letter-spacing: -.3px;
}
.dashboard-topbar-brand:hover { color: var(--brand); }
.dashboard-topbar-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.dashboard-topbar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 8px;
    color: #555;
    text-decoration: none;
    font-size: 1.15rem;
    transition: background .15s;
}
.dashboard-topbar-icon:hover { background: var(--bs-secondary-bg); color: #333; }
.dashboard-topbar-user {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .3rem .65rem .3rem .4rem;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background .15s;
}
.dashboard-topbar-user:hover { background: var(--bs-secondary-bg); }

/* Dashboard layout — full viewport, below fixed topbar */
.dashboard-body { overflow: hidden; }
.dashboard-layout {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 56px);
    margin-top: 56px;
}
.dashboard-sidebar {
    width: 240px;
    min-width: 240px;
    flex-shrink: 0;
    height: 100%;
    overflow-y: auto;
    background: #fff;
    border-right: 1px solid var(--border);
}
.dashboard-sidebar-inner {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}
.dashboard-content {
    flex: 1;
    min-width: 0;
    padding: 2rem 2rem 4rem;
    overflow-y: auto;
    overflow-x: auto;
    background: var(--bs-secondary-bg);
}
.dashboard-footer {
    position: fixed;
    bottom: 0;
    left: 240px;
    right: 0;
    height: 36px;
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    font-size: 13px;
    z-index: 100;
}

/* Stat cards */
.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
}
.stat-card .stat-number {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}
.stat-card .stat-label {
    color: var(--text-muted);
    margin-top: .25rem;
}

/* Badges */
.badge { font-weight: 500; }

/* Event card hover */
.event-card {
    transition: transform .2s ease, box-shadow .2s ease;
}
.event-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12), 0 0 0 1px rgba(13,110,253,.14) !important;
}
.event-card-img-wrap {
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}
.event-card-img-wrap img {
    border-radius: 0 !important;
    transition: transform .35s ease;
}
.event-card:hover .event-card-img-wrap img {
    transform: scale(1.04);
}

/* Event card text clamping */
.event-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.event-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Webinar thumbnail */
.webinar-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

/* Live page */
.live-container iframe {
    width: 100%;
    height: calc(100vh - 120px);
    border: none;
    border-radius: 8px;
}

/* Pagination */
.page-link { color: var(--brand); }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); }

/* Form helpers */
.form-label { font-weight: 500; }
.form-control, .form-select { border-color: var(--border); }
.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem rgba(13,110,253,.15);
}

/* Inline icon labels */
.icon-label { display: flex; align-items: center; gap: .5rem; }

/* Resource card icon */
.res-icon { font-size: 1.4rem; }

/* Notifications dot */
.notif-dot {
    width: 8px; height: 8px;
    background: #dc3545;
    border-radius: 50%;
    display: inline-block;
}

@media (max-width: 768px) {
    .dashboard-layout { flex-direction: column; height: auto; }
    .dashboard-sidebar { width: 100%; min-width: 0; height: auto; overflow-y: visible; border-right: none; border-bottom: 1px solid var(--border); }
    .dashboard-sidebar-inner { min-height: 0; }
    .dashboard-content { padding: 1rem; overflow-y: visible; }
}

/* Avatar stack */
.avatar-stack { display: flex; align-items: center; }
.avatar-stack a,
.avatar-stack .avatar-more {
    width: 30px; height: 30px;
    margin-left: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    position: relative;
    transition: transform .15s;
    flex-shrink: 0;
}
.avatar-stack a:first-child,
.avatar-stack .avatar-more:first-child { margin-left: 0; }
.avatar-stack a:hover { transform: translateY(-3px); z-index: 5; }
.avatar-stack a img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar-stack .avatar-more {
    background: #dee2e6;
    color: #6c757d;
    font-size: .65rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

/* Resource cards */
.resource-card { transition: background .15s, border-color .15s; }
a.resource-card:hover { background: #f0f7ff !important; border-color: #3b82f6 !important; }

/* Auth pages (login / register) — centered on mobile, left-offset on md+ */
.auth-card-wrap { margin-left: auto; margin-right: auto; padding: 0 1rem; }
@media (min-width: 768px) { .auth-card-wrap { margin-left: 14%; margin-right: 0; padding: 0; } }
