/* ============================================
   ORDN — Ultra-Modern Design System
   Light/Dark Mode with Toggle
   ============================================ */

/* Smooth scroll + offset for sticky navbar */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* --- Theme Variables --- */
:root,
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-card: #ffffff;
    --bg-input: #f5f5f5;
    --border: #e0e0e0;
    --border-light: #eeeeee;
    --text-primary: #0a0a0a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --accent: #000000;
    --accent-hover: #333333;
    --gold: #c9a961;
    --gold-hover: #d4b46a;
    --overlay-bg: rgba(0, 0, 0, 0.5);
    --navbar-bg: rgba(255, 255, 255, 0.98);
    --modal-bg: #ffffff;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
    --navbar-height: 50px;

    /* Pillar colors — same in both themes */
    --pillar-body: #c0392b;
    --pillar-mind: #2980b9;
    --pillar-spirit: #8e44ad;
    --pillar-service: #27ae60;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;

    /* Backward compat aliases used by old inline styles */
    --ordn-bg-primary: var(--bg-primary);
    --ordn-bg-secondary: var(--bg-secondary);
    --ordn-bg-card: var(--bg-card);
    --ordn-bg-input: var(--bg-input);
    --ordn-border: var(--border);
    --ordn-border-light: var(--border-light);
    --ordn-text-primary: var(--text-primary);
    --ordn-text-secondary: var(--text-secondary);
    --ordn-text-muted: var(--text-muted);
    --ordn-accent: var(--gold);
    --ordn-accent-hover: var(--gold-hover);
    --ordn-pillar-body: var(--pillar-body);
    --ordn-pillar-mind: var(--pillar-mind);
    --ordn-pillar-spirit: var(--pillar-spirit);
    --ordn-pillar-service: var(--pillar-service);
}

[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #161616;
    --bg-input: #1c1c1c;
    --border: #2a2a2a;
    --border-light: #333333;
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent: #ffffff;
    --accent-hover: #cccccc;
    --gold: #c9a961;
    --gold-hover: #d4b46a;
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --navbar-bg: rgba(10, 10, 10, 0.98);
    --modal-bg: #161616;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: -0.01em;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

main {
    flex: 1;
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-primary);
}

.text-accent {
    color: var(--gold) !important;
}

.text-muted-ordn {
    color: var(--text-secondary) !important;
}

/* --- Container --- */
.container {
    max-width: 1400px;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar-ordn {
    background: var(--navbar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.navbar-ordn .navbar-brand {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-primary) !important;
}

/* Navbar logo — theme switching */
.navbar-logo {
    height: 42px;
    width: auto;
}
.navbar-logo-dark {
    display: none;
}
[data-theme="dark"] .navbar-logo-light {
    display: none;
}
[data-theme="dark"] .navbar-logo-dark {
    display: inline-block;
}

.navbar-ordn .nav-link {
    color: var(--text-secondary) !important;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 8px 16px !important;
    transition: color 0.3s ease;
}

.navbar-ordn .nav-link:hover,
.navbar-ordn .nav-link.active {
    color: var(--text-primary) !important;
}

.navbar-ordn .navbar-toggler {
    border-color: var(--border);
    padding: 6px 10px;
}

.navbar-ordn .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(150,150,150,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Theme toggle button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    padding: 0;
}

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

/* Navbar avatar dropdown */
.navbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold);
}

.navbar-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--gold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    border: 2px solid var(--gold);
}

.nav-item.dropdown .dropdown-toggle:has(.navbar-avatar, .navbar-avatar-placeholder)::after {
    display: none;
}

.dropdown-divider {
    border-color: var(--border);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-ordn {
    background: var(--text-primary);
    color: var(--bg-primary) !important;
    border: 1px solid var(--text-primary);
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    border-radius: 0;
    transition: all 0.3s ease;
}

.btn-ordn:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--bg-primary) !important;
    transform: translateY(-1px);
}

.btn-ordn-outline {
    background: transparent;
    color: var(--text-primary) !important;
    border: 1px solid var(--border);
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    border-radius: 0;
    transition: all 0.3s ease;
}

.btn-ordn-outline:hover {
    border-color: var(--text-primary);
    color: var(--text-primary) !important;
}

.btn-ordn.btn-sm,
.btn-ordn-outline.btn-sm {
    padding: 8px 20px;
    font-size: 13px;
}

.btn-ordn.btn-lg,
.btn-ordn-outline.btn-lg {
    padding: 16px 40px;
    font-size: 15px;
}

.btn-gold {
    background: var(--gold);
    color: #000 !important;
    border: 1px solid var(--gold);
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    border-radius: 0;
    transition: all 0.3s ease;
}

.btn-gold:hover {
    background: var(--gold-hover);
    border-color: var(--gold-hover);
    color: #000 !important;
    transform: translateY(-1px);
}

.btn-gold.btn-sm {
    padding: 8px 20px;
    font-size: 13px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    padding: 140px 0 120px;
    background: #000 url('../images/ORDN_theme.png') calc(100% + 350px) center/auto 200% no-repeat;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1,
.hero-section .lead {
    color: #fff;
}

.hero-section h1 {
    font-size: 72px;
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    max-width: 600px;
}

.hero-section .lead {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 520px;
    margin-bottom: 40px;
}

/* ============================================
   SECTIONS
   ============================================ */
.section-ordn {
    padding: 100px 0;
    transition: background-color 0.3s ease;
}

.bg-dark-alt {
    background: var(--bg-secondary);
}

.section-title {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    text-align: center;
}

.section-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 60px;
    line-height: 1.7;
}

.section-label {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 16px;
    display: block;
}

/* ============================================
   CARDS
   ============================================ */
.card-ordn,
.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 24px;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.card-ordn:hover {
    border-color: var(--text-primary);
    transform: translateY(-2px);
}

.card-ordn .card-body {
    padding: 0;
}

.card-ordn .card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-ordn .card-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.card-ordn .card-img-top {
    border-radius: 0;
    margin: -24px -24px 16px -24px;
    width: calc(100% + 48px);
    max-width: calc(100% + 48px);
    height: 180px;
    object-fit: cover;
}

