/* RISENLEAD brand layer on top of Tabler (https://tabler.io, MIT). Always light. */
:root, [data-bs-theme=light] {
  --rl-maroon: #9b1c1c; --rl-maroon-dark: #7f1d1d; --rl-red: #e5372a; --rl-soft: #fbecec;
  --tblr-primary: #9b1c1c; --tblr-primary-rgb: 155,28,28; --tblr-primary-fg: #fff;
  --tblr-primary-darken: #7f1d1d; --tblr-primary-lt: #fbecec; --tblr-primary-lt-rgb: 251,236,236;
  --tblr-font-sans-serif: Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tblr-body-bg: #f6f5f3; --tblr-bg-surface-secondary: #f6f5f3;
  --tblr-link-color: #9b1c1c; --tblr-link-color-rgb: 155,28,28; --tblr-link-hover-color: #7f1d1d;
  --tblr-border-color: #ebe8e4; --tblr-border-radius: 8px;
}
body { background: var(--tblr-body-bg); }
.btn-primary { --tblr-btn-bg: #9b1c1c; --tblr-btn-border-color: #9b1c1c; --tblr-btn-hover-bg: #7f1d1d; --tblr-btn-hover-border-color: #7f1d1d; --tblr-btn-active-bg: #6b1515; --tblr-btn-active-border-color: #6b1515; --tblr-btn-disabled-bg: #9b1c1c; --tblr-btn-disabled-border-color: #9b1c1c; }
.form-control:focus, .form-select:focus { border-color: #c98a8a; box-shadow: 0 0 0 .2rem rgba(155,28,28,.15); }
.form-check-input:checked { background-color: #9b1c1c; border-color: #9b1c1c; }
.page-title, .card-title, .modal-title, h1, h2, .h1, .h2 { font-family: Montserrat, Inter, sans-serif; letter-spacing: -.01em; }
.page-title { font-weight: 700; font-size: 1.5rem; }
.card { border-color: var(--tblr-border-color); box-shadow: 0 1px 2px rgba(28,25,23,.03); }
.text-maroon { color: var(--rl-maroon) !important; }
.bg-maroon-lt { background: var(--rl-soft) !important; color: var(--rl-maroon) !important; }
[hidden] { display: none !important; }

/* Sidebar */
.navbar-vertical.rl-side { background: #fff; border-right: 1px solid var(--tblr-border-color); }
.rl-side .navbar-brand img { width: 168px; height: auto; }
.rl-side .nav-link { border-radius: 8px; margin: 1px 10px; padding: .55rem .75rem; color: #44403c; font-weight: 500; }
.rl-side .nav-link:hover { background: #f6f5f3; color: #1c1917; }
.rl-side .nav-item.active .nav-link { background: var(--rl-soft); color: var(--rl-maroon); font-weight: 600; }
.rl-side .nav-link-icon { color: inherit !important; opacity: .9; }
.rl-side .nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #a8a29e; font-weight: 600; padding: 1rem 1.6rem .3rem; list-style: none; }
@media (max-width: 991.98px) { .rl-side .navbar-brand img { width: 130px; } }

/* Header search */
.rl-search { position: relative; max-width: 420px; width: 100%; }
.rl-search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1050; max-height: 420px; overflow: auto; }
.rl-search-results .list-group-item { cursor: pointer; }

/* Avatars & icons */
.avatar.rl { background: var(--rl-soft); color: var(--rl-maroon); font-weight: 700; }
.avatar.c1 { background: #fbecec; color: #9b1c1c; } .avatar.c2 { background: #eef2ff; color: #4338ca; }
.avatar.c3 { background: #fff4e5; color: #c2410c; } .avatar.c4 { background: #e8f3ee; color: #15803d; }
.avatar.c5 { background: #f3e8ff; color: #7e22ce; } .avatar.c6 { background: #e0f2fe; color: #0369a1; }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; flex: none; }
.dot-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 16px; }

/* Hero banner */
.rl-hero { background: linear-gradient(120deg, #7f1a15 0%, #a81f1a 55%, #e5372a 135%); color: #fff; border: 0; overflow: hidden; position: relative; }
.rl-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 300px; height: 300px; border-radius: 50%; background: rgba(255,255,255,.07); pointer-events: none; }
.rl-hero h2 { color: #fff; font-size: 1.6rem; }
.rl-hero .btn-white { color: var(--rl-maroon); font-weight: 600; }
.rl-hero .btn-outline-white { --tblr-btn-bg: transparent; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.55); }
.rl-hero .btn-outline-white:hover { background: rgba(255,255,255,.14); color: #fff; }
.cert-thumb { aspect-ratio: 842/595; border-radius: 10px; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6% 7%; position: relative; overflow: hidden; color: #111; }
.cert-thumb .t1 { font: 700 7px Montserrat, sans-serif; letter-spacing: .2em; margin-top: 7%; }
.cert-thumb .t2 { font: italic 600 17px Georgia, serif; margin-top: 6%; }
.cert-thumb .t3 { font: 700 11px Inter, sans-serif; margin-top: 5%; }
.cert-thumb .qr { position: absolute; right: 7%; top: 9%; width: 13%; aspect-ratio: 1; background: repeating-conic-gradient(#222 0 25%, #fff 0 50%) 0 0/25% 25%; border-radius: 3px; }

/* Tables */
.card-table tbody tr.clickable { cursor: pointer; }
.card-table tbody tr.clickable:hover { background: #faf9f7; }
.table-actions { white-space: nowrap; text-align: end; }
.empty-state { padding: 3rem 1rem; text-align: center; color: var(--tblr-secondary); }
.empty-state .ti { font-size: 2.5rem; color: #d6d3d1; display: block; margin-bottom: .5rem; }

/* Steps on the Issue page */
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--rl-maroon); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; margin-right: .6rem; flex: none; }
.sticky-summary { position: sticky; top: 1rem; }

/* Modal (native <dialog>) */
dialog.rl-modal { border: 0; padding: 0; background: transparent; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: visible; }
dialog.rl-modal.wide { width: min(780px, calc(100vw - 32px)); }
dialog.rl-modal::backdrop { background: rgba(28,25,23,.45); backdrop-filter: blur(2px); }
dialog.rl-modal .modal-content { background: #fff; border: 1px solid var(--tblr-border-color); border-radius: 12px; box-shadow: 0 24px 64px rgba(0,0,0,.25); max-height: calc(100vh - 32px); display: flex; flex-direction: column; color: var(--tblr-body-color); }
dialog.rl-modal .modal-header, dialog.rl-modal .modal-footer { padding: 1rem 1.25rem; border-color: var(--tblr-border-color); }
dialog.rl-modal .modal-header { border-bottom: 1px solid var(--tblr-border-color); }
dialog.rl-modal .modal-footer { border-top: 1px solid var(--tblr-border-color); }
dialog.rl-modal .modal-body { padding: 1.25rem; }
dialog.rl-modal .modal-body { overflow: auto; display: grid; gap: 1rem; }

/* Toasts */
#toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 2000; }
.rl-toast { background: #1c1917; color: #fff; padding: .7rem 1rem; border-radius: 10px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: 380px; display: flex; gap: .5rem; align-items: center; }
.rl-toast.err { background: #b91c1c; }

/* Auth (split screen) */
.rl-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: #fff; }
.rl-auth-brand { background: linear-gradient(140deg, #6e1712 0%, #9b1c1c 55%, #d6322a 120%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.rl-auth-brand::before, .rl-auth-brand::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.06); }
.rl-auth-brand::before { width: 420px; height: 420px; right: -120px; top: -120px; }
.rl-auth-brand::after { width: 300px; height: 300px; left: -100px; bottom: -100px; }
.rl-auth-brand img.logo { width: 220px; position: relative; z-index: 1; }
.rl-auth-brand h1 { color: #fff; font-size: 2.1rem; line-height: 1.2; max-width: 460px; position: relative; z-index: 1; }
.rl-auth-brand p { opacity: .85; max-width: 440px; font-size: 1.05rem; position: relative; z-index: 1; }
.rl-cred-stack { position: relative; z-index: 1; max-width: 440px; margin: 2.25rem 0 1.75rem; }
.rl-cred { position: relative; background: #fff; color: #1c1917; border-radius: 14px; box-shadow: 0 24px 48px -12px rgba(40,6,4,.45); overflow: hidden; }
.rl-cred-back { position: absolute; inset: 0; transform: translate(18px, 16px) rotate(2.5deg); background: rgba(255,255,255,.18); box-shadow: none; }
.rl-cred-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid #f0ebe9; }
.rl-cred-top img { height: 26px; }
.rl-cred-ok { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 600; color: #1f7a3d; background: #e8f5ec; border-radius: 999px; padding: 3px 10px 3px 6px; }
.rl-cred-ok i { font-size: 1rem; }
.rl-cred-body { display: flex; gap: 18px; align-items: flex-end; justify-content: space-between; padding: 18px 20px 20px; }
.rl-cred-label { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: #9b1c1c; font-weight: 600; }
.rl-cred-name { font-family: Montserrat, sans-serif; font-weight: 700; font-size: 1.45rem; margin: 4px 0 2px; }
.rl-cred-course { color: #57534e; font-size: .9rem; }
.rl-cred-meta { display: flex; gap: 22px; margin-top: 14px; font-size: .8rem; font-weight: 500; }
.rl-cred-meta span { display: block; font-size: .68rem; color: #a8a29e; font-weight: 400; text-transform: uppercase; letter-spacing: .06em; }
.rl-cred-qr { width: 76px; height: 76px; flex: none; padding: 6px; border: 1px solid #f0ebe9; border-radius: 8px; }
.rl-cred-actions { display: flex; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid #f0ebe9; background: #faf8f7; }
.rl-cred-actions span { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 500; color: #44403c; background: #fff; border: 1px solid #e7e2df; border-radius: 6px; padding: 5px 10px; }
.rl-cred-actions span.li { color: #0a66c2; }
.rl-cred-actions i { font-size: .95rem; }
.rl-auth-alt { display: flex; gap: .5rem; align-items: center; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--tblr-border-color); color: var(--tblr-secondary); font-size: .875rem; }
.rl-auth-points { list-style: none; padding: 0; margin: 0; position: relative; z-index: 1; max-width: 440px; display: grid; gap: .6rem; }
.rl-auth-points li { display: flex; gap: .6rem; align-items: flex-start; opacity: .9; }
.rl-auth-points i { font-size: 1.15rem; margin-top: 1px; }
.rl-auth-form { display: grid; place-items: center; padding: 2rem 1.5rem; }
.rl-auth-form .inner { width: 100%; max-width: 400px; }
.code-input { font-size: 1.9rem; letter-spacing: .45em; text-align: center; font-family: ui-monospace, Menlo, monospace; }
@media (max-width: 860px) {
  .rl-auth { grid-template-columns: 1fr; }
  .rl-auth-brand { padding: 1.5rem; }
  .rl-auth-brand h1, .rl-auth-brand p, .rl-cred-stack, .rl-auth-points { display: none; }
  .rl-auth-brand img.logo { width: 170px; }
}

/* Student portal */
.rl-portal-head { background: #fff; border-bottom: 1px solid var(--tblr-border-color); }
.rl-portal-head img { width: 160px; }

.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-width: 200px; }

/* Template designer */
.dz-stage { position: relative; width: 100%; user-select: none; touch-action: none; background: #fff; box-shadow: 0 8px 30px rgba(0,0,0,.08); border-radius: 4px; overflow: hidden; }
.dz-stage canvas { display: block; width: 100%; height: auto; }
.dz-layer { position: absolute; inset: 0; }
.dz-box { position: absolute; display: flex; cursor: move; outline: 1px dashed rgba(155,28,28,.45); outline-offset: 0; overflow: visible; }
.dz-box:hover { outline: 1px solid rgba(155,28,28,.8); background: rgba(155,28,28,.04); }
.dz-box.sel { outline: 2px solid #9b1c1c; background: rgba(155,28,28,.06); z-index: 5; }
.dz-box .dz-text { width: 100%; overflow: visible; pointer-events: none; }
.dz-box.shrink .dz-text { white-space: nowrap; align-self: center; }
.dz-box.wrap .dz-text { white-space: normal; align-self: flex-start; }
.dz-box .dz-tag { position: absolute; left: -2px; top: -18px; font: 600 10px/16px Inter, sans-serif; background: #9b1c1c; color: #fff; padding: 0 6px; border-radius: 4px 4px 0 0; white-space: nowrap; display: none; pointer-events: none; }
.dz-box.sel .dz-tag, .dz-box:hover .dz-tag { display: block; }
.dz-handle { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; background: #fff; border: 2px solid #9b1c1c; border-radius: 3px; cursor: nwse-resize; display: none; }
.dz-box.sel .dz-handle { display: block; }
.dz-qr { background: repeating-conic-gradient(#222 0 25%, #fff 0 50%) 0 0/20% 20%; opacity: .85; }
.dz-guide { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed #0ea5e9; pointer-events: none; z-index: 10; }
.dz-fields .list-group-item { cursor: pointer; }
.dz-fields .list-group-item.active { background: var(--rl-soft); color: var(--rl-maroon); border-color: var(--tblr-border-color); }
.dz-chip { font-size: .75rem; padding: .1rem .45rem; }
.dz-panel { position: sticky; top: 1rem; }

/* Centre icons inside inputs (Tabler's webfont icons otherwise sit slightly high). */
.input-icon-addon { display: flex; align-items: center; justify-content: center; top: 0; bottom: 0; height: auto; }
.input-icon-addon .ti { font-size: 1.1rem; line-height: 1; display: block; }
.form-control-lg ~ .input-icon-addon .ti, .input-icon-addon:has(~ .form-control-lg) .ti { font-size: 1.25rem; }
.input-icon:has(.form-control-lg) .form-control-lg { padding-left: 2.75rem; }
.input-icon:has(.form-control-lg) .input-icon-addon { min-width: 2.75rem; }
