:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --primary: #2563eb;
    --primary-soft: #dbeafe;
    --text: #132238;
    --muted: #667085;
    --border: #e7edf5;
    --sidebar-bg: #243649;
    --sidebar-bg-2: #2e4358;
    --sidebar-text: #ebf2f8;
    --sidebar-muted: #a9b9c9;
    --topbar-h: 64px;
    --sidebar-w: 252px;
    --radius-lg: 20px;
    --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.08);
}

html { font-size: 15px; }
body {
    font-family: 'Noto Sans Thai', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(1100px 560px at 6% -12%, rgba(37, 99, 235, 0.12), transparent 60%),
        radial-gradient(900px 480px at 106% 4%, rgba(16, 185, 129, 0.10), transparent 55%),
        radial-gradient(820px 560px at 46% 120%, rgba(99, 102, 241, 0.09), transparent 60%),
        linear-gradient(180deg, #f7f9fc 0%, #eef4fb 100%);
    color: var(--text);
    font-size: 0.98rem;
    line-height: 1.68;
    font-weight: 400;
}
body.app-with-sidebar { min-height: 100vh; }
.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

h1, .h1 { font-size: clamp(1.65rem, 2.25vw, 2.05rem); font-weight: 700; letter-spacing: 0; line-height: 1.28; }
h2, .h2 { font-size: clamp(1.28rem, 1.8vw, 1.55rem); font-weight: 700; letter-spacing: 0; line-height: 1.35; }
h3, .h3 { font-size: clamp(1.12rem, 1.5vw, 1.28rem); font-weight: 700; line-height: 1.4; }
h4, .h4, h5, .h5 { font-weight: 700; line-height: 1.45; }
p, .text-secondary, .small { line-height: 1.7; }

a { text-decoration: none; }

.app-topbar {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--topbar-h);
    z-index: 1040;
    background: rgba(255,255,255,0.94);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(231,237,245,0.95);
}
.app-topbar-inner {
    height: 100%;
    display: flex;
    align-items: center;
}
.app-brand {
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
}
.sidebar-toggle-btn {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: #edf2f7;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 0 10px;
}
.sidebar-toggle-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: #334155;
    border-radius: 999px;
}
.topbar-user-name { font-weight: 700; line-height: 1.25; font-size: .94rem; }
.topbar-user-role { color: var(--muted); font-size: .82rem; }
.topbar-logout { min-width: 94px; }

.app-sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    color: var(--sidebar-text);
    z-index: 1035;
    box-shadow: 14px 0 40px rgba(15, 23, 42, 0.10);
    transition: transform .25s ease;
}
.sidebar-scroll {
    height: 100%;
    overflow-y: auto;
    padding: 1rem .9rem .9rem;
}
.sidebar-logo-wrap {
    padding: .55rem .55rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: .9rem;
}
.sidebar-logo {
    display: block;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.15;
}
.sidebar-caption {
    margin-top: .35rem;
    font-size: .78rem;
    color: var(--sidebar-muted);
    letter-spacing: .08em;
    text-transform: uppercase;
}
.sidebar-group-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--sidebar-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .8rem .7rem .55rem;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.sidebar-group-toggle:hover { color: #fff; }
.sidebar-caret { transition: transform .2s ease; font-size: .95rem; }
.sidebar-group-toggle.collapsed .sidebar-caret { transform: rotate(-90deg); }
.sidebar-submenu { padding: 0 .3rem .3rem; }
.sidebar-link {
    display: block;
    color: var(--sidebar-text);
    padding: .72rem .9rem;
    border-radius: 14px;
    margin-bottom: .22rem;
    font-size: .98rem;
    font-weight: 600;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}
.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    transform: translateX(2px);
}
.sidebar-link.active {
    background: rgba(37, 99, 235, 0.22);
    color: #fff;
    box-shadow: inset 3px 0 0 #22c55e;
}
.sidebar-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-footer-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: .9rem .95rem;
}
.sidebar-footer-title { color: var(--sidebar-muted); font-size: .76rem; margin-bottom: .3rem; }
.sidebar-footer-name { font-weight: 700; font-size: .98rem; }
.sidebar-footer-role { color: var(--sidebar-muted); font-size: .84rem; }

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 1030;
}
.app-main {
    margin-left: var(--sidebar-w);
    padding-top: var(--topbar-h);
    transition: margin-left .25s ease;
    position: relative;
    z-index: 1;
}
.app-content {
    min-height: calc(100vh - var(--topbar-h));
    max-width: 1440px;
    margin: 0 auto;
}
body.sidebar-hidden .app-sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
body.sidebar-hidden .app-main { margin-left: 0; }
body.sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; pointer-events: auto; }

.card,
.card-soft,
.content-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}
.session-detail-page ~ .session-detail-page {
    display: none !important;
}
.card-soft, .content-card { overflow: hidden; }
.card-soft .card-body,
.card .card-body,
.content-card-body { padding: 1.1rem 1.2rem; }
.content-card .session-thumb {
    width: 100%;
    height: 150px;
    max-height: 150px;
    background: #eef3f8;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    flex: 0 0 150px;
}
.content-card .session-thumb img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 150px;
    max-height: 150px;
    object-fit: contain;
    object-position: center;
    background: #fff;
}
.content-card .session-thumb-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-weight: 800;
    text-transform: uppercase;
    background: #eef3f8;
}
.session-detail-hero {
    width: 100%;
    height: 260px;
    background: #f4f7fb;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.session-detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #fff;
}
.session-detail-hero-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-weight: 800;
    text-transform: uppercase;
}
.alert-soft,
.alert { border-radius: 16px; }