/* ============================================
   PILLAR CARDS
   ============================================ */
.pillar-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 40px 30px;
    text-align: center;
    transition: all 0.4s ease;
}

.pillar-card:hover {
    border-color: var(--text-primary);
    transform: translateY(-4px);
}

.pillar-card .pillar-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.pillar-card .pillar-latin {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 6px;
}

.pillar-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.pillar-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* ============================================
   AUTH CONTAINER
   ============================================ */
.auth-container {
    max-width: 440px;
    margin: 80px auto;
    padding: 48px;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.auth-container h1 {
    font-size: 28px;
    text-align: center;
    margin-bottom: 8px;
}

.auth-container .form-control {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 14px 16px;
    font-size: 14px;
    border-radius: 0;
    transition: border-color 0.3s ease;
}

.auth-container .form-control:focus {
    border-color: var(--text-primary);
    box-shadow: none;
    background: var(--bg-input);
    color: var(--text-primary);
}

.auth-container .form-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* ============================================
   FORM CONTROLS (GLOBAL)
   ============================================ */
.form-control {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 0;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: var(--text-primary);
    box-shadow: none;
    background: var(--bg-input);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-check-input {
    background-color: var(--bg-input);
    border-color: var(--border);
}

.form-check-input:checked {
    background-color: var(--gold);
    border-color: var(--gold);
}

.form-select {
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 0;
}

/* ============================================
   CONTENT PAGE
   ============================================ */
.content-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 24px 100px;
}

.content-page h1 {
    font-size: 36px;
    margin-bottom: 24px;
}

.content-page h2 {
    font-size: 24px;
    margin-top: 40px;
    margin-bottom: 16px;
}

.content-page h3 {
    font-size: 20px;
    margin-top: 32px;
    margin-bottom: 12px;
}

.content-page p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.content-page ul, .content-page ol {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.content-page blockquote {
    border-left: 3px solid var(--gold);
    padding: 16px 24px;
    margin: 32px 0;
    font-style: italic;
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.article-content p {
    margin-bottom: 16px;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 24px;
}

.breadcrumb-item a {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.breadcrumb-item.active {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    font-weight: 600;
    letter-spacing: 0.03em;
    border-radius: 0;
    padding: 5px 12px;
}

.badge-membership-active {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.badge-membership-gold {
    background: var(--gold);
    color: #000;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination .page-link {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 0;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background: var(--bg-input);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.pagination .page-item.active .page-link {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--bg-primary);
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border-radius: 0;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
}

.alert-success { border-left: 3px solid var(--success); }
.alert-warning { border-left: 3px solid var(--warning); }
.alert-danger, .alert-error { border-left: 3px solid var(--danger); }
.alert-info { border-left: 3px solid var(--info); }

.btn-close {
    filter: invert(0.5);
}

[data-theme="dark"] .btn-close {
    filter: invert(0.8);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.95rem;
    margin-bottom: 12px;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress {
    background: var(--bg-input);
    border-radius: 0;
    height: 6px;
}

.progress-bar {
    background: var(--gold);
    border-radius: 0;
}

/* ============================================
   LEAD MAGNET
   ============================================ */
.lead-magnet-section {
    padding: 100px 0;
    background: var(--text-primary);
    color: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.lead-magnet-card {
    position: relative;
}

.lead-magnet-glow {
    display: none;
}

.lead-magnet-eyebrow {
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 16px;
}

.lead-magnet-title {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    color: inherit;
}

.lead-magnet-desc {
    font-size: 16px;
    line-height: 1.8;
    opacity: 0.8;
    margin-bottom: 24px;
}

.lead-magnet-features {
    list-style: none;
    padding: 0;
    margin-bottom: 32px;
}

.lead-magnet-features li {
    padding: 6px 0;
    font-size: 15px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lead-magnet-features li i {
    color: var(--gold);
}

.lead-magnet-form,
.lead-magnet-input-group {
    display: flex;
    gap: 10px;
    max-width: 460px;
}

.lead-magnet-input-group .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.lead-magnet-input-group .form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.lead-magnet-input-group .form-control:focus {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.lead-magnet-input-group .btn-ordn {
    background: var(--gold);
    border-color: var(--gold);
    color: #000 !important;
    white-space: nowrap;
}

.lead-magnet-input-group .btn-ordn:hover {
    background: var(--gold-hover);
    border-color: var(--gold-hover);
}

.lead-magnet-privacy {
    margin-top: 12px;
    font-size: 12px;
    opacity: 0.4;
}

.lead-magnet-book-img {
    max-height: 350px;
    object-fit: contain;
}

.lead-magnet-book {
    position: relative;
}

.lead-magnet-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--gold);
    color: #000;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lead-magnet-success {
    text-align: center;
}

.lead-magnet-success-icon {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 12px;
}

.lead-magnet-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 8px;
}

.motto {
    color: var(--gold);
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* ============================================
   COMMUNITY
   ============================================ */
.community-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-decoration: none;
}

.community-pill:hover,
.community-pill.active {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: var(--bg-card);
}

.community-post {
    transition: border-color 0.3s ease;
    position: relative;
}

.community-post:hover {
    border-color: var(--border-light);
}

/* Feed card top-right action icons */
.feed-card-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.community-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    transition: color 0.3s ease;
}

.community-action-btn:hover {
    color: var(--text-primary);
}

.community-action-btn.liked,
.community-action-btn.watching,
.community-action-btn.pinned {
    color: var(--gold);
}

.community-comment {
    transition: background-color 0.3s ease;
}

/* Thread like button */
.thread-like-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.thread-like-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.thread-like-btn.liked {
    border-color: var(--gold);
    color: var(--gold);
}

.thread-comment-count {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Thread Modal */
.thread-modal-overlay,
.event-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thread-modal-container,
.event-modal-container {
    background: var(--modal-bg);
    border: 1px solid var(--border);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

/* Thread modal: wider + flex layout for sticky header/footer */
.thread-modal-container {
    max-width: 850px;
    display: flex;
    flex-direction: column;
}

.thread-modal-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Sticky header inside modal */
.modal-thread-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--modal-bg);
    padding: 1.5rem 2rem 1rem;
}

/* Sticky comment input at bottom */
.modal-comment-box {
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: var(--modal-bg);
    border-top: 1px solid var(--border);
    padding: 1rem 2rem;
}

/* Comment avatar classes (circular) */
.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.comment-avatar-sm {
    width: 32px;
    height: 32px;
}
.comment-avatar-placeholder {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
}
.comment-avatar-sm.comment-avatar-placeholder {
    font-size: 0.75rem;
}
.comment-meta {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}
.comment-body {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.comment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    font-size: 0.8rem;
}

/* Close button: top-left of overlay (outside modal) like Skool */
.thread-modal-close,
.event-modal-close {
    position: fixed;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2010;
    font-size: 1.3rem;
    transition: color 0.3s ease;
}

.thread-modal-close:hover,
.event-modal-close:hover {
    color: #fff;
}

/* Modal header actions: top-right icons */
.modal-header-actions {
    position: absolute;
    top: 16px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 6;
}

.modal-header-icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

.modal-header-icon-btn:hover {
    color: var(--text-primary);
}

.modal-header-icon-btn.watching,
.modal-header-icon-btn.pinned {
    color: var(--gold);
}

/* Three-dot dropdown menu */
.modal-more-menu {
    position: relative;
}

.modal-more-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    min-width: 180px;
    z-index: 20;
    padding: 4px 0;
    margin-top: 4px;
}

.modal-more-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
}

.modal-more-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Thread author avatar (circular) */
.thread-author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.thread-author-avatar-placeholder {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
}

/* Comment replies (nested) */
.community-reply {
    border-left: 2px solid var(--border);
    padding-left: 12px !important;
}

/* Reply indicator */
.reply-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cancel-reply-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0 4px;
}

.cancel-reply-btn:hover {
    color: var(--text-primary);
}

/* @mention highlight */
.comment-mention {
    color: var(--gold);
    font-weight: 600;
}

/* Comment media */
.comment-media {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    margin: 8px 0;
    display: block;
    border: 1px solid var(--border);
}

.comment-file-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    margin: 4px 0;
}

.comment-file-link:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* Embeds */
.comment-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    margin: 8px 0;
    overflow: hidden;
}

