/* EduHub GH - theme on top of Bootstrap 5 */
:root {
  --eh-green: #0f4c3a;
  --eh-green-2: #146b52;
  --eh-green-soft: #e7f2ed;
  --eh-gold: #e0a526;
  --eh-gold-soft: #fdf4df;
  --eh-ink: #1b2620;
  --eh-muted: #66766d;
  --eh-bg: #f4f6f3;
  --eh-line: #e3e8e4;
  --eh-sidebar-w: 256px;
  --bs-primary: #0f4c3a;
  --bs-primary-rgb: 15, 76, 58;
  --bs-link-color: #146b52;
  --bs-link-hover-color: #0f4c3a;
  --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--eh-ink);
  --bs-border-color: var(--eh-line);
}
body { background: var(--eh-bg); font-size: .93rem; }

/* Buttons */
.btn-primary { --bs-btn-bg: var(--eh-green); --bs-btn-border-color: var(--eh-green); --bs-btn-hover-bg: var(--eh-green-2); --bs-btn-hover-border-color: var(--eh-green-2); --bs-btn-active-bg: #0b3a2c; --bs-btn-disabled-bg: var(--eh-green); --bs-btn-disabled-border-color: var(--eh-green); }
.btn-outline-primary { --bs-btn-color: var(--eh-green); --bs-btn-border-color: var(--eh-green); --bs-btn-hover-bg: var(--eh-green); --bs-btn-hover-border-color: var(--eh-green); --bs-btn-active-bg: var(--eh-green); }
.btn-gold { background: var(--eh-gold); color: #2b1d00; border: 0; font-weight: 600; }
.btn-gold:hover { background: #c98f17; color: #1a1200; }
.btn-icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; color: var(--eh-ink); }
.btn-icon:hover { background: var(--eh-green-soft); }
.text-bg-primary { background-color: var(--eh-green) !important; }
.form-control:focus, .form-select:focus { border-color: #5aa58a; box-shadow: 0 0 0 .2rem rgba(20,107,82,.15); }
.form-label { font-weight: 600; font-size: .82rem; color: #3b4a41; margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--eh-green); border-color: var(--eh-green); }
.nav-pills .nav-link.active { background: var(--eh-green); }
.nav-pills .nav-link { color: var(--eh-ink); }
.page-link { color: var(--eh-green); }
.active > .page-link { background: var(--eh-green); border-color: var(--eh-green); }

/* Layout */
.app-body { display: flex; min-height: 100vh; }
.sidebar { width: var(--eh-sidebar-w); background: var(--eh-green) !important; color: #d7e8e0; flex-shrink: 0; }
@media (min-width: 992px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; display: flex !important; flex-direction: column; }
  .sidebar .sidebar-nav { overflow-y: auto; }
  .main { margin-left: var(--eh-sidebar-w); }
}
.sidebar.offcanvas-lg { --bs-offcanvas-width: 270px; --bs-offcanvas-bg: var(--eh-green); }
.sidebar-brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { width: 40px; height: 40px; display: inline-grid; place-items: center; flex-shrink: 0; }
.brand-mark img { width: 100%; height: 100%; display: block; }
.brand-mark.big { width: 76px; height: 76px; margin-bottom: 1.2rem; }
.auth-logo { height: 44px; width: auto; max-width: 100%; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; }
.brand-text { line-height: 1.15; min-width: 0; }
.brand-text strong { color: #fff; display: block; font-size: 1rem; }
.brand-text small { color: #a9c9bb; font-size: .74rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.sidebar-nav { padding: .6rem .6rem 2rem; overflow-y: auto; flex: 1; }
.sidebar-nav .nav-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: #84ab9a; padding: 1rem .8rem .35rem; font-weight: 700; }
.sidebar-nav .nav-link { display: flex; align-items: center; gap: .75rem; color: #d7e8e0; padding: .52rem .8rem; border-radius: 9px; font-weight: 500; font-size: .88rem; }
.sidebar-nav .nav-link i { font-size: 1.05rem; opacity: .85; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--eh-gold); color: #241900; font-weight: 700; }
.sidebar-nav .nav-link.active i { opacity: 1; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: .75rem; padding: .8rem 1.5rem; background: #fff; border-bottom: 1px solid var(--eh-line); position: sticky; top: 0; z-index: 1020; }
.topbar-title h1 { font-size: 1.15rem; font-weight: 700; margin: 0; }
.topbar-title small { color: var(--eh-muted); font-size: .78rem; }
.user-chip { display: flex; align-items: center; gap: .55rem; border: 1px solid var(--eh-line); border-radius: 30px; padding: .25rem .7rem .25rem .25rem; background: #fff; }
.user-chip small { color: var(--eh-muted); font-size: .72rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--eh-green-soft); color: var(--eh-green); display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem; flex-shrink: 0; }
.avatar.lg { width: 96px; height: 96px; font-size: 2rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.alerts-menu { min-width: 290px; }
.content { padding: 1.5rem; flex: 1; }
.app-footer { padding: 1rem 1.5rem; color: var(--eh-muted); font-size: .78rem; }
@media (max-width: 575.98px) { .content { padding: 1rem .75rem; } .topbar { padding: .6rem .75rem; } }

/* Cards */
.card { border: 1px solid var(--eh-line); border-radius: 14px; box-shadow: 0 1px 2px rgba(16,40,30,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--eh-line); padding: .9rem 1.1rem; font-weight: 700; border-radius: 14px 14px 0 0 !important; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.card-header .actions { margin-left: auto; display: flex; gap: .4rem; flex-wrap: wrap; }
.stat { padding: 1.1rem 1.2rem; display: flex; flex-direction: row; gap: 1rem; align-items: center; }
.stat > div { min-width: 0; }
.stat .ic { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; flex-shrink: 0; }
.stat .ic.g { background: var(--eh-green-soft); color: var(--eh-green); }
.stat .ic.y { background: var(--eh-gold-soft); color: #a8740b; }
.stat .ic.b { background: #e6effc; color: #2457b8; }
.stat .ic.r { background: #fde8e8; color: #b42318; }
.stat .num { font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.stat .lbl { color: var(--eh-muted); font-size: .8rem; }

/* Tables */
.table { --bs-table-striped-bg: #f8faf8; margin-bottom: 0; }
.table > thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--eh-muted); background: #f8faf8; font-weight: 700; white-space: nowrap; border-bottom-width: 1px; }
.table td { vertical-align: middle; }
.table-responsive { border-radius: 0 0 14px 14px; }
.table-scores input { min-width: 70px; max-width: 90px; }

.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; }
.filters > * { flex: 0 1 auto; }
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state > i { font-size: 2.6rem; color: #9fb5aa; display: block; margin-bottom: .6rem; }
.capacity-bar { height: 6px; border-radius: 4px; background: #edf1ee; overflow: hidden; }
.capacity-bar span { display: block; height: 100%; background: var(--eh-green-2); }
.capacity-bar span.full { background: #d92d20; }
.capacity-bar span.near { background: var(--eh-gold); }

.att-radio .btn { min-width: 38px; font-weight: 700; }
.btn-check:checked + .btn-outline-success { background: #198754; color: #fff; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: .45rem 1rem; font-size: .9rem; }
.kv dt { color: var(--eh-muted); font-weight: 500; }
.kv dd { margin: 0; font-weight: 600; }
@media (max-width: 575.98px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: .4rem; } }
.perm-group { border: 1px solid var(--eh-line); border-radius: 12px; padding: .9rem 1rem; height: 100%; }
.perm-group h6 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--eh-green); font-weight: 700; }
.clock-face { font-size: 3rem; font-weight: 800; letter-spacing: .02em; color: var(--eh-green); font-variant-numeric: tabular-nums; }

/* Auth */
.auth-body { background: var(--eh-bg); }
.auth-wrap { min-height: 100vh; display: flex; }
.auth-side { flex: 1; background: radial-gradient(circle at 20% 20%, #1a7a5c 0, var(--eh-green) 55%, #0a3428 100%); color: #e4f1eb; padding: 4rem; align-items: center; }
.auth-side h2 { color: #fff; font-weight: 800; font-size: 2.3rem; }
.auth-side p { font-size: 1.05rem; color: #bcd8cb; max-width: 420px; }
.auth-points { list-style: none; padding: 0; margin-top: 2rem; }
.auth-points li { margin-bottom: .7rem; }
.auth-points i { color: var(--eh-gold); margin-right: .5rem; }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 420px; background: #fff; padding: 2.2rem; border-radius: 18px; border: 1px solid var(--eh-line); box-shadow: 0 10px 30px rgba(16,40,30,.06); }
.auth-card h3 { font-weight: 800; }
.otp-input { font-size: 1.8rem; letter-spacing: .6rem; text-align: center; font-weight: 700; }

/* Print documents */
.print-body { background: #e9ece9; }
.print-toolbar { position: sticky; top: 0; padding: .6rem; text-align: center; background: #fff; border-bottom: 1px solid var(--eh-line); z-index: 5; display: flex; gap: .5rem; justify-content: center; }
.sheet { background: #fff; width: 210mm; min-height: 148mm; margin: 1rem auto; padding: 14mm; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.sheet.a5 { width: 148mm; }
.sheet.receipt { width: 88mm; padding: 6mm; font-size: 12px; }
.letterhead { display: flex; align-items: center; gap: 1rem; border-bottom: 3px double var(--eh-green); padding-bottom: .7rem; margin-bottom: .8rem; }
.lh-logo { width: 70px; height: 70px; object-fit: contain; }
.lh-mark { display: grid; place-items: center; background: var(--eh-green); color: var(--eh-gold); border-radius: 12px; font-size: 2rem; }
.lh-text h2 { margin: 0; font-size: 1.45rem; font-weight: 800; color: var(--eh-green); text-transform: uppercase; }
.lh-motto { font-style: italic; color: #555; font-size: .85rem; }
.lh-contact { font-size: .8rem; color: #444; }
.receipt .letterhead { flex-direction: column; text-align: center; gap: .3rem; }
.receipt .lh-logo { width: 46px; height: 46px; }
.receipt .lh-text h2 { font-size: 1rem; }
.doc-title { text-align: center; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin: .4rem 0 .9rem; color: #222; }
.sheet table { font-size: .82rem; }
.sheet .table > thead th { background: #eef3f0; color: #222; }
.sig-line { border-top: 1px solid #333; padding-top: .25rem; margin-top: 2.5rem; font-size: .8rem; text-align: center; }
.watermark-paid { position: absolute; right: 10mm; top: 40mm; transform: rotate(-18deg); border: 3px solid #198754; color: #198754; font-weight: 800; padding: .2rem .8rem; font-size: 1.4rem; opacity: .6; border-radius: 6px; }
.page-break { page-break-after: always; }

@media print {
  @page { size: A4; margin: 8mm; }
  body, .print-body { background: #fff !important; }
  .sidebar, .topbar, .app-footer, .no-print { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; }
  .sheet { box-shadow: none; margin: 0 auto; width: auto; min-height: 0; padding: 0; }
  .sheet.receipt { width: 80mm; }
  .card { border: 0; box-shadow: none; }
  a { text-decoration: none; color: inherit; }
}
.list-group-item.active { background-color: var(--eh-green); border-color: var(--eh-green); color: #fff; }
.list-group-item.active .text-muted, .list-group-item.active small { color: rgba(255,255,255,.8) !important; }
.min-w-0 { min-width: 0; }

/* Parent portal */
.parent-body { background: var(--eh-bg); }
.parent-nav { background: var(--eh-green); }
.parent-nav .navbar-brand, .parent-nav .navbar-brand small { color: #fff; }
.parent-nav .navbar-brand small { color: #a9c9bb; font-size: .72rem; }
.parent-nav .nav-link { color: #d7e8e0; font-weight: 500; }
.parent-nav .nav-link:hover { color: #fff; }
.parent-nav .navbar-toggler { border: 0; }
.ward-card { transition: box-shadow .15s; }
.ward-card:hover { box-shadow: 0 6px 18px rgba(16,40,30,.08); }
.ward-card .avatar.lg { width: 72px; height: 72px; font-size: 1.5rem; }

/* ---- Privacy Policy & Terms (v1.7) ---- */
.legal-links a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.legal-body { background: var(--eh-bg, #f4f7f5); min-height: 100vh; }
.legal-top { background: var(--eh-green); padding: .8rem 0; }
.legal-top .brand-mark { width: 34px; height: 34px; }
.legal-wrap { max-width: 880px; }
.legal-doc { line-height: 1.65; color: #24312b; }
.legal-doc h1 { font-weight: 800; font-size: 1.9rem; color: var(--eh-green); margin-bottom: .25rem; }
.legal-doc h3 { font-size: 1.15rem; font-weight: 700; color: var(--eh-green); margin: 1.6rem 0 .5rem; }
.legal-doc h4 { font-size: 1rem; font-weight: 700; margin: 1.1rem 0 .4rem; }
.legal-doc ul { padding-left: 1.2rem; }
.legal-doc li { margin-bottom: .3rem; }
.legal-meta { color: #6b7a72; font-size: .9rem; border-bottom: 1px solid var(--eh-line, #e3e9e5); padding-bottom: 1rem; margin-bottom: 1.2rem; }
.legal-scroll { max-height: 360px; overflow-y: auto; background: #fbfcfb; }
.legal-scroll .legal-doc h3:first-child { margin-top: 0; }
@media print {
  .legal-body { background: #fff; }
  .legal-doc.card { border: 0; box-shadow: none; }
  .legal-doc .card-body { padding: 0 !important; }
}

/* ---- Demo school & sign-up (v1.8) ---- */
.auth-card.wide { max-width: 560px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.demo-banner { background: var(--eh-gold-soft); border-bottom: 1px solid #f2dfae; color: #6b4b00; padding: .55rem 1rem; font-size: .9rem; text-align: center; }
.demo-banner a:not(.btn) { color: #6b4b00; font-weight: 600; }
.demo-role { display: flex; gap: .9rem; align-items: flex-start; text-align: left; width: 100%; border: 1px solid var(--eh-line); border-radius: 14px; background: #fff; padding: 1rem; transition: border-color .15s, box-shadow .15s; }
.demo-role:hover, .demo-role:focus-visible { border-color: var(--eh-green-2); box-shadow: 0 6px 18px rgba(16,40,30,.08); }
.demo-role .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--eh-green-soft); color: var(--eh-green); display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.demo-role b { color: var(--eh-ink); display: block; }
.demo-role small { color: var(--eh-muted); }
.auth-alt { border-top: 1px solid var(--eh-line); margin-top: 1.5rem; padding-top: 1.2rem; }

/* ---- School calendar (v1.9) ---- */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head > div { padding: .55rem .6rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--eh-muted); border-bottom: 1px solid var(--eh-line); }
.cal-day { min-height: 118px; padding: .35rem; border-right: 1px solid var(--eh-line); border-bottom: 1px solid var(--eh-line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.rest { background: #fafbf9; }
.cal-day.out { background: #f6f7f5; }
.cal-day.out .cal-num, .cal-day.out .cal-chip { opacity: .55; }
.cal-num { font-size: .82rem; font-weight: 700; color: var(--eh-ink); }
.cal-num a { color: inherit; text-decoration: none; display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; }
.cal-num a:hover { background: var(--eh-green-soft); }
.cal-day.today .cal-num a, .cal-day.today .cal-num { color: #fff; }
.cal-day.today .cal-num a, .cal-day.today .cal-num:not(:has(a)) { background: var(--eh-green); border-radius: 50%; display: inline-grid; place-items: center; width: 26px; height: 26px; }
.cal-chip { display: block; font-size: .74rem; line-height: 1.3; padding: 2px 6px; border-radius: 6px; color: #fff; background: var(--c); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip:hover { color: #fff; filter: brightness(1.08); }
.cal-chip.auto { background: color-mix(in srgb, var(--c) 14%, #fff); color: color-mix(in srgb, var(--c) 80%, #000); border: 1px solid color-mix(in srgb, var(--c) 30%, #fff); }
.cal-more { font-size: .72rem; color: var(--eh-muted); padding-left: 4px; }
.cal-date { width: 46px; flex-shrink: 0; text-align: center; border-radius: 10px; padding: .3rem 0; background: color-mix(in srgb, var(--c) 12%, #fff); color: color-mix(in srgb, var(--c) 85%, #000); line-height: 1.05; }
.cal-date b { display: block; font-size: 1.15rem; }
.cal-date span { font-size: .68rem; text-transform: uppercase; font-weight: 700; }
.cal-filter input { position: absolute; opacity: 0; pointer-events: none; }
.cal-filter span { display: inline-flex; gap: .3rem; align-items: center; border: 1px solid var(--eh-line); border-radius: 999px; padding: .2rem .65rem; cursor: pointer; color: var(--eh-muted); }
.cal-filter input:checked + span { border-color: var(--c); color: color-mix(in srgb, var(--c) 85%, #000); background: color-mix(in srgb, var(--c) 9%, #fff); }
.cal-filter input:focus-visible + span { outline: 2px solid var(--eh-green-2); outline-offset: 2px; }
.cal-filter i { color: var(--c); }
.min-w-0 { min-width: 0; }
.cal-print-month { font-size: 1rem; font-weight: 800; color: var(--eh-green); margin: 1rem 0 .3rem; }
.cal-print td { vertical-align: top; }

/* ---- v2.0: timetable ---- */
.tt-grid { table-layout: fixed; min-width: 860px; }
.tt-grid th, .tt-grid td { border: 1px solid var(--eh-line); text-align: center; vertical-align: middle; padding: .4rem; }
.tt-grid thead th { background: #f6f8f6; font-size: .78rem; }
.tt-grid thead th small { display: block; color: var(--eh-muted); font-weight: 500; }
.tt-grid .tt-day { width: 92px; text-align: left; background: #f6f8f6; font-size: .82rem; }
.tt-grid .tt-break { width: 42px; background: repeating-linear-gradient(45deg, #f4f1e8, #f4f1e8 6px, #faf8f2 6px, #faf8f2 12px); color: #8a6d1f; font-size: .72rem; font-weight: 700; }
.tt-grid td.tt-break span { writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .08em; text-transform: uppercase; }
.tt-grid thead .tt-break div, .tt-grid thead .tt-break small { writing-mode: vertical-rl; transform: rotate(180deg); margin: auto; }
.tt-cell { background: hsl(var(--h) 55% 95%); }
.tt-cell b { display: block; font-size: .8rem; color: hsl(var(--h) 45% 25%); line-height: 1.2; }
.tt-cell small { display: block; font-size: .7rem; color: hsl(var(--h) 20% 35%); margin-top: 2px; }
.tt-edit td { padding: .25rem; }
.tt-edit .form-select-sm { font-size: .74rem; padding: .2rem 1.4rem .2rem .4rem; }
.tt-edit .tt-teacher { color: var(--eh-muted); }
.tt-clash { background: #fde8e8 !important; box-shadow: inset 0 0 0 2px #dc2626; }
@media print { .tt-grid { min-width: 0; font-size: 10px; } .tt-cell { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.payslip { min-height: auto; page-break-after: always; }
.payslip .table { font-size: .8rem; }
@media print { .payslip { box-shadow: none; margin: 0 auto 8mm; } }
.active-soft { background: var(--eh-green-soft) !important; }

/* ---- v2.0: lesson notes ---- */
.ln-head th { width: 19%; background: #f6f8f6; font-size: .8rem; font-weight: 600; }
.ln-head td { font-size: .86rem; }
.ln-head ul { padding-left: 1.1rem; }
.ln-lesson { font-size: 1rem; font-weight: 800; color: var(--eh-green); margin: 1.2rem 0 .5rem; }
.ln-lesson small { font-weight: 500; color: var(--eh-muted); }
.ln-phases th { background: #f6f8f6; font-size: .8rem; vertical-align: top; }
.ln-phases td { font-size: .86rem; }
.ln-pre { white-space: pre-line; }
.ln-assess { margin-top: .6rem; padding-top: .5rem; border-top: 1px dashed var(--eh-line); }
.ln-sheet { font-size: .85rem; }
@media print { .ln-sheet { width: auto; padding: 8mm; } .ln-head th, .ln-phases th { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---------- v2.1: ID cards ---------- */
.idcard-sheet { width: 194mm; margin: 0 auto 1rem; display: grid; grid-template-columns: repeat(2, 85.6mm); gap: 6mm 10mm; justify-content: center; }
.idcard { --card: #0f4c3a; width: 85.6mm; height: 54mm; border-radius: 3mm; background: #fff; border: .2mm solid #cfd6d2; overflow: hidden; display: flex; flex-direction: column;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif; color: #1d2939; break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.idc-head { background: var(--card); color: #fff; display: flex; align-items: center; gap: 2mm; padding: 1.6mm 2.5mm; min-height: 11mm; }
.idc-head img { width: 8mm; height: 8mm; object-fit: contain; background: #fff; border-radius: 1.5mm; padding: .5mm; }
.idc-head b { display: block; font-size: 2.9mm; line-height: 1.15; }
.idc-head small { display: block; font-size: 1.9mm; opacity: .85; font-style: italic; }
.idc-body { flex: 1; display: flex; gap: 2.4mm; padding: 2mm 2.5mm 1mm; align-items: center; }
.idc-photo { width: 19mm; height: 23mm; border-radius: 1.5mm; background: #eef3f0; overflow: hidden; display: grid; place-items: center; flex-shrink: 0; border: .3mm solid var(--card); }
.idc-photo img { width: 100%; height: 100%; object-fit: cover; }
.idc-photo span { font-weight: 800; font-size: 6mm; color: var(--card); }
.idc-info { flex: 1; min-width: 0; font-size: 2.3mm; line-height: 1.35; }
.idc-role { display: inline-block; background: var(--card); color: #fff; font-weight: 700; font-size: 1.8mm; letter-spacing: .4mm; padding: .2mm 1.4mm; border-radius: 1mm; margin-bottom: .6mm; }
.idc-name { font-weight: 800; font-size: 3mm; line-height: 1.15; margin-bottom: .8mm; overflow-wrap: anywhere; }
.idc-row span { color: #667085; display: inline-block; min-width: 10.5mm; }
.idc-qr { width: 21mm; height: 21mm; flex-shrink: 0; }
.idc-qr svg { width: 100%; height: 100%; display: block; }
.idc-foot { font-size: 1.7mm; text-align: center; color: #fff; background: var(--card); padding: .7mm 2mm; }
@media print { .idcard-sheet { width: auto; gap: 4mm 8mm; } }

/* ---------- v2.1: QR scanner ---------- */
.scan-wrap { max-width: 980px; margin: 0 auto; }
.scan-video { position: relative; background: #101828; border-radius: 1rem; overflow: hidden; aspect-ratio: 4 / 3; }
.scan-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-video .scan-frame { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.85); border-radius: 1rem; box-shadow: 0 0 0 9999px rgba(0,0,0,.25); pointer-events: none; }
.scan-video .scan-hint { position: absolute; left: 0; right: 0; bottom: .6rem; text-align: center; color: #fff; font-size: .85rem; text-shadow: 0 1px 2px #000; }
.scan-result { border-radius: 1rem; padding: 1rem; display: flex; gap: 1rem; align-items: center; min-height: 104px; border: 2px solid transparent; transition: background .2s; }
.scan-result.success { background: #ecfdf3; border-color: #12b76a; }
.scan-result.warning { background: #fffaeb; border-color: #f79009; }
.scan-result.danger { background: #fef3f2; border-color: #f04438; }
.scan-result .avatar { width: 72px; height: 72px; font-size: 1.4rem; flex-shrink: 0; }
.scan-result .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.scan-result .sr-title { font-weight: 800; font-size: 1.25rem; }
.scan-log { max-height: 320px; overflow: auto; }
