:root {
  --kn-green: #006B3F;
  --kn-green-dark: #00502F;
  --kn-green-soft: #E6F2EC;
  --kn-gold: #FCD116;
  --kn-gold-soft: #FFF8D6;
  --ef-bg: #F4F6F5;
  --ef-border: #E1E6E3;
  --ef-text-muted: #6B7A72;
  --sidebar-w: 248px;
  --bs-primary: #006B3F;
  --bs-primary-rgb: 0, 107, 63;
  --bs-link-color: #006B3F;
  --bs-link-hover-color: #00502F;
  --bs-link-color-rgb: 0, 107, 63;
}

body { background: var(--ef-bg); font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #1E2A24; }

/* Buttons & accents */
.btn-primary { --bs-btn-bg: var(--kn-green); --bs-btn-border-color: var(--kn-green); --bs-btn-hover-bg: var(--kn-green-dark);
  --bs-btn-hover-border-color: var(--kn-green-dark); --bs-btn-active-bg: var(--kn-green-dark); --bs-btn-disabled-bg: #6c9e86; --bs-btn-disabled-border-color: #6c9e86; }
.btn-outline-primary { --bs-btn-color: var(--kn-green); --bs-btn-border-color: var(--kn-green); --bs-btn-hover-bg: var(--kn-green);
  --bs-btn-hover-border-color: var(--kn-green); --bs-btn-active-bg: var(--kn-green-dark); }
.btn-gold { background: var(--kn-gold); border-color: var(--kn-gold); color: #3a3000; font-weight: 600; }
.btn-gold:hover { background: #e9bf00; border-color: #e9bf00; color: #2b2400; }
.text-kn { color: var(--kn-green) !important; }
.bg-kn { background: var(--kn-green) !important; }
.bg-kn-soft { background: var(--kn-green-soft) !important; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: #4f9b7a; box-shadow: 0 0 0 .2rem rgba(0,107,63,.18); }
.form-check-input:checked { background-color: var(--kn-green); border-color: var(--kn-green); }
.progress-bar { background-color: var(--kn-green); }
.nav-tabs .nav-link.active { color: var(--kn-green); border-bottom: 3px solid var(--kn-green); font-weight: 600; }
.nav-tabs .nav-link { color: #4d5b54; border: none; }
.page-link { color: var(--kn-green); }
.active > .page-link { background: var(--kn-green); border-color: var(--kn-green); }

/* Layout */
/* The sidebar column stretches the full page height (so long pages and full-page
   screenshots stay green to the bottom); its contents stay pinned while scrolling. */
.ef-shell { display: flex; min-height: 100vh; }
.ef-sidebar-inner { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.ef-sidebar { flex: 0 0 var(--sidebar-w); width: var(--sidebar-w); background: #004A2D linear-gradient(180deg, #00603A 0, #004A2D 100vh) no-repeat;
  color: #fff; display: flex; flex-direction: column; z-index: 1030; }
.ef-brand { padding: 1.1rem 1.2rem; display: flex; align-items: center; gap: .75rem; border-bottom: 1px solid rgba(255,255,255,.12); }
.ef-logo { width: 46px; height: 46px; border-radius: .6rem; background: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 0 0 2px rgba(252,209,22,.6); }
.ef-logo img { width: 40px; height: 40px; object-fit: contain; }
.ef-brand .name { font-weight: 700; font-size: 1.15rem; letter-spacing: .2px; line-height: 1.1; }
.ef-brand .sub { font-size: .68rem; white-space: nowrap; color: rgba(255,255,255,.7); }
.ef-nav { padding: .8rem .6rem; flex: 1; overflow-y: auto; }
.ef-nav .section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.5); padding: .9rem .8rem .35rem; }
.ef-nav a { display: flex; align-items: center; gap: .7rem; color: rgba(255,255,255,.85); text-decoration: none; padding: .58rem .8rem;
  border-radius: .5rem; font-size: .93rem; margin-bottom: 2px; }
.ef-nav a i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.ef-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.ef-nav a.active { background: rgba(252,209,22,.16); color: #fff; box-shadow: inset 3px 0 0 var(--kn-gold); font-weight: 600; }
.ef-nav a.active i { color: var(--kn-gold); }
.ef-sidebar-footer { padding: .9rem 1.2rem; font-size: .75rem; color: rgba(255,255,255,.55); border-top: 1px solid rgba(255,255,255,.12); }
.ef-main { flex: 1 1 auto; min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.ef-topbar { background: #fff; border-bottom: 1px solid var(--ef-border); padding: .7rem 1.6rem; display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 1020; }
.ef-topbar h1 { font-size: 1.2rem; margin: 0; font-weight: 650; }
.ef-topbar .crumb { font-size: .78rem; color: var(--ef-text-muted); }
.ef-content { padding: 1.5rem 1.6rem 2.5rem; flex: 1; }
.ef-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--kn-green-soft); color: var(--kn-green); display: inline-flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.demo-badge { background: repeating-linear-gradient(45deg, #FCD116, #FCD116 10px, #f5c400 10px, #f5c400 20px); color: #3a2f00;
  font-weight: 800; letter-spacing: .06em; border: 1px solid #c9a400; padding: .35rem .7rem; border-radius: .4rem; font-size: .75rem; }

@media (max-width: 991.98px) {
  .ef-sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-100%); transition: transform .2s; }
  .ef-sidebar.show { transform: none; }
  .ef-main { margin-left: 0; }
}

/* Cards */
.card { border: 1px solid var(--ef-border); border-radius: .8rem; box-shadow: 0 1px 2px rgba(16,40,28,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--ef-border); font-weight: 600; padding: .85rem 1.1rem; border-radius: .8rem .8rem 0 0 !important; }
.stat-card { padding: 1.1rem 1.2rem; display: flex; flex-direction: row; align-items: center; gap: 1rem; height: 100%; }
.stat-card .icon { width: 48px; height: 48px; border-radius: .7rem; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.stat-card .value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-card .label { font-size: .72rem; color: var(--ef-text-muted); text-transform: uppercase; letter-spacing: .04em; margin-top: .3rem; }
.stat-card .hint { font-size: .75rem; color: var(--ef-text-muted); }
.icon-green { background: var(--kn-green-soft); color: var(--kn-green); }
.icon-gold { background: var(--kn-gold-soft); color: #9a7b00; }
.icon-blue { background: #E7F0FB; color: #2161B0; }
.icon-amber { background: #FFF1DD; color: #B86E00; }
.icon-red { background: #FDE8E7; color: #C0392B; }

/* Tables */
.table-ef { margin: 0; font-size: .9rem; }
.table-ef thead th { background: #F7F9F8; color: #56645C; font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--ef-border); white-space: nowrap; padding: .7rem .9rem; }
.table-ef td { padding: .65rem .9rem; vertical-align: middle; border-color: #EEF1EF; }
.table-ef tbody tr:hover { background: #FAFCFB; }
.thumb { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--ef-border); background: #ddd; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; }

/* Badges */
.badge-soft { padding: .38em .7em; font-weight: 600; border-radius: 2rem; font-size: .74rem; }
.b-present, .b-OPEN, .b-enrolled { background: #E3F4EA; color: #17703A; }
.b-flagged { background: #FFF1D6; color: #9A5B00; }
.b-absent { background: #FDE8E7; color: #B03A2E; }
.b-pending, .b-SCHEDULED, .b-not-enrolled { background: #EEF0EF; color: #5F6B65; }
.b-CLOSED { background: #E6ECF5; color: #34507A; }
.b-INDIVIDUAL { background: #E7F0FB; color: #2161B0; }
.b-GROUP { background: #F1E8FB; color: #6B33A8; }
.b-MANUAL { background: #FFF1D6; color: #9A5B00; }
.b-ADMIN { background: #FDE8E7; color: #B03A2E; }
.b-EXAM_OFFICER { background: #E7F0FB; color: #2161B0; }
.b-INVIGILATOR { background: #E3F4EA; color: #17703A; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #20B25B; display: inline-block; box-shadow: 0 0 0 0 rgba(32,178,91,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(32,178,91,.55);} 70% { box-shadow: 0 0 0 9px rgba(32,178,91,0);} 100% { box-shadow: 0 0 0 0 rgba(32,178,91,0);} }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(252,209,22,.25), transparent 60%), linear-gradient(135deg, #006B3F 0%, #003D24 100%); }
.login-card { width: 100%; max-width: 430px; border-radius: 1rem; border: none; box-shadow: 0 20px 50px rgba(0,0,0,.25); overflow: hidden; }
.login-card .top { background: #fff; padding: 2rem 2rem .5rem; text-align: center; }
.login-card .top img { width: 96px; height: 96px; object-fit: contain; }
.login-card .stripe { height: 5px; background: linear-gradient(90deg, var(--kn-green) 0 33%, var(--kn-gold) 33% 66%, #C8102E 66%); }

/* Enrolment */
.camera-box { position: relative; background: #0f1a14; border-radius: .7rem; overflow: hidden; aspect-ratio: 4 / 3; }
.camera-box video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera-box .guide { position: absolute; left: 50%; top: 50%; width: 42%; height: 62%; transform: translate(-50%, -52%);
  border: 3px dashed rgba(252,209,22,.85); border-radius: 50%; pointer-events: none; }
.camera-box .placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #9fb3a8; text-align: center; padding: 1rem; }
.capture-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem; }
.capture-item { border: 1px solid var(--ef-border); border-radius: .6rem; overflow: hidden; background: #fff; font-size: .75rem; position: relative; }
.capture-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.capture-item .cap { padding: .35rem .5rem; line-height: 1.2; }
.capture-item.ok { border-color: #8fd0a6; }
.capture-item.bad { border-color: #f0a8a1; }
.capture-item.bad img { filter: grayscale(.6) opacity(.75); }
.capture-item .del { position: absolute; top: 4px; right: 4px; }
.consent-box { background: var(--kn-gold-soft); border: 1px solid #F1DE86; border-radius: .6rem; padding: .9rem 1rem; font-size: .86rem; }

/* Live view */
.session-hero { background: linear-gradient(120deg, #006B3F, #00502F); color: #fff; border-radius: .9rem; padding: 1.3rem 1.5rem; }
.session-hero .meta span { margin-right: 1.3rem; opacity: .9; font-size: .92rem; }
.counter { background: rgba(255,255,255,.12); border-radius: .7rem; padding: .6rem 1rem; text-align: center; min-width: 96px; }
.counter .v { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.counter .l { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.group-thumb { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: .5rem; cursor: zoom-in; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--ef-text-muted); }
.empty-state i { font-size: 2rem; display: block; margin-bottom: .5rem; opacity: .6; }

/* Side panel (New session) – leaves the list visible beside it */
.ef-panel.offcanvas-end { width: 600px; max-width: 100vw; box-shadow: -12px 0 40px rgba(16,40,28,.18); border-left: 1px solid var(--ef-border); }
.ef-panel .card { box-shadow: none; }