.comment-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid var(--border);
}

.comment-embed-spotify {
    padding-bottom: 0;
    height: 80px;
}

.comment-embed-spotify iframe {
    position: static;
    height: 80px;
}

/* Comment toolbar */
.comment-composer {
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: border-color 0.3s ease;
}

.comment-composer:focus-within {
    border-color: var(--text-secondary);
}

.comment-composer textarea {
    border: none !important;
    background: transparent !important;
    padding: 10px 12px;
}

.comment-composer textarea:focus {
    box-shadow: none !important;
}

.comment-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.toolbar-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 8px;
    font-size: 14px;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.toolbar-btn:hover {
    color: var(--gold);
}

.toolbar-divider {
    width: 1px;
    height: 18px;
    background: var(--border);
    margin: 0 4px;
}

/* Emoji picker */
.emoji-picker-dropdown {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    max-width: 320px;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
}

.emoji-item {
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.15s ease;
    line-height: 1;
}

.emoji-item:hover {
    transform: scale(1.3);
}

/* GIF picker */
.gif-picker-dropdown {
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    max-width: 400px;
    margin-top: 4px;
}

.gif-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    max-height: 250px;
    overflow-y: auto;
}

.gif-result-item {
    width: 100%;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: border-color 0.2s ease;
}

.gif-result-item:hover {
    border-color: var(--gold);
}

/* Attachment previews */
.attachment-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px 4px;
}

.attachment-previews:empty {
    display: none;
}

.attachment-preview-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
}

.attachment-preview-item img {
    width: 64px;
    height: 64px;
    object-fit: cover;
}

.attachment-file-name {
    padding: 8px 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.remove-attachment {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    border-radius: 50%;
}

.remove-attachment:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

/* Jump to latest — floating pill */
.jump-to-latest-wrapper {
    position: sticky;
    bottom: 80px;
    z-index: 6;
    text-align: center;
    pointer-events: none;
}

.jump-to-latest {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: auto;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.jump-to-latest:hover {
    background: var(--gold);
    color: #000;
}

/* New comment badge on feed */
.new-comment-badge {
    display: inline-flex;
    align-items: center;
}

/* Commenter avatars on feed */
.commenter-avatars {
    display: flex;
    align-items: center;
}

.commenter-avatar-img,
.commenter-avatar-placeholder {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
    margin-left: -8px;
    flex-shrink: 0;
}

.commenter-avatar-img:first-child,
.commenter-avatar-placeholder:first-child {
    margin-left: 0;
}

.commenter-avatar-img {
    object-fit: cover;
}

.commenter-avatar-placeholder {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

/* ============================================
   CLASSROOM / COURSES
   ============================================ */
.classroom-card-link {
    text-decoration: none;
    color: inherit;
}

.classroom-card {
    border: 1px solid var(--border);
    background: var(--bg-card);
    overflow: hidden;
    transition: all 0.3s ease;
}

.classroom-card:hover {
    border-color: var(--text-primary);
    transform: translateY(-2px);
}

.classroom-card-img {
    height: 180px;
    background: var(--bg-input);
    overflow: hidden;
    position: relative;
}

.classroom-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.classroom-card-img-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.classroom-draft-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--warning);
    color: #000;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    z-index: 2;
}

/* Three-dot menu on card image */
.classroom-card-menu {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
}
.classroom-card-menu-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.classroom-card:hover .classroom-card-menu-btn {
    opacity: 1;
}
.classroom-card-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    min-width: 160px;
    padding: 4px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
}
.classroom-card-menu-dropdown button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
}
.classroom-card-menu-dropdown button:hover {
    background: var(--bg-secondary);
}
.classroom-card-menu-dropdown button.text-danger {
    color: var(--danger);
}