.btn {
    border-radius: 12px;
    font-weight: 600;
    padding: .58rem 1rem;
}
.btn-sm { border-radius: 10px; padding: .42rem .78rem; font-size: .84rem; }
.form-control,
.form-select {
    border-radius: 12px;
    min-height: 42px;
    border-color: #dbe3ee;
}
.datetime-24h-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px auto 76px;
    align-items: center;
    gap: .45rem;
}
.datetime-24h-picker .form-control,
.datetime-24h-picker .form-select {
    min-height: 42px;
}
.table td, .table th { vertical-align: middle; }
.badge { border-radius: 999px; font-weight: 600; padding: .42rem .66rem; font-size: .76rem; }
.badge-soft-success { background: #dcfce7; color: #166534; }
.badge-soft-warning { background: #fef3c7; color: #92400e; }
.badge-soft-info { background: #dbeafe; color: #1d4ed8; }
.badge-soft-danger { background: #fee2e2; color: #b91c1c; }
.badge-soft-secondary { background: #eef2f7; color: #475569; }
.badge-soft-dark { background: #e2e8f0; color: #1e293b; }

.enrollment-review-table th:last-child,
.enrollment-review-table td:last-child {
    width: 180px;
}
.enrollment-actions {
    min-width: 180px;
}
.enrollment-action-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .45rem;
}
.enrollment-editor {
    position: relative;
}
.enrollment-editor summary {
    list-style: none;
    cursor: pointer;
}
.enrollment-editor summary::-webkit-details-marker {
    display: none;
}
.enrollment-editor[open] {
    min-width: 340px;
}
.enrollment-review-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
    align-items: end;
    margin-top: .6rem;
    padding: .65rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}
.enrollment-field {
    display: grid;
    gap: .25rem;
    text-align: left;
    margin: 0;
}
.enrollment-field span {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 700;
}
.enrollment-field .form-control,
.enrollment-field .form-select {
    width: 100%;
    min-height: 34px;
    border-radius: 8px;
    font-size: .82rem;
}
.enrollment-field-wide {
    grid-column: span 2;
}
.enrollment-action-row {
    display: flex;
    justify-content: flex-end;
}
.enrollment-certificate-form {
    display: flex;
    justify-content: flex-end;
    margin-top: .5rem;
}
.enrollment-add-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(130px, 180px) minmax(130px, 180px) auto;
    gap: .65rem;
    align-items: end;
}
.enrollment-user-select {
    min-height: 112px;
    font-size: .86rem;
}
.enrollment-add-form .form-label {
    margin-bottom: .25rem;
    font-size: .82rem;
}
.enrollment-add-form .form-control,
.enrollment-add-form .form-select {
    min-height: 36px;
    border-radius: 8px;
    font-size: .88rem;
}
.enrollment-add-user {
    grid-column: 1 / 4;
}
.enrollment-add-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .55rem;
    min-width: 150px;
}
.enrollment-add-actions .btn {
    width: auto;
    white-space: nowrap;
}
.enrollment-add-actions .form-check-label,
.enrollment-add-form .form-text {
    font-size: .78rem;
}

.approval-actions-group {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.approval-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
    align-items: center;
}
.approval-select { width: 140px; }
.approval-input { width: 180px; }

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem 1.25rem;
    border: 1px solid rgba(37,99,235,.10);
    border-radius: 22px;
    background: linear-gradient(135deg, #ffffff 0%, #eef4ff 100%);
    box-shadow: 0 14px 32px rgba(15,23,42,.05);
}
.page-kicker {
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #2563eb;
    margin-bottom: .35rem;
}
.page-title { margin: 0; }
.page-subtitle { color: var(--muted); max-width: 760px; font-size: .96rem; }
.section-title { font-size: 1.02rem; font-weight: 800; color: var(--text); }

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.summary-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    padding: .95rem 1.05rem;
}
.summary-label { color: var(--muted); font-size: .84rem; margin-bottom: .25rem; }
.summary-value { font-size: 1.45rem; font-weight: 800; line-height: 1.1; }

.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    padding: .95rem 1.05rem;
}
.stat-label { color: var(--muted); font-size: .82rem; font-weight: 700; margin-bottom: .3rem; }
.stat-value { font-size: 1.55rem; font-weight: 800; line-height: 1.15; color: var(--text); }

