/* ==========================================================================
   WeCan LMS — theme built from the WeCan logo
   Teal-blue (mountains) · Green (fields) · Charcoal (wordmark)
   ========================================================================== */
:root {
    --wc-primary: #0b87b5;
    --wc-primary-600: #0a77a0;
    --wc-primary-700: #086585;
    --wc-primary-50: #e7f4f9;
    --wc-primary-100: #cfe9f3;
    --wc-green: #0f8a5f;
    --wc-green-600: #0c7651;
    --wc-green-50: #e6f4ee;
    --wc-dark: #2f3439;
    --wc-dark-2: #454c53;
    --wc-muted: #6b7680;
    --wc-bg: #f3f7f9;
    --wc-card: #ffffff;
    --wc-border: #e2e8ec;
    --wc-amber: #d98a14;
    --wc-red: #c8414b;
    --wc-gradient: linear-gradient(135deg, #0b87b5 0%, #0e8f8a 55%, #0f8a5f 100%);
    --wc-radius: 14px;
    --wc-shadow: 0 1px 2px rgba(16, 40, 56, .05), 0 4px 16px rgba(16, 40, 56, .06);
    --wc-shadow-lg: 0 10px 30px rgba(16, 40, 56, .12);
    --sidebar-w: 260px;

    /* Bootstrap overrides */
    --bs-primary: var(--wc-primary);
    --bs-primary-rgb: 11, 135, 181;
    --bs-success: var(--wc-green);
    --bs-success-rgb: 15, 138, 95;
    --bs-body-color: var(--wc-dark);
    --bs-body-bg: var(--wc-bg);
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-link-color: var(--wc-primary-600);
    --bs-link-color-rgb: 10, 119, 160;
    --bs-link-hover-color: var(--wc-primary-700);
    --bs-border-color: var(--wc-border);
    --bs-border-radius: 10px;
    --bs-focus-ring-color: rgba(11, 135, 181, .25);
}

body { background: var(--wc-bg); font-size: .935rem; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { color: var(--wc-dark); font-weight: 700; letter-spacing: -.01em; }
a { text-decoration: none; }
.text-muted { color: var(--wc-muted) !important; }
.fw-semibold { font-weight: 600 !important; }
.small-caps { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--wc-muted); }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: 10px; padding: .5rem 1rem; transition: all .15s ease; }
.btn-sm { padding: .3rem .7rem; border-radius: 8px; }
.btn-primary { --bs-btn-bg: var(--wc-primary); --bs-btn-border-color: var(--wc-primary); --bs-btn-hover-bg: var(--wc-primary-600); --bs-btn-hover-border-color: var(--wc-primary-600); --bs-btn-active-bg: var(--wc-primary-700); --bs-btn-active-border-color: var(--wc-primary-700); --bs-btn-disabled-bg: var(--wc-primary); --bs-btn-disabled-border-color: var(--wc-primary); }
.btn-success { --bs-btn-bg: var(--wc-green); --bs-btn-border-color: var(--wc-green); --bs-btn-hover-bg: var(--wc-green-600); --bs-btn-hover-border-color: var(--wc-green-600); --bs-btn-active-bg: var(--wc-green-600); }
.btn-outline-primary { --bs-btn-color: var(--wc-primary); --bs-btn-border-color: var(--wc-primary); --bs-btn-hover-bg: var(--wc-primary); --bs-btn-hover-border-color: var(--wc-primary); --bs-btn-active-bg: var(--wc-primary-700); }
.btn-soft { background: var(--wc-primary-50); color: var(--wc-primary-700); border: 0; }
.btn-soft:hover { background: var(--wc-primary-100); color: var(--wc-primary-700); }
.btn-join { background: var(--wc-gradient); color: #fff; border: 0; box-shadow: 0 4px 14px rgba(11, 135, 181, .35); }
.btn-join:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(11, 135, 181, .45); }
.btn:focus-visible, .form-control:focus, .form-select:focus { box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); border-color: var(--wc-primary); }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w); background: #fff; border-right: 1px solid var(--wc-border);
    position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 1030;
    transition: transform .25s ease;
}
.sidebar .brand { padding: 1.1rem 1.25rem .9rem; display: flex; align-items: center; gap: .6rem; border-bottom: 1px solid var(--wc-border); }
.sidebar .brand img { height: 42px; }
.sidebar .brand .tag { font-size: .68rem; font-weight: 700; color: #fff; background: var(--wc-gradient); padding: .15rem .45rem; border-radius: 6px; letter-spacing: .06em; }
.sidebar nav { padding: .75rem .75rem 1rem; overflow-y: auto; flex: 1; }
.sidebar .nav-section { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #9aa5ae; padding: 1rem .75rem .4rem; }
.sidebar .nav-link {
    display: flex; align-items: center; gap: .75rem; color: var(--wc-dark-2); font-weight: 500;
    padding: .58rem .8rem; border-radius: 10px; margin-bottom: 2px; position: relative;
}
.sidebar .nav-link i { font-size: 1.1rem; color: #8a96a0; width: 1.25rem; text-align: center; transition: color .15s; }
.sidebar .nav-link:hover { background: var(--wc-primary-50); color: var(--wc-primary-700); }
.sidebar .nav-link:hover i { color: var(--wc-primary); }
.sidebar .nav-link.active { background: var(--wc-primary-50); color: var(--wc-primary-700); font-weight: 600; }
.sidebar .nav-link.active i { color: var(--wc-primary); }
.sidebar .nav-link.active::before { content: ""; position: absolute; left: -.75rem; top: 20%; bottom: 20%; width: 4px; border-radius: 0 4px 4px 0; background: var(--wc-gradient); }
.sidebar .nav-link .badge { margin-left: auto; }
.sidebar .sidebar-foot { padding: .9rem 1.25rem; border-top: 1px solid var(--wc-border); font-size: .75rem; color: var(--wc-muted); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 1020; background: rgba(255, 255, 255, .9); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--wc-border); padding: .7rem 1.5rem; display: flex; align-items: center; gap: 1rem;
}
.topbar .page-title { font-size: 1.1rem; font-weight: 700; margin: 0; }
.topbar .crumbs { font-size: .78rem; color: var(--wc-muted); }
.content { padding: 1.5rem; flex: 1; }
.content-foot { padding: 1rem 1.5rem; color: var(--wc-muted); font-size: .78rem; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--wc-shadow-lg); }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(20, 30, 40, .4); z-index: 1025; }
    .main { margin-left: 0; }
    .content { padding: 1rem; }
    .topbar { padding: .6rem 1rem; }
}