/* Inline access badge (in card body) */
.course-access-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}
.course-access-badge-inline.badge-open {
    background: rgba(39, 174, 96, 0.15);
    color: #27ae60;
}
.course-access-badge-inline.badge-level {
    background: rgba(201, 169, 97, 0.15);
    color: var(--gold);
}
.course-access-badge-inline.badge-buy {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
}
.course-access-badge-inline.badge-time {
    background: rgba(243, 156, 18, 0.15);
    color: #f39c12;
}
.course-access-badge-inline.badge-private {
    background: rgba(142, 68, 173, 0.15);
    color: #8e44ad;
}

/* New course tile (Skool-style) */
.classroom-card-new {
    border: 2px dashed var(--gold);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 280px;
    cursor: pointer;
    color: var(--gold);
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    background: transparent;
}
.classroom-card-new i {
    font-size: 2.5rem;
}
.classroom-card-new:hover {
    background: rgba(201, 169, 97, 0.08);
    border-color: var(--gold);
}

.classroom-card-body {
    padding: 20px;
}

.classroom-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.classroom-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.classroom-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-decoration: none;
    margin-bottom: 4px;
    transition: color 0.2s ease;
}

.classroom-back-link:hover {
    color: var(--text-primary);
}

.classroom-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.classroom-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-input);
    overflow: hidden;
}

.classroom-progress-fill {
    height: 100%;
    background: var(--gold);
    transition: width 0.3s ease;
}

.classroom-progress-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 32px;
    text-align: right;
}

/* ============================================
   APP SIDEBAR LAYOUT
   ============================================ */
.app-layout {
    min-height: calc(100vh - var(--navbar-height));
}

.app-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
    z-index: 1030;
}

/* Slim navbar in app layout (logo moved to sidebar) */
.navbar-ordn.navbar-app {
    padding: 6px 0;
}

.app-content {
    margin-left: 260px;
    min-height: calc(100vh - var(--navbar-height));
    min-width: 0;
    background: var(--bg-primary);
}

/* Sidebar brand logo */
.app-sidebar-brand {
    padding: 24px 20px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.app-sidebar-logo {
    height: 63px;
    width: auto;
}
[data-theme="dark"] .sidebar-logo-light,
[data-theme="light"] .sidebar-logo-dark,
.sidebar-logo-dark {
    display: none;
}
[data-theme="dark"] .sidebar-logo-dark {
    display: inline;
}

/* User section as footer header */
.app-sidebar-user-section {
    padding: 14px 20px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-sidebar-header {
    padding: 14px 20px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.app-sidebar-avatar-placeholder {
    background: var(--gold);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.app-sidebar-user {
    font-weight: 600;
    font-size: 0.9rem;
}

.app-sidebar-nav {
    padding: 12px 0;
}

.app-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

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

.app-sidebar-link.active {
    color: var(--gold);
    border-left: 3px solid var(--gold);
    padding-left: 17px;
    font-weight: 600;
}

.app-sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.app-sidebar-footer {
    margin-top: auto;
    padding: 0 0 12px;
}

/* Mobile sidebar toggle + backdrop */
.app-sidebar-toggle {
    display: none;
}

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

@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
    }
    .app-sidebar.open {
        left: 0;
    }
    .app-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    .app-sidebar-backdrop.open {
        opacity: 1;
        pointer-events: auto;
    }
    .app-sidebar-toggle {
        display: flex;
        position: fixed;
        bottom: 20px;
        left: 20px;
        z-index: 1030;
        background: var(--bg-card);
        border: 1px solid var(--border);
        color: var(--text-primary);
        width: 48px;
        height: 48px;
        align-items: center;
        justify-content: center;
        font-size: 1.3rem;
        cursor: pointer;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
    .app-content {
        margin-left: 0;
        width: 100%;
    }
}

/* Course detail 2-panel */
.classroom-detail-layout {
    display: flex;
    min-height: calc(100vh - 70px);
}

.classroom-sidebar {
    width: 320px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 24px;
    overflow-y: auto;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
}

.classroom-sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.classroom-content {
    flex: 1;
    padding: 48px 80px;
    display: flex;
    flex-direction: column;
}
.classroom-content-inner {
    max-width: 780px;
    width: 100%;
    margin: 0 auto;
}

.classroom-module {
    margin-bottom: 8px;
}

.classroom-module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.classroom-module-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.classroom-module-chevron {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.collapsed .classroom-module-chevron {
    transform: rotate(180deg);
}

.classroom-module-lessons {
    padding: 4px 0;
}

.classroom-lesson-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.classroom-lesson-item:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.classroom-lesson-item.active {
    background: var(--bg-input);
    color: var(--text-primary);
    border-left-color: var(--gold);
    font-weight: 600;
}

.classroom-lesson-icon {
    font-size: 1rem;
}

.classroom-lesson-label {
    flex: 1;
}

.classroom-lesson-done {
    color: var(--gold);
    font-size: 0.9rem;
}

.classroom-lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.classroom-lesson-title {
    font-size: 1.5rem;
    margin: 0;
}

.classroom-lesson-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* Inline lesson editor */
.lesson-title-input {
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    flex: 1;
}
.lesson-title-input:focus {
    border-color: var(--gold);
    outline: none;
    box-shadow: 0 0 0 2px rgba(201, 169, 97, 0.15);
}
.lesson-editor-wrapper {
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
}
.lesson-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.lesson-editor-textarea {
    width: 100%;
    min-height: 400px;
    padding: 20px;
    border: none;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.8;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    resize: vertical;
}
.lesson-editor-textarea:focus {
    outline: none;
}
.lesson-preview {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-top: 0.5rem;
    background: var(--bg-card);
}

/* Lesson rendered content */
.classroom-lesson-content h1,
.classroom-lesson-content h2,
.classroom-lesson-content h3 {
    color: var(--text-primary);
    margin: 1.5em 0 0.5em;
}
.classroom-lesson-content h1 { font-size: 1.6rem; }
.classroom-lesson-content h2 { font-size: 1.3rem; }
.classroom-lesson-content h3 { font-size: 1.1rem; }
.classroom-lesson-content h1:first-child,
.classroom-lesson-content h2:first-child,
.classroom-lesson-content h3:first-child { margin-top: 0; }
.classroom-lesson-content p {
    margin: 0.6em 0;
}
.classroom-lesson-content ul,
.classroom-lesson-content ol {
    padding-left: 1.5em;
    margin: 0.5em 0;
}
.classroom-lesson-content li {
    margin-bottom: 0.3em;
}
.classroom-lesson-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5em 0;
}
.lesson-blockquote {
    border-left: 3px solid var(--gold);
    padding: 0.5em 1em;
    margin: 0.8em 0;
    color: var(--text-secondary);
    font-style: italic;
}
.classroom-lesson-content code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}
.lesson-content-img {
    max-width: 100%;
    margin: 1em 0;
    border-radius: 4px;
}
.lesson-code-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1em 1.2em;
    margin: 1em 0;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.85em;
    line-height: 1.5;
}
.lesson-code-block code {
    background: none;
    padding: 0;
    font-size: inherit;
}

.classroom-complete-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.classroom-complete-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.classroom-complete-btn.completed {
    color: var(--gold);
    border-color: var(--gold);
}

/* --- Course Access Badges (course_list cards) --- */
/* Legacy .course-access-badge kept for course detail page */
.course-access-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border-radius: 3px;
}
.course-access-badge.badge-open {
    background: rgba(39, 174, 96, 0.15);
    color: #27ae60;
}
.course-access-badge.badge-level {
    background: rgba(201, 169, 97, 0.15);
    color: var(--gold);
}
.course-access-badge.badge-buy {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
}
.course-access-badge.badge-time {
    background: rgba(243, 156, 18, 0.15);
    color: #f39c12;
}
.course-access-badge.badge-private {
    background: rgba(142, 68, 173, 0.15);
    color: #8e44ad;
}