.content-card-head,
.content-card-foot {
    padding: 1rem 1.15rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
}
.content-card-head { border-bottom: 1px solid var(--border); }
.content-card-foot {
    border-top: 1px solid var(--border);
    background: #fafcff;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start;
}
.session-toggle-form {
    display: inline-flex;
    align-items: center;
}
.admin-switch {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 31px;
    cursor: pointer;
    user-select: none;
}
.admin-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.admin-switch-track {
    position: relative;
    width: 46px;
    height: 26px;
    flex: 0 0 46px;
    border-radius: 999px;
    background: #cbd5e1;
    border: 1px solid #b6c2d2;
    transition: background .18s ease, border-color .18s ease;
}
.admin-switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .24);
    transition: transform .18s ease;
}
.admin-switch input:checked + .admin-switch-track {
    background: #16a34a;
    border-color: #15803d;
}
.admin-switch input:checked + .admin-switch-track::after {
    transform: translateX(20px);
}
.admin-switch input:focus-visible + .admin-switch-track {
    outline: 3px solid rgba(37, 99, 235, .22);
    outline-offset: 2px;
}
.admin-switch-text {
    font-size: .82rem;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
}
.admin-switch.is-on .admin-switch-text {
    color: #15803d;
}
.content-kicker {
    color: var(--muted);
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: .2rem;
}
.content-title {
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.42;
    margin: 0 0 .2rem;
}
.content-subtitle { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.session-compact-meta {
    display: none;
    gap: .35rem;
    flex-wrap: wrap;
    margin-top: .45rem;
}
.session-compact-meta span {
    display: inline-flex;
    align-items: center;
    padding: .22rem .5rem;
    border-radius: 999px;
    background: #f8fbff;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: .74rem;
    font-weight: 500;
}

.info-grid { display: grid; gap: .72rem; }
.info-row {
    display: flex;
    justify-content: space-between;
    gap: .85rem;
    align-items: flex-start;
}
.info-label { color: var(--muted); font-size: .9rem; min-width: 88px; font-weight: 400; }
.info-value { color: var(--text); font-size: .92rem; font-weight: 500; text-align: right; line-height: 1.6; }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem;
}
.detail-card {
    padding: 1rem 1.05rem;
    border-radius: 12px;
    background: #f8fbff;
    border: 1px solid var(--border);
}
.detail-card-wide { grid-column: span 2; }
.detail-label { font-size: .82rem; color: var(--muted); margin-bottom: .35rem; font-weight: 500; }
.detail-value { font-size: .94rem; font-weight: 500; color: var(--text); line-height: 1.7; word-break: break-word; }
.session-detail-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 1rem;
}
.session-detail-grid {
    gap: 1rem;
}
.session-notes {
    font-weight: 400;
    color: #344054;
}
.session-date-range {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem;
}
.session-date-range span:nth-child(2) {
    color: var(--muted);
    font-size: .88rem;
    font-weight: 400;
}
.qr-preview-block {
    flex: 0 0 auto;
}
.session-qr-image {
    width: 180px;
    max-width: 100%;
    height: auto;
    padding: .6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}