/* ---------- Avatar ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; color: #fff; background: var(--wc-gradient); object-fit: cover; flex-shrink: 0; }
.avatar-sm { width: 28px; height: 28px; font-size: .68rem; }
.avatar-lg { width: 96px; height: 96px; font-size: 1.8rem; }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--wc-border); border-radius: var(--wc-radius); box-shadow: var(--wc-shadow); background: var(--wc-card); }
.card-header { background: transparent; border-bottom: 1px solid var(--wc-border); padding: .95rem 1.2rem; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-header .card-title { margin: 0; font-size: .98rem; display: flex; align-items: center; gap: .5rem; }
.card-header .card-title i { color: var(--wc-primary); }
.card-body { padding: 1.2rem; }
.card-hover { transition: transform .15s ease, box-shadow .15s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--wc-shadow-lg); }

.stat-card { padding: 1.1rem 1.2rem; display: flex; flex-direction: row; align-items: center; gap: 1rem; }
.card.stat-card { height: 100%; }
.stat-card.p-0 { flex-shrink: 0; }

/* Report catalogue cards */
.report-card { display: flex; flex-direction: column; height: 100%; padding: 1.25rem; color: var(--wc-dark); }
.report-card .report-head { display: flex; align-items: center; gap: .85rem; margin-bottom: .75rem; }
.report-card .report-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.report-card .report-title { font-weight: 700; font-size: 1rem; line-height: 1.3; margin: 0; }
.report-card .report-desc { color: var(--wc-muted); font-size: .85rem; margin-bottom: 1rem; flex-grow: 1; }
.report-card .report-link { font-size: .82rem; font-weight: 600; color: var(--wc-primary-600); display: inline-flex; align-items: center; gap: .35rem; }
.report-card:hover .report-link i { transform: translateX(3px); }
.report-card .report-link i { transition: transform .15s ease; }
.stat-card .icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-card .value { font-size: 1.6rem; font-weight: 800; line-height: 1.1; color: var(--wc-dark); }
.stat-card .label { font-size: .8rem; color: var(--wc-muted); font-weight: 500; }
.tone-primary { background: var(--wc-primary-50); color: var(--wc-primary); }
.tone-green { background: var(--wc-green-50); color: var(--wc-green); }
.tone-amber { background: #fdf3e2; color: var(--wc-amber); }
.tone-red { background: #fbeaec; color: var(--wc-red); }
.tone-dark { background: #eceff1; color: var(--wc-dark-2); }
.tone-purple { background: #f0ebf7; color: #7b5ea7; }

.hero {
    background: var(--wc-gradient); color: #fff; border-radius: var(--wc-radius); padding: 1.5rem 1.75rem;
    position: relative; overflow: hidden; box-shadow: var(--wc-shadow-lg);
}
.hero h2, .hero h1 { color: #fff; }
.hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 260px; height: 160px; border-radius: 50%; border: 22px solid rgba(255, 255, 255, .12); transform: rotate(-12deg); }
.hero::before { content: ""; position: absolute; right: 90px; top: -70px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.hero .btn-light { color: var(--wc-primary-700); }

/* ---------- Status pills (icon + text; never colour alone) ---------- */
.pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .74rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px; white-space: nowrap; line-height: 1.2; }
.pill i { font-size: .8rem; }
.pill-primary { background: var(--wc-primary-50); color: var(--wc-primary-700); }
.pill-green { background: var(--wc-green-50); color: var(--wc-green-600); }
.pill-amber { background: #fdf3e2; color: #a5650a; }
.pill-red { background: #fbeaec; color: #a5323b; }
.pill-gray { background: #eef1f3; color: #56616a; }
.pill-purple { background: #f0ebf7; color: #634a8c; }
.pill-live { background: #fbeaec; color: #a5323b; }
.pill-live i { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; margin: 0; }
.table > :not(caption) > * > * { padding: .75rem 1rem; border-bottom-color: var(--wc-border); vertical-align: middle; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--wc-muted); font-weight: 700; background: #f8fafb; white-space: nowrap; border-bottom: 1px solid var(--wc-border); }
.table thead th a { color: inherit; display: inline-flex; align-items: center; gap: .25rem; }
.table thead th a:hover { color: var(--wc-primary); }
.table-hover > tbody > tr:hover > * { background: #f7fbfd; }
.table-card { overflow: hidden; }
.table-responsive { border-radius: 0 0 var(--wc-radius) var(--wc-radius); }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .85rem; color: var(--wc-dark-2); margin-bottom: .35rem; }
.form-control, .form-select { border-radius: 10px; border-color: #d6dee3; padding: .55rem .8rem; }
.form-control-sm, .form-select-sm { padding: .3rem .6rem; border-radius: 8px; }
.form-text { color: var(--wc-muted); }
.form-check-input:checked { background-color: var(--wc-primary); border-color: var(--wc-primary); }
.form-switch .form-check-input { width: 2.4em; height: 1.25em; }
.required::after { content: " *"; color: var(--wc-red); }
.filter-bar { background: #fff; border: 1px solid var(--wc-border); border-radius: var(--wc-radius); padding: .9rem 1rem; box-shadow: var(--wc-shadow); }

/* ---------- Nav tabs ---------- */
.nav-tabs-wc { border-bottom: 1px solid var(--wc-border); gap: .25rem; }
.nav-tabs-wc .nav-link { border: 0; color: var(--wc-muted); font-weight: 600; padding: .65rem 1rem; border-bottom: 3px solid transparent; border-radius: 0; }
.nav-tabs-wc .nav-link:hover { color: var(--wc-primary); }
.nav-tabs-wc .nav-link.active { color: var(--wc-primary-700); border-bottom-color: var(--wc-primary); background: transparent; }

/* ---------- Session tiles ---------- */
.session-item { display: flex; gap: 1rem; align-items: center; padding: .85rem 1.2rem; border-bottom: 1px solid var(--wc-border); }
.session-item:last-child { border-bottom: 0; }
.date-chip { width: 54px; flex-shrink: 0; text-align: center; border-radius: 12px; background: var(--wc-primary-50); color: var(--wc-primary-700); padding: .35rem 0; line-height: 1.1; }
.date-chip .d { font-size: 1.25rem; font-weight: 800; }
.date-chip .m { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.date-chip.live { background: var(--wc-gradient); color: #fff; }
.countdown { font-variant-numeric: tabular-nums; font-size: .78rem; color: var(--wc-green-600); font-weight: 600; }

/* ---------- Course cards ---------- */
.course-card .cover { height: 92px; background: var(--wc-gradient); border-radius: var(--wc-radius) var(--wc-radius) 0 0; position: relative; overflow: hidden; padding: 1rem 1.2rem; color: #fff; }
.course-card .cover::after { content: ""; position: absolute; right: -30px; bottom: -50px; width: 160px; height: 110px; border-radius: 50%; border: 16px solid rgba(255, 255, 255, .15); }
.course-card .cover .code { font-weight: 800; letter-spacing: .05em; font-size: .8rem; background: rgba(255, 255, 255, .2); padding: .15rem .5rem; border-radius: 6px; }
.course-card .cover.alt-1 { background: linear-gradient(135deg, #0f8a5f, #3aa76d); }
.course-card .cover.alt-2 { background: linear-gradient(135deg, #2f3439, #0b87b5); }
.course-card .cover.alt-3 { background: linear-gradient(135deg, #086585, #0b87b5); }

/* ---------- Forum ---------- */
.thread { border: 1px solid var(--wc-border); border-radius: 12px; margin-bottom: 1rem; background: #fff; }
.thread-head { padding: 1rem 1.1rem; display: flex; gap: .8rem; }
.thread-body { white-space: pre-line; word-wrap: break-word; }
.replies { border-top: 1px solid var(--wc-border); background: #f9fbfc; padding: .8rem 1.1rem; border-radius: 0 0 12px 12px; }
.reply { display: flex; gap: .7rem; padding: .6rem 0; }
.reply + .reply { border-top: 1px dashed var(--wc-border); }
.post-hidden { opacity: .65; font-style: italic; }

/* ---------- Attendance register ---------- */
.att-options .btn-check + .btn { border: 1px solid var(--wc-border); background: #fff; color: var(--wc-dark-2); font-weight: 600; font-size: .78rem; padding: .3rem .55rem; }
.att-options .btn-check:checked + .btn.att-present { background: var(--wc-green); border-color: var(--wc-green); color: #fff; }
.att-options .btn-check:checked + .btn.att-late { background: var(--wc-amber); border-color: var(--wc-amber); color: #fff; }
.att-options .btn-check:checked + .btn.att-absent { background: var(--wc-red); border-color: var(--wc-red); color: #fff; }
.att-options .btn-check:checked + .btn.att-excused { background: #7b5ea7; border-color: #7b5ea7; color: #fff; }
.att-row.changed { background: #fffbea; }

/* ---------- Upload dropzone ---------- */
.dropzone { border: 2px dashed #c4d3db; border-radius: 12px; padding: 1.5rem; text-align: center; color: var(--wc-muted); cursor: pointer; transition: all .15s; background: #fafcfd; }
.dropzone:hover, .dropzone.drag { border-color: var(--wc-primary); background: var(--wc-primary-50); color: var(--wc-primary-700); }
.dropzone i { font-size: 2rem; color: var(--wc-primary); }

/* ---------- Auth page ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-brand { background: var(--wc-gradient); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-brand::before { content: ""; position: absolute; width: 520px; height: 300px; border-radius: 50%; border: 40px solid rgba(255, 255, 255, .1); right: -160px; bottom: -120px; transform: rotate(-14deg); }
.auth-brand::after { content: ""; position: absolute; width: 380px; height: 220px; border-radius: 50%; border: 28px solid rgba(255, 255, 255, .08); right: -60px; bottom: -40px; transform: rotate(-14deg); }
.auth-brand h1 { color: #fff; font-size: 2.3rem; font-weight: 800; line-height: 1.15; }
.auth-brand .logo-box { background: #fff; border-radius: 16px; padding: .7rem 1rem; display: inline-block; box-shadow: var(--wc-shadow-lg); }
.auth-brand .feature { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1rem; position: relative; z-index: 1; }
.auth-brand .feature i { font-size: 1.2rem; background: rgba(255, 255, 255, .18); width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem; background: #fff; }
.auth-form .inner { width: 100%; max-width: 400px; }
@media (max-width: 991.98px) { .auth-wrap { grid-template-columns: 1fr; } .auth-brand { display: none; } }

/* ---------- Misc ---------- */
.empty-state { text-align: center; padding: 2.2rem 1rem; color: var(--wc-muted); }
.empty-state i { font-size: 2.4rem; color: #b8c6cf; display: block; margin-bottom: .5rem; }
.list-tight .list-group-item { padding: .75rem 1.2rem; border-color: var(--wc-border); }
.kv dt { font-size: .75rem; color: var(--wc-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kv dd { font-weight: 500; margin-bottom: .9rem; }
.progress { height: 8px; border-radius: 99px; background: #e8eef1; }
.progress-bar { background: var(--wc-gradient); }
.toast-container { z-index: 1090; }
.toast { border: 0; border-radius: 12px; box-shadow: var(--wc-shadow-lg); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding-left: 1.4rem; padding-bottom: .9rem; font-size: .85rem; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--wc-primary); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 16px; bottom: 0; width: 2px; background: var(--wc-border); }
.timeline li:last-child::after { display: none; }
.dropdown-menu { border: 1px solid var(--wc-border); border-radius: 12px; box-shadow: var(--wc-shadow-lg); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .45rem .75rem; }
.dropdown-item:active { background: var(--wc-primary); }
.pagination { --bs-pagination-active-bg: var(--wc-primary); --bs-pagination-active-border-color: var(--wc-primary); --bs-pagination-color: var(--wc-primary-600); margin: 0; }
.fc { --fc-border-color: var(--wc-border); --fc-today-bg-color: var(--wc-primary-50); --fc-button-bg-color: var(--wc-primary); --fc-button-border-color: var(--wc-primary); --fc-button-hover-bg-color: var(--wc-primary-600); --fc-button-active-bg-color: var(--wc-primary-700); font-size: .85rem; }
.fc .fc-toolbar-title { font-size: 1.15rem; font-weight: 700; }
.fc-cancelled { text-decoration: line-through; opacity: .7; }
.fc-event { cursor: pointer; border-radius: 6px; padding: 1px 3px; }
.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 2000; }
.skip-link:focus { left: 1rem; top: 1rem; }
.select-multi { min-height: 180px; }
.chip-list .chip { display: inline-flex; align-items: center; gap: .4rem; background: var(--wc-primary-50); color: var(--wc-primary-700); border-radius: 999px; padding: .2rem .35rem .2rem .7rem; font-size: .8rem; font-weight: 600; margin: 0 .3rem .35rem 0; }
.search-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--wc-border); border-radius: 10px; }
.search-list label { display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; border-bottom: 1px solid var(--wc-border); cursor: pointer; margin: 0; }
.search-list label:hover { background: var(--wc-primary-50); }
.search-list label:last-child { border-bottom: 0; }
video { width: 100%; border-radius: 12px; background: #000; }