/* Locked overlay on course card */
.classroom-card.course-locked {
    opacity: 0.7;
    position: relative;
}
.classroom-card.course-locked::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, var(--bg-card) 100%);
    pointer-events: none;
    z-index: 1;
}
.course-lock-icon {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: 1.2rem;
    color: var(--text-muted);
    z-index: 2;
}

/* --- Course Detail: Locked State --- */
.course-locked-message {
    text-align: center;
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.course-locked-message .lock-icon {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 1rem;
}
.course-locked-message h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}
.course-locked-message p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
.course-locked-sidebar .classroom-lesson-item {
    opacity: 0.4;
    pointer-events: none;
}
.course-locked-sidebar .classroom-module-header {
    opacity: 0.5;
}

/* --- Course Modal (Staff create/edit) --- */
.course-modal-body {
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(90vh - 2rem);
}
.course-modal-body .form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

/* Access type radio group */
.course-access-radios {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1rem;
}
.course-access-radios label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-secondary);
    background: var(--bg-input);
}
.course-access-radios label:hover {
    border-color: var(--gold);
    color: var(--text-primary);
}
.course-access-radios input[type="radio"] {
    display: none;
}
.course-access-radios input[type="radio"]:checked + label,
.course-access-radios label.active {
    border-color: var(--gold);
    background: rgba(201, 169, 97, 0.1);
    color: var(--gold);
    font-weight: 600;
}

/* Conditional access fields (hidden by default) */
.course-access-field {
    display: none;
    margin-bottom: 1rem;
}
.course-access-field.active {
    display: block;
}

/* Character counter */
.char-counter {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 2px;
}
.char-counter.over-limit {
    color: var(--danger);
}

/* Cover image preview */
.course-cover-preview {
    width: 100%;
    height: 140px;
    border: 1px dashed var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background: var(--bg-input);
    margin-bottom: 0.5rem;
}
.course-cover-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.course-cover-preview .placeholder-text {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Published/Draft toggle */
.course-status-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.course-status-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 36px;
    height: 20px;
    background: var(--border);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}
.course-status-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}
.course-status-toggle input[type="checkbox"]:checked {
    background: var(--gold);
}
.course-status-toggle input[type="checkbox"]:checked::before {
    transform: translateX(16px);
}

/* Modal footer: Published toggle left, buttons right */
.course-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    margin-top: 1.5rem;
}
.course-modal-footer .footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Staff "+" button on course list */
.course-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.course-add-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* Leaderboard: level-unlock course badges */
.lb-level-unlock {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--gold);
    margin-top: 2px;
    opacity: 0.85;
}
.lb-level-unlock i {
    font-size: 0.65rem;
}