.session-link-box {
    padding: .8rem .9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafcff;
    word-break: break-all;
}
.session-material-link-list {
    display: grid;
    gap: .35rem;
}
.session-material-link-list a {
    word-break: break-word;
}
.session-daily-checkins {
    display: grid;
    gap: .6rem;
}
.session-daily-checkin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding: .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}
.session-daily-checkin-row form {
    flex: 0 0 auto;
}
.session-form-page-head {
    align-items: center;
}
.session-form-shell {
    display: block;
}
.session-form-layout {
    display: block;
}
.session-form-main {
    display: grid;
    gap: 1rem;
}
.session-form-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}
.session-form-section {
    padding: 1.15rem 1.2rem;
}
.session-form-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: .9rem;
    border-bottom: 1px solid #edf2f7;
}
.session-form-section-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.4;
}
.session-form-section-copy {
    max-width: 420px;
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.6;
}
.session-form-toggle-grid {
    display: grid;
    gap: .75rem;
}
.session-form-toggle {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: .8rem;
    align-items: start;
    padding: .85rem .95rem;
    border: 1px solid #dbe6f3;
    border-radius: 14px;
    background: #f8fbff;
}
.session-form-toggle .form-check-input {
    margin-top: .2rem;
}
.session-form-toggle strong,
.session-form-actions-copy strong {
    display: block;
    font-size: .95rem;
    line-height: 1.45;
}
.session-form-toggle small,
.session-form-actions-copy small {
    display: block;
    color: var(--muted);
    line-height: 1.55;
}
.session-form-field-card {
    height: 100%;
    padding: .95rem;
    border: 1px solid #e5edf6;
    border-radius: 14px;
    background: #fbfdff;
}
.session-form-audience-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin-bottom: .55rem;
}
.session-form-audience-title {
    margin: 0;
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
}
.session-form-audience-actions {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}
.audience-action-btn {
    border: 1px solid #d6e0ec;
    background: #fff;
    color: #475569;
    border-radius: 999px;
    padding: .18rem .55rem;
    font-size: .72rem;
    line-height: 1.4;
    font-weight: 600;
}
.audience-action-btn:hover {
    background: #f8fbff;
    color: #1d4ed8;
    border-color: #bfd5ff;
}
.audience-multi-select {
    min-height: 220px;
    font-size: .9rem;
}
.audience-multi-select optgroup {
    font-style: normal;
    font-weight: 800;
    font-size: .78rem;
    letter-spacing: .02em;
    color: #1d4ed8;
    background: #eef4ff;
    padding: .4rem .5rem .3rem;
}
.audience-multi-select option {
    font-weight: 400;
    color: #1f2937;
    padding: .32rem .6rem;
}
.audience-division-filter {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-bottom: .5rem;
}
.audience-division-chip {
    border: 1px solid #dbe7f6;
    background: #f8fbff;
    color: #475569;
    border-radius: 999px;
    padding: .3rem .7rem;
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.4;
}
.audience-division-chip:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
    background: #eef6ff;
}
.audience-division-chip.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.audience-department-row.is-filtered-out {
    display: none;
}
#audienceUserSelect {
    overflow-x: auto;
    white-space: nowrap;
}
#audienceUserSelect option {
    min-width: max-content;
}
.session-repeat-list {
    display: grid;
    gap: .55rem;
}
.session-repeat-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: .5rem;
    align-items: center;
}
.session-repeat-add,
.session-repeat-remove {
    width: 36px;
    min-width: 36px;
    padding-right: 0;
    padding-left: 0;
    font-weight: 800;
    line-height: 1.2;
}
.session-repeat-remove {
    width: 42px;
    min-width: 42px;
}
.session-current-materials {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.session-current-materials a {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: .32rem .55rem;
    border: 1px solid #dbe6f3;
    border-radius: 8px;
    background: #f8fbff;
    font-size: .82rem;
    line-height: 1.35;
    text-decoration: none;
    word-break: break-word;
}
.session-form-actions {
    position: sticky;
    bottom: 1rem;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.calendar-month-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
}
.training-calendar {
    overflow: hidden;
}
.calendar-week-head,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}
.calendar-week-head {
    background: #f8fbff;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
    text-align: center;
}
.calendar-week-head div {
    padding: .75rem .4rem;
}
.calendar-day {
    min-height: 130px;
    padding: .65rem;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.calendar-day:nth-child(7n) {
    border-right: 0;
}
.calendar-day:hover,
.calendar-day.is-selected {
    background: #eef4ff;
    box-shadow: inset 0 0 0 2px #2563eb;
}
.calendar-day.is-muted {
    background: #fafcff;
    color: #94a3b8;
}
.calendar-day.is-today .calendar-day-number {
    background: #132238;
    color: #fff;
}
.calendar-day-number {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .86rem;
    font-weight: 800;
}
.calendar-day-events {
    display: grid;
    gap: .3rem;
    min-width: 0;
}
.calendar-event-dot,
.calendar-more {
    display: block;
    padding: .25rem .45rem;
    border-radius: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .72rem;
    font-weight: 700;
}
.calendar-more {
    color: #475569;
    background: #eef2f7;
}
.calendar-detail-list {
    display: grid;
    gap: .85rem;
}
.calendar-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}
.calendar-detail-meta {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: .88rem;
}
.calendar-detail-actions {
    flex: 0 0 160px;
    display: grid;
    gap: .5rem;
}
.state-box {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fafcff;
    padding: 1rem;
}
.chip,
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: .38rem .72rem;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 600;
}
.chip-neutral { background: #f8fafc; color: #334155; border: 1px solid #e2e8f0; }
.chip-open { background: #dcfce7; color: #166534; }
.chip-warn { background: #fef3c7; color: #92400e; }
.chip-success { background: #d1fae5; color: #065f46; }
.status-draft { background: #eef2f7; color: #475569; }
.status-open { background: #dcfce7; color: #166534; }
.status-closed { background: #fef3c7; color: #92400e; }
.status-completed { background: #dbeafe; color: #1d4ed8; }
.status-canceled { background: #fee2e2; color: #b91c1c; }

.stat-number { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }

body:not(.app-with-sidebar) {
    min-height: 100vh;
    background-color: #2148c7;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1.6px),
        radial-gradient(1200px 700px at 8% -12%, rgba(255, 255, 255, 0.22), transparent 55%),
        radial-gradient(900px 620px at 104% 0%, rgba(16, 185, 129, 0.38), transparent 55%),
        radial-gradient(1000px 720px at 50% 122%, rgba(67, 56, 202, 0.55), transparent 60%),
        linear-gradient(135deg, #1d4ed8 0%, #2563eb 45%, #312e81 100%);
    background-size: 22px 22px, auto, auto, auto, auto;
    background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat;
    background-attachment: fixed;
}
.login-page-wrap {
    min-height: calc(100vh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0;
}
.login-shell {
    width: 100%;
    max-width: 980px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    border-radius: 28px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 40px 90px rgba(9, 16, 45, .38);
}
.login-panel-left {
    background: linear-gradient(160deg, #eef2ff 0%, #e6ebff 55%, #eef2ff 100%);
    padding: 2.6rem 2.4rem;
    display: flex;
    flex-direction: column;
}
.login-panel-right {
    padding: 2.6rem 2.4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
}
.login-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: 2rem;
}
.login-brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-weight: 800;
    font-size: .76rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.login-brand-name {
    font-weight: 800;
    color: var(--text);
    font-size: 1rem;
}
.login-welcome-title {
    font-size: 1.9rem;
    font-weight: 800;
    color: #14204a;
    margin-bottom: .6rem;
}
.login-welcome-text {
    color: #51608a;
    font-size: .96rem;
    line-height: 1.7;
    max-width: 320px;
    margin-bottom: 1.25rem;
}
.login-illustration {
    margin-top: auto;
}
.login-illustration-svg {
    width: 100%;
    max-width: 340px;
    height: auto;
    display: block;
}
.login-form-head {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    margin-bottom: 1.6rem;
}
.login-shield-badge {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 14px;
    background: #eef2ff;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.login-remember {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .88rem;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0;
}
.login-inline-link {
    font-size: .86rem;
    font-weight: 700;
    color: #2563eb;
}
.login-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #94a3b8;
    font-size: .82rem;
    margin: 1.4rem 0;
}
.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5eaf3;
}
.login-help-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    border: 1px solid #e5eaf3;
    border-radius: 16px;
    padding: .85rem 1rem;
    color: inherit;
    transition: border-color .15s ease, background .15s ease;
}
.login-help-row:hover {
    border-color: #bfd5ff;
    background: #f8fbff;
}
.login-help-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    background: #eef2ff;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.login-help-chevron {
    margin-left: auto;
    color: #94a3b8;
    font-size: 1.3rem;
    line-height: 1;
}
@media (max-width: 991.98px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-panel-left { display: none; }
}
@media (max-width: 575.98px) {
    .login-panel-right { padding: 2rem 1.4rem; }
}
.auth-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}
.auth-brand-mark {
    width: 64px;
    height: 64px;
    margin: 0 auto .85rem;
    border-radius: 18px;
    background: #fff;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: .02em;
    box-shadow: 0 20px 44px rgba(10, 20, 50, .38), 0 0 0 6px rgba(255, 255, 255, .16);
}
.auth-brand-name {
    font-weight: 800;
    color: #fff;
    font-size: 1.08rem;
    text-shadow: 0 2px 12px rgba(10, 20, 50, .3);
}
.auth-brand-tagline {
    color: rgba(255, 255, 255, .82);
    font-size: .86rem;
    margin-top: .25rem;
}
.auth-card {
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 26px;
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 0 40px 90px rgba(9, 16, 45, .38);
}
.auth-card .btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: 0;
    box-shadow: 0 16px 32px rgba(37, 99, 235, .35);
    transition: transform .15s ease, box-shadow .15s ease;
}
.auth-card .btn-primary:hover,
.auth-card .btn-primary:focus {
    transform: translateY(-1px);
    box-shadow: 0 20px 38px rgba(37, 99, 235, .42);
}
.input-icon-wrap {
    position: relative;
}
.input-icon-wrap .input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #94a3b8;
    display: inline-flex;
    pointer-events: none;
}
.input-icon-wrap .form-control {
    padding-left: 42px;
}
.password-toggle-wrap {
    position: relative;
}
.password-toggle-input {
    padding-right: 84px;
}
.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #4f5d75;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 6px 10px;
    line-height: 1;
}
.password-toggle-btn:hover,
.password-toggle-btn:focus {
    color: #1f6feb;
}
.certificate-paper { max-width: 980px; }

.quiz-option {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .8rem .95rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafcff;
    margin-bottom: .55rem !important;
    min-height: 3rem;
    transition: border-color .15s ease, background .15s ease;
}
.quiz-option:last-child { margin-bottom: 0 !important; }
.quiz-option:hover,
.quiz-option:focus-within {
    border-color: #bfd5ff;
    background: #f5f9ff;
}
.quiz-option .form-check-input {
    float: none;
    margin: .2rem 0 0;
    flex: 0 0 auto;
    width: 1.15em;
    height: 1.15em;
}
.quiz-option .form-check-label {
    margin: 0;
    padding: 0;
    flex: 1 1 auto;
    cursor: pointer;
    line-height: 1.5;
}

@media (max-width: 1199.98px) {
    .page-head { padding: 1rem 1.05rem; }
}
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(calc(-1 * var(--sidebar-w)));
    }
    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }
    .app-main { margin-left: 0; }
    .summary-grid,
    .detail-grid { grid-template-columns: 1fr; }
    .detail-card-wide { grid-column: span 1; }
}
@media (max-width: 767.98px) {
    html { font-size: 14px; }
    .page-head,
    .content-card-head,
    .content-card-foot,
    .info-row {
        flex-direction: column;
        align-items: stretch;
    }
    .info-value { text-align: left; }
    .app-brand-subtitle,
    .sidebar-brand-subtitle {
        display: none;
    }
    .app-brand-title {
        font-size: .95rem;
    }
    .enrollment-review-table th:last-child,
    .enrollment-review-table td:last-child {
        width: auto;
    }
    .enrollment-actions {
        min-width: 180px;
    }
    .enrollment-editor[open] {
        min-width: 280px;
    }
    .enrollment-review-form {
        grid-template-columns: 1fr;
    }
    .enrollment-field-wide {
        grid-column: span 1;
    }
    .enrollment-add-form {
        grid-template-columns: 1fr;
    }
    .enrollment-add-user {
        grid-column: auto;
    }
    .enrollment-add-actions {
        min-width: 0;
    }
    .content-card .session-thumb {
        height: 120px;
        max-height: 120px;
        flex-basis: 120px;
    }
    .content-card .session-thumb img {
        height: 120px;
        max-height: 120px;
    }
    .session-detail-hero {
        height: 200px;
    }
    .session-qr-image {
        width: 148px;
    }
    .session-form-section,
    .content-card {
        border-radius: 14px;
    }
    .session-form-section {
        padding: .95rem;
    }
    .session-form-section-head,
    .session-form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .session-form-section-copy {
        max-width: none;
    }
    .session-form-audience-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .audience-multi-select {
        min-height: 200px;
    }
    .session-form-actions {
        bottom: .6rem;
        padding: .9rem;
    }
    .session-form-actions .btn {
        flex: 1 1 auto;
    }
}

