:root {
    --primary: #16864a;
    --primary-dark: #0c6436;
    --secondary: #6b7a99;
    --success: #16885b;
    --warning: #d78610;
    --danger: #cf3f4f;
    --info: #2476a6;
    --bg: #f3f8f5;
    --surface: #ffffff;
    --text: #172033;
    --muted: #67728a;
    --border: #dfe5ef;
    --shadow: 0 12px 35px rgba(25, 45, 88, .08);
    --radius: 16px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #0e5935, #073a26);
    color: #fff;
    padding: 22px 16px;
    z-index: 30;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 22px; }
.brand strong { display: block; font-size: 1.12rem; letter-spacing: .06em; }
.brand small { display: block; color: #bfcbed; font-size: .72rem; }
.brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #0e5935;
    background: #fff;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.brand-mark.large { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 20px; font-size: 1.25rem; }
.nav-menu { display: grid; gap: 4px; overflow-y: auto; padding-right: 2px; }
.nav-link {
    color: #dce5ff;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: .91rem;
}
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,.12); }
.nav-link.active { box-shadow: inset 3px 0 0 #f4c95d; }
.nav-icon { width: 22px; text-align: center; font-weight: 800; }
.sidebar-footer { margin-top: auto; padding: 18px 10px 4px; border-top: 1px solid rgba(255,255,255,.13); font-size: .85rem; }
.sidebar-footer span { display: block; color: #fff; margin-bottom: 3px; }
.sidebar-footer a { color: #bfcbed; }

.main-content { min-width: 0; }
.topbar {
    min-height: 88px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 30px;
    background: rgba(255,255,255,.88);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar h1 { margin: 0; font-size: 1.45rem; line-height: 1.2; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.topbar .today { margin-left: auto; color: var(--muted); font-size: .88rem; }
.menu-button { display: none; border: 0; background: transparent; font-size: 1.4rem; color: var(--text); }
.page-content { padding: 28px 30px 50px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 22px;
}
.card-header { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 18px; }
.card-header h2, .card h2 { margin: 0; font-size: 1.08rem; }
.card-header p { margin: 3px 0 0; color: var(--muted); font-size: .85rem; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat-card small { color: var(--muted); display: block; }
.stat-card strong { display: block; margin-top: 5px; font-size: 1.85rem; }
.stat-card .stat-note { margin-top: 5px; font-size: .75rem; color: var(--muted); }
.stat-blue { border-top: 4px solid var(--primary); }
.stat-green { border-top: 4px solid var(--success); }
.stat-orange { border-top: 4px solid var(--warning); }
.stat-red { border-top: 4px solid var(--danger); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .9fr); gap: 22px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 9px 14px;
    cursor: pointer;
    font-weight: 650;
    font-size: .88rem;
    transition: .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { color: var(--text); background: #eef2f8; border-color: #dce3ee; }
.btn-success { color: #fff; background: var(--success); }
.btn-warning { color: #fff; background: var(--warning); }
.btn-danger { color: #fff; background: var(--danger); }
.btn-outline { color: var(--primary); border-color: #aac0f8; background: #f8faff; }
.btn-sm { padding: 6px 10px; font-size: .78rem; }
.btn-block { width: 100%; }

.form-stack { display: grid; gap: 15px; }
.form-stack h2 { margin: 10px 0 -4px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 1rem; }
label { display: grid; gap: 6px; font-weight: 650; font-size: .85rem; }
input, select, textarea {
    width: 100%;
    color: var(--text);
    background: #fff;
    border: 1px solid #cfd7e5;
    border-radius: 9px;
    padding: 10px 11px;
    outline: none;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #7296ed; box-shadow: 0 0 0 3px rgba(38, 88, 217, .12); }
.form-grid { display: grid; gap: 15px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.inline-form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.inline-form > label { min-width: 160px; flex: 1 1 160px; }
.check-label { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check-label input { width: auto; }
.help-text { color: var(--muted); font-size: .78rem; margin: 2px 0 0; }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: #4d5a74; background: #f7f9fc; font-size: .77rem; text-transform: uppercase; letter-spacing: .035em; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcff; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.empty-state { text-align: center; color: var(--muted); padding: 32px 16px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-weight: 700; font-size: .72rem; white-space: nowrap; }
.badge-primary { color: #204698; background: #e8efff; }
.badge-success, .badge-h { color: #0c6a43; background: #dcf5e9; }
.badge-warning, .badge-i { color: #8a5506; background: #fff0d4; }
.badge-info, .badge-s { color: #185d83; background: #deeff8; }
.badge-danger, .badge-a { color: #972736; background: #ffe4e8; }
.badge-muted { color: #5d6679; background: #edf0f5; }

.alert { position: relative; border-radius: 10px; padding: 11px 42px 11px 13px; margin-bottom: 17px; border: 1px solid; }
.alert button { position: absolute; right: 9px; top: 7px; border: 0; background: transparent; font-size: 1.25rem; color: inherit; cursor: pointer; }
.alert-success { color: #0d6543; background: #e3f7ed; border-color: #b8e8d1; }
.alert-error { color: #962b39; background: #ffeaed; border-color: #f5c4ca; }
.alert-info { color: #185d83; background: #e5f3fb; border-color: #bfdfef; }
.alert-warning { color: #7e500b; background: #fff2dc; border-color: #f1d6a5; }

.auth-page { display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top left, #d9f4e4, transparent 40%), #edf6f0; }
.auth-card, .installer-card { width: min(430px, 100%); background: #fff; border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 24px 70px rgba(26, 49, 94, .15); padding: 30px; }
.installer-card { width: min(680px, 100%); }
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-brand h1 { margin: 0; font-size: 1.55rem; }
.auth-brand p { margin: 5px 0 0; color: var(--muted); font-size: .85rem; }
.auth-footer { display: block; text-align: center; color: var(--muted); margin-top: 20px; }

.progress-list { display: grid; gap: 13px; }
.progress-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(120px, 2fr) 45px; align-items: center; gap: 10px; font-size: .83rem; }
.progress-track { height: 9px; background: #edf1f7; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--primary); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .78rem; color: var(--muted); }
.legend span::before { content: ''; width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; background: var(--legend); }

.attendance-status { display: inline-flex; gap: 4px; }
.attendance-status label { display: inline-flex; cursor: pointer; }
.attendance-status input { position: absolute; opacity: 0; pointer-events: none; }
.attendance-status span { min-width: 35px; text-align: center; padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; font-size: .77rem; background: #fff; }
.attendance-status input:checked + span { color: #fff; border-color: var(--primary); background: var(--primary); }

.qr-stage { max-width: 560px; margin: 0 auto; text-align: center; }
#qr-reader { width: 100%; min-height: 280px; border: 2px dashed #b9c5d8; border-radius: 16px; overflow: hidden; background: #f8fafc; }
.qr-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.qr-card { border: 1px solid #bdc7d8; border-radius: 12px; padding: 14px; text-align: center; break-inside: avoid; background: #fff; }
.qr-box { width: 150px; height: 150px; margin: 8px auto; display: grid; place-items: center; }
.qr-box img, .qr-box canvas { max-width: 100%; height: auto; }
.qr-card h3 { margin: 7px 0 2px; font-size: .95rem; }
.qr-card p { margin: 0; color: var(--muted); font-size: .76rem; }
.token-fallback { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .62rem; word-break: break-all; }
.token-code { display: inline-block; margin: 6px 0; padding: 8px 10px; border-radius: 7px; background: rgba(255,255,255,.65); word-break: break-all; user-select: all; }
.code-block { margin: 12px 0; padding: 14px; overflow-x: auto; border-radius: 10px; color: #dbe7ff; background: #132345; font: .78rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }

.letter-sheet { max-width: 800px; margin: 0 auto; background: #fff; padding: 42px 54px; color: #111; border: 1px solid var(--border); }
.letter-head { display: flex; align-items: center; justify-content: center; gap: 18px; text-align: center; border-bottom: 3px double #111; padding-bottom: 13px; margin-bottom: 22px; }
.letter-head img { width: 74px; height: 74px; object-fit: contain; }
.letter-head h1 { margin: 0; font-size: 1.15rem; text-transform: uppercase; }
.letter-head p { margin: 3px 0 0; font-size: .85rem; }
.letter-meta { display: grid; grid-template-columns: 85px 10px 1fr; font-size: .92rem; }
.letter-body { margin-top: 24px; font-family: Georgia, serif; line-height: 1.7; }
.letter-sign { width: 300px; margin: 55px 0 0 auto; text-align: center; }
.letter-sign .space { height: 65px; }

.tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; }
.tab { color: var(--secondary); background: #edf1f7; border-radius: 8px; padding: 8px 12px; font-size: .82rem; font-weight: 650; }
.tab.active { color: #fff; background: var(--primary); }
.divider { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

button:disabled, .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.eyebrow { display: block; color: var(--primary); font-size: .67rem; font-weight: 850; letter-spacing: .13em; margin-bottom: 5px; }
.content-grid-students { grid-template-columns: minmax(0, 1.75fr) minmax(350px, .9fr); }
.student-form-card { align-self: start; position: sticky; top: 110px; }
.public-link-list, .auth-public-links { display: flex; flex-wrap: wrap; gap: 8px; }
.public-link-list a, .auth-public-links a { padding: 7px 10px; border-radius: 8px; color: var(--primary-dark); background: #e7f5ed; font-size: .78rem; font-weight: 700; }
.auth-public-links { justify-content: center; margin-top: 18px; }

/* Import data siswa */
.import-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; color: #fff; border: 0; background: linear-gradient(125deg, #0d6238, #16965a); overflow: hidden; position: relative; }
.import-hero::after { content: ''; width: 220px; height: 220px; position: absolute; right: 14%; top: -135px; border: 32px solid rgba(255,255,255,.08); border-radius: 50%; }
.import-hero > * { position: relative; z-index: 1; }
.import-hero .eyebrow { color: #c8f1d9; }
.import-hero h2 { font-size: 1.35rem; margin-bottom: 5px; }
.import-hero p { margin: 0; max-width: 720px; color: #d9f3e4; }
.import-hero .btn-outline { color: #fff; border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.12); }
.import-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.file-drop { min-height: 190px; place-items: center; border: 2px dashed #9fcab0; border-radius: 16px; background: linear-gradient(145deg, #f4fbf7, #eef8f2); cursor: pointer; text-align: center; padding: 20px; }
.file-drop:hover { border-color: var(--primary); background: #edf9f2; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop span { display: grid; gap: 6px; }
.file-drop span::before { content: '⇧'; width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 5px; color: #fff; background: var(--primary); border-radius: 16px; font-size: 1.8rem; }
.file-drop strong { font-size: 1rem; }
.file-drop small { color: var(--muted); font-weight: 500; }
.requirements-list { display: grid; gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.requirements-list div { display: grid; grid-template-columns: 135px 1fr; gap: 12px; padding: 11px 13px; border-bottom: 1px solid var(--border); font-size: .82rem; }
.requirements-list div:last-child { border-bottom: 0; }
.requirements-list strong { color: var(--primary-dark); }
.requirements-list span { color: var(--muted); }
.error-list { margin: 0; padding-left: 22px; color: #8e2d3b; }
.error-list li + li { margin-top: 6px; }

/* Kartu pelajar */
.id-card-page { overflow: visible; }
.card-sheets-preview { display: grid; gap: 24px; justify-content: center; }
.card-print-sheet { page: student-card-sheet; width: 210mm; min-height: 297mm; position: relative; display: grid; grid-template-columns: repeat(2, 85.6mm); grid-auto-rows: 54mm; align-content: start; justify-content: center; gap: 2.5mm 8mm; padding: 8.5mm 0; background: #fff; box-shadow: 0 16px 48px rgba(17,65,37,.14); }
.sheet-label { position: absolute; top: -20px; left: 0; color: var(--muted); font-size: .75rem; font-weight: 800; }
.student-id-card { box-sizing: border-box; width: 85.6mm; height: 54mm; position: relative; overflow: hidden; break-inside: avoid; border: .25mm solid #b4ccbc; border-radius: 3.2mm; box-shadow: 0 8px 22px rgba(11,76,42,.13); font-family: Inter, Arial, sans-serif; }
.card-front { padding: 2.6mm 3mm 2mm; color: #173527; background: linear-gradient(145deg, #fff 0 72%, #e8f5ed 72% 100%); }
.card-pattern { position: absolute; inset: auto -10mm -16mm auto; width: 42mm; height: 42mm; border: 7mm solid rgba(15,125,68,.08); border-radius: 50%; }
.id-card-header { min-height: 11.5mm; display: grid; grid-template-columns: 10mm minmax(0, 1fr); gap: 2.2mm; align-items: center; position: relative; z-index: 1; padding-bottom: 1.4mm; border-bottom: .55mm solid #c9a33c; }
.id-card-header img { width: 9.5mm; height: 9.5mm; object-fit: contain; }
.card-school-name { min-width: 0; }
.card-school-name strong { display: block; color: #075f37; font-size: 2.65mm; font-weight: 900; line-height: 1.05; letter-spacing: .025em; white-space: nowrap; }
.card-school-name strong:nth-child(2) { font-size: 2.8mm; }
.card-school-name small { display: block; margin-top: .7mm; color: #52695c; font-size: 1.45mm; font-weight: 850; letter-spacing: .14em; }
.id-card-body { display: grid; grid-template-columns: 16.5mm minmax(0, 1fr) 15.8mm; gap: 2mm; align-items: center; position: relative; z-index: 1; padding-top: 1.8mm; }
.student-card-photo { width: 16.5mm; height: 22mm; display: grid; place-items: center; align-content: center; overflow: hidden; border: .45mm solid #c7a541; border-radius: 1.8mm; color: #fff; background: linear-gradient(155deg, #16864a, #074f2d); box-shadow: inset 0 0 0 .45mm rgba(255,255,255,.35); }
.student-card-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.student-card-photo span { font-size: 4.2mm; font-weight: 900; }
.student-card-photo small { margin-top: .5mm; font-size: 1.2mm; font-weight: 800; letter-spacing: .16em; }
.student-card-data { min-width: 0; align-self: start; padding-top: .2mm; }
.id-label { color: #7b8b82; font-size: 1.25mm; font-weight: 850; letter-spacing: .1em; }
.student-card-data h3 { max-width: 43mm; margin: .3mm 0 1.1mm; overflow: hidden; color: #102f20; font-size: 2.85mm; line-height: 1.08; white-space: nowrap; text-overflow: ellipsis; }
.student-card-data dl { display: grid; gap: .55mm; margin: 0; }
.student-card-data dl div { min-width: 0; }
.student-card-data dt { color: #78877f; font-size: 1.22mm; font-weight: 700; line-height: 1.05; }
.student-card-data dd { margin: .15mm 0 0; overflow: hidden; color: #18372a; font-size: 1.65mm; font-weight: 800; line-height: 1.12; white-space: nowrap; text-overflow: ellipsis; }
.id-qr-wrap { display: grid; justify-items: center; gap: .8mm; }
.id-qr { width: 15.2mm; height: 15.2mm; display: grid; place-items: center; padding: .8mm; border-radius: 1.4mm; background: #fff; box-shadow: 0 0 0 .3mm #bfd1c5; }
.id-qr img, .id-qr canvas { width: 100% !important; height: 100% !important; }
.id-qr-wrap small { color: #557064; font-size: 1.15mm; font-weight: 850; letter-spacing: .08em; }
.id-card-footer { position: absolute; z-index: 1; right: 3mm; bottom: 1.2mm; left: 21.5mm; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 1mm; }
.id-card-footer canvas { width: 100%; height: 4.4mm; }
.id-card-footer small { padding-bottom: .2mm; color: #52685b; font-size: 1.3mm; font-weight: 850; white-space: nowrap; }
.card-back { padding: 2.4mm 3mm 2mm; color: #f8fff9; background: linear-gradient(150deg, #073b27 0%, #09623a 58%, #0f7d47 100%); border-color: #c7a748; }
.back-watermark { position: absolute; right: -7mm; bottom: -7mm; opacity: .075; }
.back-watermark img { width: 40mm; height: 40mm; object-fit: contain; filter: grayscale(1) brightness(4); }
.back-header { display: grid; grid-template-columns: 8mm 1fr; gap: 1.8mm; align-items: center; position: relative; z-index: 1; padding-bottom: 1mm; border-bottom: .35mm solid rgba(233,202,112,.75); }
.back-header img { width: 7.5mm; height: 7.5mm; object-fit: contain; filter: drop-shadow(0 .4mm .6mm rgba(0,0,0,.18)); }
.back-header strong { display: block; color: #f5d681; font-size: 2.9mm; line-height: 1; letter-spacing: .08em; }
.back-header small { display: block; margin-top: .45mm; font-size: 1.45mm; font-weight: 800; letter-spacing: .08em; }
.card-vision, .card-mission { position: relative; z-index: 1; }
.card-vision { margin-top: 1mm; }
.card-vision > strong, .card-mission > strong { display: inline-block; margin-bottom: .35mm; color: #f4d680; font-size: 1.45mm; font-weight: 900; letter-spacing: .12em; }
.card-vision p { margin: 0; font-size: 1.55mm; font-weight: 700; line-height: 1.22; }
.card-mission { margin-top: .75mm; }
.card-mission ol { display: grid; gap: .18mm; margin: 0; padding-left: 3.6mm; }
.card-mission li { padding-left: .3mm; font-size: 1.28mm; font-weight: 610; line-height: 1.16; }
.card-mission li::marker { color: #f4d680; font-weight: 900; }
.back-footer { position: absolute; right: 3mm; bottom: 1.35mm; left: 3mm; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding-top: .65mm; border-top: .25mm solid rgba(255,255,255,.35); font-size: 1.2mm; font-weight: 700; }
.back-footer b { color: #f4d680; letter-spacing: .12em; }
.student-list-identity { min-width: 190px; display: flex; align-items: center; gap: 10px; }
.student-list-identity > img, .student-list-identity > span { width: 38px; height: 46px; flex: 0 0 38px; display: grid; place-items: center; object-fit: cover; object-position: center 22%; border: 1px solid var(--border); border-radius: 9px; color: #fff; background: var(--primary); font-size: .72rem; font-weight: 850; }
.student-photo-preview { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.student-photo-preview img { width: 64px; height: 78px; object-fit: cover; object-position: center 22%; border: 1px solid var(--border); border-radius: 12px; }
.class-card-print-form { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 12px; align-items: end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

/* Laporan cetak */
.print-toolbar { display: flex; justify-content: center; gap: 9px; margin-bottom: 18px; }
.attendance-sheet { width: min(210mm, 100%); margin: 0 auto; padding: 13mm 13mm 16mm; color: #17231b; background: #fff; border: 1px solid #dbe5de; box-shadow: 0 18px 55px rgba(17,65,37,.1); }
.report-letterhead { display: grid; grid-template-columns: 23mm 1fr 22mm; gap: 5mm; align-items: center; border-bottom: 1.2mm solid #0d6739; padding-bottom: 4mm; }
.report-letterhead img { width: 22mm; height: 22mm; object-fit: contain; }
.report-letterhead span { color: #7c8a81; font-size: 7pt; font-weight: 850; letter-spacing: .18em; }
.report-letterhead h1 { margin: 1mm 0; color: #0b5e34; font-size: 17pt; line-height: 1.05; text-transform: uppercase; }
.report-letterhead p { margin: 0; color: #526158; font-size: 7.5pt; }
.report-mark { width: 19mm; height: 19mm; display: grid; place-items: center; align-content: center; border: .6mm solid #d3a72e; border-radius: 50%; color: #17683e; font-size: 8pt; font-weight: 900; }
.report-mark small { display: block; font-size: 6pt; color: #8d6b15; }
.report-title { text-align: center; padding: 7mm 0 5mm; }
.report-title h2 { margin: 0; font-size: 13pt; letter-spacing: .04em; }
.report-title p { margin: 1mm 0 0; color: #667269; font-size: 8pt; }
.report-meta { display: grid; grid-template-columns: repeat(4, 1fr); border: .3mm solid #cfdad2; border-radius: 2mm; overflow: hidden; margin-bottom: 4mm; }
.report-meta div { padding: 2.2mm 2.5mm; border-right: .3mm solid #d9e2dc; }
.report-meta div:last-child { border-right: 0; }
.report-meta span, .report-meta strong { display: block; }
.report-meta span { color: #738078; font-size: 6.5pt; text-transform: uppercase; }
.report-meta strong { margin-top: .5mm; font-size: 8pt; }
.report-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.2mm; margin-bottom: 4mm; }
.report-summary div { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 2.2mm 3mm; border-radius: 2mm; }
.report-summary span { grid-column: 1; font-size: 7pt; font-weight: 750; }
.report-summary strong { grid-row: 1 / span 2; grid-column: 2; font-size: 15pt; }
.report-summary small { font-size: 6.5pt; }
.summary-h { color: #0d633a; background: #e1f5e9; }.summary-s { color: #1d5f7e; background: #e2f1f7; }.summary-i { color: #85520c; background: #fff1d9; }.summary-a { color: #94313f; background: #fde6e9; }
.report-table { width: 100%; font-size: 7pt; border: .3mm solid #cdd8d0; }
.report-table th { padding: 2mm 1.6mm; color: #fff; background: #11683b; font-size: 6.5pt; }
.report-table td { padding: 1.9mm 1.6mm; border: .25mm solid #dbe3dd; }
.report-table td small { display: block; color: #768178; font-size: 6pt; }
.report-table tbody tr:nth-child(even) { background: #f6faf7; }
.report-table .cell-h { color: #0b6c3c; background: #eff9f3; }.report-table .cell-s { color: #21647e; }.report-table .cell-i { color: #8b5a10; }.report-table .cell-a { color: #a12c3c; }
.report-legend { display: flex; flex-wrap: wrap; gap: 4mm; margin-top: 2.5mm; color: #68756d; font-size: 6.5pt; }
.report-legend span:last-child { margin-left: auto; }
.report-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 35mm; margin-top: 8mm; text-align: center; font-size: 8pt; }
.report-signatures > div:last-child { grid-column: 2; }
.report-signatures p { margin: 0; }.report-signatures span { display: block; height: 16mm; }.report-signatures strong, .report-signatures small { display: block; }

/* Portal publik */
.public-page { background: radial-gradient(circle at 8% 0, rgba(30,159,92,.16), transparent 30%), #f3f8f5; }
.public-header { min-height: 78px; display: flex; align-items: center; gap: 28px; padding: 12px max(24px, calc((100vw - 1180px)/2)); color: #fff; background: rgba(7,63,37,.96); box-shadow: 0 8px 30px rgba(5,52,29,.16); position: sticky; top: 0; z-index: 20; }
.public-brand { display: flex; align-items: center; gap: 11px; color: #fff; margin-right: auto; }
.public-brand img { width: 48px; height: 48px; object-fit: contain; padding: 3px; border-radius: 13px; background: #fff; }
.public-brand strong, .public-brand small { display: block; }.public-brand strong { max-width: 400px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }.public-brand small { color: #bde1ca; font-size: .72rem; }
.public-nav { display: flex; align-items: center; gap: 4px; }
.public-nav a { padding: 9px 11px; border-radius: 9px; color: #d8efe1; font-size: .84rem; font-weight: 700; }
.public-nav a:hover, .public-nav a.active { color: #fff; background: rgba(255,255,255,.12); }
.public-nav .admin-link { margin-left: 8px; color: #17482e; background: #f0cf70; }
.public-menu-button { display: none; color: #fff; background: transparent; border: 0; font-size: 1.5rem; }
.public-main { width: min(1180px, calc(100% - 32px)); min-height: calc(100vh - 170px); margin: 0 auto; padding: 42px 0 60px; }
.public-title { margin-bottom: 25px; }.public-title > span, .section-heading > div > span { color: var(--primary); font-size: .67rem; font-weight: 850; letter-spacing: .15em; }.public-title h1 { margin: 5px 0 2px; font-size: clamp(1.65rem, 4vw, 2.45rem); }.public-title p { margin: 0; color: var(--muted); }
.public-card { margin-bottom: 22px; padding: 24px; border: 1px solid #dbe7df; border-radius: 18px; background: #fff; box-shadow: 0 13px 38px rgba(15,70,38,.07); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; }.section-heading h2 { margin: 4px 0 0; font-size: 1.15rem; }.section-heading p { margin: 0; color: var(--muted); font-size: .84rem; }
.class-chip-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.class-chip { min-height: 110px; display: flex; flex-direction: column; justify-content: flex-end; padding: 15px; color: #183427; border: 1px solid #d8e7dd; border-radius: 14px; background: linear-gradient(145deg, #f8fcf9, #edf7f1); transition: .18s ease; }
.class-chip:hover { transform: translateY(-3px); border-color: #87c7a2; box-shadow: 0 10px 25px rgba(16,112,58,.1); }.class-chip.active { color: #fff; border-color: transparent; background: linear-gradient(145deg, #168a4d, #0c6538); }
.class-chip span { font-size: .68rem; opacity: .72; text-transform: uppercase; letter-spacing: .08em; }.class-chip strong { margin: 4px 0; font-size: 1.05rem; }.class-chip small { opacity: .72; }
.public-count { min-width: 72px; padding: 8px 12px; border-radius: 12px; text-align: center; color: #10643a; background: #e7f6ed; }.public-count strong, .public-count small { display: block; }.public-count strong { font-size: 1.35rem; line-height: 1; }.public-count small { margin-top: 3px; font-size: .65rem; text-transform: uppercase; }
.public-table th { color: #e7f8ed; background: #12693d; }.privacy-note { margin: 12px 0 0; color: #748078; font-size: .75rem; }
.public-hint { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 25px; color: var(--muted); }.public-hint div { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; background: var(--primary); border-radius: 50%; font-weight: 900; }.public-hint p { margin: 0; }
.public-notice { padding: 17px 20px; border: 1px solid #c9e2d3; border-radius: 13px; color: #155b36; background: #e9f7ee; }.public-notice.warning { margin-bottom: 20px; color: #84520d; border-color: #ecd29c; background: #fff3dc; }
.public-footer { min-height: 92px; display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 15px max(24px, calc((100vw - 1180px)/2)); color: #cce4d5; background: #073c26; }.public-footer img { width: 44px; height: 44px; object-fit: contain; padding: 3px; border-radius: 11px; background: #fff; }.public-footer strong, .public-footer small { display: block; }.public-footer small, .public-footer > span { font-size: .72rem; opacity: .8; }
.search-card { display: grid; grid-template-columns: 1fr minmax(360px, .8fr); gap: 35px; align-items: center; padding: 30px; color: #fff; background: linear-gradient(125deg, #0a5f36, #16965a); }.search-card .eyebrow { color: #c5efd5; }.search-card h2 { margin: 4px 0; font-size: 1.5rem; }.search-card p { margin: 0; color: #d8f2e2; }.public-search { display: flex; gap: 8px; padding: 8px; border-radius: 13px; background: rgba(255,255,255,.14); }.public-search input { border: 0; }
.public-results { margin-top: 24px; }.public-empty-card { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed #bad2c3; border-radius: 16px; }.public-empty-card strong { color: var(--text); }.public-empty-card p { margin: 5px 0 0; }
.alumni-result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }.alumni-result { position: relative; overflow: hidden; padding: 22px; border: 1px solid #d7e6dc; border-radius: 16px; background: #fff; box-shadow: 0 10px 27px rgba(12,74,38,.07); }.verified-mark { position: absolute; top: 16px; right: 16px; width: 29px; height: 29px; display: grid; place-items: center; color: #fff; background: var(--primary); border-radius: 50%; font-weight: 900; }.alumni-result h3 { margin: 5px 35px 14px 0; }.alumni-result dl { display: grid; gap: 7px; margin: 0; }.alumni-result dl div { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid #ecf1ed; font-size: .8rem; }.alumni-result dt { color: var(--muted); }.alumni-result dd { margin: 0; font-weight: 750; }.alumni-result > p { margin: 13px 0 0; color: var(--muted); font-size: .78rem; }
.violation-check-card { display: grid; grid-template-columns: 65px minmax(220px, .7fr) 1fr; align-items: center; gap: 22px; }.security-icon { width: 62px; height: 62px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #17894c, #0b5f35); border-radius: 18px; font-size: 2rem; }.violation-check-card h2 { margin: 4px 0; }.violation-check-card p { margin: 0; color: var(--muted); font-size: .82rem; }.verification-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 9px; }
.student-verification-card { display: grid; grid-template-columns: 62px 1fr auto; gap: 16px; align-items: center; margin: 22px 0; padding: 22px; color: #fff; border-radius: 18px; background: linear-gradient(125deg, #0c663a, #168f51); box-shadow: 0 13px 35px rgba(13,92,50,.18); }.verification-avatar, .graduate-avatar { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 17px; color: #0b6036; background: #fff; font-weight: 900; font-size: 1.15rem; }.student-verification-card .eyebrow { color: #c7efd6; }.student-verification-card h2 { margin: 3px 0; }.student-verification-card p { margin: 0; color: #d8f1e2; }.point-total { min-width: 95px; padding: 12px; text-align: center; border-radius: 14px; color: #125e37; background: #fff; }.point-total.has-points { color: #9a2d3c; }.point-total strong, .point-total span { display: block; }.point-total strong { font-size: 1.7rem; line-height: 1; }.point-total span { margin-top: 3px; font-size: .67rem; text-transform: uppercase; }
.clean-record { display: flex; align-items: center; gap: 13px; padding: 22px; color: #126039; border-radius: 13px; background: #e7f6ed; }.clean-record > span { width: 39px; height: 39px; display: grid; place-items: center; color: #fff; background: var(--primary); border-radius: 50%; font-weight: 900; }.clean-record strong { display: block; }.clean-record p { margin: 2px 0 0; font-size: .78rem; }
.violation-timeline { display: grid; gap: 10px; }.violation-timeline article { display: grid; grid-template-columns: 145px 1fr auto; gap: 17px; align-items: center; padding: 14px 16px; border: 1px solid #e2e9e4; border-left: 4px solid #d14b5d; border-radius: 11px; }.violation-timeline time { color: var(--muted); font-size: .78rem; }.violation-timeline article div > span { color: #a33444; font-size: .66rem; font-weight: 850; }.violation-timeline h3 { margin: 2px 0; font-size: .92rem; }.violation-timeline p { margin: 0; color: var(--muted); font-size: .76rem; }.violation-timeline article > strong { color: #a33141; font-size: .78rem; }
.summons-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }.summons-grid > div { display: grid; gap: 6px; padding: 15px; border: 1px solid #e5dade; border-radius: 12px; background: #fff8f9; }.summons-grid .badge { justify-self: start; }.summons-grid small { color: var(--muted); }
.graduate-card { display: grid; grid-template-columns: 62px minmax(220px, .5fr) 1fr; align-items: center; gap: 18px; color: #fff; border: 0; background: linear-gradient(125deg, #0c6339, #158a4d); }.graduate-card .graduate-avatar { color: #0d663a; }.graduate-card .eyebrow { color: #c5edd3; }.graduate-card h2 { margin: 4px 0; }.graduate-card p { margin: 0; color: #d5efdf; }.graduate-card label { color: #fff; }.graduate-card input { color: var(--text); }

/* Kiosk absensi publik */
.kiosk-unlock-card { display: grid; grid-template-columns: 76px minmax(250px, 1fr) minmax(300px, .8fr); gap: 24px; align-items: center; padding: 30px; }
.kiosk-lock-icon { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 22px; color: #fff; background: linear-gradient(145deg, #178b4e, #0a5c34); box-shadow: inset 0 0 0 8px rgba(255,255,255,.12); font-size: 1.3rem; }
.kiosk-unlock-card h2 { margin: 4px 0; font-size: 1.45rem; }.kiosk-unlock-card p { margin: 0; color: var(--muted); }
.kiosk-unlock-form { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: end; }
.kiosk-status-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; margin-bottom: 20px; padding: 14px 18px; color: #fff; border-radius: 16px; box-shadow: 0 12px 30px rgba(8,72,37,.13); }
.kiosk-status-bar.open { background: linear-gradient(115deg, #0e6639, #168e50); }.kiosk-status-bar.closed { background: linear-gradient(115deg, #765311, #aa7615); }
.kiosk-status-bar > div:first-child { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 9px; }.kiosk-status-bar > div:first-child small { grid-column: 2; color: rgba(255,255,255,.76); }
.status-dot { width: 12px; height: 12px; grid-row: 1 / span 2; border: 3px solid rgba(255,255,255,.35); border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px rgba(255,255,255,.12); }
.kiosk-clock { text-align: center; }.kiosk-clock strong, .kiosk-clock small { display: block; }.kiosk-clock strong { font: 900 1.65rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; }.kiosk-clock small { margin-top: 4px; color: rgba(255,255,255,.75); font-size: .72rem; }
.kiosk-controls { display: flex; justify-content: flex-end; gap: 8px; }.kiosk-controls form { display: inline-flex; }.kiosk-status-bar .btn-outline { color: #fff; border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.1); }
.kiosk-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(350px, .8fr); gap: 20px; }
.scan-device-card, .camera-scan-card { min-height: 430px; position: relative; overflow: hidden; }
.scan-device-card { padding-top: 32px; text-align: center; }.scan-device-card > p { max-width: 640px; margin: 4px auto 20px; color: var(--muted); }
.scan-illustration { width: 96px; height: 96px; position: relative; margin: 0 auto 16px; border-radius: 28px; background: linear-gradient(145deg, #e6f7ed, #d5efdf); }
.scan-illustration span { width: 54px; height: 34px; position: absolute; left: 20px; top: 32px; border: 4px solid #117140; border-radius: 8px; background: #fff; transform: rotate(-7deg); }
.scan-illustration span::before { content: ''; width: 28px; height: 3px; position: absolute; left: 9px; top: 12px; border-radius: 2px; background: #d4a733; box-shadow: 0 7px 0 #d9e6dd; }
.scan-illustration i { width: 44px; height: 44px; position: absolute; right: -5px; top: 8px; border: 3px solid #16884c; border-left-color: transparent; border-bottom-color: transparent; border-radius: 50%; transform: rotate(15deg); }
.kiosk-scan-form { max-width: 650px; display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: end; margin: 0 auto; padding: 13px; border: 1px solid #b9d9c5; border-radius: 14px; background: #f3faf6; }
.kiosk-scan-form label { text-align: left; }.kiosk-scan-form input { min-height: 48px; border-color: #8fc5a5; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1rem; font-weight: 750; letter-spacing: .04em; }
.scan-tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 19px; }.scan-tips span { display: flex; align-items: center; gap: 7px; padding: 9px; color: var(--muted); border-radius: 10px; background: #f6f9f7; font-size: .74rem; }.scan-tips strong { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; color: #fff; border-radius: 50%; background: var(--primary); }
.kiosk-camera { min-height: 290px; display: grid; place-items: center; overflow: hidden; border: 2px dashed #b7cdbf; border-radius: 15px; background: #f6faf7; }
.camera-placeholder { display: grid; place-items: center; gap: 5px; color: var(--muted); text-align: center; }.camera-placeholder > span { width: 60px; height: 60px; display: grid; place-items: center; margin-bottom: 4px; color: #fff; border-radius: 18px; background: #769383; font-size: 1.7rem; }.camera-placeholder small { font-size: .72rem; }
#kiosk-camera video { border-radius: 10px; }.camera-scan-card #kiosk-camera__scan_region { min-height: 220px; }.camera-scan-card #kiosk-camera__dashboard { padding: 8px !important; }
.kiosk-result-card { min-height: 115px; display: grid; grid-template-columns: auto 1fr auto; gap: 17px; align-items: center; border-left: 6px solid #8ca398; transition: .18s ease; }
.result-idle { display: contents; }.result-idle > span, .kiosk-result-icon { width: 56px; height: 56px; display: grid; place-items: center; color: #fff; border-radius: 17px; background: #718b7d; font-size: 1.4rem; font-weight: 900; }.result-idle strong { display: block; }.result-idle p { margin: 3px 0 0; color: var(--muted); }
.kiosk-result-card.success { border-color: #16884c; background: linear-gradient(110deg, #fff, #edf9f2); }.kiosk-result-card.success .kiosk-result-icon { background: #16884c; }.kiosk-result-card.duplicate { border-color: #2476a6; background: linear-gradient(110deg, #fff, #eef7fb); }.kiosk-result-card.duplicate .kiosk-result-icon { background: #2476a6; }.kiosk-result-card.error { border-color: #cf3f4f; background: linear-gradient(110deg, #fff, #fff1f3); }.kiosk-result-card.error .kiosk-result-icon { background: #cf3f4f; }
.kiosk-result-card h2 { margin: 3px 0; font-size: 1.25rem; }.kiosk-result-card p { margin: 0; color: var(--muted); }.kiosk-result-card > time { font: 800 1.05rem ui-monospace, SFMono-Regular, Menlo, monospace; color: #41534a; }
.kiosk-result-card.processing { grid-template-columns: auto 1fr; }.kiosk-spinner { width: 45px; height: 45px; border: 5px solid #dcebe2; border-top-color: var(--primary); border-radius: 50%; animation: kiosk-spin .8s linear infinite; }
@keyframes kiosk-spin { to { transform: rotate(360deg); } }
.kiosk-recent-list { display: grid; gap: 7px; }.kiosk-recent-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid #e1e9e3; border-radius: 11px; background: #fafcfb; }.kiosk-recent-item > span { width: 32px; height: 32px; display: grid; place-items: center; color: #fff; border-radius: 9px; background: #16884c; font-weight: 900; }.kiosk-recent-item.error > span { background: #cf3f4f; }.kiosk-recent-item strong, .kiosk-recent-item small { display: block; }.kiosk-recent-item small { margin-top: 2px; color: var(--muted); }.kiosk-recent-item time { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 750; }

@media (max-width: 1080px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .content-grid { grid-template-columns: 1fr; }
    .qr-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .student-form-card { position: static; }
    .class-chip-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .alumni-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .violation-check-card { grid-template-columns: 58px 1fr; }
    .verification-form { grid-column: 1 / -1; }
    .graduate-card { grid-template-columns: 58px 1fr; }
    .graduate-card form { grid-column: 1 / -1; }
    .kiosk-unlock-card { grid-template-columns: 70px 1fr; }.kiosk-unlock-form { grid-column: 1 / -1; }
    .kiosk-grid { grid-template-columns: 1fr; }.scan-device-card, .camera-scan-card { min-height: 0; }
}

@media (max-width: 760px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; transform: translateX(-100%); transition: .2s ease; box-shadow: 18px 0 50px rgba(0,0,0,.2); }
    .sidebar.open { transform: translateX(0); }
    .menu-button { display: block; }
    .topbar { min-height: 74px; padding: 13px 16px; }
    .topbar h1 { font-size: 1.16rem; }
    .topbar .today { display: none; }
    .page-content { padding: 18px 14px 38px; }
    .stats-grid { gap: 11px; }
    .stat-card { padding: 15px; }
    .stat-card strong { font-size: 1.45rem; }
    .card { padding: 16px; border-radius: 13px; }
    .card-header { align-items: flex-start; flex-direction: column; }
    .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
    .qr-card-grid { grid-template-columns: 1fr; }
    .progress-row { grid-template-columns: 95px minmax(100px, 1fr) 38px; }
    .import-hero { align-items: flex-start; flex-direction: column; }
    .import-stats { grid-template-columns: 1fr; }
    .card-sheets-preview { justify-content: start; overflow-x: auto; padding: 22px 0 8px; }
    .public-header { min-height: 68px; padding: 10px 16px; flex-wrap: wrap; }
    .public-brand img { width: 43px; height: 43px; }
    .public-brand strong { max-width: 220px; }
    .public-menu-button { display: block; }
    .public-nav { width: 100%; display: none; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.12); }
    .public-nav.open { display: grid; grid-template-columns: 1fr 1fr; }
    .public-nav .admin-link { margin-left: 0; }
    .public-main { width: min(100% - 24px, 1180px); padding-top: 28px; }
    .public-card { padding: 18px; border-radius: 14px; }
    .class-chip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .search-card { grid-template-columns: 1fr; gap: 20px; }
    .violation-check-card { display: block; }
    .violation-check-card .security-icon { margin-bottom: 14px; }
    .verification-form { grid-template-columns: 1fr; margin-top: 18px; }
    .student-verification-card { grid-template-columns: 54px 1fr; }
    .point-total { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
    .violation-timeline article { grid-template-columns: 1fr auto; }
    .violation-timeline time { grid-column: 1 / -1; }
    .summons-grid { grid-template-columns: 1fr; }
    .attendance-sheet { padding: 7mm; overflow-x: auto; }
    .report-letterhead { grid-template-columns: 18mm 1fr; }
    .report-letterhead img { width: 17mm; height: 17mm; }
    .report-mark { display: none; }
    .report-meta, .report-summary { grid-template-columns: repeat(2, 1fr); }
    .report-meta div:nth-child(2) { border-right: 0; }
    .kiosk-status-bar { grid-template-columns: 1fr auto; }.kiosk-controls { grid-column: 1 / -1; justify-content: stretch; }.kiosk-controls .btn, .kiosk-controls form { flex: 1; }.kiosk-controls form .btn { width: 100%; }
    .kiosk-scan-form { grid-template-columns: 1fr; }.scan-tips { grid-template-columns: 1fr; }
    .kiosk-result-card { grid-template-columns: auto 1fr; }.kiosk-result-card > time { grid-column: 2; }
}

@media (max-width: 460px) {
    .stats-grid { grid-template-columns: 1fr; }
    .attendance-status { flex-wrap: wrap; min-width: 82px; }
    .auth-card, .installer-card { padding: 22px 18px; }
    .requirements-list div { grid-template-columns: 1fr; gap: 3px; }
    .class-card-print-form { grid-template-columns: 1fr; }
    .class-chip-grid, .alumni-result-grid { grid-template-columns: 1fr; }
    .public-search { flex-direction: column; }
    .section-heading { align-items: flex-start; }
    .public-footer { grid-template-columns: 40px 1fr; }
    .public-footer > span { grid-column: 1 / -1; }
    .kiosk-unlock-card { display: block; }.kiosk-lock-icon { margin-bottom: 15px; }.kiosk-unlock-form { grid-template-columns: 1fr; margin-top: 18px; }
    .kiosk-status-bar { display: block; text-align: center; }.kiosk-status-bar > div:first-child { display: flex; justify-content: center; flex-wrap: wrap; }.kiosk-status-bar > div:first-child small { width: 100%; }.kiosk-clock { margin: 14px 0; }.kiosk-controls { display: grid; grid-template-columns: 1fr 1fr; }
    .kiosk-result-card { display: block; text-align: center; }.kiosk-result-icon, .result-idle > span { margin: 0 auto 10px; }.kiosk-result-card > time { display: block; margin-top: 9px; }
}

@media print {
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    body { background: #fff; }
    .sidebar, .topbar, .no-print, .alert { display: none !important; }
    .app-shell, .main-content { display: block; }
    .page-content { padding: 0; }
    .card { border: 0; box-shadow: none; padding: 0; }
    .qr-card-grid { grid-template-columns: repeat(3, 1fr); }
    .qr-card { padding: 8px; }
    .qr-box { width: 120px; height: 120px; }
    .letter-sheet { border: 0; padding: 0; max-width: none; }
    .id-card-page { margin: 0; padding: 0; overflow: visible; }
    .card-sheets-preview { display: block; }
    .card-print-sheet { width: 210mm; height: 297mm; min-height: 297mm; margin: 0; padding: 8.5mm 0; box-shadow: none; break-after: page; page-break-after: always; }
    .card-print-sheet:last-child { break-after: auto; page-break-after: auto; }
    .student-id-card { width: 85.6mm; height: 54mm; max-width: none; border-radius: 3.2mm; box-shadow: none; }
    .attendance-sheet { width: 100%; margin: 0; padding: 0; border: 0; box-shadow: none; }
    .report-table tr, .report-table td, .report-table th { break-inside: avoid; }
    .report-signatures { break-inside: avoid; }
    @page { size: A4; margin: 10mm; }
}

@page student-card-sheet { size: A4 portrait; margin: 0; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; padding: 18px 8px 4px; }
.pagination a, .pagination span { min-width: 34px; height: 34px; display: grid; place-items: center; padding: 0 9px; border: 1px solid var(--border); border-radius: 9px; color: var(--primary-dark); background: #fff; font-size: .82rem; font-weight: 750; text-decoration: none; }
.pagination a:hover, .pagination a.active { color: #fff; border-color: var(--primary); background: var(--primary); }
.logo-preview { width: 140px; height: 140px; display: grid; place-items: center; margin: 0 auto 18px; padding: 10px; border: 1px solid var(--border); border-radius: 20px; background: #fff; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.details-body { padding-top: 14px; }
.wa-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 16px; }
.wa-stats div { padding: 14px 9px; border: 1px solid var(--border); border-radius: 12px; text-align: center; background: var(--surface-soft); }
.wa-stats strong, .wa-stats span { display: block; }
.wa-stats strong { color: var(--primary-dark); font-size: 1.45rem; }
.wa-stats span { margin-top: 2px; color: var(--muted); font-size: .7rem; }
.connection-score { min-width: 58px; padding: 7px 11px; color: #8a641a; border: 1px solid #ecd795; border-radius: 999px; background: #fff7d9; font-size: .9rem; font-weight: 900; text-align: center; }
.connection-score.ready { color: #fff; border-color: var(--primary); background: var(--primary); }
.setup-progress-track { height: 10px; margin: -2px 0 16px; overflow: hidden; border-radius: 999px; background: #e8eee9; }
.setup-progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #159153, #d2ad45); transition: width .3s ease; }
.telegram-setup-steps { display: grid; gap: 8px; margin-bottom: 14px; }
.telegram-setup-steps > div { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: #fbfdfc; }
.telegram-setup-steps > div > span { width: 32px; height: 32px; display: grid; place-items: center; color: #7b897f; border-radius: 50%; background: #e8eee9; font-size: .8rem; font-weight: 900; }
.telegram-setup-steps > div.done { border-color: #a9d8bd; background: #f1fbf5; }
.telegram-setup-steps > div.done > span { color: #fff; background: var(--primary); }
.telegram-setup-steps strong, .telegram-setup-steps small { display: block; }
.telegram-setup-steps strong { color: var(--text); font-size: .78rem; }
.telegram-setup-steps small { margin-top: 2px; color: var(--muted); font-size: .68rem; line-height: 1.35; }
.telegram-last-error { margin-bottom: 14px; font-size: .73rem; overflow-wrap: anywhere; }
.telegram-wizard-actions { display: grid; gap: 9px; }
.telegram-wizard-actions form, .telegram-wizard-actions .btn { width: 100%; }
.telegram-start-guide { display: grid; gap: 3px; padding: 11px 12px; color: #28513a; border: 1px dashed #a9c9b5; border-radius: 12px; background: #f3faf6; font-size: .73rem; line-height: 1.4; }
.telegram-start-guide code { padding: 2px 5px; border-radius: 5px; color: #7b5610; background: #fff1c5; font-weight: 850; }
.detected-chat-form { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; padding: 11px; border: 1px solid #b8d9c4; border-radius: 13px; background: #f3fbf6; }
.detected-chat-form label { min-width: 0; }
.btn:disabled { cursor: not-allowed; opacity: .48; filter: grayscale(.25); }
details { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
summary { color: var(--primary-dark); cursor: pointer; font-weight: 750; }

/* App-like shell & progressive web app */
[hidden] { display: none !important; }
.sidebar-footer-links { display: flex; gap: 10px; flex-wrap: wrap; }
.sidebar-install {
    width: 100%;
    margin-top: 12px;
    padding: 9px 11px;
    color: #fff;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 10px;
    background: rgba(255,255,255,.1);
    cursor: pointer;
    font-weight: 750;
}
.sidebar-backdrop, .mobile-bottom-nav, .public-bottom-nav { display: none; }
.mobile-quick-actions { display: none; }
.topbar-install, .public-install {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 7px 11px;
    color: var(--primary-dark);
    border: 1px solid #b8d7c5;
    border-radius: 10px;
    background: #edf8f2;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 800;
}
.topbar-install { margin-left: auto; }
.topbar-install[hidden] + .today { margin-left: auto; }
.topbar-install:not([hidden]) + .today { margin-left: 0; }
.auth-install { margin-top: 12px; }
.network-status {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 200;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 28px);
    padding: 10px 15px;
    color: #fff;
    border-radius: 999px;
    background: #9a3340;
    box-shadow: 0 10px 30px rgba(20,35,29,.24);
    font-size: .82rem;
    font-weight: 750;
    text-align: center;
}
.network-status.online { background: #147447; }
html:fullscreen .mobile-bottom-nav, html:fullscreen .public-bottom-nav { display: none !important; }
.app-install-guide { display: grid; gap: 9px; margin-bottom: 13px; }
.app-install-guide div { padding: 11px 12px; border: 1px solid var(--border); border-radius: 12px; background: #f8fbf9; }
.app-install-guide span { color: var(--primary-dark); font-size: .75rem; font-weight: 850; }
.app-install-guide p { margin: 3px 0 0; color: var(--muted); font-size: .76rem; }

@media (display-mode: standalone) {
    .topbar-install, .public-install, .sidebar-install, .auth-install { display: none !important; }
}

@media (max-width: 760px) {
    :root { --radius: 18px; --shadow: 0 7px 24px rgba(25, 58, 41, .075); }
    html { width: 100%; max-width: 100%; background: #edf4f0; overflow-x: hidden; overscroll-behavior-y: none; }
    body { width: 100%; max-width: 100%; padding-bottom: calc(72px + env(safe-area-inset-bottom)); overflow-x: hidden; }
    body.sidebar-open { overflow: hidden; }
    .app-shell { display: block !important; grid-template-columns: none !important; width: 100% !important; max-width: 100% !important; min-height: calc(100vh - 72px); }
    .sidebar {
        inset: 0 auto 0 0;
        width: min(86vw, 320px);
        height: 100dvh;
        z-index: 100;
        padding: calc(18px + env(safe-area-inset-top)) 15px calc(18px + env(safe-area-inset-bottom));
        border-radius: 0 24px 24px 0;
        transition: transform .24s cubic-bezier(.2,.8,.2,1);
    }
    .sidebar .brand { padding-bottom: 15px; }
    .nav-menu { gap: 3px; }
    .nav-link { min-height: 46px; padding: 11px 13px; border-radius: 12px; }
    .nav-link.active { box-shadow: none; background: rgba(255,255,255,.16); }
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 90;
        visibility: hidden;
        opacity: 0;
        border: 0;
        background: rgba(9, 25, 17, .5);
        backdrop-filter: blur(2px);
        transition: opacity .2s ease, visibility .2s ease;
    }
    .sidebar-backdrop.open { visibility: visible; opacity: 1; }
    .mobile-bottom-nav, .public-bottom-nav {
        position: fixed;
        right: 8px;
        bottom: max(8px, env(safe-area-inset-bottom));
        left: 8px;
        z-index: 85;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        min-height: 62px;
        padding: 5px;
        border: 1px solid rgba(205, 220, 211, .9);
        border-radius: 20px;
        background: rgba(255,255,255,.94);
        box-shadow: 0 13px 38px rgba(18, 59, 37, .2);
        backdrop-filter: blur(16px);
    }
    .mobile-bottom-nav a, .mobile-bottom-nav button,
    .public-bottom-nav a {
        min-width: 0;
        min-height: 52px;
        display: grid;
        place-items: center;
        align-content: center;
        gap: 1px;
        padding: 3px 2px;
        color: #67776e;
        border: 0;
        border-radius: 15px;
        background: transparent;
        cursor: pointer;
    }
    .mobile-bottom-nav span, .public-bottom-nav span { font-size: 1.12rem; font-weight: 900; line-height: 1; }
    .mobile-bottom-nav small, .public-bottom-nav small { font-size: .62rem; font-weight: 750; white-space: nowrap; }
    .mobile-bottom-nav .active, .public-bottom-nav .active { color: #fff; background: linear-gradient(145deg, var(--primary), var(--primary-dark)); }
    .main-content { width: 100% !important; max-width: 100% !important; min-width: 0 !important; min-height: 100dvh; margin: 0 !important; }
    .topbar {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 66px;
        padding: calc(9px + env(safe-area-inset-top)) 14px 9px;
        background: rgba(255,255,255,.94);
        box-shadow: 0 4px 18px rgba(28,69,47,.06);
        backdrop-filter: blur(16px);
    }
    .menu-button { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 13px; background: #edf7f1; }
    .topbar h1 { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.05rem; }
    .topbar p { max-width: 46vw; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .69rem; }
    .topbar-install { margin-left: auto; padding: 6px 9px; font-size: .7rem; }
    .page-content { width: 100% !important; max-width: 100% !important; padding: 14px 12px 24px; }
    .card { margin-bottom: 13px; padding: 15px; border-radius: 18px; box-shadow: var(--shadow); }
    .card-header { gap: 10px; margin-bottom: 14px; }
    .card-header h2, .card h2 { font-size: 1rem; }
    .card-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card-actions .btn { width: 100%; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 13px; }
    .stat-card { min-height: 104px; padding: 14px; border-radius: 17px; }
    .stat-card strong { font-size: 1.5rem; }
    .content-grid { gap: 13px; }
    .content-grid-students { grid-template-columns: minmax(0, 1fr); }
    .mobile-quick-actions {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        margin: 0 0 13px;
    }
    .mobile-quick-actions a {
        min-width: 0;
        display: grid;
        justify-items: center;
        gap: 2px;
        padding: 12px 5px 10px;
        color: var(--text);
        border: 1px solid var(--border);
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 5px 18px rgba(25,58,41,.06);
        text-align: center;
    }
    .mobile-quick-actions span { width: 37px; height: 37px; display: grid; place-items: center; margin-bottom: 3px; color: #fff; border-radius: 12px; background: linear-gradient(145deg, var(--primary), var(--primary-dark)); font-size: 1rem; font-weight: 900; }
    .mobile-quick-actions strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .7rem; }
    .mobile-quick-actions small { color: var(--muted); font-size: .56rem; white-space: nowrap; }
    .btn { min-height: 44px; padding: 10px 13px; border-radius: 12px; }
    .btn-sm { min-height: 39px; padding: 8px 10px; }
    input, select, textarea { min-height: 47px; padding: 11px 12px; border-radius: 12px; font-size: 16px; }
    textarea { min-height: 100px; }
    .check-label { min-height: 43px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: #fbfdfc; }
    .check-label input { min-height: auto; }
    .inline-form { display: grid; grid-template-columns: 1fr; align-items: stretch; gap: 10px; }
    .inline-form > label { min-width: 0; }
    .inline-form > .btn { width: 100%; }
    .form-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
    .form-actions > .btn, .form-actions > form, .form-actions > form .btn { width: 100%; }
    .detected-chat-form { grid-template-columns: minmax(0, 1fr); }
    .table-wrap {
        max-width: 100%;
        border-radius: 14px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
    }
    .table-wrap table { min-width: 680px; }
    th, td { padding: 11px 10px; }
    th { position: sticky; top: 0; z-index: 1; }
    .row-actions { min-width: 130px; }
    .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
    .tabs::-webkit-scrollbar { display: none; }
    .tab { flex: 0 0 auto; min-height: 42px; display: inline-flex; align-items: center; }
    .alert { border-radius: 14px; }
    dialog { width: calc(100% - 20px); max-width: none; max-height: 88dvh; margin: auto 10px 10px; border-radius: 22px 22px 10px 10px; }
    .pagination { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; }
    .pagination a, .pagination span { flex: 0 0 auto; min-width: 40px; height: 40px; }
    .network-status { bottom: calc(82px + env(safe-area-inset-bottom)); }
    .public-page { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
    .public-header {
        position: sticky;
        top: 0;
        z-index: 75;
        min-height: 64px;
        padding: calc(8px + env(safe-area-inset-top)) 13px 8px;
        flex-wrap: nowrap;
        box-shadow: 0 5px 20px rgba(10,52,30,.15);
    }
    .public-brand { min-width: 0; }
    .public-brand img { width: 42px; height: 42px; flex: 0 0 42px; }
    .public-brand strong { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .public-brand small { font-size: .65rem; }
    .public-menu-button, .public-nav { display: none !important; }
    .public-install { margin-left: auto; color: #fff; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.12); }
    .public-main { width: min(100% - 20px, 1180px); padding: 22px 0 16px; }
    .public-title { margin-bottom: 18px; }
    .public-title h1 { font-size: 1.45rem; }
    .public-card { margin-bottom: 13px; padding: 15px; border-radius: 18px; }
    .public-footer { margin-bottom: 8px; }
    .auth-page { align-content: center; padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom)); }
    .auth-card, .installer-card { border-radius: 24px; box-shadow: 0 22px 60px rgba(24,67,44,.16); }
}

@media (max-width: 390px) {
    .mobile-bottom-nav, .public-bottom-nav { right: 5px; bottom: max(5px, env(safe-area-inset-bottom)); left: 5px; }
    .mobile-bottom-nav small, .public-bottom-nav small { font-size: .58rem; }
    .topbar-install { max-width: 72px; overflow: hidden; white-space: nowrap; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-card { min-height: 96px; padding: 12px; }
    .mobile-quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mobile-quick-actions a { grid-template-columns: 38px 1fr; justify-items: start; align-items: center; text-align: left; }
    .mobile-quick-actions span { grid-row: 1 / 3; margin: 0; }
}

@media print {
    .mobile-bottom-nav, .public-bottom-nav, .mobile-quick-actions, .sidebar-backdrop, .topbar-install, .public-install, .sidebar-install, .network-status { display: none !important; }
    body, .public-page { padding-bottom: 0; }
}

@media (max-width: 460px) {
    .wa-stats { grid-template-columns: 1fr; }
}

/* v1.5.6 — Telegram wali, rekap per kelas, polling cadangan, dan absensi mobile */
.telegram-parent-link-card { display: grid; gap: 11px; padding: 14px; border: 1px solid #d8e3db; border-radius: 15px; background: #f8fbf9; }
.telegram-parent-link-card.linked { border-color: #9ed1b3; background: #effaf4; }
.telegram-parent-link-card strong, .telegram-parent-link-card small { display: block; }
.telegram-parent-link-card small { margin-top: 3px; color: var(--muted); font-size: .74rem; }
.telegram-parent-link-card input { font-size: .78rem; }
.telegram-parent-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.telegram-parent-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.telegram-parent-stats div { padding: 12px 7px; border: 1px solid var(--border); border-radius: 12px; text-align: center; background: #f8fbf9; }
.telegram-parent-stats strong, .telegram-parent-stats span { display: block; }
.telegram-parent-stats strong { color: var(--primary-dark); font-size: 1.35rem; }
.telegram-parent-stats span { color: var(--muted); font-size: .67rem; }

@media screen and (max-width: 760px) {
    html, body, .app-shell, .main-content, .topbar, .page-content { width: 100% !important; max-width: none !important; min-width: 0 !important; }
    .app-shell { display: block !important; grid-template-columns: none !important; }
    .main-content, .topbar, .page-content { margin: 0 !important; }
    .page-content > * { max-width: 100% !important; }
}

@media screen and (max-width: 760px) {
    .attendance-table-wrap { overflow: visible; border: 0; background: transparent; }
    .attendance-table-wrap .attendance-table { min-width: 0 !important; display: block; }
    .attendance-table thead { display: none; }
    .attendance-table tbody { display: grid; gap: 10px; }
    .attendance-table tr { display: grid; grid-template-columns: 44px minmax(0, 1fr); padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: 0 5px 16px rgba(25,58,41,.05); }
    .attendance-table td { display: block; padding: 3px 5px; border: 0; min-width: 0; }
    .attendance-table td:nth-child(1) { grid-column: 1; grid-row: 1; color: var(--muted); font-weight: 800; }
    .attendance-table td:nth-child(2) { grid-column: 1; grid-row: 2; color: var(--muted); font-size: .72rem; overflow-wrap: anywhere; }
    .attendance-table td:nth-child(3) { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
    .attendance-table td:nth-child(4), .attendance-table td:nth-child(5) { grid-column: 1 / -1; display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 8px; align-items: center; margin-top: 7px; padding-top: 10px; border-top: 1px solid #edf1ee; }
    .attendance-table td:nth-child(4)::before, .attendance-table td:nth-child(5)::before { content: attr(data-label); color: var(--muted); font-size: .72rem; font-weight: 800; }
    .attendance-table .attendance-status { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
    .attendance-table .attendance-status label, .attendance-table .attendance-status span { width: 100%; }
    .attendance-table .attendance-status span { min-width: 0; min-height: 42px; display: grid; place-items: center; padding: 7px 3px; }
    .attendance-table input { min-width: 0; }
    .telegram-parent-actions { display: grid; grid-template-columns: 1fr; }
    .telegram-parent-actions .btn { width: 100%; }
}

@media screen and (max-width: 390px) {
    .telegram-parent-stats { grid-template-columns: 1fr; }
}

/* Rekap pengiriman Telegram per siswa */
.telegram-recap-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.telegram-delivery-list { display: grid; gap: 12px; }
.telegram-delivery-item { display: grid; grid-template-columns: minmax(210px, 1.1fr) minmax(420px, 2fr) auto; gap: 14px 18px; align-items: center; padding: 15px; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(145deg, #fff, #f8fbf9); }
.telegram-delivery-student { min-width: 0; display: flex; align-items: center; gap: 11px; }
.telegram-delivery-student .student-avatar { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: linear-gradient(145deg, var(--primary), var(--primary-dark)); font-weight: 900; }
.telegram-delivery-student strong, .telegram-delivery-student small { display: block; }
.telegram-delivery-student strong { overflow-wrap: anywhere; }
.telegram-delivery-student small { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.telegram-delivery-details { min-width: 0; display: grid; grid-template-columns: repeat(5, minmax(100px, 1fr)); gap: 9px; }
.telegram-delivery-details > div { min-width: 0; padding-left: 10px; border-left: 2px solid #e6eee9; }
.telegram-delivery-details small, .telegram-delivery-details strong { display: block; }
.telegram-delivery-details small { color: var(--muted); font-size: .66rem; }
.telegram-delivery-details strong { margin-top: 3px; overflow-wrap: anywhere; font-size: .78rem; }
.telegram-delivery-details .badge { display: inline-flex; margin-top: 4px; white-space: normal; text-align: left; }
.telegram-delivery-error { grid-column: 1 / -1; padding: 9px 11px; border-radius: 10px; color: #862634; background: #fff0f2; overflow-wrap: anywhere; font-size: .74rem; }
.telegram-delivery-actions { justify-self: end; }
.telegram-delivery-actions form { margin: 0; }
.delivery-complete { color: var(--success); font-size: .76rem; font-weight: 800; }

@media screen and (max-width: 1180px) {
    .telegram-recap-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .telegram-delivery-item { grid-template-columns: minmax(190px, .8fr) minmax(0, 2fr); }
    .telegram-delivery-actions { grid-column: 1 / -1; justify-self: stretch; }
    .telegram-delivery-actions .btn { width: 100%; }
}

@media screen and (max-width: 760px) {
    .telegram-recap-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .telegram-delivery-item { display: block; padding: 13px; }
    .telegram-delivery-details { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 13px; }
    .telegram-delivery-details > div { padding: 8px; border: 1px solid #e6eee9; border-radius: 10px; }
    .telegram-delivery-error { margin-top: 10px; }
    .telegram-delivery-actions { margin-top: 12px; }
    .telegram-delivery-actions .btn { width: 100%; min-height: 44px; }
}

@media screen and (max-width: 390px) {
    .telegram-delivery-details { grid-template-columns: 1fr; }
}

/* v1.5.6 refinement — polished authentication, public portal, admin shell */
:root {
    --primary: #0f6a3d;
    --primary-dark: #084c2b;
    --surface-soft: #f5faf7;
}

.auth-page-modern {
    min-height: 100vh;
    padding: 28px;
    background:
        radial-gradient(circle at 8% 8%, rgba(40, 177, 102, .22), transparent 28%),
        radial-gradient(circle at 92% 86%, rgba(244, 201, 93, .18), transparent 25%),
        linear-gradient(145deg, #eaf5ef 0%, #f7faf8 54%, #eef6f1 100%);
}
.auth-shell {
    width: min(1080px, 100%);
    min-height: 650px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(390px, .85fr);
    overflow: hidden;
    border: 1px solid rgba(15, 106, 61, .12);
    border-radius: 30px;
    background: #fff;
    box-shadow: 0 32px 90px rgba(6, 62, 35, .15);
}
.auth-showcase {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 42px;
    color: #fff;
    background:
        radial-gradient(circle at 82% 18%, rgba(255,255,255,.14), transparent 25%),
        linear-gradient(145deg, #0b5532 0%, #0f7040 58%, #138650 100%);
}
.auth-showcase::after {
    content: '';
    position: absolute;
    right: -80px;
    bottom: -120px;
    width: 310px;
    height: 310px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    box-shadow: 0 0 0 45px rgba(255,255,255,.035), 0 0 0 90px rgba(255,255,255,.025);
    pointer-events: none;
}
.auth-showcase-brand { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.auth-showcase-brand .auth-logo { width: 58px; height: 58px; flex-basis: 58px; border-radius: 18px; padding: 5px; }
.auth-showcase-brand span, .auth-showcase-brand strong, .auth-showcase-brand small { display: block; }
.auth-showcase-brand span { font-weight: 900; letter-spacing: .16em; font-size: .72rem; color: #bde7cd; }
.auth-showcase-brand strong { max-width: 430px; margin-top: 2px; font-size: 1.02rem; line-height: 1.25; }
.auth-showcase-brand small { max-width: 430px; margin-top: 3px; color: rgba(255,255,255,.68); font-size: .72rem; }
.auth-showcase-copy { position: relative; z-index: 1; margin: auto 0 28px; max-width: 610px; }
.auth-eyebrow { display: inline-block; color: #2c8b59; font-size: .69rem; font-weight: 850; letter-spacing: .14em; }
.auth-showcase .auth-eyebrow { color: #c4edd3; }
.auth-showcase-copy h1 { max-width: 570px; margin: 10px 0 14px; font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.04; letter-spacing: -.035em; }
.auth-showcase-copy p { max-width: 550px; margin: 0; color: rgba(255,255,255,.78); font-size: .98rem; line-height: 1.7; }
.auth-feature-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.auth-feature-grid > div { display: grid; grid-template-columns: 38px 1fr; gap: 0 10px; align-items: center; padding: 13px; border: 1px solid rgba(255,255,255,.12); border-radius: 15px; background: rgba(255,255,255,.075); backdrop-filter: blur(8px); }
.auth-feature-grid > div > span { grid-row: span 2; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: #155f39; background: #e9f8ef; font-weight: 900; }
.auth-feature-grid strong { font-size: .83rem; }
.auth-feature-grid small { margin-top: 1px; color: rgba(255,255,255,.66); font-size: .68rem; }
.auth-security-note { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; margin-top: 20px; color: rgba(255,255,255,.7); font-size: .74rem; }
.auth-security-note span { width: 8px; height: 8px; border-radius: 50%; background: #8ff0b1; box-shadow: 0 0 0 5px rgba(143,240,177,.12); }
.auth-card-modern { width: auto; margin: 0; padding: 52px 44px; border: 0; border-radius: 0; box-shadow: none; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.auth-card-heading { margin-bottom: 24px; }
.auth-card-heading h2 { margin: 6px 0 6px; font-size: 1.8rem; line-height: 1.15; letter-spacing: -.02em; }
.auth-card-heading p { margin: 0; color: var(--muted); font-size: .86rem; }
.auth-form { gap: 16px; }
.auth-form label { font-size: .83rem; }
.auth-form input { min-height: 48px; border-radius: 12px; background: #fbfdfc; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 86px; }
.password-toggle { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); min-width: 62px; padding: 7px 8px; border: 0; border-radius: 8px; color: var(--primary); background: #e9f6ee; cursor: pointer; font-size: .73rem; font-weight: 800; }
.auth-submit { min-height: 50px; justify-content: space-between; margin-top: 4px; padding-left: 18px; padding-right: 16px; border-radius: 12px; box-shadow: 0 12px 25px rgba(15,106,61,.18); }
.auth-submit b { font-size: 1.2rem; }
.auth-helper { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 8px; color: var(--muted); font-size: .77rem; }
.auth-helper a { font-weight: 800; }
.auth-public-links-modern { padding-top: 15px; margin-top: 12px; border-top: 1px solid var(--border); }
.auth-public-links-modern a { background: #f1f7f3; }
.auth-card-modern .auth-footer { margin-top: 18px; font-size: .7rem; }

.public-header {
    min-height: 82px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: linear-gradient(110deg, rgba(7, 63, 37, .98), rgba(11, 89, 51, .97));
    backdrop-filter: blur(14px);
}
.public-brand img { box-shadow: 0 7px 18px rgba(0,0,0,.12); }
.public-nav a { transition: .16s ease; }
.public-nav a:hover { transform: translateY(-1px); }
.public-main { padding-top: 36px; }
.public-title { position: relative; padding: 24px 26px; overflow: hidden; border: 1px solid #dbe9df; border-radius: 20px; background: linear-gradient(120deg, #ffffff, #f2faf5); box-shadow: 0 14px 35px rgba(15,70,38,.05); }
.public-title::after { content: ''; position: absolute; right: -58px; top: -78px; width: 210px; height: 210px; border: 34px solid rgba(21, 132, 74, .055); border-radius: 50%; }
.public-title > * { position: relative; z-index: 1; }
.public-card { transition: box-shadow .18s ease, transform .18s ease; }
.public-card:hover { box-shadow: 0 16px 42px rgba(15,70,38,.09); }
.class-chip { transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.class-chip:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15,70,38,.08); }
.public-table tbody tr:nth-child(even) { background: #fbfdfc; }
.privacy-note { display: flex; align-items: flex-start; gap: 7px; padding: 10px 12px; border-radius: 10px; background: #f6faf7; }
.privacy-note::before { content: '●'; color: #2c8b59; font-size: .62rem; margin-top: 2px; }

.sidebar { box-shadow: 9px 0 30px rgba(5, 52, 29, .08); }
.nav-link { transition: background .15s ease, transform .15s ease; }
.nav-link:hover { transform: translateX(2px); }
.topbar { box-shadow: 0 3px 16px rgba(15, 70, 38, .035); }
.admin-top-meta { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.admin-user-chip { display: grid; grid-template-columns: 34px auto; gap: 8px; align-items: center; padding: 6px 10px 6px 7px; border: 1px solid #dce8e0; border-radius: 12px; background: #fff; }
.admin-user-chip > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(145deg, #117345, #0a5532); font-size: .72rem; font-weight: 850; }
.admin-user-chip strong, .admin-user-chip small { display: block; }
.admin-user-chip strong { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.admin-user-chip small { color: var(--muted); font-size: .65rem; }
.system-readiness { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: center; }
.readiness-score { width: 170px; height: 170px; display: grid; place-items: center; margin: 0 auto; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--score) * 1%), #e8f0eb 0); position: relative; }
.readiness-score::before { content: ''; position: absolute; inset: 13px; border-radius: inherit; background: #fff; }
.readiness-score > div { position: relative; z-index: 1; text-align: center; }
.readiness-score strong { display: block; color: var(--primary-dark); font-size: 2.15rem; line-height: 1; }
.readiness-score small { display: block; margin-top: 5px; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
.readiness-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.readiness-item { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: center; padding: 11px 12px; border: 1px solid #e0e8e2; border-radius: 12px; background: #fbfdfc; }
.readiness-item > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; font-weight: 900; }
.readiness-item.ok > span { color: #0d6940; background: #e0f5e9; }
.readiness-item.warn > span { color: #8a5809; background: #fff0d5; }
.readiness-item strong, .readiness-item small { display: block; }
.readiness-item strong { font-size: .79rem; }
.readiness-item small { margin-top: 1px; color: var(--muted); font-size: .68rem; line-height: 1.35; }

.bulk-action-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid #dce7df; border-radius: 12px; background: #f7fbf8; }
.bulk-action-bar p { margin: 0; color: var(--muted); font-size: .79rem; }

@media (max-width: 900px) {
    .auth-page-modern { padding: 18px; align-items: start; }
    .auth-shell { min-height: 0; grid-template-columns: 1fr; border-radius: 24px; }
    .auth-showcase { padding: 28px; min-height: 290px; }
    .auth-showcase-copy { margin: 34px 0 0; }
    .auth-showcase-copy h1 { font-size: 2rem; max-width: 540px; }
    .auth-feature-grid { margin-top: 25px; }
    .auth-security-note { display: none; }
    .auth-card-modern { padding: 34px 28px; }
    .system-readiness { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .admin-top-meta { margin-left: auto; }
    .admin-user-chip { display: none; }
    .public-title { padding: 20px; border-radius: 16px; }
    .public-main { padding-top: 20px; }
    .readiness-list { grid-template-columns: 1fr; }
    .readiness-score { width: 150px; height: 150px; }
    .bulk-action-bar { align-items: stretch; flex-direction: column; }
}

@media (max-width: 560px) {
    .auth-page-modern { padding: 0; background: #fff; }
    .auth-shell { border: 0; border-radius: 0; box-shadow: none; }
    .auth-showcase { min-height: 235px; padding: 24px 20px; }
    .auth-showcase-brand .auth-logo { width: 50px; height: 50px; flex-basis: 50px; }
    .auth-showcase-copy { margin-top: 28px; }
    .auth-showcase-copy h1 { margin-bottom: 8px; font-size: 1.65rem; }
    .auth-showcase-copy p { display: none; }
    .auth-feature-grid { display: none; }
    .auth-card-modern { padding: 30px 20px 38px; }
    .auth-card-heading h2 { font-size: 1.55rem; }
    .auth-helper { align-items: flex-start; flex-direction: column; gap: 4px; }
}

/* v1.5.6 — Rekap kehadiran matriks per tanggal */
.matrix-print-hint { max-width: 1180px; margin: 0 auto 16px; padding: 12px 15px; border: 1px solid #cfe1d5; border-radius: 12px; color: #31533f; background: #f2faf5; font-size: .82rem; }
.attendance-matrix-sheet { width: min(1180px, 100%); padding: 10mm; }
.matrix-new-page { margin-top: 22px; }
.matrix-letterhead { grid-template-columns: 18mm 1fr 18mm; gap: 4mm; padding-bottom: 3mm; }
.matrix-letterhead img { width: 17mm; height: 17mm; }
.matrix-letterhead h1 { font-size: 14pt; }
.matrix-title { padding: 4mm 0 3.5mm; }
.matrix-title h2 { font-size: 11pt; }
.matrix-meta { grid-template-columns: 1fr 1.25fr 1fr .7fr 1.2fr 1fr; margin-bottom: 3mm; }
.matrix-meta div { padding: 1.7mm 2mm; }
.matrix-table-wrap { width: 100%; overflow-x: auto; }
.attendance-matrix-table { width: 100%; min-width: max-content; border-collapse: collapse; table-layout: auto; font-size: 6.5pt; }
.attendance-matrix-table th, .attendance-matrix-table td { text-align: center; vertical-align: middle; white-space: nowrap; }
.attendance-matrix-table thead th { padding: 1.25mm .8mm; }
.attendance-matrix-table tbody td { padding: 1.15mm .7mm; height: 5.4mm; }
.attendance-matrix-table .matrix-col-no { width: 7mm; min-width: 7mm; text-align: center; }
.attendance-matrix-table .matrix-col-nis { width: 19mm; min-width: 19mm; text-align: left; }
.attendance-matrix-table .matrix-col-name { width: 43mm; min-width: 43mm; max-width: 43mm; text-align: left; white-space: normal; line-height: 1.1; }
.attendance-matrix-table .matrix-date-group { letter-spacing: .05em; }
.attendance-matrix-table .matrix-date-head { width: 5.4mm; min-width: 5.4mm; padding: .75mm .25mm; }
.attendance-matrix-table .matrix-date-head strong, .attendance-matrix-table .matrix-date-head small { display: block; }
.attendance-matrix-table .matrix-date-head strong { font-size: 6.7pt; line-height: 1; }
.attendance-matrix-table .matrix-date-head small { margin-top: .45mm; color: rgba(255,255,255,.82); font-size: 4.7pt; line-height: 1; }
.attendance-matrix-table .matrix-summary-head { background: #0b5631; }
.attendance-matrix-table .matrix-status-cell { width: 5.4mm; min-width: 5.4mm; padding: 1mm .25mm; font-weight: 900; }
.attendance-matrix-table .matrix-empty { color: #a9b4ac; background: #fff; }
.attendance-matrix-table .matrix-h { color: #075f34; background: #e6f6ec; }
.attendance-matrix-table .matrix-s { color: #185e7c; background: #e5f2f8; }
.attendance-matrix-table .matrix-i { color: #81500b; background: #fff2d9; }
.attendance-matrix-table .matrix-a { color: #9b2739; background: #fde5e9; }
.attendance-matrix-table .matrix-total-h,
.attendance-matrix-table .matrix-total-s,
.attendance-matrix-table .matrix-total-i,
.attendance-matrix-table .matrix-total-a,
.attendance-matrix-table .matrix-total-all { width: 7mm; min-width: 7mm; font-weight: 850; }
.attendance-matrix-table tbody .matrix-total-h { color: #075f34; background: #eff9f3; }
.attendance-matrix-table tbody .matrix-total-s { color: #185e7c; background: #eef7fa; }
.attendance-matrix-table tbody .matrix-total-i { color: #81500b; background: #fff8e9; }
.attendance-matrix-table tbody .matrix-total-a { color: #9b2739; background: #fff0f2; }
.attendance-matrix-table tbody .matrix-total-all { background: #f1f4f2; }
.attendance-matrix-table .matrix-weekend { background-image: repeating-linear-gradient(135deg, rgba(58,75,64,.04) 0, rgba(58,75,64,.04) 2px, rgba(58,75,64,.10) 2px, rgba(58,75,64,.10) 3px); }
.attendance-matrix-table thead .matrix-weekend { background-color: #53665a; background-image: none; }
.attendance-matrix-table tfoot th, .attendance-matrix-table tfoot td { padding: .9mm .55mm; border: .25mm solid #d2ddd5; font-size: 5.7pt; font-weight: 800; }
.attendance-matrix-table tfoot th { text-align: right; background: #f1f5f2; }
.attendance-matrix-table tfoot .matrix-h td { color: #075f34; background-color: #eef8f2; }
.attendance-matrix-table tfoot .matrix-s td { color: #185e7c; background-color: #eef7fa; }
.attendance-matrix-table tfoot .matrix-i td { color: #81500b; background-color: #fff8e9; }
.attendance-matrix-table tfoot .matrix-a td { color: #9b2739; background-color: #fff0f2; }
.matrix-legend { gap: 2.5mm 4mm; margin-top: 2mm; font-size: 5.8pt; }
.legend-dot { display: inline-grid; width: 4mm; height: 4mm; place-items: center; margin-right: .7mm; border-radius: 1mm; }
.legend-h { color: #075f34; background: #e6f6ec; }.legend-s { color: #185e7c; background: #e5f2f8; }.legend-i { color: #81500b; background: #fff2d9; }.legend-a { color: #9b2739; background: #fde5e9; }
.matrix-signatures { gap: 60mm; margin-top: 5mm; font-size: 7pt; }
.matrix-signatures span { height: 10mm; }

@page attendance-matrix { size: A4 landscape; margin: 7mm; }

@media print {
    .attendance-matrix-sheet { page: attendance-matrix; width: 100%; max-width: none; margin: 0; padding: 0; overflow: visible; break-after: page; page-break-after: always; }
    .attendance-matrix-sheet:last-of-type { break-after: auto; page-break-after: auto; }
    .matrix-new-page { margin-top: 0; break-before: page; page-break-before: always; }
    .matrix-table-wrap { overflow: visible; }
    .attendance-matrix-table { width: 100%; min-width: 0; table-layout: fixed; font-size: 5.3pt; }
    .attendance-matrix-table thead { display: table-header-group; }
    .attendance-matrix-table tfoot { display: table-row-group; }
    .attendance-matrix-table th, .attendance-matrix-table td { break-inside: avoid; page-break-inside: avoid; }
    .attendance-matrix-table .matrix-col-no { width: 6mm; min-width: 0; }
    .attendance-matrix-table .matrix-col-nis { width: 16mm; min-width: 0; }
    .attendance-matrix-table .matrix-col-name { width: 39mm; min-width: 0; max-width: none; }
    .attendance-matrix-table .matrix-date-head,
    .attendance-matrix-table .matrix-status-cell { width: auto; min-width: 0; }
    .attendance-matrix-table .matrix-total-h,
    .attendance-matrix-table .matrix-total-s,
    .attendance-matrix-table .matrix-total-i,
    .attendance-matrix-table .matrix-total-a,
    .attendance-matrix-table .matrix-total-all { width: 6.5mm; min-width: 0; }
    .attendance-matrix-table tbody td { height: 4.2mm; padding: .65mm .35mm; }
    .attendance-matrix-table thead th { padding: .75mm .3mm; }
    .attendance-matrix-table .matrix-date-head strong { font-size: 5.8pt; }
    .attendance-matrix-table .matrix-date-head small { font-size: 4pt; }
    .matrix-letterhead { grid-template-columns: 14mm 1fr 14mm; gap: 3mm; padding-bottom: 2mm; }
    .matrix-letterhead img { width: 13mm; height: 13mm; }
    .matrix-letterhead h1 { font-size: 11pt; }
    .matrix-letterhead p { font-size: 6pt; }
    .matrix-letterhead span { font-size: 5.5pt; }
    .matrix-letterhead .report-mark { width: 13mm; height: 13mm; font-size: 5.5pt; }
    .matrix-title { padding: 2.5mm 0 2mm; }
    .matrix-title h2 { font-size: 9pt; }
    .matrix-title p { font-size: 6pt; }
    .matrix-meta { margin-bottom: 2mm; }
    .matrix-meta div { padding: 1mm 1.2mm; }
    .matrix-meta span { font-size: 4.7pt; }
    .matrix-meta strong { font-size: 5.8pt; }
    .matrix-legend { margin-top: 1.3mm; font-size: 5pt; }
    .matrix-signatures { gap: 75mm; margin-top: 3mm; font-size: 6pt; }
    .matrix-signatures span { height: 7mm; }
}

@media (max-width: 760px) {
    .attendance-matrix-sheet { padding: 6mm; }
    .matrix-meta { grid-template-columns: repeat(2, 1fr); }
    .matrix-table-wrap { border: 1px solid var(--border); border-radius: 10px; }
}
.attendance-matrix-table tfoot .matrix-recorded th,
.attendance-matrix-table tfoot .matrix-recorded td { color: #33453a; background-color: #edf2ee; }


/* Mobile SIAKSI v1.5.8 */
.shortcut-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.shortcut-grid a{min-height:48px;display:flex;align-items:center;justify-content:center;border-radius:12px}@media(max-width:768px){.shortcut-grid{grid-template-columns:1fr}.page,.card{width:100%!important;max-width:100%!important}.public-header{padding:16px}.public-page .card{margin:12px}.table{display:block;overflow-x:auto}.sidebar{width:100%;max-width:100%}}