/* --- Moderation: Report & Staff Actions --- */
.report-inline-form {
    position: absolute;
    top: 60px;
    right: 16px;
    z-index: 2020;
    background: var(--modal-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 260px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.report-form-inner {
    padding: 12px;
}

/* Navbar report badge */
.report-badge {
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
}

/* Report reason badges on reports page */
.report-reason-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 3px;
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger);
}
.report-reason-spam { background: rgba(243, 156, 18, 0.1); color: #f39c12; }
.report-reason-offensive { background: rgba(231, 76, 60, 0.1); color: #e74c3c; }
.report-reason-harassment { background: rgba(142, 68, 173, 0.1); color: #8e44ad; }
.report-reason-other { background: rgba(52, 152, 219, 0.1); color: #3498db; }

.report-resolved-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 3px;
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

/* Staff action buttons in dropdown (red tint for destructive) */
.mod-action-ban {
    color: var(--danger) !important;
}

/* ============================================
   EVENTS CALENDAR
   ============================================ */
.event-calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}

.event-calendar-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.event-calendar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.event-calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.event-calendar-table th {
    padding: 12px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.event-calendar-cell {
    vertical-align: top;
    padding: 8px;
    border: 1px solid var(--border);
    min-height: 80px;
    height: 100px;
    cursor: default;
    transition: background 0.2s ease;
}

.event-calendar-cell:hover {
    background: var(--bg-secondary);
}

.event-calendar-day {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.event-calendar-day.today {
    color: var(--bg-primary);
    background: var(--text-primary);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.event-calendar-day.other-month {
    opacity: 0.3;
}

.event-calendar-event {
    display: block;
    padding: 3px 6px;
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg-input);
    border-left: 2px solid var(--gold);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.2s ease;
    color: var(--text-primary);
    text-decoration: none;
}

.event-calendar-event:hover {
    background: var(--border);
}

/* Event list view */
.event-list-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.event-list-item:last-child {
    border-bottom: none;
}

.event-list-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
}

.event-list-day {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.event-list-month {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.event-list-info {
    flex: 1;
}

.event-list-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.event-list-title {
    font-size: 1rem;
    font-weight: 600;
}

/* ============================================
   FOOTER
   ============================================ */
.footer-ordn {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 60px 0 30px;
    margin-top: auto;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-ordn h5 {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.footer-ordn a {
    color: var(--text-secondary);
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-ordn a:hover {
    color: var(--text-primary);
}

.footer-ordn .motto {
    font-size: 0.85rem;
}

.footer-socials {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.footer-socials a {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: color 0.2s;
}
.footer-socials a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================
   DROPDOWN MENU
   ============================================ */
.dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0;
}

.dropdown-item {
    color: var(--text-primary);
    font-size: 14px;
    padding: 8px 16px;
}

.dropdown-item:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.dropdown-item.active {
    background: var(--bg-input);
    color: var(--gold);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .classroom-detail-layout {
        flex-direction: column;
    }

    .classroom-sidebar {
        width: 100%;
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .classroom-content {
        padding: 24px 20px;
    }

    .hero-section h1 {
        font-size: 48px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 80px 0 60px;
    }

    .hero-section h1 {
        font-size: 40px;
    }

    .section-ordn {
        padding: 60px 0;
    }

    .section-title {
        font-size: 28px;
    }

    .auth-container {
        margin: 40px 16px;
        padding: 32px 24px;
    }

    .content-page {
        padding: 32px 16px 60px;
    }

    .lead-magnet-section {
        padding: 60px 0;
    }

    .lead-magnet-title {
        font-size: 32px;
    }

    .lead-magnet-form,
    .lead-magnet-input-group {
        flex-direction: column;
    }

    .event-calendar-toolbar {
        flex-wrap: wrap;
    }
}

@media (max-width: 576px) {
    .community-pill {
        font-size: 12px;
        padding: 6px 12px;
    }

    .section-title {
        font-size: 24px;
    }
}

/* ============================================
   COMMUNITY TAB TOGGLE
   ============================================ */
.community-tab-toggle {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
}
.community-tab {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.community-tab:hover {
    color: var(--text-primary);
    text-decoration: none;
}
.community-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

/* ============================================
   LEADERBOARDS
   ============================================ */

/* Avatar with level badge + circular progress ring */
.lb-avatar-wrapper {
    position: relative;
    display: inline-block;
    width: 120px;
    height: 120px;
}
.lb-avatar-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    position: absolute;
    top: 10px;
    left: 10px;
}
.lb-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gold);
    color: #000;
    font-size: 2.2rem;
    font-weight: 700;
}
.lb-progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
}
.lb-progress-ring-bg {
    stroke: var(--border);
}
.lb-progress-ring-fill {
    stroke: var(--gold);
    stroke-linecap: round;
    transition: stroke-dasharray 0.6s ease;
}
.lb-level-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gold);
    color: #000;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card);
    z-index: 1;
}

/* Info question mark (opens modal) */
.lb-info-trigger {
    display: inline-block;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.75rem;
    vertical-align: middle;
}
.lb-info-trigger:hover {
    color: var(--gold);
}

/* Points table in info modal */
.lb-points-table {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 2rem;
}

/* Level grid — two columns (1-5 | 6-9) */
.lb-levels-grid {
    display: flex;
    gap: 1rem;
}
.lb-levels-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
@media (max-width: 768px) {
    .lb-levels-grid {
        flex-direction: column;
    }
}
.lb-level-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
}
.lb-level-current {
    background: var(--bg-input);
}
.lb-level-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--bg-input);
    color: var(--text-muted);
    flex-shrink: 0;
}
.lb-level-reached {
    background: var(--gold);
    color: #000;
}
.lb-level-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}
.lb-level-pct {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Leaderboard tables */
.lb-table-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}
.lb-table {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.lb-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
}
.lb-rank {
    width: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
    flex-shrink: 0;
}
.lb-row-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.lb-row-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gold);
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
}
.lb-row-name {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lb-row-points {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gold);
    flex-shrink: 0;
}

/* ============================================
   REMOVE SHADOWS
   ============================================ */
/* ============================================
   CHALLENGE CHECK-IN
   ============================================ */
.checkin-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.checkin-mood-selector {
    display: flex;
    gap: 0.5rem;
}

.checkin-mood-btn {
    width: 48px;
    height: 48px;
    border: 2px solid var(--bg-secondary);
    border-radius: 12px;
    background: transparent;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkin-mood-btn:hover {
    border-color: var(--gold);
    transform: scale(1.1);
}

.checkin-mood-btn.active {
    border-color: var(--gold);
    background: rgba(192, 160, 98, 0.15);
    transform: scale(1.1);
}

.checkin-done {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--gold);
    font-weight: 600;
    flex-wrap: wrap;
}

.checkin-done i {
    font-size: 1.2rem;
}

.checkin-mood-display {
    font-size: 1.3rem;
}

.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(255, 165, 0, 0.15));
    color: #ff6b35;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.streak-badge i {
    color: #ff6b35;
}

.xp-earned-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    background: rgba(192, 160, 98, 0.15);
    color: var(--gold);
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Calendar heatmap */
.checkin-calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    padding: 0 2px;
}

.checkin-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    position: relative;
}

.checkin-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: default;
    max-width: 40px;
    transition: transform 0.15s;
}

.checkin-day.empty {
    background: var(--bg-secondary);
    color: var(--text-muted);
    opacity: 0.5;
}

.checkin-day.outside {
    background: transparent;
    color: var(--text-muted);
    opacity: 0.25;
}