@media print {
    .app-topbar,
    .app-sidebar,
    .sidebar-overlay,
    .no-print,
    .btn,
    .alert { display: none !important; }
    body { background: #fff !important; }
    .app-main { margin-left: 0 !important; padding-top: 0 !important; }
    .app-content { max-width: 100% !important; padding: 0 !important; }
    .certificate-paper {
        box-shadow: none !important;
        border: 0 !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
}


.topbar-bell-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.topbar-bell-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.topbar-bell-menu {
    width: 300px;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}
.topbar-bell-header {
    padding: .85rem 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    background: #fafcff;
}
.bell-item {
    padding: .85rem 1rem;
}
.bell-item + .bell-item {
    border-top: 1px solid var(--border);
}
.bell-item-title {
    font-weight: 700;
    color: var(--text);
}
.bell-item-count {
    color: var(--muted);
    font-size: .84rem;
}

:root {
    --sidebar-bg: #edf3f9;
    --sidebar-bg-2: #e2ebf5;
    --sidebar-text: #1f2f46;
    --sidebar-muted: #53657a;
    --sidebar-w: 276px;
}

.app-brand {
    display: grid;
    gap: .08rem;
    white-space: nowrap;
}
.app-brand-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--text);
}
.app-brand-subtitle {
    color: var(--muted);
    font-size: .74rem;
    font-weight: 600;
}
.sidebar-toggle-btn {
    border-radius: 8px;
    background: #eef3f8;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
}
.topbar-logout {
    border-radius: 8px;
}
.topbar-settings-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: #24364e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.topbar-settings-btn:hover,
.topbar-settings-btn:focus {
    border-color: #93bdf8;
    background: #eef6ff;
    color: #1d4ed8;
}
.topbar-settings-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}
.topbar-settings-menu {
    min-width: 180px;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}
