:root {
    --primary: #103f8a;
    --secondary: #fecb0a;
    --bg: #eef4ff;
    --surface: #ffffff;
    --text: #111827;
    --muted: #64748b;
    --border: #d7e1ef;
    --shadow: 0 18px 45px rgba(16, 63, 138, 0.08);
    --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.06);
    --radius: 18px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #d9e4ff;
    border-radius: 14px;
    background: #f8fbff;
    color: #16325c;
    font-weight: 600;
}

.checkbox-card input {
    width: 18px;
    height: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
    margin: 0;
    font-family: Inter, system-ui, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(254,203,10,.18), transparent 24%),
        radial-gradient(circle at top right, rgba(16,63,138,.12), transparent 20%),
        linear-gradient(180deg, #f9fbff 0%, var(--bg) 100%);
}

a { color: var(--primary); text-decoration: none; transition: .2s ease; }
a:hover { opacity: .95; }
button { cursor: pointer; font: inherit; }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 80;
    width: 282px;
    height: 100vh;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    background: linear-gradient(180deg, #0d3471 0%, #103f8a 100%);
    color: #fff;
}

.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.brand-guest { margin: 0; }
.brand-mark {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    font-weight: 800;
    text-transform: uppercase;
    background: linear-gradient(135deg, #fecb0a 0%, #fff2b8 100%);
    color: #111827;
}

.brand-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 16px;
    background: rgba(255,255,255,.12);
    padding: 6px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}

.brand strong { display: block; line-height: 1.2; }
.brand span { display: block; margin-top: 4px; color: rgba(255,255,255,.84); font-size: .9rem; }

.sidebar-note {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.08);
}

.sidebar-note strong { display: block; margin-bottom: 5px; font-size: .95rem; }
.sidebar-note span { color: rgba(255,255,255,.8); font-size: .88rem; line-height: 1.5; }

.nav-links { display: grid; gap: 8px; }
.nav-links-footer { margin-top: auto; position: sticky; bottom: 0; padding-top: 8px; background: linear-gradient(180deg, rgba(16,63,138,0) 0%, rgba(16,63,138,.95) 26%); }
.nav-links a {
    color: rgba(255,255,255,.96);
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.06);
    background: rgba(255,255,255,.1);
    font-weight: 700;
}

.nav-links a:hover { transform: translateX(2px); background: rgba(255,255,255,.16); }
.nav-links a.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(254,203,10,.28) 0%, rgba(255,255,255,.2) 100%);
    border-color: rgba(255,255,255,.18);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

.main-content {
    min-width: 0;
    margin-left: 282px;
    padding: 28px 28px 108px;
}

.main-content.guest-content { margin-left: 0; }
.guest-content { max-width: 1100px; margin: 0 auto; }
.page-frame { width: min(1360px, 100%); margin: 0 auto; }

.topbar, .guest-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    margin-bottom: 24px;
}

.mobile-topbar,
.mobile-drawer,
.mobile-drawer-overlay { display: none; }

.eyebrow {
    margin: 0 0 6px;
    color: var(--primary);
    font-size: .8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.topbar h1 { margin: 0; font-size: clamp(1.8rem, 2.5vw, 2.5rem); }
.topbar-subtitle { margin: 8px 0 0; color: var(--muted); max-width: 720px; line-height: 1.6; }
.topbar-meta { display: flex; align-items: center; gap: 12px; }
.topbar-logo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    object-fit: contain;
    background: #fff;
    padding: 4px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.topbar-chip {
    padding: 12px 15px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    font-weight: 700;
}

.card {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary) 0%, rgba(254,203,10,.65) 100%);
    opacity: .95;
}

.narrow { max-width: 920px; margin: 24px auto; }
.section-head { margin-bottom: 16px; }
.section-head h2, .section-head h3 { margin: 0 0 6px; }
.section-head p { margin: 0; color: var(--muted); }
.row-between { display: flex; justify-content: space-between; gap: 16px; align-items: start; }

.stats-grid,
.two-column,
.three-column,
.form-grid,
.check-grid,
.id-grid {
    display: grid;
    gap: 16px;
}