.checkin-day.great {
    background: var(--gold);
    color: #000;
    cursor: pointer;
}

.checkin-day.good {
    background: #4caf50;
    color: #fff;
    cursor: pointer;
}

.checkin-day.ok {
    background: #78909c;
    color: #fff;
    cursor: pointer;
}

.checkin-day.bad {
    background: #ff9800;
    color: #fff;
    cursor: pointer;
}

.checkin-day.great:hover,
.checkin-day.good:hover,
.checkin-day.ok:hover,
.checkin-day.bad:hover {
    transform: scale(1.2);
    z-index: 2;
}

.checkin-tooltip {
    position: absolute;
    background: var(--bg-primary);
    border: 1px solid var(--bg-secondary);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    z-index: 10;
    pointer-events: none;
    transform: translateX(-50%);
    white-space: nowrap;
    max-width: 250px;
    white-space: normal;
}

.checkin-tooltip strong {
    color: var(--text-primary);
}

.checkin-tooltip em {
    color: var(--text-muted);
    font-style: normal;
    display: block;
    margin-top: 0.25rem;
}

/* ============================================
   CONFIRM MODAL (stacked above other modals)
   ============================================ */
#confirmModal {
    z-index: 2100;
}
#confirmModal + .modal-backdrop,
#confirmModal ~ .modal-backdrop:last-of-type {
    z-index: 2050;
}

/* ============================================
   SECTION HELP ICON (tooltip)
   ============================================ */
.section-help-icon {
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: help;
    transition: color 0.2s;
}
.section-help-icon:hover {
    color: var(--gold);
}

/* ============================================
   PARTICIPANT PROGRESS
   ============================================ */
.participant-progress-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}
.participant-progress-row:last-child {
    border-bottom: none;
}
.participant-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.75rem;
}
.participant-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.participant-info {
    flex: 1;
    min-width: 0;
}
.participant-name {
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.participant-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.participant-progress-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}
.participant-progress-fill {
    height: 100%;
    background: var(--gold);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ============================================
   ABANDON CHALLENGE BUTTON
   ============================================ */
.btn-abandon {
    background: transparent;
    color: #e74c3c;
    border: 2px solid #e74c3c;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.btn-abandon:hover {
    background: #e74c3c;
    color: #fff;
}

/* ============================================
   CHECKIN DIARY LIST
   ============================================ */
.checkin-entry {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.checkin-entry.last {
    border-bottom: none;
}
.checkin-entry-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 3.5rem;
    white-space: nowrap;
    padding-top: 0.1rem;
}
.checkin-entry-mood {
    font-size: 1.1rem;
    flex-shrink: 0;
    line-height: 1;
    padding-top: 0.1rem;
}
.checkin-entry-content {
    flex: 1;
    min-width: 0;
}
.checkin-entry-mood-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.checkin-entry-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 0.15rem 0 0;
}

/* ============================================
   STEP COMPLETION NOTES & ATTACHMENTS
   ============================================ */
.step-completion-detail {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}
.step-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0.5rem;
}
.step-note i {
    color: var(--gold);
    margin-right: 0.25rem;
}
.step-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.step-attachment-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: opacity 0.2s;
}
.step-attachment-thumb:hover {
    opacity: 0.8;
}
.step-attachment-video {
    max-width: 240px;
    border-radius: 8px;
}
.step-attachment-file {
    font-size: 0.8rem;
    color: var(--gold);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.6rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    text-decoration: none;
}
.step-attachment-file:hover {
    color: var(--text-primary);
}

/* Upload toolbar */
.step-upload-toolbar {
    display: flex;
    gap: 0.5rem;
}
.step-upload-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.step-upload-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* Upload previews */
.step-attachment-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.step-attachment-preview-item {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.step-attachment-preview-item img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.step-attachment-preview-file {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.3rem 0.6rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.remove-step-attachment {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    color: var(--text-secondary);
    padding: 0;
    line-height: 1;
}
.remove-step-attachment:hover {
    color: #e74c3c;
    border-color: #e74c3c;
}

/* ============================================
   CHALLENGE COMMUNITY INTEGRATION
   ============================================ */

/* Challenge thread badge in feed */
.challenge-thread-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.1rem 0.4rem;
    background: rgba(192, 160, 98, 0.15);
    color: var(--gold);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* System post visual */
.system-post {
    border-left: 3px solid var(--gold);
}

.system-post-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), #e8b534);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Challenge participants avatars */
.challenge-participants {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.challenge-participant img,
.challenge-participant-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.challenge-participant-placeholder {
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

.challenge-participant-more {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* Challenge leaderboard table */
.challenge-lb-table {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.challenge-lb-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: var(--bg-secondary);
    font-size: 0.85rem;
}

.challenge-lb-row.current {
    background: rgba(192, 160, 98, 0.12);
    border: 1px solid rgba(192, 160, 98, 0.3);
}

.challenge-lb-rank {
    width: 24px;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
    flex-shrink: 0;
}

.challenge-lb-row.current .challenge-lb-rank {
    color: var(--gold);
}

.challenge-lb-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.challenge-lb-user span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.challenge-lb-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.challenge-lb-avatar-placeholder {
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
}

.challenge-lb-xp {
    font-weight: 700;
    color: var(--gold);
    white-space: nowrap;
}

.challenge-lb-checkins {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Challenge thread items in challenge detail */
.challenge-thread-item {
    display: block;
    padding: 0.6rem 0;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--bg-secondary);
    transition: background 0.15s;
}

.challenge-thread-item:last-of-type {
    border-bottom: none;
}

.challenge-thread-item:hover {
    background: rgba(192, 160, 98, 0.05);
}

/* XP breakdown bar on leaderboard */
.xp-breakdown {
    text-align: left;
}

.xp-breakdown-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-secondary);
    margin-bottom: 0.4rem;
}

.xp-breakdown-segment {
    min-width: 4px;
    transition: width 0.3s;
}

.xp-breakdown-segment.discussions {
    background: #5b8def;
}

.xp-breakdown-segment.library {
    background: #4caf50;
}

.xp-breakdown-segment.challenges {
    background: var(--gold);
}

.xp-breakdown-segment.events {
    background: #e67e22;
}

.xp-breakdown-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.xp-breakdown-legend span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.xp-breakdown-legend i {
    font-size: 0.5rem;
}

/* ============================================
   REMOVE SHADOWS
   ============================================ */
.card-ordn,
.dashboard-card,
.pillar-card,
.navbar-ordn,
.classroom-card,
.auth-container {
    box-shadow: none !important;
}

/* ============================================
   Notifications
   ============================================ */

/* Bell in navbar */
.notification-bell-wrap {
    position: relative;
}
.notification-bell {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 0.3rem;
    cursor: pointer;
    position: relative;
    transition: color 0.15s;
}
.notification-bell:hover {
    color: var(--gold);
}
.notification-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* Dropdown panel */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    max-height: 420px;
    overflow-y: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    z-index: 9999;
}
.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.notif-mark-all {
    font-size: 0.78rem;
    color: var(--gold) !important;
    text-decoration: none;
    cursor: pointer;
}
.notif-mark-all:hover { text-decoration: underline; }

/* Dropdown items */
.notif-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
    position: relative;
}
.notif-dropdown-item:hover {
    background: rgba(201, 169, 97, 0.06);
    color: var(--text-primary);
}
.notif-dropdown-item.unread {
    background: rgba(201, 169, 97, 0.04);
}
.notif-dropdown-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
}
.notif-dropdown-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.notif-dropdown-avatar span {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
}
.notif-dropdown-body {
    flex: 1;
    min-width: 0;
}
.notif-dropdown-text {
    font-size: 0.82rem;
    line-height: 1.3;
}
.notif-dropdown-time {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}
.notif-dropdown-footer {
    display: block;
    text-align: center;
    padding: 0.6rem;
    font-size: 0.82rem;
    color: var(--gold) !important;
    text-decoration: none;
    border-top: 1px solid var(--border);
}
.notif-dropdown-footer:hover { text-decoration: underline; }
.notif-dropdown-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Unread dot */
.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
    flex-shrink: 0;
}