.app-sidebar {
    border-right: 1px solid #cdd9e7;
    box-shadow: 12px 0 30px rgba(15, 23, 42, 0.08);
}
.sidebar-scroll {
    padding: 1rem;
}
.sidebar-logo-wrap {
    padding: .15rem 0 1rem;
    margin-bottom: 1rem;
}
.sidebar-brand-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: .85rem;
    align-items: start;
    padding: .95rem;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #cbd8e7;
    color: var(--sidebar-text);
}
.sidebar-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f8fbff 0%, #d7e7ff 100%);
    color: #1d4ed8;
    font-size: .95rem;
    font-weight: 800;
}
.sidebar-brand-copy {
    display: grid;
    gap: .18rem;
    min-width: 0;
}
.sidebar-brand-title {
    color: #14233a;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}
.sidebar-brand-subtitle {
    color: var(--sidebar-muted);
    font-size: .84rem;
    line-height: 1.45;
}
.sidebar-group-toggle {
    border-radius: 8px;
    background: #dbe6f2;
    color: #24364e;
    padding: .82rem .9rem;
    font-size: .92rem;
    letter-spacing: 0;
    text-transform: none;
}
.sidebar-group-toggle:hover {
    background: #d2deeb;
    color: #122238;
}
.sidebar-caret {
    font-size: 1rem;
    line-height: 1;
}
.sidebar-group-toggle.collapsed .sidebar-caret {
    transform: rotate(0deg);
}
.sidebar-group-toggle:not(.collapsed) .sidebar-caret {
    transform: rotate(90deg);
}
.sidebar-submenu {
    display: grid;
    gap: .28rem;
    padding: .55rem 0 .2rem;
}
.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .78rem .85rem;
    border-radius: 8px;
    border: 1px solid transparent;
    margin-bottom: 0;
    color: #1f2f46;
    font-size: 1rem;
    font-weight: 700;
}
.sidebar-link:hover {
    background: #ffffff;
    border-color: #c7d6e7;
    color: #0f1f35;
}
.sidebar-link.active {
    background: #ffffff;
    color: #0f2f6f;
    border-color: #93bdf8;
    box-shadow: inset 4px 0 0 #2563eb, 0 8px 18px rgba(37, 99, 235, 0.10);
}
.sidebar-link-label {
    min-width: 0;
}
.sidebar-link-main {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    min-width: 0;
}
.sidebar-link-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    padding: 7px;
    border-radius: 8px;
    fill: currentColor;
    background: #d5e2f1;
    color: #304761;
}
.sidebar-link.active .sidebar-link-icon {
    background: #dbeafe;
    color: #1d4ed8;
}
.sidebar-link-count {
    min-width: 24px;
    height: 24px;
    padding: 0 .45rem;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .74rem;
    font-weight: 700;
}
.sidebar-footer {
    margin-top: 1.1rem;
}
.sidebar-footer-card {
    background: #ffffff;
    border: 1px solid #cbd8e7;
    border-radius: 8px;
    padding: .85rem .9rem;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: .8rem;
    align-items: center;
}
.sidebar-footer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #e2eaf4;
    color: #24364e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}