.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; }
.stats-grid.compact { margin-top: 0; }
.two-column { grid-template-columns: 1fr 1fr; }
.three-column { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.id-grid {
    grid-template-columns: repeat(3, 54mm);
    justify-content: center;
    gap: 8mm;
}

.stat-card { background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%); }
.stat-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.stat-card h3 { margin: 8px 0 0; color: var(--primary); font-size: 1.8rem; line-height: 1.15; }
.stat-card-kpi { padding-top: 18px; }
.stat-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(16,63,138,.12) 0%, rgba(254,203,10,.22) 100%);
    color: var(--primary);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
}

.field { display: grid; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field.action-fit { align-content: end; }
.field label { font-weight: 700; font-size: .92rem; }
.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    font: inherit;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search-row input:focus,
.search-row select:focus {
    outline: none;
    border-color: rgba(16,63,138,.45);
    box-shadow: 0 0 0 4px rgba(16,63,138,.09);
}

.field input[type="checkbox"] { width: auto; }
.field textarea { min-height: 88px; resize: vertical; }
.section-stack { display: grid; gap: 18px; }
.action-row, .search-row, .action-inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.search-row { margin-bottom: 16px; }
.search-row input, .search-row select {
    flex: 1;
    min-width: 180px;
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.button,
.action-inline button {
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 700;
    box-shadow: var(--shadow-soft);
    transition: transform .2s ease, box-shadow .2s ease;
}

.button:hover,
.action-inline button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(15,23,42,.08);
}

.button-primary { background: var(--primary); color: #fff; }
.button-secondary,
.action-inline button { background: #eff4fc; color: var(--text); }

.flash {
    padding: 14px 16px;
    margin-bottom: 16px;
    border-radius: 14px;
    font-weight: 700;
}

.flash-success { background: #ecfdf3; color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }

.empty-state {
    padding: 26px 18px;
    border: 1px dashed var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, #fbfdff 0%, #f6faff 100%);
    color: var(--muted);
    text-align: center;
    font-weight: 600;
}

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
thead th { position: sticky; top: 0; z-index: 1; background: #fbfdff; }
th { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover td { background: rgba(16,63,138,.02); }
.desktop-only { display: block; }
.mobile-only { display: none; }

.simple-list { margin: 0; padding-left: 18px; }
.status-pill { display: inline-flex; align-items: center; padding: 7px 10px; border-radius: 999px; font-size: .82rem; font-weight: 800; }
.status-active, .status-present { background: #ecfdf3; color: #166534; }
.status-inactive, .status-absent { background: #fff1f2; color: #be123c; }
.status-late { background: #fff7ed; color: #c2410c; }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.detail-item { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: #f8fbff; }
.detail-item span { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.detail-item strong { font-size: 1rem; line-height: 1.45; }
.detail-item-full { grid-column: 1 / -1; }

.check-item,
.check-box {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8fbff;
}

.check-item.ok span { color: #166534; font-weight: 700; }
.check-item.warn span { color: #92400e; font-weight: 700; }
.check-box { display: block; }

.id-card {
    width: 54mm;
    height: 86mm;
    min-width: 54mm;
    max-width: 54mm;
    min-height: 86mm;
    max-height: 86mm;
    position: relative;
    overflow: hidden;
    border-radius: 4mm;
    box-sizing: border-box;
    border: .28mm solid #d3deef;
    background-color: #ffffff;
    background-image:
        var(--id-card-bg-image),
        radial-gradient(circle at top right, rgba(254,203,10,.10), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    background-size: cover, auto, auto;
    background-position: center, top right, center;
    background-repeat: no-repeat, no-repeat, no-repeat;
    box-shadow: none;
}

.id-card-wrapper {
    overflow: visible;
    background: transparent;
    border: none;
}

.id-card-overlay {
    position: absolute;
    inset: 0;
}

.id-card header { margin: 0; color: var(--primary); font-size: .72rem; font-weight: 800; }
.id-card-header {
    position: absolute;
    left: 4.4mm;
    right: 4mm;
    top: 4mm;
    height: 18.5mm;
    display: grid;
    grid-template-columns: 18.5mm 1fr;
    gap: 3.2mm;
    align-items: start;
}

.logo-box {
    overflow: hidden;
    border-radius: 4mm;
    z-index: 2;
    position: relative;
    z-index: 5;
    background: #ffffff;
}

.id-card-brandmark {
    width: 18.5mm;
    height: 18.5mm;
    border: .35mm solid #c9d7eb;
    border-radius: 4mm;
    background: #fff;
    display: grid;
    place-items: center;
    padding: 1.4mm;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    transform: translateY(-2.6mm);
}

.id-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.id-card-brandcopy {
    display: grid;
    gap: .9mm;
    min-width: 0;
    padding-top: .5mm;
}

.id-card-brandcopy header {
    font-family: Poppins, Inter, system-ui, sans-serif;
    font-size: .7rem;
    line-height: .92;
    letter-spacing: -.01em;
    text-transform: uppercase;
    color: #103f8a;
    font-weight: 900;
}

.id-contact-line {
    display: flex;
    align-items: flex-start;
    gap: .9mm;
    color: #334155;
    font-size: .31rem;
    line-height: 1.15;
}

.id-contact-line span:last-child {
    min-width: 0;
    word-break: break-word;
}

.id-contact-icon {
    width: 1.2mm;
    height: 1.2mm;
    flex: 0 0 1.2mm;
    border-radius: 999px;
    color: #103f8a;
    background: #103f8a;
    margin-top: .7mm;
}

.id-card-divider {
    position: absolute;
    left: 24.8mm;
    right: 4mm;
    top: 25.8mm;
    height: .55mm;
    background: #103f8a;
    opacity: .92;
    z-index: 1;
}

.header-divider {
    margin-top: 2mm;
}

.id-card-body {
    position: absolute;
    left: 4.4mm;
    right: 4.6mm;
    top: 31.2mm;
    height: 28.8mm;
    display: grid;
    grid-template-columns: 22mm 1fr;
    gap: 3mm;
    align-items: center;
}

.student-photo-box {
    width: 22mm;
    height: 28mm;
    border: .55mm solid #103f8a;
    border-radius: 4mm;
    overflow: hidden;
    background: #eaf1ff;
}

.id-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.id-photo-fallback {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: #e7eefc;
    color: var(--primary);
    font-weight: 800;
}

.id-info-column {
    display: grid;
    gap: .9mm;
    align-content: center;
    padding-right: .9mm;
}

.id-info-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: .45mm;
    padding-bottom: .9mm;
    border-bottom: 1px solid #d9e5f7;
}

.id-detail-copy {
    display: grid;
    gap: .35mm;
    min-width: 0;
}

.id-info-row span {
    color: #64748b;
    font-size: .22rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.id-info-row strong {
    color: #103f8a;
    font-size: .48rem;
    line-height: 1.12;
    font-weight: 900;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.student-value {
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.15;
}

.branch-value {
    text-overflow: ellipsis;
}

.id-card-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 24mm;
    background: #103f8a;
    display: grid;
    grid-template-columns: 20mm 1fr;
    gap: 3.4mm;
    align-items: center;
    padding: 3mm 4mm 3.2mm;
    box-sizing: border-box;
}

.footer-section {
    display: grid;
    grid-template-columns: 23mm 1fr;
    align-items: center;
    gap: 4mm;
}

.id-bottom-qr {
    display: grid;
    justify-items: start;
}

.qr-box,
.id-qr-wrap {
    width: 20mm;
    height: 20mm;
    background: #ffffff;
    padding: 1.5mm;
    border-radius: 2mm;
    overflow: hidden;
    box-sizing: border-box;
    display: grid;
    place-items: center;
}

.qr-box img,
.id-qr {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.signature-box,
.id-bottom-sign {
    color: #ffffff;
    display: grid;
    gap: .8mm;
    align-content: center;
    overflow: hidden;
    padding-right: .4mm;
    justify-items: start;
}

.id-verify-title {
    color: #fecb0a;
    font-size: .34rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.id-verify-line {
    color: #ffffff;
    font-size: .26rem;
    line-height: 1.15;
    font-weight: 700;
    word-break: break-word;
}

.id-grid-single { grid-template-columns: 54mm; }
.id-grid-bulk,
.id-grid-a4 { grid-template-columns: repeat(3, 54mm); }
.id-card-single { border-radius: 4mm; }
.id-card-a4,
.id-card-bulk { border-radius: 4mm; }

@media (max-width: 640px) {
    .id-grid,
    .id-grid-bulk,
    .id-grid-a4 { grid-template-columns: 54mm; justify-content: center; }
}

.student-thumb { display: block; width: 88px; height: 88px; margin-top: 8px; border: 2px solid var(--border); border-radius: 18px; object-fit: cover; }
.logo-thumb { width: 84px; max-height: 84px; padding: 8px; border: 1px solid var(--border); border-radius: 16px; background: #fff; object-fit: contain; }
.profile-photo-wrap { margin-bottom: 16px; }
.profile-photo { width: 132px; height: 132px; border: 4px solid rgba(16,63,138,.08); border-radius: 24px; box-shadow: var(--shadow); object-fit: cover; }
.profile-photo-thumb { width: 96px; height: 96px; border-radius: 20px; }

.thumb-preview-card {
    display: inline-grid;
    gap: 8px;
    padding: 12px;
    border: 1px dashed var(--border);
    border-radius: 18px;
    background: #f8fbff;
    align-items: start;
    justify-items: start;
}

.thumb-preview-card span { color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.thumb-preview-card-profile { margin-bottom: 12px; }

.receipt-page-shell { width: min(100%, 794px); max-width: 794px; margin: 0 auto; }
.receipt-toolbar { display: flex; justify-content: flex-end; gap: 12px; margin: 0 0 18px; flex-wrap: wrap; }
.receipt-content-card {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 28px;
    border: 1px solid #dbe5f2;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 24px 50px rgba(15,23,42,.08);
}

.receipt-print-header {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) 230px;
    gap: 18px;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 2px solid #e6edf8;
}

.receipt-logo-box {
    width: 90px;
    height: 90px;
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
}

.receipt-logo {
    max-width: 76px;
    max-height: 76px;
    width: auto;
    height: auto;
    object-fit: contain;
    image-rendering: auto;
}

.receipt-logo-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(16,63,138,.95) 0%, rgba(38,92,181,.92) 100%);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
}

.receipt-brand-copy { min-width: 0; align-self: center; }
.receipt-institute-name {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 800;
    color: #103f8a;
    line-height: 1.1;
    white-space: nowrap;
}
.receipt-institute-name-tight { font-size: 23px; }
.receipt-brand-copy p { margin: 4px 0; color: var(--muted); line-height: 1.55; }

.receipt-title-block {
    display: grid;
    gap: 8px;
    justify-items: end;
    text-align: right;
}
.receipt-meta { min-width: 220px; }

.receipt-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(254,203,10,.22);
    color: #7c5a00;
    font-size: .82rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.receipt-title-block strong { font-size: 1rem; color: var(--text); }
.receipt-title-block span { color: var(--muted); font-size: .92rem; }

.receipt-info-grid,
.receipt-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.receipt-info-box,
.receipt-summary-box,
.receipt-words-box,
.receipt-footer-box,
.receipt-signature-box {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid #dbe5f2;
    border-radius: 18px;
    background: #fbfdff;
}

.receipt-info-box span,
.receipt-summary-box span,
.receipt-words-box span,
.receipt-footer-box span {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.receipt-info-box strong,
.receipt-summary-box strong,
.receipt-words-box strong { color: var(--text); font-size: 1rem; }

.receipt-summary-box strong { color: var(--primary); font-size: 1.2rem; }
.receipt-table-shell { margin-bottom: 18px; overflow: hidden; border: 1px solid #dbe5f2; border-radius: 18px; }
.receipt-print-table { width: 100%; border-collapse: collapse; }
.receipt-print-table th,
.receipt-print-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #e6edf8;
    text-align: left;
    vertical-align: top;
}

.receipt-print-table thead th {
    background: #f8fbff;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.receipt-print-table tbody tr:last-child td { border-bottom: 0; }
.receipt-words-box { margin-bottom: 18px; }
.receipt-footer-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 16px; align-items: stretch; }
.receipt-footer-box p { margin: 0; color: var(--text); line-height: 1.65; }
.receipt-generated-note { margin-top: 10px !important; color: var(--muted) !important; font-size: .9rem; font-weight: 700; }

.receipt-signature-box {
    align-content: end;
    justify-items: center;
    text-align: center;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.signature-space {
    width: 100%;
    height: 72px;
    border-bottom: 2px solid #94a3b8;
    margin-bottom: 10px;
}

.receipt-signature-box strong { color: var(--text); }
.receipt-signature-box span { color: var(--muted); font-size: .86rem; }

body.print-layout-page {
    background: #eef4ff;
}

body.print-layout-page .print-shell {
    min-height: 100vh;
    padding: 18px 16px 28px;
}

body.print-layout-page .receipt-page-shell {
    max-width: 920px;
    margin: 0 auto;
    background: transparent;
}

body.print-layout-page .receipt-toolbar {
    margin-bottom: 14px;
}

body.print-layout-page .receipt-content-card {
    max-width: 820px;
    padding: 20px;
    border-radius: 22px;
    box-shadow: 0 16px 36px rgba(15,23,42,.07);
}

body.print-layout-page .receipt-print-header {
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 12px;
}

body.print-layout-page .receipt-brand-block {
    gap: 12px;
}

body.print-layout-page .receipt-logo {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
    padding: 6px;
    border-radius: 16px;
}

body.print-layout-page .receipt-brand-copy h1 {
    font-size: 1.45rem;
    margin-bottom: 6px;
}

body.print-layout-page .receipt-brand-copy p,
body.print-layout-page .receipt-title-block span,
body.print-layout-page .receipt-generated-note,
body.print-layout-page .receipt-signature-box span {
    font-size: .82rem;
}

body.print-layout-page .receipt-title-block {
    gap: 6px;
}

body.print-layout-page .receipt-info-grid,
body.print-layout-page .receipt-summary-grid {
    gap: 10px;
    margin-bottom: 12px;
}

body.print-layout-page .receipt-info-box,
body.print-layout-page .receipt-summary-box,
body.print-layout-page .receipt-words-box,
body.print-layout-page .receipt-footer-box,
body.print-layout-page .receipt-signature-box {
    gap: 4px;
    padding: 10px 12px;
}

body.print-layout-page .receipt-summary-box strong {
    font-size: 1.1rem;
}

body.print-layout-page .receipt-table-shell,
body.print-layout-page .receipt-words-box {
    margin-bottom: 12px;
}

body.print-layout-page .receipt-print-table th,
body.print-layout-page .receipt-print-table td {
    padding: 10px 8px;
    font-size: 12px;
}

body.print-layout-page .receipt-footer-grid {
    gap: 12px;
}

body.print-layout-page .receipt-footer-box p {
    line-height: 1.5;
}

body.print-layout-page .signature-space {
    height: 48px;
    margin-bottom: 8px;
}

.notice-list { display: grid; gap: 10px; }
.notice-card {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}

.notice-card strong { display: block; margin-bottom: 6px; }
.notice-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.notice-badge { padding: 6px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.notice-card-warning .notice-badge { background: #fff7ed; color: #c2410c; }
.notice-card-success .notice-badge { background: #ecfdf3; color: #166534; }
.notice-card-danger .notice-badge { background: #fff1f2; color: #be123c; }
.notice-card-info .notice-badge { background: #eff6ff; color: #1d4ed8; }
.notice-action { font-size: .88rem; font-weight: 800; }

.auth-hero,
.install-hero {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 18px;
    max-width: 1180px;
    margin: 0 auto 18px;
    padding: 0 12px;
}

.auth-hero h2, .install-hero h2 { margin: 0 0 8px; font-size: clamp(1.8rem, 3vw, 2.8rem); }
.auth-copy, .install-copy { max-width: 760px; margin: 0; color: var(--muted); }
.auth-badges, .install-hero-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.auth-badges span, .install-hero-meta span, .optional-tag {
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(16,63,138,.08);
    color: var(--primary);
    font-weight: 700;
}

.auth-card { margin-top: 0; }
.helper-line { color: var(--muted); font-size: .9rem; }
.install-layout {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 18px;
    align-items: start;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 12px 24px;
}

.install-main, .install-side { padding: 24px; }
.install-section { padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(180deg, #fff 0%, #fbfdff 100%); }
.install-note { margin-top: 18px; padding: 16px; border: 1px solid #fde68a; border-radius: 16px; background: #fff9e6; }
.install-note strong { display: block; margin-bottom: 6px; }
.install-note p { margin: 0; color: #7c5a00; }
.check-grid.single { grid-template-columns: 1fr; }
.remember-row { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .95rem; }
.remember-row input { width: auto; }

.success-card { text-align: center; }
.success-icon {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(180deg, #ecfdf3 0%, #dcfce7 100%);
    color: #166534;
    font-weight: 800;
}

.success-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0; text-align: left; }
.success-item { padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: #f8fbff; }
.success-item strong { display: block; margin-bottom: 6px; }
.success-checklist { display: grid; gap: 10px; margin-top: 18px; text-align: left; }
.success-check { padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: #f8fbff; color: var(--text); font-weight: 600; }
.redirect-note { margin-top: 12px; color: var(--muted); }

.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quick-tile {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 88px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    font-weight: 700;
}

.quick-tile::after {
    content: "";
    position: absolute;
    inset: auto -12px -12px auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(254,203,10,.22);
}

.quick-tile:hover { transform: translateY(-2px); }
.quick-tile-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(16,63,138,.12) 0%, rgba(254,203,10,.2) 100%);
    color: var(--primary);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .06em;
}

.quick-tile-body { display: grid; gap: 4px; min-width: 0; }
.quick-tile-body strong { color: var(--text); }
.quick-tile-body small { color: var(--muted); font-size: .82rem; line-height: 1.4; }

.graph-stack { display: grid; gap: 14px; }
.graph-row { display: grid; grid-template-columns: 160px 1fr 70px; gap: 14px; align-items: center; }
.graph-bar { height: 12px; border-radius: 999px; background: #eef3fb; overflow: hidden; }
.graph-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%); }

.qr-scanner-card { display: grid; gap: 12px; padding: 14px; border: 1px dashed var(--border); border-radius: 18px; background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%); }
.qr-scanner-head { display: grid; gap: 4px; }
.qr-video-shell { position: relative; overflow: hidden; display: grid; place-items: center; min-height: 240px; border-radius: 18px; background: #0f172a; }
.qr-video { display: block; width: 100%; min-height: 240px; max-height: 320px; object-fit: cover; }
.qr-scan-frame {
    position: absolute;
    inset: 50% auto auto 50%;
    width: min(60vw, 190px);
    height: min(60vw, 190px);
    transform: translate(-50%, -50%);
    border: 4px solid rgba(254,203,10,.95);
    border-radius: 18px;
    box-shadow: 0 0 0 999px rgba(0,0,0,.18);
}

.onboarding-card { margin-bottom: 20px; background: linear-gradient(135deg, rgba(16,63,138,.96) 0%, rgba(28,85,178,.96) 58%, rgba(18,53,113,.98) 100%); color: #fff; }
.onboarding-card::before { opacity: .55; }
.onboarding-card .eyebrow,
.onboarding-card .section-head p,
.onboarding-card h2 { color: #fff; }
.onboarding-badge { padding: 10px 14px; border-radius: 999px; background: rgba(254,203,10,.16); color: #fff2b8; font-weight: 800; }
.onboarding-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.onboarding-step { display: grid; gap: 8px; padding: 16px; border: 1px solid rgba(255,255,255,.12); border-radius: 18px; background: rgba(255,255,255,.08); }
.onboarding-step strong { font-size: 1rem; }
.onboarding-step span { color: rgba(255,255,255,.78); line-height: 1.5; }
.onboarding-step a { color: #fff; font-weight: 700; }

.mobile-card-stack { display: grid; gap: 12px; }
.mobile-data-card {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
    box-shadow: var(--shadow-soft);
}

.mobile-data-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 8px; }
.mobile-data-head strong { color: var(--text); }
.mobile-data-head span { color: var(--primary); font-size: .88rem; font-weight: 800; }
.mobile-data-meta { display: grid; gap: 4px; color: var(--muted); font-size: .88rem; }

.mobile-nav { display: none; }
.mobile-profile-chip {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #fff;
    color: var(--primary);
    font-weight: 800;
    box-shadow: var(--shadow-soft);
}

.pagination-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.pagination-pages {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font-weight: 700;
    box-shadow: var(--shadow-soft);
}

.pagination-link.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination-link.disabled {
    opacity: .5;
    pointer-events: none;
}

@media (min-width: 768px) {
    .desktop-student-table {
        display: block !important;
    }

    .mobile-student-cards {
        display: none !important;
    }
}

@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 16px 16px 102px; }
    .page-frame { width: 100%; }
    .topbar { display: none; }

    .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 70;
        margin-bottom: 18px;
        padding: 10px 0 14px;
        background: linear-gradient(180deg, rgba(238,244,255,.98) 0%, rgba(238,244,255,.88) 100%);
        backdrop-filter: blur(10px);
    }

    .mobile-topbar-title { display: grid; gap: 2px; min-width: 0; }
    .mobile-topbar-title strong { font-size: 1rem; color: var(--text); }
    .mobile-topbar-title span {
        max-width: 180px;
        color: var(--muted);
        font-size: .8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-menu-button {
        width: 42px;
        height: 42px;
        display: grid;
        align-content: center;
        justify-items: center;
        gap: 4px;
        border: 0;
        border-radius: 14px;
        background: #fff;
        box-shadow: var(--shadow-soft);
    }

    .mobile-menu-button span {
        display: block;
        width: 18px;
        height: 2px;
        border-radius: 999px;
        background: var(--primary);
    }

    .mobile-drawer-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 90;
        background: rgba(15, 23, 42, .42);
        opacity: 0;
        pointer-events: none;
        transition: opacity .24s ease;
    }

    .mobile-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 100;
        width: min(320px, 88vw);
        padding: 22px 18px 18px;
        overflow-y: auto;
        background: linear-gradient(180deg, #0d3471 0%, #103f8a 100%);
        color: #fff;
        transform: translateX(-104%);
        transition: transform .24s ease;
    }

    .mobile-drawer-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; margin-bottom: 16px; }
    .mobile-drawer-links { margin-bottom: 16px; }

    .drawer-close {
        padding: 10px 12px;
        border: 0;
        border-radius: 12px;
        background: rgba(255,255,255,.14);
        color: #fff;
        font-weight: 700;
    }

    body.drawer-open .mobile-drawer { transform: translateX(0); }
    body.drawer-open .mobile-drawer-overlay { opacity: 1; pointer-events: auto; }

    .stats-grid,
    .two-column,
    .three-column,
    .form-grid,
    .check-grid,
    .id-grid,
    .detail-grid,
    .success-grid,
    .quick-grid,
    .graph-row,
    .onboarding-grid {
        grid-template-columns: 1fr;
    }

    .receipt-print-header,
    .auth-hero,
    .install-hero,
    .install-layout,
    .guest-header {
        display: grid;
        grid-template-columns: 1fr;
    }

    .receipt-info-grid,
    .receipt-summary-grid,
    .receipt-footer-grid {
        grid-template-columns: 1fr;
    }

    .receipt-title-block {
        justify-items: start;
        text-align: left;
    }

    .receipt-brand-block {
        flex-direction: column;
    }

    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }
    .desktop-student-table { display: none !important; }
    .mobile-student-cards { display: grid !important; }

    .mobile-nav {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        z-index: 1200;
        padding: 10px;
        border-radius: 22px;
        background: rgba(255,255,255,.96);
        border: 1px solid rgba(215,225,239,.9);
        box-shadow: 0 18px 40px rgba(15,23,42,.14);
        backdrop-filter: blur(10px);
    }

    .mobile-nav a {
        text-align: center;
        padding: 10px 8px;
        border-radius: 16px;
        color: var(--muted);
        font-size: .78rem;
        font-weight: 800;
        line-height: 1.2;
    }

    .mobile-nav a.active {
        background: linear-gradient(180deg, rgba(16,63,138,.92) 0%, rgba(16,63,138,.86) 100%);
        color: #fff;
    }

    .pagination-nav {
        justify-content: center;
    }

    .qr-video { max-height: 260px; }

    .id-grid,
    .id-grid-bulk,
    .id-grid-a4,
    .id-grid-single {
        grid-template-columns: 54mm;
        justify-content: center;
    }
}

@media print {
    @page {
        size: A4;
        margin: 10mm;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body * {
        visibility: hidden !important;
    }

    .receipt-print-area,
    .receipt-print-area *,
    .id-print-area,
    .id-print-area * {
        visibility: visible !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .receipt-print-area {
        position: static !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        max-width: 794px !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    .id-print-area {
        position: static !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        box-shadow: none !important;
    }

    .id-grid,
    .id-grid-single,
    .id-grid-bulk,
    .id-grid-a4 {
        grid-template-columns: repeat(3, 54mm) !important;
        justify-content: center !important;
        gap: 5mm !important;
    }

    .id-card {
        width: 54mm !important;
        height: 86mm !important;
        min-width: 54mm !important;
        max-width: 54mm !important;
        min-height: 86mm !important;
        max-height: 86mm !important;
        overflow: hidden !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        box-shadow: none !important;
    }

    .receipt-content-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 28px !important;
        border: 1px solid #dbe5f2 !important;
        border-radius: 24px !important;
        background: #fff !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    .no-print,
    .receipt-actions,
    .top-actions,
    .receipt-toolbar,
    .button,
    button,
    a.back-button,
    .sidebar,
    .topbar,
    .mobile-topbar,
    .mobile-nav,
    .mobile-drawer,
    .mobile-drawer-overlay,
    .build-stamp,
    .flash {
        display: none !important;
        visibility: hidden !important;
    }

    body.print-layout-page * {
        visibility: visible !important;
    }

    body.print-layout-page .print-shell {
        padding: 0 !important;
    }

    body.print-layout-page .receipt-page-shell {
        max-width: 794px !important;
        margin: 0 auto !important;
        background: #fff !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    body.print-layout-page .receipt-print-area {
        position: static !important;
        width: 100% !important;
        max-width: 794px !important;
        margin: 0 auto !important;
        padding: 0 !important;
        background: #fff !important;
    }

    body.print-layout-page .receipt-content-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 28px !important;
        border: 1px solid #dbe5f2 !important;
        border-radius: 24px !important;
        background: #fff !important;
        box-shadow: 0 24px 50px rgba(15,23,42,.08) !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    body.print-layout-page .receipt-print-header {
        margin-bottom: 16px !important;
        padding-bottom: 12px !important;
    }

    body.print-layout-page .receipt-info-grid,
    body.print-layout-page .receipt-summary-grid {
        gap: 10px !important;
        margin-bottom: 12px !important;
    }

    body.print-layout-page .receipt-info-box,
    body.print-layout-page .receipt-summary-box,
    body.print-layout-page .receipt-words-box,
    body.print-layout-page .receipt-footer-box,
    body.print-layout-page .receipt-signature-box {
        padding: 10px 12px !important;
        gap: 4px !important;
    }

    body.print-layout-page .receipt-table-shell,
    body.print-layout-page .receipt-words-box {
        margin-bottom: 12px !important;
    }

    body.print-layout-page .receipt-print-table th,
    body.print-layout-page .receipt-print-table td {
        padding: 10px 8px !important;
        font-size: 12px !important;
    }

    body.print-layout-page .receipt-brand-copy h1 {
        font-size: 1.45rem !important;
        margin-bottom: 6px !important;
    }

    body.print-layout-page .receipt-brand-copy p,
    body.print-layout-page .receipt-title-block span,
    body.print-layout-page .receipt-generated-note,
    body.print-layout-page .receipt-signature-box span {
        font-size: .82rem !important;
    }

    body.print-layout-page .receipt-logo {
        width: 72px !important;
        height: 72px !important;
        flex-basis: 72px !important;
        padding: 6px !important;
    }

    body.print-layout-page .signature-space {
        height: 50px !important;
        margin-bottom: 8px !important;
    }
}