/* Notification list page items */
.notification-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.1s;
}
.notification-item:hover {
    background: rgba(201, 169, 97, 0.06);
    color: var(--text-primary);
}
.notification-item.unread {
    background: rgba(201, 169, 97, 0.04);
}
.notification-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
}
.notification-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.notification-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
}
.notification-content {
    flex: 1;
    min-width: 0;
}
.notification-text {
    font-size: 0.88rem;
    line-height: 1.35;
}
.notification-time {
    font-size: 0.76rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* =============================================
   CHAT / MESSAGING
   ============================================= */

/* Online / Offline dots */
.online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ECC71;
    flex-shrink: 0;
}
.offline-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    flex-shrink: 0;
}
.online-dot-inbox {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border: 2px solid var(--bg-primary);
}

/* Chat avatars */
.chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.chat-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.chat-avatar-xs {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.chat-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8rem;
}
.chat-avatar-sm.chat-avatar-placeholder {
    font-size: 0.7rem;
}
.chat-avatar-xs.chat-avatar-placeholder {
    font-size: 0.6rem;
}

/* Search results */
.chat-search-results {
    border: 1px solid var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
}
.chat-search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--bg-secondary);
}
.chat-search-result-item:last-child {
    border-bottom: none;
}

/* Inbox list */
.chat-inbox-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.chat-inbox-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.15s;
}
.chat-inbox-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
}
.chat-inbox-item.unread {
    background: color-mix(in srgb, var(--accent-gold) 8%, transparent);
}
.chat-inbox-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}
.chat-inbox-body {
    flex: 1;
    min-width: 0;
}
.chat-inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}
.chat-inbox-name {
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-inbox-time {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}
.chat-inbox-preview {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.1rem;
}
.chat-unread-badge {
    background: var(--accent-gold);
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    flex-shrink: 0;
}

/* Conversation layout */
.chat-conversation-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    width: 50%;
    margin: 0 auto;
}
.chat-conv-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid var(--bg-secondary);
    flex-shrink: 0;
}
.chat-back-btn {
    color: var(--text-primary);
    font-size: 1.2rem;
    text-decoration: none;
    display: flex;
    align-items: center;
}
.chat-back-btn:hover {
    color: var(--accent-gold);
}
.chat-online-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Messages area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.chat-empty-conversation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 3rem 0;
}

/* Bubbles */
.chat-bubble {
    display: flex;
    gap: 0.5rem;
    max-width: 75%;
    align-items: flex-end;
}
.chat-bubble-mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.chat-bubble-theirs {
    align-self: flex-start;
}
.chat-bubble-avatar {
    flex-shrink: 0;
}
.chat-bubble-avatar img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}
.chat-bubble-content {
    padding: 0.5rem 0.8rem;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
}
.chat-bubble-mine .chat-bubble-content {
    background: var(--accent-gold);
    color: #000;
    border-bottom-right-radius: 4px;
}
.chat-bubble-theirs .chat-bubble-content {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}
.chat-bubble-time {
    font-size: 0.65rem;
    opacity: 0.6;
    margin-top: 0.15rem;
    text-align: right;
}
.chat-bubble-theirs .chat-bubble-time {
    text-align: left;
}

/* Input bar */
.chat-input-bar {
    padding: 0.8rem 1.5rem;
    border-top: 1px solid var(--bg-secondary);
    flex-shrink: 0;
}

/* Make conversation fill the app content height */
.app-content:has(.chat-conversation-wrap) {
    display: flex;
    flex-direction: column;
}
.app-content:has(.chat-conversation-wrap) .chat-conversation-wrap {
    flex: 1;
    min-height: 0;
}

/* Mobile adjustments */
@media (max-width: 991px) {
    .chat-conversation-wrap {
        width: 100%;
    }
}
@media (max-width: 767px) {
    .chat-bubble {
        max-width: 88%;
    }
    .chat-messages {
        padding: 1rem;
    }
    .chat-input-bar {
        padding: 0.8rem 1rem;
    }
}