.sidebar-footer-copy {
    min-width: 0;
}
.sidebar-footer-name {
    color: #14233a;
    font-size: 1rem;
}
.sidebar-footer-title,
.sidebar-footer-role {
    color: var(--sidebar-muted);
    font-size: .88rem;
}
.topbar-bell-btn {
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: .95rem;
    font-weight: 700;
}
.topbar-bell-menu {
    border-radius: 8px;
}
.bell-item-count {
    min-width: 26px;
    height: 26px;
    padding: 0 .5rem;
    border-radius: 999px;
    background: #eef4ff;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .76rem;
    font-weight: 700;
}


.search-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}
.search-toolbar-input {
    flex: 1 1 auto;
    min-width: 0;
}
.search-toolbar-select {
    flex: 0 0 190px;
}
.search-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    margin-top: 0 !important;
    width: auto;
}
.search-toolbar-actions .btn {
    white-space: nowrap;
}
.session-filter-strip {
    align-items: center;
}
@media (max-width: 767.98px) {
    .search-toolbar {
        gap: 10px;
        flex-wrap: wrap;
    }
    .search-toolbar-input {
        flex: 1 1 100%;
        min-width: 100%;
    }
    .search-toolbar-select {
        flex: 1 1 100%;
    }
    .search-toolbar-actions {
        width: 100%;
        justify-content: flex-start;
    }
    .search-toolbar-actions .btn {
        flex: 1 1 auto;
    }
    .datetime-24h-picker {
        grid-template-columns: minmax(0, 1fr) 68px auto 68px;
    }
    .page-head {
        padding: 1rem;
        margin-bottom: 1rem !important;
    }
    .content-card {
        border-radius: 14px;
    }
    .content-card-head,
    .content-card-body,
    .content-card-foot {
        padding: .85rem .9rem;
    }
    .content-card .session-thumb {
        display: block;
        height: 82px;
        max-height: 82px;
        flex-basis: 82px;
    }
    .content-card .session-thumb img {
        height: 82px;
        max-height: 82px;
    }
    .session-detail-hero {
        height: 170px;
    }
    .content-title {
        font-size: 1.04rem;
        margin-bottom: .15rem;
    }
    .content-subtitle {
        font-size: .84rem;
    }
    .session-compact-meta {
        display: flex;
    }
    .content-card-body {
        padding-top: .35rem;
    }
    .info-grid {
        gap: .45rem;
    }
    .info-row {
        gap: .35rem;
        padding: .28rem 0;
    }
    .info-row-optional {
        display: none;
    }
    .info-label {
        font-size: .8rem;
        min-width: 0;
    }
    .info-value {
        font-size: .85rem;
    }
    .status-badge,
    .badge {
        font-size: .72rem;
        padding: .32rem .58rem;
    }
    .stat-card {
        padding: .8rem .85rem;
        border-radius: 14px;
    }
    .stat-value {
        font-size: 1.3rem;
    }
    .content-card-foot .btn,
    .content-card-foot .d-flex {
        width: 100%;
    }
    .content-card-foot .d-flex {
        gap: .45rem !important;
    }
    .content-card-foot .btn {
        text-align: center;
    }
    .session-filter-strip {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        padding-bottom: .15rem;
        margin-inline: -.1rem;
        scrollbar-width: thin;
    }
    .session-filter-strip .btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }
    .calendar-week-head {
        display: none;
    }
    .calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .7rem;
        padding: .8rem;
        background: #f8fbff;
    }
    .calendar-day {
        min-height: 96px;
        border: 1px solid var(--border);
        border-radius: 8px;
    }
    .calendar-day.is-muted {
        display: none;
    }
    .calendar-event-dot {
        font-size: .68rem;
    }
    .calendar-detail-item {
        flex-direction: column;
    }
    .calendar-detail-actions {
        flex: 0 0 auto;
        width: 100%;
    }
    .calendar-detail-actions .btn {
        width: 100%;
    }
    .approval-actions-group,
    .approval-inline-form {
        flex-direction: column;
        align-items: stretch;
    }
    .approval-select,
    .approval-input {
        width: 100%;
    }
    .quiz-option {
        padding: .85rem 1rem;
        min-height: 3.25rem;
    }
    .quiz-option .form-check-label {
        font-size: .95rem;
    }
}

/* ===== Vivid card-grid design system (browse-style pages) ===== */
.page-head { position: relative; overflow: hidden; }
.page-head::before {
    content: "";
    position: absolute;
    top: -46px;
    right: -20px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, .14), transparent 70%);
    pointer-events: none;
}
.page-head::after {
    content: "";
    position: absolute;
    bottom: -70px;
    right: 140px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, .12), transparent 70%);
    pointer-events: none;
}
.page-head > * { position: relative; z-index: 1; }
.page-kicker {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: #fff;
    border: 1px solid #dbe6f7;
    color: #2563eb;
    padding: .34rem .85rem .34rem .65rem;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .12);
    text-transform: uppercase;
}
.page-kicker::before {
    content: "";
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #2563eb;
}
.btn-icon-leading { display: inline-flex; align-items: center; gap: .4rem; }
.btn-icon-leading svg { width: 15px; height: 15px; fill: currentColor; flex: 0 0 auto; }

.search-toolbar-input .form-control,
.search-toolbar-select .form-select {
    border-radius: 999px;
    border-color: #e2e8f5;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}
.search-toolbar .btn { border-radius: 999px; }
.search-toolbar-input.input-icon-wrap .input-icon svg { width: 17px; height: 17px; fill: currentColor; }

.content-card { position: relative; }
.content-card .session-thumb { position: relative; }
.session-thumb-tile {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-repeat: repeat, no-repeat;
}
.session-thumb-tile svg {
    width: 44px;
    height: 44px;
    fill: #fff;
    opacity: .95;
    filter: drop-shadow(0 6px 14px rgba(15, 23, 42, .22));
}
.session-thumb-grad-1 { background-image: radial-gradient(circle at 20px 20px, rgba(255,255,255,.18) 1.5px, transparent 1.6px), linear-gradient(135deg, #6366f1 0%, #4338ca 100%); background-size: 22px 22px, auto; }
.session-thumb-grad-2 { background-image: radial-gradient(circle at 20px 20px, rgba(255,255,255,.18) 1.5px, transparent 1.6px), linear-gradient(135deg, #34d399 0%, #059669 100%); background-size: 22px 22px, auto; }
.session-thumb-grad-3 { background-image: radial-gradient(circle at 20px 20px, rgba(255,255,255,.18) 1.5px, transparent 1.6px), linear-gradient(135deg, #7c3aed 0%, #312e81 100%); background-size: 22px 22px, auto; }
.session-thumb-grad-4 { background-image: radial-gradient(circle at 20px 20px, rgba(255,255,255,.18) 1.5px, transparent 1.6px), linear-gradient(135deg, #f59e0b 0%, #b45309 100%); background-size: 22px 22px, auto; }

.session-status-float {
    position: absolute;
    top: .65rem;
    right: .65rem;
    z-index: 2;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .2);
}

.info-row-left { display: inline-flex; align-items: center; gap: .55rem; min-width: 0; }
.info-row-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 9px;
    background: #eef4ff;
    color: #2563eb;
}
.info-row-icon svg { width: 15px; height: 15px; fill: currentColor; }

.session-join-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .5rem .9rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
    border: 0;
    white-space: nowrap;
}
.session-join-pill svg { width: 14px; height: 14px; fill: currentColor; }
.session-join-pill.is-pending { background: #2563eb; color: #fff; }
.session-join-pill.is-joined { background: #dcfce7; color: #166534; }

/* ===== Shared dashboard hero/kpi system (was duplicated per-file) ===== */
.dashboard-hero {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);
    border: 1px solid #dbeafe;
    padding: 24px;
    margin-bottom: 20px;
}
.dashboard-hero::before {
    content: "";
    position: absolute;
    top: -46px;
    right: -20px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, .14), transparent 70%);
    pointer-events: none;
}
.dashboard-hero::after {
    content: "";
    position: absolute;
    bottom: -70px;
    right: 140px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, .12), transparent 70%);
    pointer-events: none;
}
.dashboard-hero > * { position: relative; z-index: 1; }
.dashboard-kicker, .page-kicker {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: #fff;
    border: 1px solid #dbe6f7;
    color: #2563eb;
    padding: .34rem .85rem .34rem .65rem;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .12);
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: .35rem;
}
.dashboard-kicker::before, .page-kicker::before {
    content: "";
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #2563eb;
}
.dashboard-title {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    margin: 6px 0;
}
.dashboard-filter {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 20px;
}
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.kpi-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}
.kpi-card.is-clickable { display: block; color: inherit; text-decoration: none; }
.kpi-card.is-clickable:hover { border-color: #93c5fd; box-shadow: 0 14px 34px rgba(37, 99, 235, .12); }
.kpi-label { color: #64748b; font-size: 13px; font-weight: 700; }
.kpi-value { color: #0f172a; font-size: 30px; font-weight: 800; margin-top: 8px; }
.kpi-hint { margin-top: 6px; color: #2563eb; font-size: 12px; font-weight: 700; }
.progress-soft { height: 10px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.progress-soft > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2563eb, #10b981); }
.dashboard-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
    margin-bottom: 18px;
}
.dashboard-card.is-clickable { display: block; color: inherit; text-decoration: none; }
.dashboard-card.is-clickable:hover { border-color: #93c5fd; }
.action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.action-value { font-size: 22px; font-weight: 800; color: #2563eb; }
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pending-row-title { font-weight: 800; color: #0f172a; }
.pending-row-sub { color: #64748b; font-size: 12px; }
.chart-bar-row {
    display: grid;
    grid-template-columns: 180px 1fr 70px;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}
.chart-bar-track { height: 12px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.chart-bar-fill { height: 100%; background: linear-gradient(90deg, #2563eb, #10b981); border-radius: 999px; }
@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .chart-bar-row { grid-template-columns: 1fr; }
}
