:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --ink: #172033;
    --muted: #667085;
    --line: #d9e1ec;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --accent: #2563eb;
    --success: #16835f;
    --warning: #a16207;
    --danger: #c24135;
--radius: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 28px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    color: #ffffff;
    background: var(--primary);
    font-weight: 700;
}

.brand-logo {
    display: block;
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    object-fit: cover;
    background: #ffffff;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.nav-user {
    color: var(--muted);
    padding: 8px 10px;
    font-size: 13px;
}

.nav a {
    color: var(--ink);
    padding: 8px 10px;
    border-radius: var(--radius);
}

.nav a:hover {
    background: #e9f7f5;
    text-decoration: none;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto;
}

.footer {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 28px;
    color: var(--muted);
    font-size: 14px;
}

.hero,
.panel,
.form-card {
    margin-bottom: 20px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 8px 24px rgba(15,23,42,.06);
}

.hero{
    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:30px;

    background:
    linear-gradient(
        135deg,
        #0f766e,
        #14b8a6
    );

    color:#fff;

    border:none;

    border-radius:22px;

    box-shadow:
    0 18px 40px rgba(15,118,110,.20);
}

.hero h1{
    color:#fff;
    font-size:36px;
}

.hero h1{
    color:#ffffff !important;
}

.hero p{
    color:rgba(255,255,255,.95) !important;
    font-size:15px;
}

.hero .muted{
    color:rgba(255,255,255,.85) !important;
}



.hero-actions {
    display: grid;
    gap: 10px;
    justify-items: stretch;
}

h1,
h2,
h3 {
    margin: 0 0 10px;
    line-height: 1.2;
}

.muted,
.hero p {
    color: var(--muted);
}

.actions,
.row-actions,
.form-actions,
.status-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stats article,
.mini-card{
    padding:24px;
    border:none;
    border-radius:20px;

    background:linear-gradient(
        135deg,
        #0f766e,
        #14b8a6
    );

    color:#fff;

    box-shadow:
    0 15px 35px rgba(15,118,110,.25);

    transition:.3s ease;
}

.stats article:hover{
    transform:translateY(-6px);
}

.stats span,
.mini-card span{

    color:rgba(255,255,255,.85);
    font-size:14px;
    text-transform:uppercase;
    letter-spacing:.08em;
}

.stats strong{
    display:block;
    margin-top:10px;
    font-size:42px;
    font-weight:800;
    color:#fff;
}

.account-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid rgba(15, 118, 110, .12);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.96), rgba(240,253,250,.95)),
        radial-gradient(circle at 90% 15%, rgba(37, 99, 235, .12), transparent 34%);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
}

.account-info span,
.account-meta span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.account-info h2 {
    margin: 4px 0 4px;
    color: #172033;
    font-size: 24px;
}

.account-info p {
    margin: 0;
    color: #475467;
}

.account-meta {
    padding: 13px 15px;
    border: 1px solid #dbe7f3;
    border-radius: 16px;
    background: rgba(255,255,255,.82);
}

.account-meta strong {
    display: block;
    margin-top: 5px;
    color: #0f766e;
    white-space: nowrap;
}

.grid-two {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: #344054;
    background: #f8fafc;
    font-size: 13px;
}

.empty {
    color: var(--muted);
    text-align: center;
    padding: 28px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.badge.menunggu {
    color: #854d0e;
    background: #fef3c7;
}

.badge.kedaluwarsa {
    color: #475569;
    background: #e2e8f0;
}

.badge.disetujui {
    color: #175cd3;
    background: #dbeafe;
}

.badge.ditolak,
.badge.dibatalkan {
    color: #991b1b;
    background: #fee2e2;
}

.badge.keluar {
    color: #7c2d12;
    background: #ffedd5;
}

.badge.kembali,
.badge.aktif {
    color: #075e45;
    background: #dcfce7;
}

.badge.nonaktif {
    color: #991b1b;
    background: #fee2e2;
}

.badge.hadir { color: #075e45; background: #dcfce7; }
.badge.sakit { color: #854d0e; background: #fef3c7; }
.badge.izin { color: #1d4ed8; background: #dbeafe; }
.badge.tugas-sekolah { color: #0f766e; background: #ccfbf1; }
.badge.dinas-luar { color: #0f766e; background: #ccfbf1; }
.badge.cuti { color: #6d28d9; background: #ede9fe; }
.badge.terlambat { color: #c2410c; background: #ffedd5; }

.presensi-guru-page {
    max-width: 100%;
}

.presensi-guru-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.presensi-guru-stats {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.teacher-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #ccfbf1;
    color: #0f766e;
    font-weight: 900;
}

.teacher-avatar.large {
    width: 78px;
    height: 78px;
    font-size: 30px;
}

.teacher-detail-hero {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
}

.rekap-bars {
    display: grid;
    gap: 12px;
}

.rekap-bars div {
    display: grid;
    grid-template-columns: 140px 1fr 48px;
    align-items: center;
    gap: 12px;
}

.rekap-bars span {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.rekap-bars i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, #14b8a6, #0f766e);
}

.presensi-guru-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
    width: 100%;
    min-width: 0;
}

.presensi-guru-layout > .panel {
    min-width: 0;
    margin: 0;
}

#bulkHiddenFields {
    display: none;
}

.bulk-primary-action,
.bulk-save-button {
    width: 100%;
    min-height: 54px;
    border-radius: 20px;
    font-weight: 900;
}

.bulk-progress-card,
.bulk-picker-card,
.save-summary-card {
    display: grid;
    gap: 14px;
    margin-top: 16px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

.bulk-picker-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bulk-picker-card .full {
    grid-column: 1 / -1;
}

.bulk-progress {
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.bulk-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    transition: width .3s ease;
}

.teacher-check-list {
    display: grid;
    gap: 8px;
    max-height: 320px;
    overflow: auto;
    padding: 4px;
}

.teacher-check-item {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #ffffff;
}

.teacher-check-item input {
    width: 20px;
    height: 20px;
    min-height: 20px;
    accent-color: #0f766e;
}

.teacher-check-item strong {
    display: grid;
    min-width: 0;
    font-size: 14px;
}

.teacher-check-item small,
.teacher-check-item em {
    color: #64748b;
    font-size: 12px;
    font-style: normal;
}

.bulk-status-summary {
    display: grid;
    gap: 12px;
}

.bulk-status-card {
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
    transition: transform .2s ease, box-shadow .2s ease;
}

.bulk-status-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, .08);
}

.bulk-status-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 0;
    cursor: pointer;
    list-style: none;
}

.bulk-status-head::-webkit-details-marker {
    display: none;
}

.bulk-status-head::after {
    content: "\F282";
    font-family: "bootstrap-icons";
    color: #64748b;
    font-size: 13px;
    transition: transform .2s ease;
}

.bulk-status-card[open] .bulk-status-head::after {
    transform: rotate(180deg);
}

.bulk-status-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    animation: softSlideDown .2s ease;
}

.bulk-status-list span,
.bulk-unassigned span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border-radius: 999px;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}

.bulk-status-list button {
    border: 0;
    padding: 0;
    color: #c24135;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.bulk-unassigned {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
    padding: 14px;
    border: 1px dashed #f59e0b;
    border-radius: 20px;
    background: #fffbeb;
}

.bulk-unassigned strong {
    flex-basis: 100%;
    color: #854d0e;
}

.save-summary-card {
    margin-bottom: 18px;
    background: linear-gradient(135deg, #ffffff, #ecfeff);
}

.dashboard-presensi-monitor {
    display: grid;
    gap: 14px;
}

.presence-monitor-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.presence-monitor-grid article,
.presence-monitor-button {
    display: grid;
    gap: 6px;
    min-height: 112px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #ffffff;
    color: #0f172a;
    text-align: left;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

.presence-monitor-button {
    cursor: pointer;
}

.presence-monitor-grid span {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.presence-monitor-grid strong {
    color: #0f766e;
    font-size: 34px;
    line-height: 1;
}

.presence-monitor-grid small {
    color: #64748b;
}

.unrecorded-modal .student-picker-sheet {
    max-width: 560px;
}

.refined-presensi-page {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    padding-inline: 0;
}

.refined-work-card {
    display: grid;
    gap: 18px;
}

.refined-work-card > label,
.refined-picker-card label {
    display: grid;
    gap: 7px;
    color: #334155;
    font-weight: 800;
}

.workflow-title {
    margin: 4px 0 0;
    font-size: 22px;
}

.compact-head {
    margin-bottom: 8px;
}

.compact-head h3 {
    font-size: 16px;
}

.inline-progress-mobile {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.refined-picker-card {
    display: grid;
    gap: 14px;
}

.attendance-input-top {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: 14px;
    margin-top: 18px;
}

.attendance-input-top > div,
.attendance-entry-card {
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.input-action-label {
    display: block;
    margin-bottom: 8px;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
}

.attendance-entry-card {
    grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr);
    margin-top: 14px;
}

.attendance-entry-card .selected-preview,
.attendance-entry-card .bulk-note-field,
.attendance-entry-card .presensi-action-row,
.attendance-entry-card .tips-card {
    grid-column: 1 / -1;
}

.teacher-modal-trigger {
    justify-content: space-between;
    min-height: 48px;
    border-radius: 18px;
}

.teacher-modal-trigger span {
    padding: 4px 9px;
    border-radius: 999px;
    background: #ccfbf1;
    color: #0f766e;
    font-size: 12px;
    font-weight: 900;
}

.selected-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 32px;
}

.selected-preview span {
    padding: 6px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}

.presensi-action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.presensi-action-row .btn {
    min-height: 50px;
    border-radius: 18px;
    white-space: normal;
}

.unsaved-badge {
    margin-left: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #ffedd5;
    color: #c2410c;
    font-size: 11px;
    font-weight: 900;
}

.tips-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    background: #f0fdf4;
    color: #14532d;
}

.tips-card i {
    font-size: 22px;
}

.tips-card p {
    margin: 3px 0 0;
    color: #166534;
    font-size: 13px;
}

.refined-summary-panel {
    display: grid;
    gap: 14px;
}

.quick-summary-card,
.activity-log-card {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.summary-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 14px;
}

.summary-progress-head h3 {
    margin: 0;
    font-size: 16px;
}

.summary-progress-head p {
    margin: 3px 0 0;
}

#summaryCounter {
    color: #0f766e;
    font-size: 15px;
    font-weight: 900;
}

.quick-summary-card h3,
.activity-log-card h3 {
    margin: 0;
    font-size: 16px;
}

#quickSummaryRows {
    display: grid;
    gap: 8px;
}

#quickSummaryRows div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e5e7eb;
}

#quickSummaryRows div:last-child {
    border-bottom: 0;
}

#quickSummaryRows span {
    color: #64748b;
}

#quickSummaryRows strong {
    color: #0f766e;
}

#quickSummaryRows .danger-row strong {
    color: #dc2626;
}

.danger-outline {
    border-color: #fecaca;
    color: #b91c1c;
    background: #fff1f2;
}

.status-card-hadir { background: #f0fdf4; }
.status-card-sakit { background: #fffbeb; }
.status-card-izin { background: #eff6ff; }
.status-card-dinas-luar { background: #ecfeff; }
.status-card-cuti { background: #fff1f2; }

.bulk-status-card .clear-status {
    margin-top: 10px;
    font-weight: 900;
}

.presensi-guru-rekap-page .rekap-filter-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.guru-rekap-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 16px;
}

.guru-rekap-legend span,
.teacher-total-chips span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.guru-matrix-wrap {
    max-height: 72vh;
    overflow: auto;
}

.guru-monthly-matrix {
    min-width: 1120px;
    border-collapse: separate;
    border-spacing: 0;
}

.guru-monthly-matrix th {
    position: sticky;
    top: 0;
    z-index: 4;
}

.guru-monthly-matrix th:nth-child(1),
.guru-monthly-matrix td:nth-child(1) {
    width: 54px;
    min-width: 54px;
}

.guru-monthly-matrix th:nth-child(2),
.guru-monthly-matrix td:nth-child(2) {
    position: sticky;
    left: 0;
    z-index: 3;
    min-width: 230px;
    background: #ffffff;
    text-align: left;
}

.guru-monthly-matrix th:nth-child(2) {
    z-index: 5;
    background: #0f766e;
}

.guru-monthly-matrix tbody tr:hover td {
    background-color: #f8fafc;
}

.guru-monthly-matrix tbody tr:hover td.code-h,
.code-h {
    background: #dcfce7;
    color: #166534;
}

.guru-monthly-matrix tbody tr:hover td.code-s,
.code-s {
    background: #fef3c7;
    color: #92400e;
}

.guru-monthly-matrix tbody tr:hover td.code-i,
.code-i {
    background: #dbeafe;
    color: #1d4ed8;
}

.guru-monthly-matrix tbody tr:hover td.code-dl,
.code-dl {
    background: #ede9fe;
    color: #6d28d9;
}

.guru-monthly-matrix tbody tr:hover td.code-c,
.code-c {
    background: #fee2e2;
    color: #b91c1c;
}

.guru-monthly-matrix tbody tr:hover td.code-libur,
.code-libur {
    background: #cbd5e1;
    color: #111827;
}

.guru-monthly-matrix .code-empty {
    color: #94a3b8;
    background: #f8fafc;
}

.guru-rekap-dashboard {
    display: grid;
    gap: 18px;
}

.guru-rekap-dashboard .section-head strong {
    color: #0f766e;
    font-size: 28px;
    font-weight: 900;
}

.guru-trend-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr);
    gap: 18px;
}

.guru-trend-grid article {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.guru-trend-grid h3 {
    margin: 0;
    font-size: 16px;
}

.guru-trend-bars {
    display: grid;
    gap: 10px;
}

.guru-trend-bars div {
    display: grid;
    grid-template-columns: 92px 1fr 40px;
    align-items: center;
    gap: 10px;
}

.guru-trend-bars span,
.guru-trend-bars strong {
    color: #475569;
    font-size: 12px;
    font-weight: 850;
}

.guru-trend-bars b {
    display: block;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #14b8a6, #0f766e);
}

.teacher-rekap-mobile-cards {
    display: none;
}

.teacher-total-chips,
.teacher-day-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.teacher-day-grid {
    margin-top: 12px;
}

.teacher-day-grid span {
    display: inline-grid;
    place-items: center;
    width: 42px;
    min-height: 44px;
    border-radius: 14px;
    color: #64748b;
    background: #f8fafc;
    font-weight: 900;
}

.teacher-day-grid small {
    display: block;
    color: inherit;
    font-size: 10px;
    opacity: .75;
}

@media (min-width: 992px) {
    .refined-presensi-page {
        max-width: none;
        padding: 24px;
    }

    .presensi-guru-layout {
        grid-template-columns: minmax(420px, 460px) minmax(0, 1fr);
        gap: 24px;
        align-items: start;
    }

    .presensi-guru-layout .refined-work-card,
    .presensi-guru-layout .refined-summary-panel {
        align-self: start;
        width: 100%;
    }
}

.teacher-picker-modal[hidden] {
    display: none;
}

.teacher-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: grid;
    place-items: center;
    padding: 18px;
}

.teacher-picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .38);
    backdrop-filter: blur(4px);
}

.teacher-picker-sheet,
.draft-dialog-card {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
    width: min(780px, 100%);
    max-height: min(82vh, 760px);
    overflow: hidden;
    padding: 18px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
    animation: modalIn .2s ease;
}

.draft-dialog-card {
    width: min(420px, 100%);
}

.modal-teacher-list {
    max-height: 56vh;
    overflow: auto;
}

.modal-teacher-card {
    grid-template-columns: auto 1fr auto auto;
}

.modal-teacher-card input {
    justify-self: end;
}

.presensi-toast-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 2400;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 28px));
}

.presensi-toast {
    padding: 14px;
    border: 1px solid #bbf7d0;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .16);
    animation: toastIn .2s ease;
}

.presensi-toast p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}

.presensi-toast.is-hide {
    opacity: 0;
    transform: translateY(-8px);
    transition: .2s ease;
}

.toast-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.toast-actions a {
    padding: 6px 9px;
    border-radius: 999px;
    background: #ccfbf1;
    color: #0f766e;
    font-size: 12px;
    font-weight: 900;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes softSlideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 760px) {
    .presensi-guru-hero,
    .teacher-detail-hero {
        align-items: stretch;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .presensi-guru-stats {
        grid-template-columns: 1fr;
    }

    .rekap-bars div {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .presensi-guru-layout,
    .bulk-picker-card,
    .presence-monitor-grid,
    .attendance-input-top,
    .attendance-entry-card {
        grid-template-columns: 1fr;
    }

    .presensi-action-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        position: sticky;
        bottom: 12px;
        z-index: 40;
        padding: 8px;
        border: 1px solid #e2e8f0;
        border-radius: 20px;
        background: rgba(255, 255, 255, .94);
        box-shadow: 0 16px 34px rgba(15, 23, 42, .14);
        backdrop-filter: blur(12px);
    }

    .teacher-picker-modal {
        align-items: end;
        padding: 0;
    }

    .teacher-picker-sheet {
        width: 100%;
        max-height: 92vh;
        border-radius: 24px 24px 0 0;
    }

    .presensi-toast-stack {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .modal-teacher-card {
        grid-template-columns: auto 1fr auto;
    }

    .modal-teacher-card em {
        grid-column: 2;
    }

    .teacher-check-item {
        grid-template-columns: auto auto 1fr;
    }

    .teacher-check-item em {
        grid-column: 3;
    }
}

@media (max-width: 380px) {
    .presensi-action-row {
        grid-template-columns: 1fr;
    }
}

.permit-type {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 11px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.permit-type.keluar-sementara {
    border-color: #99f6e4;
    color: #0f766e;
    background: #ccfbf1;
}

.permit-type.pulang-awal {
    border-color: #fed7aa;
    color: #c2410c;
    background: #ffedd5;
}

.permit-type.masuk-kelas {
    border-color: #bfdbfe;
    color: #1d4ed8;
    background: #dbeafe;
}

.btn,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: #ffffff;
    font: inherit;
    cursor: pointer;
}

.btn {
    transition: all .25s ease;
}

.btn:hover {
    background: #f8fafc;
    text-decoration: none;
    transform: translateY(-2px);
}

.btn.primary {
    border-color: var(--primary);
    color: #ffffff;
    background: var(--primary);
}

.btn.primary:hover {
    background: var(--primary-dark);
}

.btn.danger {
    border-color: var(--danger);
    color: #ffffff;
    background: var(--danger);
}

.btn.accent {
    border-color: var(--accent);
    color: #ffffff;
    background: var(--accent);
}

.btn.warning {
    border-color: #ea580c;
    color: #ffffff;
    background: #ea580c;
}

.link-button {
    border: 0;
    padding: 0;
    color: var(--primary);
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.danger-link {
    color: var(--danger);
}

.form {
    display: grid;
    gap: 14px;
}

.grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
    display: grid;
    gap: 6px;
    color: #344054;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: #ffffff;
    font: inherit;
}

textarea {
    resize: vertical;
}

.field-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.field-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.field-badge.required {
    color: #991b1b;
    background: #fee2e2;
}

.field-badge.optional {
    color: #0f766e;
    background: #ccfbf1;
}

.field-badge.auto {
    color: #1d4ed8;
    background: #dbeafe;
}

label:has(.field-badge.required) input,
label:has(.field-badge.required) textarea,
label:has(.field-badge.required) select {
    border-color: rgba(194, 65, 53, .32);
    background: #fffafa;
}

label:has(.field-badge.optional) input,
label:has(.field-badge.optional) textarea,
label:has(.field-badge.optional) select {
    border-color: rgba(15, 118, 110, .22);
    background: #fbfffe;
}

label:has(.field-badge.auto) input {
    border-color: rgba(37, 99, 235, .22);
    background: #f8fbff;
}

.full {
    grid-column: 1 / -1;
}

.filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 160px 160px auto auto;
    gap: 10px;
    margin-bottom: 16px;
}

.alert {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
}

.alert-success {
    border-color: #a6e3c6;
    color: #075e45;
    background: #ecfdf5;
}

.alert-warning {
    border-color: #f4d585;
    color: var(--warning);
    background: #fffbeb;
}

.alert-danger {
    border-color: #f4aaa4;
    color: var(--danger);
    background: #fff1f0;
}

.inline {
    display: inline;
}

.permit-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 18px;
}

.qr-box {
    display: grid;
    place-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
}

.qr-box img {
    width: 160px;
    height: 160px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.detail-grid div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcfe;
}

dt {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 13px;
}

dd {
    margin: 0;
    font-weight: 700;
}

.scan-result {
    border-left: 5px solid var(--accent);
}

/* ===== ROLE-AWARE PERMIT DETAIL ===== */
.permit-detail-shell { width: min(100%, 820px); margin: 0 auto; display: grid; gap: 14px; padding-bottom: 112px; }
.permit-detail-topbar { display: flex; align-items: center; gap: 11px; min-width: 0; }
.permit-back-button { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #dbe5ec; border-radius: 13px; color: #17324d; background: #fff; font-size: 20px; text-decoration: none; box-shadow: 0 5px 14px rgba(15,23,42,.05); }
.permit-detail-topbar h1 { margin: 1px 0 0; color: #0f1f38; font-size: clamp(20px, 5vw, 27px); line-height: 1.1; }
.permit-detail-eyebrow, .permit-card-heading span, .permit-action-panel > div > span { display: block; color: #087a70; font-size: 11px; font-weight: 800; letter-spacing: .045em; }
.permit-number-chip { max-width: 44%; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 7px 9px; border-radius: 9px; color: #155e75; background: #eaf8f6; font-size: 11px; font-weight: 800; }
.permit-status-hero { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 15px; border: 1px solid #dce7ed; border-radius: 19px; background: #f8fafc; box-shadow: 0 8px 22px rgba(15,23,42,.045); }
.permit-status-hero.is-green { border-color: #b7e8ce; background: linear-gradient(135deg,#effcf5,#f9fffc); }.permit-status-hero.is-blue { border-color: #b9d9ff; background: linear-gradient(135deg,#eff8ff,#f9fcff); }.permit-status-hero.is-amber { border-color: #fde3a4; background: linear-gradient(135deg,#fff8e8,#fffdf8); }.permit-status-hero.is-red { border-color: #fecaca; background: #fff8f8; }.permit-status-hero.is-gray { border-color: #dbe3ea; background: #f8fafc; }
.permit-status-icon { width: 45px; height: 45px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 15px; font-size: 24px; background: #dcfce7; color: #15803d; }.is-blue .permit-status-icon { color: #2563eb; background: #dbeafe; }.is-amber .permit-status-icon { color: #b45309; background: #fef3c7; }.is-red .permit-status-icon { color: #dc2626; background: #fee2e2; }.is-gray .permit-status-icon { color: #64748b; background: #e2e8f0; }
.permit-status-hero > div { min-width: 0; }.permit-status-hero strong { display: block; color: #0f5132; font-size: 15px; }.permit-status-hero.is-blue strong { color: #1d4ed8; }.permit-status-hero.is-amber strong { color: #9a4d08; }.permit-status-hero.is-red strong { color: #b91c1c; }.permit-status-hero.is-gray strong { color: #475569; }.permit-status-hero p { margin: 3px 0 0; color: #64748b; font-size: 12px; line-height: 1.35; }
.permit-status-pill, .permit-participant-chip { margin-left: auto; align-self: flex-start; padding: 5px 8px; border-radius: 999px; color: #087a70; background: #d9f8f1; font-size: 10px; font-weight: 800; white-space: nowrap; }.is-amber .permit-status-pill { color:#a45a07; background:#fef3c7; }.is-blue .permit-status-pill { color:#1d4ed8; background:#dbeafe; }.is-red .permit-status-pill { color:#b91c1c; background:#fee2e2; }.is-gray .permit-status-pill { color:#475569; background:#e2e8f0; }
.permit-student-summary-card, .permit-journey-card, .permit-details-card, .permit-accordion-card, .permit-qr-card, .permit-time-focus, .permit-qr-unavailable, .permit-action-panel { border: 1px solid #dce7ed; border-radius: 19px; background: rgba(255,255,255,.96); box-shadow: 0 8px 22px rgba(15,23,42,.045); }
.permit-student-summary-card { display: flex; align-items: center; gap: 13px; padding: 16px; }.permit-person-avatar { width: 56px; height: 56px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #135d59; background: linear-gradient(135deg,#d5fbf1,#c4eee9); font-size: 22px; font-weight: 800; }.permit-student-summary-card > div { min-width: 0; }.permit-student-summary-card small { color:#64748b; font-size:12px; }.permit-student-summary-card h2 { margin:2px 0; overflow-wrap:anywhere; color:#10213b; font-size:18px; }.permit-student-summary-card p { margin:0; color:#64748b; font-size:12px; }.permit-student-summary-card .permit-type { margin-left:auto; text-align:center; }
.permit-card-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; }.permit-card-heading h2 { margin:3px 0 0; color:#10213b; font-size:16px; }.permit-card-heading > i { width:38px; height:38px; display:grid; place-items:center; border-radius:13px; color:#087a70; background:#e2f9f4; font-size:20px; }
.permit-journey-card, .permit-details-card, .permit-qr-card { padding:16px; }.permit-timeline { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; margin-top:15px; }.permit-timeline > div { position:relative; min-width:0; padding-top:31px; color:#94a3b8; text-align:center; }.permit-timeline > div:not(:last-child)::after { position:absolute; top:13px; left:calc(50% + 17px); width:calc(100% - 34px); height:3px; border-radius:9px; background:#dce4ea; content:''; }.permit-timeline > div.is-done::after { background:#12a078; }.permit-timeline i { position:absolute; top:0; left:50%; width:27px; height:27px; display:grid; place-items:center; transform:translateX(-50%); border:2px solid #dce4ea; border-radius:50%; color:#94a3b8; background:#fff; font-size:13px; z-index:1; }.permit-timeline .is-done i { border-color:#0f9d72; color:#fff; background:#0f9d72; }.permit-timeline strong { display:block; overflow-wrap:anywhere; color:inherit; font-size:11px; }.permit-timeline .is-done strong { color:#136b55; }.permit-timeline small { display:block; margin-top:4px; overflow-wrap:anywhere; font-size:10px; line-height:1.3; }
.permit-time-warning { display:flex; align-items:center; gap:8px; margin:14px 0 0; padding:10px 11px; border-radius:11px; color:#a45a07; background:#fff7e6; font-size:12px; font-weight:700; }.permit-time-warning.is-late { color:#b45309; }.permit-time-focus { padding:15px; text-align:center; background:linear-gradient(135deg,#effcf7,#fafffd); }.permit-time-focus.is-late { background:#fff7e8; }.permit-time-focus span { display:block; color:#087a70; font-size:11px; font-weight:800; letter-spacing:.05em; }.permit-time-focus strong { display:block; margin:3px 0; color:#0b6c58; font-size:25px; }.permit-time-focus small { color:#64748b; font-weight:700; }.permit-time-focus.is-late span,.permit-time-focus.is-late strong { color:#b45309; }
.permit-detail-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0; margin:14px 0 0; border:1px solid #edf1f5; border-radius:13px; overflow:hidden; }.permit-detail-facts > div { min-width:0; padding:12px; border-right:1px solid #edf1f5; border-bottom:1px solid #edf1f5; }.permit-detail-facts > div:nth-child(2n) { border-right:0; }.permit-detail-facts > div:nth-last-child(-n+2) { border-bottom:0; }.permit-detail-facts dt { display:flex; align-items:center; gap:6px; margin:0 0 5px; color:#64748b; font-size:11px; }.permit-detail-facts dt i { color:#087a70; }.permit-detail-facts dd { overflow-wrap:anywhere; color:#10213b; font-size:13px; line-height:1.42; }.permit-detail-facts dd small { display:block; margin-top:3px; color:#64748b; font-size:11px; font-weight:500; }.permit-full-fact { grid-column:1 / -1; border-right:0 !important; }.permit-detail-facts.compact { margin-top:12px; }
.permit-accordion-card { padding:0; overflow:hidden; }.permit-accordion-card summary { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:15px 16px; cursor:pointer; color:#10213b; font-size:15px; font-weight:800; list-style:none; }.permit-accordion-card summary::-webkit-details-marker { display:none; }.permit-accordion-card[open] summary { border-bottom:1px solid #edf1f5; }.permit-accordion-card summary i { transition:transform .2s ease; }.permit-accordion-card[open] summary i { transform:rotate(180deg); }.permit-accordion-card .permit-detail-facts, .permit-accordion-card .participant-list, .permit-proof-block { margin:12px 16px 16px; }
.permit-qr-card { background:linear-gradient(135deg,#fff,#f3fffc); }.permit-qr-body { display:flex; align-items:center; gap:14px; margin-top:13px; }.permit-qr-body img { width:140px; height:140px; flex:0 0 auto; padding:6px; border:1px solid #dcebe7; border-radius:13px; background:#fff; }.permit-qr-body p { margin:0; color:#526579; font-size:13px; line-height:1.5; }.permit-qr-expand { width:100%; min-height:44px; margin-top:13px; border:1px solid #0f9d72; border-radius:12px; color:#087a70; background:#fff; font:inherit; font-size:13px; font-weight:800; cursor:pointer; }.permit-qr-expand i { margin-right:7px; }.permit-qr-unavailable { display:flex; align-items:center; gap:12px; padding:14px; }.permit-qr-unavailable > i { width:40px; height:40px; display:grid; place-items:center; flex:0 0 auto; border-radius:13px; color:#64748b; background:#eef2f7; font-size:20px; }.permit-qr-unavailable div { min-width:0; }.permit-qr-unavailable strong { color:#263850; font-size:14px; }.permit-qr-unavailable p { margin:3px 0 0; color:#64748b; font-size:12px; line-height:1.4; }.permit-qr-unavailable .btn { margin-left:auto; white-space:nowrap; }
.permit-action-panel { display:grid; gap:12px; padding:16px; }.permit-action-panel > i { width:43px; height:43px; display:grid; place-items:center; border-radius:14px; color:#087a70; background:#e1faf3; font-size:22px; }.permit-action-panel.readonly { display:flex; align-items:center; }.permit-action-panel h2 { margin:3px 0; color:#10213b; font-size:17px; }.permit-action-panel p { margin:0; color:#64748b; font-size:12px; line-height:1.45; }.permit-action-panel label { color:#263850; font-size:13px; font-weight:800; }.permit-action-panel textarea { width:100%; box-sizing:border-box; margin-top:7px; border:1px solid #cfdde7; border-radius:12px; font:inherit; font-size:13px; }.permit-action-panel .approval-actions { display:flex; flex-wrap:wrap; gap:9px; }.permit-action-panel .approval-actions .btn { flex:1 1 170px; justify-content:center; }.permit-student-actions { display:flex; flex-wrap:wrap; gap:9px; }.permit-student-actions .btn { flex:1 1 150px; justify-content:center; }.permit-student-actions .btn i { margin-right:6px; }
.permit-proof-block { display:grid; gap:10px; }.permit-proof-block img { width:min(100%,350px); border:1px solid #dce7ed; border-radius:13px; }.permit-proof-block p { margin:0; color:#64748b; font-size:12px; }
.permit-qr-modal[hidden] { display:none; }.permit-qr-modal { position:fixed; inset:0; z-index:3000; display:grid; place-items:center; padding:18px; }.permit-qr-modal-backdrop { position:absolute; inset:0; background:rgba(15,23,42,.62); backdrop-filter:blur(3px); }.permit-qr-modal-content { position:relative; z-index:1; width:min(100%,400px); display:grid; justify-items:center; gap:10px; padding:25px 20px 20px; border-radius:22px; text-align:center; background:#fff; box-shadow:0 18px 48px rgba(15,23,42,.25); }.permit-qr-modal-content > span { color:#087a70; font-size:12px; font-weight:800; }.permit-qr-modal-content h2 { margin:0; color:#10213b; font-size:19px; }.permit-qr-modal-content p,.permit-qr-modal-content small { margin:0; color:#64748b; font-size:12px; }.permit-qr-modal-content img { width:min(75vw,295px); height:min(75vw,295px); padding:7px; border:1px solid #dcebe7; border-radius:14px; background:#fff; }.permit-qr-modal-content strong { color:#087a70; font-size:14px; }.permit-modal-close { position:absolute; top:10px; right:12px; width:34px; height:34px; border:0; border-radius:50%; color:#475569; background:#f1f5f9; font-size:25px; cursor:pointer; }.permit-modal-open { overflow:hidden; }

@media (max-width: 480px) {
    .permit-detail-shell { gap:12px; padding-bottom:104px; }
    .permit-detail-topbar { align-items:flex-start; }
    .permit-detail-topbar > div { min-width:0; }
    .permit-detail-topbar h1 { font-size:20px; }
    .permit-identity-card { grid-template-columns:52px minmax(0, 1fr); padding:14px; }
    .permit-identity-card > .permit-number-chip { grid-column:2; justify-self:start; }
    .permit-type-card, .permit-detail-card, .permit-accordion, .permit-qr-card, .permit-action-panel { border-radius:16px; }
    .permit-timeline { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:13px 10px; }
    .permit-timeline > div { display:grid; grid-template-columns:29px minmax(0, 1fr); column-gap:7px; align-items:start; min-width:0; padding:0; text-align:left; }
    .permit-timeline > div:not(:last-child)::after { display:none; }
    .permit-timeline i { position:static; grid-row:span 2; width:25px; height:25px; transform:none; font-size:12px; }
    .permit-timeline strong, .permit-timeline small { min-width:0; overflow-wrap:anywhere; }
    .permit-timeline small { margin-top:1px; }
    .permit-detail-facts { grid-template-columns:1fr; }
    .permit-detail-facts > div { border-bottom:1px solid #edf2f5; }
    .permit-detail-facts > div:last-child { border-bottom:0; }
    .permit-qr-body { grid-template-columns:1fr; text-align:center; justify-items:center; }
    .permit-qr-copy { align-items:center; }
    .permit-qr-unavailable { align-items:flex-start; flex-wrap:wrap; }
    .permit-qr-unavailable .btn { margin-left:50px; }
    .permit-time-focus { align-items:flex-start; flex-direction:column; }
}

@media (max-width: 760px) {
    .topbar,
    .hero,
    .section-head,
    .permit-card {
        align-items: flex-start;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .hero-actions {
        width: 100%;
    }

    .stats,
    .account-card,
    .grid-two,
    .grid-form,
    .filters,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .container {
        width: min(100% - 20px, 1180px);
        margin: 16px auto;
    }

    .hero,
    .panel,
    .form-card {
        padding: 18px;
    }
}


/* ===== MOBILE MENU ===== */

.menu-toggle{
    display:none;
    border:none;
    background:none;
    font-size:28px;
    cursor:pointer;
    color:var(--primary);
}

/* ===== CARD MODERN ===== */

.panel,
.form-card{
    background:#fff;

    border:none;

    border-radius:22px;

    box-shadow:
    0 10px 30px rgba(15,23,42,.08);

    margin-bottom:24px;
}
.stats article,
.mini-card{
    transition:.25s;
}

.panel:hover,
.hero:hover,
.stats article:hover{
    transform:translateY(-2px);
}

/* ===== MOBILE ===== */

@media (max-width:768px){

    .menu-toggle{
        display:block;
    }

    .nav{
        display:none;
        width:100%;
        flex-direction:column;
        align-items:flex-start;
        gap:4px;
        padding-top:10px;
    }

    .nav.show{
        display:flex;
    }

    .topbar{
        flex-wrap:wrap;
        padding:12px 16px;
    }

    .nav a,
    .nav-user{
        width:100%;
        padding:12px;
    }

    .hero{
        flex-direction:column;
        align-items:flex-start;
    }

    .hero-actions{
        width:100%;
    }

    .hero-actions .btn{
        width:100%;
    }

    .permit-card{
        grid-template-columns:1fr;
    }

    .qr-box{
        margin:auto;
    }

    table{
        min-width:700px;
    }

    .container{
        width:calc(100% - 16px);
    }
}
@media print {
    .topbar,
    .footer,
    .no-print,
    .alert {
        
        display: none !important;
    }
}
/* ===== TOAST ===== */

.toast-container{
    position:fixed;
    top:20px;
    right:20px;
    z-index:9999;
    display:flex;
    flex-direction:column;
    gap:10px;
}

.toast{
    min-width:320px;
    max-width:420px;
    padding:14px 18px;
    border-radius:14px;
    color:#fff;
    font-weight:600;
    box-shadow:0 10px 30px rgba(0,0,0,.15);
    animation:slideIn .4s ease;
}

.toast.success{
    background:#16a34a;
}

.toast.warning{
    background:#d97706;
}

.toast.danger{
    background:#dc2626;
}

@keyframes slideIn{
    from{
        opacity:0;
        transform:translateX(100%);
    }
    to{
        opacity:1;
        transform:translateX(0);
    }
}

@keyframes fadeOut{
    from{
        opacity:1;
    }
    to{
        opacity:0;
    }
}

.toast.hide{
    animation:fadeOut .4s ease forwards;
}

@media(max-width:768px){

    .toast-container{
        left:10px;
        right:10px;
        top:10px;
    }

    .toast{
        min-width:auto;
        max-width:none;
        width:100%;
    }
}
@media print {
    body,
    .panel {
        background: #ffffff;
    }

    .container {
        width: 100%;
        margin: 0;
    }
    
}

.scan-gate-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, .18), transparent 34%),
        linear-gradient(135deg, #eef7f5 0%, #f7f9fc 48%, #eaf1ff 100%);
}

.scan-gate-shell {
    width: min(920px, calc(100% - 24px));
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    place-items: center;
    padding: 24px 0;
}

.scan-gate-card {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, .4);
    border-radius: 22px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 22px 60px rgba(15, 23, 42, .13);
    overflow: hidden;
}

.scan-gate-card.disetujui {
    border-top: 7px solid var(--primary);
}

.scan-gate-card.keluar {
    border-top: 7px solid var(--accent);
}

.scan-gate-card.kembali {
    border-top: 7px solid var(--success);
}

.scan-gate-card.ditolak,
.scan-gate-card.menunggu {
    border-top: 7px solid var(--warning);
}

.scan-gate-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.scan-gate-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scan-gate-brand img,
.scan-gate-brand span {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.scan-gate-brand img {
    object-fit: cover;
}

.scan-gate-brand span {
    display: grid;
    place-items: center;
    color: #ffffff;
    background: var(--primary);
    font-weight: 800;
}

.scan-gate-brand strong,
.scan-student h1 {
    display: block;
}

.scan-gate-brand small {
    color: var(--muted);
}

.scan-status {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 7px 14px;
    border-radius: 999px;
    color: #075e45;
    background: #dcfce7;
    font-weight: 800;
}

.scan-status.menunggu {
    color: #854d0e;
    background: #fef3c7;
}

.scan-status.disetujui {
    color: #175cd3;
    background: #dbeafe;
}

.scan-status.ditolak,
.scan-status.dibatalkan {
    color: #991b1b;
    background: #fee2e2;
}

.scan-status.keluar {
    color: #7c2d12;
    background: #ffedd5;
}

.scan-empty-state,
.scan-student,
.scan-info-grid,
.scan-note,
.scan-action-bar,
.scan-next-link {
    margin-left: 24px;
    margin-right: 24px;
}

.scan-empty-state {
    padding: 36px 0;
    text-align: center;
}

.scan-empty-state h1 {
    font-size: 34px;
}

.scan-empty-state p {
    width: min(560px, 100%);
    margin: 0 auto 18px;
    color: var(--muted);
}

.qr-reader {
    display: none;
    width: min(420px, 100%);
    margin: 20px auto 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #0f172a;
}

.scan-student {
    padding: 28px 0 18px;
}

.scan-student span {
    color: var(--primary);
    font-weight: 800;
    letter-spacing: .04em;
}

.scan-student h1 {
    margin: 7px 0 4px;
    font-size: clamp(34px, 6vw, 58px);
}

.scan-student p {
    margin: 0;
    color: var(--muted);
    font-size: 18px;
}

.scan-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.scan-info-grid div,
.scan-note {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
}

.scan-info-grid span,
.scan-note span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.scan-info-grid small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.scan-info-grid strong,
.scan-note strong {
    display: block;
    margin-top: 4px;
    font-size: 18px;
}

.scan-note {
    margin-top: 12px;
}

.scan-action-bar {
    padding: 22px 0 14px;
}

.scan-token-field {
    margin-bottom: 12px;
    color: var(--ink);
    text-align: left;
}

.scan-action {
    width: 100%;
    min-height: 70px;
    border: 0;
    border-radius: 16px;
    color: #ffffff;
    font: inherit;
    font-size: 22px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(15, 118, 110, .22);
}

.scan-action.exit {
    background: var(--primary);
}

.scan-action.return {
    background: var(--accent);
}

.scan-complete,
.scan-blocked {
    padding: 18px;
    border-radius: 14px;
    text-align: center;
    font-weight: 800;
}

.scan-complete {
    color: #075e45;
    background: #dcfce7;
}

.scan-blocked {
    color: #854d0e;
    background: #fef3c7;
}

.scan-next-link {
    display: block;
    margin-bottom: 24px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    text-align: center;
    color: var(--ink);
    background: #ffffff;
}

.scan-next-link:hover {
    text-decoration: none;
    background: #f8fafc;
}

@media (max-width: 640px) {
    .scan-gate-shell {
        width: min(100% - 14px, 920px);
        padding: 7px 0;
    }

    .scan-gate-card {
        border-radius: 18px;
    }

    .scan-gate-top {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
    }

    .scan-empty-state,
    .scan-student,
    .scan-info-grid,
    .scan-note,
    .scan-action-bar,
    .scan-next-link {
        margin-left: 16px;
        margin-right: 16px;
    }

    .scan-info-grid {
        grid-template-columns: 1fr;
    }

    .scan-student h1 {
        font-size: 34px;
    }
}

/* Gate control Satpam: UI-only enhancement, existing scan/token workflow is preserved. */
.gate-control-page { background: linear-gradient(145deg, #f5fbfa 0%, #f7f9fc 54%, #edf8f7 100%); color: #14213d; }
.gate-control-shell { width: min(560px, 100%); min-height: 100vh; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px calc(112px + env(safe-area-inset-bottom)); box-sizing: border-box; }
.gate-control-header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.gate-control-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gate-control-brand img, .gate-control-logo { width: 46px; height: 46px; border-radius: 13px; object-fit: contain; flex: 0 0 auto; }
.gate-control-logo { display: grid; place-items: center; background: #0f766e; color: #fff; font-weight: 800; }
.gate-control-brand strong { display: block; font-size: 19px; line-height: 1.1; letter-spacing: -.02em; }
.gate-control-brand small { display: block; margin-top: 3px; color: #64748b; font-size: 12px; }
.gate-header-action { min-height: 42px; padding: 0 13px; display: inline-flex; align-items: center; gap: 7px; color: #0f766e; border: 1px solid #cfe6e2; border-radius: 13px; background: #fff; text-decoration: none; font-weight: 700; }
.gate-header-action span { font-size: 18px; }.gate-header-action em { font-style: normal; font-size: 13px; }
.gate-alert { margin: 0 0 12px; border-radius: 14px; padding: 12px 14px; font-size: 13px; font-weight: 600; }
.gate-empty-card, .gate-student-card, .gate-permit-card, .gate-details-card { border: 1px solid #dce7ed; border-radius: 20px; background: rgba(255,255,255,.94); box-shadow: 0 10px 28px rgba(15, 23, 42, .055); }
.gate-empty-card { padding: 40px 22px; text-align: center; }.gate-empty-icon { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 20px; color: #0f766e; background: #dcf7f2; font-size: 29px; }
.gate-eyebrow { margin: 0 0 7px; color: #0f766e; font-size: 11px; font-weight: 800; letter-spacing: .09em; }.gate-empty-card h1 { margin: 0; font-size: clamp(25px, 7vw, 32px); }.gate-empty-card p:not(.gate-eyebrow) { margin: 10px auto 21px; max-width: 370px; color: #64748b; line-height: 1.55; }.gate-empty-card small { display: block; margin-top: 16px; color: #64748b; font-size: 12px; line-height: 1.45; }
.gate-primary-action { width: 100%; min-height: 60px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 16px; color: #fff; background: #0f766e; box-shadow: 0 12px 22px rgba(15,118,110,.18); font: inherit; font-size: 16px; font-weight: 800; letter-spacing: .01em; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease; }.gate-primary-action:active { transform: scale(.985); }.gate-primary-action:disabled { opacity: .7; cursor: wait; }.gate-primary-action span { font-size: 23px; line-height: 1; }.gate-empty-card .gate-primary-action { max-width: 360px; }.gate-empty-card .install-app-button { margin: 12px auto 0; }
.gate-status-banner { display: flex; align-items: center; gap: 13px; min-height: 82px; box-sizing: border-box; margin-bottom: 12px; padding: 14px 16px; border: 1px solid; border-radius: 18px; }.gate-status-icon { width: 45px; height: 45px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; font-size: 26px; font-weight: 800; }.gate-status-banner strong, .gate-status-banner small { display: block; }.gate-status-banner strong { font-size: 16px; letter-spacing: .02em; }.gate-status-banner small { margin-top: 3px; color: #475569; font-size: 13px; }.gate-status-banner.valid, .gate-status-banner.completed { border-color: #8fddb0; background: #effdf4; }.gate-status-banner.valid strong, .gate-status-banner.completed strong { color: #15723b; }.gate-status-banner.valid .gate-status-icon, .gate-status-banner.completed .gate-status-icon { background: #16a34a; }.gate-status-banner.outside { border-color: #93c5fd; background: #eff6ff; }.gate-status-banner.outside strong { color: #1769d2; }.gate-status-banner.outside .gate-status-icon { background: #1479e9; }.gate-status-banner.waiting { border-color: #f8cf73; background: #fff9ea; }.gate-status-banner.waiting strong { color: #a45a00; }.gate-status-banner.waiting .gate-status-icon { background: #f59e0b; }.gate-status-banner.rejected { border-color: #fcb8b8; background: #fff4f4; }.gate-status-banner.rejected strong { color: #bd2727; }.gate-status-banner.rejected .gate-status-icon { background: #ef4444; }.gate-status-banner.invalid { border-color: #cbd5e1; background: #f8fafc; }.gate-status-banner.invalid .gate-status-icon { background: #64748b; }
.gate-student-card { display: flex; align-items: center; gap: 15px; margin-bottom: 12px; padding: 18px; }.gate-student-avatar { width: 66px; height: 66px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: linear-gradient(135deg, #d7faf1, #c7eee8); color: #123c41; font-size: 25px; font-weight: 800; }.gate-student-card h1 { margin: 0; font-size: clamp(21px, 6vw, 27px); letter-spacing: -.025em; }.gate-student-card p { margin: 4px 0 7px; color: #475569; font-size: 14px; }.gate-student-card p b { color: #94a3b8; }.gate-student-card div > span { display: inline-block; padding: 5px 9px; border-radius: 8px; color: #087a70; background: #d9f8f1; font-size: 11px; font-weight: 800; }
.gate-permit-card { overflow: hidden; margin-bottom: 12px; }.gate-type-row { display: flex; align-items: center; gap: 12px; padding: 16px; }.gate-type-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; color: #087a70; background: #e0f8f2; font-size: 23px; font-weight: 800; }.gate-type-row small, .gate-fact-grid small { display: block; color: #64748b; font-size: 12px; }.gate-type-row strong { display: block; margin-top: 2px; font-size: 16px; }.gate-fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid #e5edf2; }.gate-fact-grid > div { min-height: 80px; padding: 13px 14px; box-sizing: border-box; border-right: 1px solid #e5edf2; border-bottom: 1px solid #e5edf2; }.gate-fact-grid > div:nth-child(2n) { border-right: 0; }.gate-fact-grid > div:nth-last-child(-n+2) { border-bottom: 0; }.gate-fact-grid strong { display: block; margin-top: 4px; overflow-wrap: anywhere; font-size: 15px; }.gate-fact-grid .is-late strong { color: #d97706; }
.gate-time-warning, .gate-block-message { min-height: 52px; box-sizing: border-box; display: flex; align-items: center; gap: 9px; margin-bottom: 12px; padding: 12px 14px; border: 1px solid; border-radius: 15px; font-size: 13px; font-weight: 700; }.gate-time-warning { color: #9a5a00; border-color: #fde1a1; background: #fff8e7; }.gate-time-warning span { width: 25px; height: 25px; display: grid; place-items: center; border: 2px solid currentColor; border-radius: 50%; }.gate-block-message.success { color: #15723b; border-color: #b5eac5; background: #f0fff4; }.gate-block-message.warning { color: #9a5a00; border-color: #fde1a1; background: #fff9e9; }.gate-block-message.danger { color: #be2828; border-color: #fecaca; background: #fff4f4; }.gate-block-message.neutral { color: #475569; border-color: #d9e2ea; background: #f8fafc; }
.action-return { background: #1677e8; box-shadow: 0 12px 22px rgba(30,119,232,.19); }.gate-action-hint { margin: 8px 0 15px; color: #64748b; text-align: center; font-size: 12px; }.gate-details-card { margin-bottom: 12px; overflow: hidden; }.gate-details-card summary { display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 0 16px; cursor: pointer; font-size: 15px; font-weight: 800; list-style: none; }.gate-details-card summary::-webkit-details-marker { display: none; }.gate-details-card[open] summary { border-bottom: 1px solid #e5edf2; }.gate-details-card[open] summary span { transform: rotate(180deg); }.gate-details-card dl { margin: 0; padding: 4px 16px 12px; }.gate-details-card dl div { display: grid; grid-template-columns: minmax(100px, .8fr) minmax(0, 1.5fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid #eef2f5; }.gate-details-card dl div:last-child { border-bottom: 0; }.gate-details-card dt { color: #64748b; font-size: 12px; }.gate-details-card dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-size: 13px; font-weight: 700; }.gate-next-scan { display: flex; align-items: center; gap: 12px; min-height: 74px; padding: 13px 15px; border: 1px solid #c5ece5; border-radius: 18px; color: #087a70; background: linear-gradient(120deg, #effcf9, #f8fffe); text-decoration: none; }.gate-next-scan > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: #d9f8f1; font-size: 22px; }.gate-next-scan strong, .gate-next-scan small { display: block; }.gate-next-scan strong { font-size: 14px; }.gate-next-scan small { margin-top: 3px; color: #58817d; font-size: 12px; }.gate-next-scan b { margin-left: auto; font-size: 28px; font-weight: 400; }
.gate-verification-modal[hidden] { display: none; }.gate-verification-modal { position: fixed; z-index: 1000; inset: 0; display: flex; align-items: flex-end; }.gate-modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.54); }.gate-verification-sheet { position: relative; width: min(560px, 100%); margin: 0 auto; padding: 10px 22px calc(24px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: #fff; box-shadow: 0 -14px 40px rgba(15,23,42,.2); text-align: center; animation: gateSheetUp .22s ease-out; }.gate-sheet-handle { width: 44px; height: 5px; margin: 0 auto 16px; border-radius: 999px; background: #cbd5e1; }.gate-close-modal { position: absolute; top: 17px; right: 18px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: #475569; background: #f1f5f9; font-size: 24px; line-height: 1; cursor: pointer; }.gate-security-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 10px; border-radius: 18px; color: #087a70; background: #e0f8f2; font-size: 29px; font-weight: 800; }.gate-verification-sheet h2 { margin: 0; font-size: 23px; }.gate-verification-sheet > p { margin: 7px auto 17px; max-width: 280px; color: #64748b; font-size: 13px; line-height: 1.45; }.gate-token-input { display: block; margin: 0 0 13px; text-align: left; }.gate-token-input > span { display: block; margin: 0 0 7px; color: #334155; font-size: 12px; font-weight: 800; }.gate-token-input input { width: 100%; min-height: 52px; box-sizing: border-box; padding: 0 14px; border: 1px solid #cbd5e1; border-radius: 14px; outline: none; font: inherit; font-size: 16px; }.gate-token-input input:focus { border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15,118,110,.12); }.gate-security-note { display: block; margin: 14px auto 0; padding: 10px; border-radius: 12px; color: #087a70; background: #effcf9; font-size: 12px; font-weight: 700; }.gate-modal-open { overflow: hidden; }@keyframes gateSheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.gate-bottom-nav { position: fixed; z-index: 900; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); width: min(520px, calc(100% - 24px)); min-height: 66px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; transform: translateX(-50%); border: 1px solid rgba(203,213,225,.85); border-radius: 21px; background: rgba(255,255,255,.96); box-shadow: 0 12px 32px rgba(15,23,42,.16); backdrop-filter: blur(14px); }.gate-bottom-nav a { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #64748b; text-decoration: none; font-weight: 700; }.gate-bottom-nav a span { font-size: 22px; line-height: 1; }.gate-bottom-nav a small { font-size: 11px; }.gate-bottom-nav a.active { margin: -17px 12px 0; border-radius: 17px; color: #fff; background: #0f766e; box-shadow: 0 10px 19px rgba(15,118,110,.28); }.gate-bottom-nav a.active span { font-size: 24px; }
@media (max-width: 380px) { .gate-control-shell { padding-left: 12px; padding-right: 12px; }.gate-control-brand strong { font-size: 17px; }.gate-header-action { padding: 0 10px; }.gate-header-action em { display: none; }.gate-student-card { padding: 15px; }.gate-student-avatar { width: 57px; height: 57px; font-size: 21px; }.gate-student-card h1 { font-size: 21px; }.gate-verification-sheet { padding-left: 16px; padding-right: 16px; } }
.stat-link{
    text-decoration:none;
    color:inherit;
}

.stat-link article{
    transition:.3s;
    cursor:pointer;
}

.stat-link article:hover{
    transform:translateY(-3px);
    box-shadow:0 10px 25px rgba(0,0,0,.12);
    
}
.notif-popup{
    position:fixed;
    top:20px;
    right:20px;
    width:320px;
    background:#fff;
    border-left:5px solid #0d9488;
    box-shadow:0 10px 25px rgba(0,0,0,.15);
    border-radius:10px;
    padding:15px;
    display:none;
    z-index:9999;
}

.notif-content h3{
    margin:0 0 8px;
}

.notif-show{
    display:block;
    animation:slideIn .4s ease;
}

@keyframes slideIn{
    from{
        transform:translateX(100%);
        opacity:0;
    }
    to{
        transform:translateX(0);
        opacity:1;
    }
}
  /* ==================================
   REKAP IZIN PER KELAS
================================== */

.class-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
    gap:20px;
}

.class-card{

    position:relative;

    overflow:hidden;

    padding:28px;

    border:none;

    border-radius:24px;

    background:#fff;

    box-shadow:
    0 15px 35px rgba(15,23,42,.08);

    transition:.3s ease;
}

.class-card:hover{

    transform:
    translateY(-8px);

    box-shadow:
    0 25px 50px rgba(15,23,42,.15);
}
table tbody tr{
    transition:.2s ease;
}

table tbody tr:hover{
    background:#f8fafc;
}

th{
    position:sticky;
    top:0;
    z-index:1;
}

.topbar{
    backdrop-filter:blur(10px);

    box-shadow:
    0 3px 20px rgba(0,0,0,.05);
}

/* ===== FINAL RESPONSIVE POLISH ===== */

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.topbar,
.container,
.hero,
.panel,
.form-card,
.table-wrap,
.grid-two > *,
.stats > * {
    min-width: 0;
}

.brand {
    min-width: 230px;
}

.brand span {
    min-width: 0;
}

.brand strong,
.brand small {
    overflow-wrap: anywhere;
}

.nav {
    justify-content: flex-end;
}

.nav a,
.nav-user {
    white-space: nowrap;
}

.hero {
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .96), rgba(20, 184, 166, .88)),
        radial-gradient(circle at 88% 15%, rgba(37, 99, 235, .35), transparent 34%);
}

.hero .actions {
    justify-content: flex-end;
}

.stats article,
.mini-card {
    min-height: 128px;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .96), rgba(20, 184, 166, .92)),
        radial-gradient(circle at 86% 22%, rgba(37, 99, 235, .28), transparent 40%);
}

.panel {
    overflow: hidden;
}

.panel .table-wrap {
    margin-inline: -2px;
}

.detail-note {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.participant-list {
    margin: 6px 0 0;
    padding-left: 18px;
}

.participant-list li {
    margin: 3px 0;
    font-weight: 700;
}

.bk-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.bk-summary div {
    padding: 14px;
    border: 1px solid #dbe7f3;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.bk-summary span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.bk-summary strong {
    display: block;
    margin-top: 6px;
    color: #0f766e;
    font-size: 28px;
    line-height: 1;
}

.class-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -4px 0 16px;
}

.class-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #344054;
    background: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

.class-tabs a:hover,
.class-tabs a.active {
    border-color: rgba(15, 118, 110, .4);
    color: #0f766e;
    background: #ecfdf5;
    text-decoration: none;
}

.bulk-action-bar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 14px;
    align-items: end;
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid #dbe7f3;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.bulk-action-bar label {
    gap: 8px;
    margin: 0;
}

.bulk-action-bar textarea {
    min-height: 54px;
}

.bulk-action-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.bulk-action-controls .muted {
    flex-basis: 100%;
    text-align: right;
}

.check-col {
    width: 42px;
    text-align: center;
}

.approval-hint {
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    color: #1e3a8a;
    background: #eff6ff;
}

.btn.compact {
    min-height: 34px;
    padding: 6px 11px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

.approval-panel {
    display: grid;
    gap: 14px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #dbe7f3;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.approval-panel h2 {
    margin-bottom: 4px;
}

.approval-panel p {
    margin: 0;
}

.approval-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.approval-actions .btn {
    flex: 1 1 170px;
}

.readonly-approval {
    border-color: #f4d585;
    background: #fffbeb;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.notif-popup {
    max-width: calc(100vw - 32px);
}

@media (min-width: 769px) {
    .filters {
        grid-template-columns: minmax(220px, 1fr) 160px 160px 160px auto auto;
    }
}

@media (max-width: 900px) {
    .topbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .nav {
        width: 100%;
        justify-content: flex-start;
    }

    .grid-two {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        background: #f3f6fb;
    }

    .topbar {
        gap: 10px;
        width: 100%;
        padding: 12px 14px;
    }

    .brand {
        flex: 1 1 calc(100% - 56px);
        min-width: 0;
    }

    .brand-logo,
    .brand-mark {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        flex: 0 0 auto;
    }

    .brand strong {
        display: block;
        font-size: 15px;
        line-height: 1.2;
    }

    .brand small {
        font-size: 11px;
        line-height: 1.25;
    }

    .menu-toggle {
        width: 44px;
        height: 44px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #ffffff;
        font-size: 24px;
        line-height: 1;
    }

    .nav {
        max-height: calc(100vh - 82px);
        overflow-y: auto;
        border-top: 1px solid var(--line);
    }

    .nav a,
    .nav-user {
        white-space: normal;
    }

    .container {
        width: calc(100% - 14px);
        margin: 14px auto;
    }

    .hero,
    .panel,
    .form-card {
        width: 100%;
        padding: 18px;
        border-radius: 18px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero .actions,
    .actions {
        width: 100%;
    }

    .hero .actions .btn {
        flex: 1 1 130px;
    }

    .stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .account-card {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 12px;
        padding: 16px;
        border-radius: 18px;
    }

    .account-info h2 {
        font-size: 20px;
    }

    .account-meta {
        grid-column: 1 / -1;
        width: 100%;
    }

    .stats article {
        min-height: 112px;
        padding: 22px;
    }

    .stats strong {
        font-size: 38px;
    }

    .section-head {
        align-items: stretch;
    }

    .section-head .actions,
    .section-head .btn {
        width: 100%;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .filters span {
        display: none;
    }

    .class-tabs {
        flex-wrap: nowrap;
        margin-inline: -18px;
        padding: 0 18px 4px;
        overflow-x: auto;
    }

    .class-tabs a {
        white-space: nowrap;
    }

    .bk-summary {
        grid-template-columns: 1fr;
    }

    .bulk-action-bar {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .bulk-action-controls {
        justify-content: stretch;
    }

    .bulk-action-controls .btn {
        flex: 1 1 150px;
    }

    .bulk-action-controls .muted {
        text-align: left;
    }

    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 640px;
    }

    .permit-card {
        gap: 14px;
    }

    .qr-box {
        width: 100%;
    }

    .notif-popup {
        top: auto;
        right: 10px;
        bottom: 12px;
        left: 10px;
        width: auto;
    }

    .permit-table-wrap {
        overflow-x: visible;
    }

    .permit-table,
    .permit-table thead,
    .permit-table tbody,
    .permit-table tr,
    .permit-table th,
    .permit-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .permit-table {
        border-collapse: separate;
        border-spacing: 0;
    }

    .permit-table thead {
        display: none;
    }

    .permit-table tbody {
        display: grid;
        gap: 12px;
    }

    .permit-table tbody tr {
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: #ffffff;
        box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
    }

    .permit-table tbody tr:hover {
        background: #ffffff;
    }

    .permit-table td {
        display: grid;
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 10px;
        padding: 8px 0;
        border-bottom: 0;
    }

    .permit-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
    }

    .permit-table td[data-label="Murid"] {
        grid-template-columns: 1fr;
        gap: 4px;
        padding-top: 0;
    }

    .permit-table td[data-label="Murid"]::before {
        display: none;
    }

    .permit-table td[data-label="Aksi"] {
        grid-template-columns: 1fr;
        padding-top: 12px;
        border-top: 1px solid var(--line);
    }

    .permit-table td[data-label="Aksi"]::before {
        display: none;
    }

    .permit-table .row-actions {
        align-items: stretch;
        width: 100%;
    }

    .permit-table .row-actions > a,
    .permit-table .row-actions .inline,
    .permit-table .row-actions .btn,
    .permit-table .row-actions button {
        flex: 1 1 112px;
        width: 100%;
    }

    .approval-actions .btn {
        flex-basis: 100%;
    }
}

@media (max-width: 420px) {
    .container {
        width: calc(100% - 10px);
    }

    .hero,
    .panel,
    .form-card {
        padding: 16px;
    }

    table {
        min-width: 560px;
    }
}

@media (min-width: 1200px) {
    .presensi-guru-layout {
        grid-template-areas: "work summary";
        grid-template-columns: minmax(0, 1fr) minmax(340px, 390px);
        gap: 24px;
    }

    .presensi-guru-layout .bulk-tool-panel {
        grid-area: work;
    }

    .presensi-guru-layout .bulk-summary-panel {
        grid-area: summary;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .presensi-guru-layout {
        grid-template-columns: minmax(0, 920px);
        justify-content: center;
    }
}

/* ===== FINAL FORM MARKERS + DUTY SCHEDULE CARDS (2026-07-01) ===== */
.permit-field {
    position: relative;
    display: block;
    min-width: 0;
    padding: 13px;
    border: 2px solid transparent;
    border-radius: 16px;
}

.permit-field .field-title {
    margin-bottom: 8px;
}

.permit-field.field-required {
    border-color: #f87171;
    background: #fff1f2;
    box-shadow: inset 4px 0 0 #dc2626;
}

.permit-field.field-optional {
    border-color: #5eead4;
    background: #f0fdfa;
    box-shadow: inset 4px 0 0 #0f766e;
}

.permit-field.field-auto {
    border-color: #93c5fd;
    background: #eff6ff;
    box-shadow: inset 4px 0 0 #2563eb;
}

.permit-field.field-required input,
.permit-field.field-required select,
.permit-field.field-required textarea {
    border-color: #fca5a5;
    background: #ffffff;
}

.permit-field.field-optional input,
.permit-field.field-optional select,
.permit-field.field-optional textarea {
    border-color: #99f6e4;
    background: #ffffff;
}

.permit-field.field-auto input {
    border-color: #bfdbfe;
    color: #1e3a8a;
    background: #ffffff;
    opacity: 1;
}

.duty-schedule-list {
    display: grid;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.duty-schedule-item {
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid #dfe7f1;
    border-radius: 15px;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .05);
}

.duty-schedule-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.duty-teacher-name {
    min-width: 0;
    color: #172033;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.duty-schedule-main .badge {
    flex: 0 0 auto;
    white-space: nowrap;
}

.duty-schedule-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #edf1f7;
}

.duty-schedule-empty {
    margin: 0;
}

@media (max-width: 768px) {
    .permit-field {
        padding: 12px;
    }

    .duty-schedule-item {
        padding: 12px;
    }

    .duty-schedule-main {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

.install-app-button {
    min-height: 38px;
    padding: 8px 14px;
    border: 0;
    border-radius: 999px;
    background: #0f766e;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.install-app-button:hover {
    background: #115e59;
}

.install-app-button[hidden] {
    display: none !important;
}

.schedule-table-wrap {
    overflow-x: visible;
}

.schedule-table {
    min-width: 0;
}

@media (display-mode: standalone) {
    .install-app-button {
        display: none !important;
    }
}

/* Mobile polish for the permit approval list. */
@media (max-width: 768px) {
    .approval-hint {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 12px;
        padding: 12px 13px;
        border-color: #d7e4f5;
        border-radius: 14px;
        color: #344054;
        background: #f8fbff;
        box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
        font-size: 13px;
        line-height: 1.45;
    }

    .approval-hint::before {
        content: "!";
        display: grid;
        place-items: center;
        flex: 0 0 22px;
        width: 22px;
        height: 22px;
        border-radius: 999px;
        color: #ffffff;
        background: var(--accent);
        font-size: 13px;
        font-weight: 800;
    }

    .bulk-action-bar {
        gap: 10px;
        margin-bottom: 14px;
        padding: 14px;
        border-radius: 16px;
        background: #ffffff;
        box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
    }

    .bulk-action-bar label {
        color: #344054;
        font-size: 13px;
        font-weight: 800;
    }

    .bulk-action-bar textarea {
        min-height: 68px;
        border-color: #e4eaf3;
        border-radius: 14px;
        background: #fbfdff;
        font-size: 14px;
        line-height: 1.45;
    }

    .bulk-action-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .bulk-action-controls .muted {
        grid-column: 1 / -1;
        padding: 2px 0;
        font-size: 13px;
    }

    .bulk-action-controls .btn {
        min-height: 44px;
        border-radius: 13px;
        font-size: 13px;
    }

    .permit-table tbody {
        gap: 14px;
    }

    .permit-table tbody tr {
        position: relative;
        display: grid;
        gap: 0;
        padding: 16px;
        border: 1px solid #e4eaf3;
        border-radius: 18px;
        background: #ffffff;
        box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
    }

    .permit-table td {
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
        align-items: center;
        gap: 8px;
        min-height: 34px;
        padding: 5px 0;
        color: #344054;
        font-size: 14px;
    }

    .permit-table td::before {
        color: #667085;
        font-size: 11px;
        letter-spacing: 0;
        text-transform: none;
    }

    .permit-table td[data-label="Pilih"] {
        position: absolute;
        top: 14px;
        right: 14px;
        z-index: 1;
        display: flex;
        width: auto;
        min-height: 0;
        padding: 0;
    }

    .permit-table td[data-label="Pilih"]::before {
        content: "";
    }

    .permit-table td[data-label="Pilih"] input {
        width: 22px;
        height: 22px;
        min-height: 22px;
        border-radius: 6px;
    }

    .permit-table td[data-label="No Izin"] {
        order: 2;
        grid-template-columns: 92px minmax(0, 1fr);
        color: #667085;
        font-size: 12px;
    }

    .permit-table td[data-label="Murid"] {
        order: 1;
        padding: 0 34px 11px 0;
        border-bottom: 1px solid #edf1f7;
    }

    .permit-table td[data-label="Murid"] strong {
        display: block;
        margin-bottom: 6px;
        color: #172033;
        font-size: 16px;
        line-height: 1.25;
        letter-spacing: 0;
    }

    .permit-table td[data-label="Murid"] .muted {
        display: block;
        color: #667085;
        font-size: 12px;
        line-height: 1.35;
    }

    .permit-table td[data-label="Murid"] .detail-note {
        display: block;
        margin-top: 8px;
        padding: 8px 10px;
        border-radius: 12px;
        color: #475467;
        background: #f6f8fb;
        font-size: 12px;
        line-height: 1.35;
    }

    .permit-table td[data-label="Tanggal"] {
        order: 3;
    }

    .permit-table td[data-label="Jenis"] {
        order: 4;
    }

    .permit-table td[data-label="Keterangan Izin"] {
        order: 5;
        align-items: start;
    }

    .permit-table td[data-label="Keterangan Izin"] .muted {
        display: block;
        margin-top: 2px;
        color: #667085;
    }

    .permit-table td[data-label="Status"] {
        order: 6;
        padding-bottom: 12px;
    }

    .permit-type,
    .badge {
        min-height: 28px;
        justify-content: center;
        padding: 6px 12px;
        border-radius: 999px;
        font-size: 12px;
        line-height: 1.1;
    }

    .permit-table td[data-label="Aksi"] {
        order: 7;
        margin-top: 8px;
        padding-top: 12px;
        border-top: 1px solid #edf1f7;
    }

    .permit-table .row-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .permit-table .row-actions > a {
        display: inline-flex;
        grid-column: 1 / -1;
        align-items: center;
        justify-content: center;
        min-height: 40px;
        border: 1px solid #d7e4f5;
        border-radius: 13px;
        color: #0f766e;
        background: #f8fbff;
        font-size: 13px;
        font-weight: 800;
        text-decoration: none;
    }

    .permit-table .row-actions .inline,
    .permit-table .row-actions .btn,
    .permit-table .row-actions button {
        min-height: 42px;
        border-radius: 13px;
        font-size: 13px;
        font-weight: 800;
    }

    .permit-table .row-actions .danger-link {
        grid-column: 1 / -1;
        min-height: 38px;
        border: 1px solid rgba(194, 65, 53, .25);
        border-radius: 13px;
        background: #fff7f6;
    }

    .schedule-table-wrap {
        overflow-x: visible;
    }

    .schedule-table,
    .schedule-table thead,
    .schedule-table tbody,
    .schedule-table tr,
    .schedule-table th,
    .schedule-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .schedule-table thead {
        display: none;
    }

    .schedule-table tbody {
        display: grid;
        gap: 10px;
    }

    .schedule-table tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 12px 13px;
        border: 1px solid #e4eaf3;
        border-radius: 15px;
        background: #ffffff;
        box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
    }

    .schedule-table td {
        padding: 0;
        border-bottom: 0;
    }

    .schedule-table td[data-label="Guru"] {
        color: #172033;
        font-weight: 800;
        line-height: 1.35;
    }

    .schedule-table td[data-label="Status"] {
        text-align: right;
    }

    .schedule-table td[data-label="Aksi"] {
        grid-column: 1 / -1;
        padding-top: 10px;
        border-top: 1px solid #edf1f7;
    }

    .schedule-table .empty {
        grid-column: 1 / -1;
    }
}

@media (max-width: 420px) {
    .approval-hint,
    .bulk-action-bar {
        margin-inline: -2px;
    }

    .bulk-action-controls {
        grid-template-columns: 1fr;
    }

    .permit-table tbody tr {
        padding: 15px;
    }

    .permit-table td {
        grid-template-columns: 82px minmax(0, 1fr);
        font-size: 13px;
    }

    .permit-table td[data-label="Murid"] strong {
        font-size: 15px;
    }

    .permit-table .row-actions {
        grid-template-columns: 1fr;
    }
}

/* PRESENSI MURID FINAL (2026-07-02) */
.presensi-shortcuts {
    border: 1px solid rgba(15, 118, 110, .12);
    background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
}

.presensi-shortcut-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.presensi-shortcut-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px solid #ccfbf1;
    border-radius: 18px;
    background: #ffffff;
    color: #0f172a;
    text-decoration: none;
    box-shadow: 0 14px 34px rgba(15, 118, 110, .10);
}

.presensi-shortcut-card span {
    width: max-content;
    padding: 5px 10px;
    border-radius: 999px;
    background: #ccfbf1;
    color: #0f766e;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.presensi-shortcut-card strong {
    font-size: 18px;
}

.presensi-shortcut-card small {
    color: #64748b;
    line-height: 1.45;
}

.bulk-absence-list {
    display: grid;
    gap: 12px;
    margin-top: 10px;
}

.bulk-absence-item {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.4fr);
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
}

.bulk-absence-check {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 0;
    font-weight: 800;
    cursor: pointer;
}

.bulk-absence-check input {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    accent-color: #0f766e;
}

.bulk-absence-check span {
    display: grid;
    gap: 3px;
}

.bulk-absence-check small {
    color: #64748b;
    font-weight: 700;
}

.bulk-absence-fields {
    display: grid;
    grid-template-columns: minmax(120px, .7fr) minmax(180px, 1.3fr);
    gap: 10px;
}

.bulk-absence-fields label {
    margin: 0;
}

.bulk-absence-item:has(.bulk-absence-check input:checked) {
    border-color: #14b8a6;
    background: #ecfeff;
    box-shadow: 0 12px 28px rgba(20, 184, 166, .12);
}

.btn.danger {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #c2410c;
}

@media (max-width: 760px) {
    .presensi-shortcut-grid,
    .bulk-absence-item,
    .bulk-absence-fields {
        grid-template-columns: 1fr;
    }

    .bulk-absence-item {
        padding: 13px;
    }

    .bulk-absence-fields {
        padding-left: 34px;
    }
}

@supports not selector(:has(*)) {
    .bulk-absence-item {
        border-left: 5px solid #0f766e;
    }
}

/* PRESENSI MURID REVISI RINGKAS (2026-07-02) */
.hero {
    align-items: stretch;
}

.hero-presensi-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 4px;
}

.hero-presensi-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    color: #ffffff;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .20);
    backdrop-filter: blur(8px);
}

.hero-presensi-actions a:first-child {
    background: rgba(15, 118, 110, .55);
}

.hero-presensi-actions a:last-child {
    background: rgba(255, 255, 255, .92);
    color: #0f766e;
}

.presensi-shortcuts {
    display: none !important;
}

.presensi-compact-form {
    gap: 14px;
}

.student-picker-button {
    width: 100%;
    display: grid;
    gap: 5px;
    min-height: 58px;
    padding: 12px 16px;
    border: 1px solid #dbe5ee;
    border-radius: 16px;
    background: #ffffff;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
}

.student-picker-button span {
    font-weight: 800;
    font-size: 16px;
}

.student-picker-button small {
    color: #64748b;
    font-weight: 700;
}

.student-picker-button:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.selected-students {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selected-students span {
    padding: 7px 10px;
    border-radius: 999px;
    background: #ccfbf1;
    color: #0f766e;
    font-size: 12px;
    font-weight: 800;
}

.student-picker-modal[hidden] {
    display: none;
}

.student-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 18px;
}

.student-picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .58);
}

.student-picker-sheet {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-height: min(760px, 88vh);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 28px 90px rgba(15, 23, 42, .32);
}

.student-picker-head,
.student-picker-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #edf2f7;
}

.student-picker-foot {
    justify-content: flex-end;
    border-top: 1px solid #edf2f7;
    border-bottom: 0;
}

.student-picker-head h3 {
    margin: 0;
}

.student-picker-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.student-picker-search {
    margin: 14px 18px;
}

.student-picker-list {
    overflow: auto;
    border-top: 1px solid #f1f5f9;
}

.student-picker-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    margin: 0;
    padding: 14px 18px;
    border-bottom: 1px solid #edf2f7;
    font-weight: 700;
    cursor: pointer;
}

.student-picker-option[hidden] {
    display: none !important;
}

.student-picker-modal.keyboard-open {
    align-items: start;
    padding: max(8px, env(safe-area-inset-top)) 10px 10px;
}

.student-picker-modal.keyboard-open .student-picker-sheet {
    max-height: calc(var(--student-picker-viewport-height, 100dvh) - 18px);
    border-radius: 18px;
}

.student-picker-modal.keyboard-open .student-picker-head,
.student-picker-modal.keyboard-open .student-picker-foot {
    padding: 12px 14px;
}

.student-picker-modal.keyboard-open .student-picker-search {
    margin: 10px 14px;
}

@media (max-width: 640px) {
    .student-picker-modal {
        align-items: start;
        padding: max(8px, env(safe-area-inset-top)) 10px 10px;
    }

    .student-picker-sheet {
        max-height: calc(var(--student-picker-viewport-height, 100dvh) - 18px);
        border-radius: 18px;
    }

    .student-picker-head,
    .student-picker-foot {
        padding: 12px 14px;
    }

    .student-picker-search {
        margin: 10px 14px;
    }
}

.student-picker-option input {
    width: 25px;
    height: 25px;
    accent-color: #0f766e;
}

.student-picker-option:has(input:checked) {
    background: #ecfeff;
    color: #0f766e;
}

.modal-open {
    overflow: hidden;
}

.nihil-btn {
    border-color: #fed7aa;
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    color: #c2410c;
    font-weight: 900;
}

@media (max-width: 760px) {
    .hero-presensi-actions {
        gap: 10px;
    }

    .hero-presensi-actions a {
        min-height: 38px;
        padding: 9px 10px;
        font-size: 13px;
    }

    .student-picker-modal {
        align-items: end;
        padding: 0;
    }

    .student-picker-sheet {
        width: 100%;
        max-height: 84vh;
        border-radius: 22px 22px 0 0;
    }
}

/* REKAP PRESENSI TERPADU (2026-07-02) */
.rekap-shell { overflow: visible; }

.rekap-tabs,
.rekap-legend,
.export-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rekap-tabs a,
.rekap-legend span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid #dbe5ee;
    border-radius: 999px;
    color: #172033;
    background: #ffffff;
    font-weight: 800;
    text-decoration: none;
}

.rekap-tabs a.active {
    border-color: #0f766e;
    color: #ffffff;
    background: #0f766e;
}

.rekap-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
}

.rekap-filter-grid .form-actions { align-items: end; }
.presensi-simple-filter .rekap-advanced-filter {
    grid-column: 1 / -1;
    margin-top: 0;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.presensi-simple-filter .rekap-advanced-filter summary {
    width: max-content;
    color: #0f766e;
    font-weight: 900;
    cursor: pointer;
}

.presensi-simple-filter .rekap-advanced-filter > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.rekap-stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.monthly-matrix { min-width: 1180px; }

.monthly-matrix th,
.monthly-matrix td {
    text-align: center;
    vertical-align: middle;
}

.monthly-matrix th:nth-child(2),
.monthly-matrix td:nth-child(2),
.rekap-table th:nth-child(2),
.rekap-table td:nth-child(2) {
    text-align: left;
}

.monthly-matrix th small {
    display: block;
    color: #667085;
    font-size: 10px;
}

.code-h,
.code-s,
.code-i,
.code-a,
.code-t,
.code-libur,
.monthly-matrix td[class^="code-"] {
    font-weight: 900;
}

.code-h { color: #065f46 !important; background: #dcfce7 !important; }
.code-s { color: #7c5b00 !important; background: #fef3c7 !important; }
.code-i { color: #1d4ed8 !important; background: #dbeafe !important; }
.code-a { color: #991b1b !important; background: #fee2e2 !important; }
.code-pkl { color: #6d28d9 !important; background: #ede9fe !important; }
.code-ts { color: #0f766e !important; background: #ccfbf1 !important; }
.checkbox-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:10px; }
.checkbox-grid label { display:flex; align-items:center; gap:8px; }
.code-t { color: #9a3412 !important; background: #ffedd5 !important; }
.code-libur { color: #ffffff !important; background: #ff4d55 !important; }

.student-rekap-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid #dbe5ee;
    border-radius: 16px;
    background: #f8fafc;
}

.student-rekap-head strong {
    color: #0f766e;
    font-size: 34px;
}

.rekap-bars,
.rank-list {
    display: grid;
    gap: 11px;
}

.rekap-bars div,
.rank-list div {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) 58px;
    align-items: center;
    gap: 10px;
}

.rank-list span {
    display: grid;
    line-height: 1.25;
}

.rank-list small {
    color: #667085;
    font-weight: 400;
}

.rekap-bars b,
.rank-list b {
    display: block;
    height: 18px;
    border-radius: 999px;
    background: linear-gradient(90deg, #0f766e, #38bdf8);
}

.rekap-bars strong,
.rank-list strong {
    text-align: right;
}

.export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.badge.nasional {
    color: #991b1b;
    background: #fee2e2;
}

.badge.sekolah {
    color: #075e45;
    background: #dcfce7;
}

@media (max-width: 760px) {
    .rekap-filter-grid,
    .rekap-bars div,
    .rank-list div {
        grid-template-columns: 1fr;
    }

    .rekap-filter-grid .form-actions,
    .student-rekap-head {
        align-items: stretch;
        flex-direction: column;
    }
}

/* REKAP PRESENSI DASHBOARD REDESIGN (2026-07-02) */
.rekap-modern-page {
    --rekap-primary: #0F766E;
    --rekap-accent: #14B8A6;
    --rekap-bg: #F8FAFC;
    --rekap-card: #FFFFFF;
    --rekap-border: #E5E7EB;
    --rekap-text: #1F2937;
    --rekap-muted: #6B7280;
    display: grid;
    gap: 22px;
    color: var(--rekap-text);
    font-family: Poppins, Inter, Arial, Helvetica, sans-serif;
}

body:has(.rekap-modern-page) {
    background: var(--rekap-bg);
}

.rekap-modern-page .panel,
.rekap-modern-hero,
.rekap-nav-card,
.rekap-filter-card {
    border: 1px solid rgba(229, 231, 235, .92);
    border-radius: 24px;
    background: var(--rekap-card);
    box-shadow: 0 8px 30px rgba(15, 23, 42, .08);
}

.rekap-modern-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 28px 30px;
}

.rekap-modern-hero h1 {
    margin: 0 0 8px;
    color: var(--rekap-text);
    font-size: 32px;
    letter-spacing: 0;
}

.rekap-modern-hero p,
.rekap-modern-page .muted {
    margin: 0;
    color: var(--rekap-muted);
    font-size: 15px;
}

.rekap-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.rekap-modern-page .btn {
    min-height: 46px;
    border-radius: 16px;
    padding: 10px 16px;
    font-weight: 800;
}

.rekap-btn-outline,
.rekap-modern-page .btn:not(.primary) {
    border-color: #D1D5DB;
    color: var(--rekap-primary);
    background: #FFFFFF;
}

.rekap-modern-page .btn.primary {
    border-color: var(--rekap-primary);
    background: linear-gradient(135deg, var(--rekap-accent), var(--rekap-primary));
    box-shadow: 0 10px 24px rgba(15, 118, 110, .20);
}

.rekap-nav-card {
    padding: 12px;
}

.rekap-modern-page .rekap-tabs {
    gap: 8px;
}

.rekap-modern-page .rekap-tabs a {
    min-height: 40px;
    border-radius: 999px;
    border-color: transparent;
    color: #4B5563;
    background: #F3F4F6;
}

.rekap-modern-page .rekap-tabs a.active {
    color: #FFFFFF;
    background: var(--rekap-primary);
}

.rekap-filter-card {
    padding: 20px;
}

.rekap-modern-page .rekap-filter-grid {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(180px, 1.1fr) auto;
    align-items: end;
    gap: 14px;
}

.rekap-modern-page label {
    gap: 8px;
    color: #374151;
    font-size: 14px;
    font-weight: 800;
}

.rekap-modern-page input,
.rekap-modern-page select {
    min-height: 46px;
    border-radius: 16px;
    border-color: var(--rekap-border);
    padding: 10px 14px;
    color: var(--rekap-text);
    background: #FFFFFF;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
}

.rekap-filter-actions {
    display: flex;
    gap: 10px;
    align-items: end;
}

.rekap-advanced-filter {
    grid-column: 1 / -1;
    margin-top: 2px;
    border-top: 1px solid var(--rekap-border);
    padding-top: 12px;
}

.rekap-advanced-filter summary {
    width: max-content;
    color: var(--rekap-primary);
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}

.rekap-advanced-filter > div {
    display: grid;
    grid-template-columns: 140px 180px minmax(220px, 1fr);
    gap: 14px;
    margin-top: 12px;
}

.rekap-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
}

.rekap-stat-grid article {
    position: relative;
    min-height: 120px;
    padding: 22px;
    border-radius: 22px;
    color: #FFFFFF;
    background: linear-gradient(135deg, #14B8A6, #0F766E);
    box-shadow: 0 14px 34px rgba(15, 118, 110, .22);
    transition: transform .22s ease, box-shadow .22s ease;
    overflow: hidden;
}

.rekap-stat-grid article:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 42px rgba(15, 118, 110, .28);
}

.rekap-stat-grid article::after {
    content: "";
    position: absolute;
    right: -28px;
    bottom: -38px;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
}

.rekap-stat-grid span {
    display: block;
    margin-top: 8px;
    color: rgba(255, 255, 255, .86);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.rekap-stat-grid strong {
    display: block;
    margin-top: 12px;
    color: #FFFFFF;
    font-size: 42px;
    line-height: 1;
}

.rekap-stat-grid small {
    display: block;
    margin-top: 9px;
    color: rgba(255, 255, 255, .78);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}

.stat-icon::before {
    color: #FFFFFF;
    font-size: 20px;
    font-style: normal;
}

.stat-people::before { content: "👥"; }
.stat-check::before { content: "✓"; font-weight: 900; }
.stat-med::before { content: "+"; font-weight: 900; }
.stat-doc::before { content: "□"; font-weight: 900; }
.stat-alert::before { content: "!"; font-weight: 900; }
.stat-clock::before { content: "◷"; font-weight: 900; }
.stat-chart::before { content: "↗"; font-weight: 900; }

.rekap-data-card {
    overflow: hidden;
}

.rekap-data-card .section-head {
    align-items: center;
    margin-bottom: 18px;
}

.rekap-table-search {
    width: 220px;
    min-height: 42px;
    border-radius: 14px;
}

.rekap-data-card .table-wrap {
    overflow: auto;
    border: 1px solid var(--rekap-border);
    border-radius: 20px;
    background: #FFFFFF;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.rekap-data-card table {
    border-collapse: separate;
    border-spacing: 0;
}

.rekap-data-card th {
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid var(--rekap-border);
    color: #4B5563;
    background: #F9FAFB;
    font-size: 13px;
    font-weight: 900;
}

.rekap-data-card td {
    border-bottom: 1px solid #EEF2F7;
}

.rekap-data-card tbody tr:nth-child(even) {
    background: #FBFDFF;
}

.rekap-data-card tbody tr:hover {
    background: #F0FDFA;
}

.rekap-data-card td:first-child,
.rekap-data-card th:first-child {
    padding-left: 18px;
}

.dashboard-monitor-grid {
    display: grid;
    grid-template-columns: minmax(320px, .95fr) minmax(420px, 1.35fr);
    gap: 18px;
}

.monitor-card {
    min-height: 100%;
}

.absence-dashboard-card,
.trend-dashboard-card {
    border-radius: 24px;
}

.absence-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.absence-category-card {
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 16px;
    border: 1px solid #E5E7EB;
    border-radius: 20px;
    background: #FFFFFF;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

.absence-category-card.alpha {
    background: linear-gradient(180deg, #FFF7F7 0%, #FFFFFF 48%);
}

.absence-category-card.sakit {
    background: linear-gradient(180deg, #FFF7ED 0%, #FFFFFF 48%);
}

.absence-category-card.izin {
    background: linear-gradient(180deg, #EFF6FF 0%, #FFFFFF 48%);
}

.absence-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.absence-category-head span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 950;
    letter-spacing: .03em;
}

.absence-category-card.alpha .absence-category-head span { color: #DC2626; }
.absence-category-card.sakit .absence-category-head span { color: #EA580C; }
.absence-category-card.izin .absence-category-head span { color: #2563EB; }

.absence-category-head span::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.absence-category-card.alpha .absence-category-head span::before { background: #EF4444; }
.absence-category-card.sakit .absence-category-head span::before { background: #F97316; }
.absence-category-card.izin .absence-category-head span::before { background: #2563EB; }

.absence-category-list {
    display: grid;
    gap: 10px;
}

.absence-person {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(229, 231, 235, .82);
    border-radius: 16px;
    background: rgba(255, 255, 255, .86);
}

.avatar-initial {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    color: #FFFFFF;
    background: #0F766E;
    font-size: 12px;
    font-weight: 950;
}

.absence-category-card.alpha .avatar-initial { background: #EF4444; }
.absence-category-card.sakit .avatar-initial { background: #F97316; }
.absence-category-card.izin .avatar-initial { background: #2563EB; }

.absence-person strong {
    display: block;
    color: #1F2937;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.absence-person small {
    display: block;
    margin-top: 2px;
    color: #6B7280;
    font-size: 11px;
}

.absence-person em {
    color: #6B7280;
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
}

.absence-category-list > a {
    font-size: 13px;
    font-weight: 950;
}

.absence-category-card.alpha .absence-category-list > a { color: #DC2626; }
.absence-category-card.sakit .absence-category-list > a { color: #EA580C; }
.absence-category-card.izin .absence-category-list > a { color: #2563EB; }

.absence-view-all {
    white-space: nowrap;
}

.absence-monitor-list {
    display: grid;
    gap: 10px;
}

.absence-monitor-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    background: #FFFFFF;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
}

.absence-monitor-item strong,
.absence-monitor-item span,
.absence-monitor-item small {
    display: block;
}

.absence-monitor-item strong {
    color: #1F2937;
    line-height: 1.3;
}

.absence-monitor-item span {
    color: #6B7280;
    font-size: 12px;
}

.absence-monitor-item small {
    margin-top: 4px;
    color: #4B5563;
    font-size: 12px;
}

.attendance-trend {
    display: grid;
    gap: 13px;
}

.trend-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 130px;
    align-items: center;
    gap: 12px;
}

.trend-row > span {
    color: #1F2937;
    font-weight: 900;
}

.trend-row small {
    display: block;
    color: #6B7280;
    font-size: 11px;
    font-weight: 700;
}

.trend-row strong {
    color: #374151;
    font-size: 12px;
    text-align: right;
    white-space: nowrap;
}

.trend-bars {
    display: grid;
    gap: 4px;
}

.trend-bars b {
    display: block;
    height: 8px;
    border-radius: 999px;
}

.trend-hadir {
    background: #0F766E;
}

.trend-absen {
    background: #EF4444;
}

.trend-late {
    background: #F97316;
}

.trend-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
    color: #6B7280;
    font-size: 12px;
    font-weight: 800;
}

.trend-legend span {
    width: 18px;
    height: 8px;
    border-radius: 999px;
}

.trend-analytics-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 18px;
    align-items: stretch;
}

.chart-shell {
    min-width: 0;
    padding: 16px;
    border: 1px solid #E5E7EB;
    border-radius: 20px;
    background: #FFFFFF;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}

.chart-shell canvas {
    display: block;
    width: 100%;
    height: 260px;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
    color: #6B7280;
    font-size: 12px;
    font-weight: 900;
}

.chart-legend span {
    width: 20px;
    height: 8px;
    border-radius: 999px;
}

.legend-hadir { background: #0F766E; }
.legend-alpha { background: #EF4444; }
.legend-sakit { background: #F97316; }
.legend-izin { background: #2563EB; }
.legend-terlambat { background: #7C3AED; }

.trend-summary-cards {
    display: grid;
    gap: 12px;
}

.trend-summary-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid transparent;
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.trend-summary-card i {
    display: grid;
    place-items: center;
    grid-row: span 2;
    width: 42px;
    height: 42px;
    border-radius: 15px;
    font-style: normal;
    font-weight: 950;
}

.trend-summary-card span {
    color: #4B5563;
    font-size: 12px;
    font-weight: 900;
}

.trend-summary-card strong {
    color: #111827;
    font-size: 26px;
    line-height: 1;
}

.trend-summary-card.hadir {
    background: #ECFDF5;
    border-color: #A7F3D0;
}

.trend-summary-card.hadir i {
    color: #FFFFFF;
    background: #0F766E;
}

.trend-summary-card.hadir i::before { content: "✓"; }

.trend-summary-card.absent {
    background: #FFF7ED;
    border-color: #FED7AA;
}

.trend-summary-card.absent i {
    color: #FFFFFF;
    background: #F97316;
}

.trend-summary-card.absent i::before { content: "!"; }

.trend-summary-card.late {
    background: #F5F3FF;
    border-color: #DDD6FE;
}

.trend-summary-card.late i {
    color: #FFFFFF;
    background: #7C3AED;
}

.trend-summary-card.late i::before { content: "◷"; }

@media (max-width: 1100px) {
    .rekap-modern-page .rekap-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rekap-filter-actions {
        grid-column: 1 / -1;
    }

    .dashboard-monitor-grid {
        grid-template-columns: 1fr;
    }

    .absence-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .trend-analytics-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .rekap-modern-hero {
        align-items: stretch;
        flex-direction: column;
        padding: 22px;
    }

    .rekap-modern-hero h1 {
        font-size: 28px;
    }

    .rekap-hero-actions,
    .rekap-hero-actions .btn,
    .rekap-filter-actions,
    .rekap-filter-actions .btn {
        width: 100%;
    }

    .rekap-modern-page .rekap-filter-grid,
    .rekap-advanced-filter > div {
        grid-template-columns: 1fr;
    }

    .rekap-table-search {
        width: 100%;
    }

    .rekap-data-card .section-head .actions {
        width: 100%;
        align-items: stretch;
    }

    .trend-row {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .trend-row strong {
        text-align: left;
    }

    .absence-category-grid {
        grid-template-columns: 1fr;
    }

    .absence-person {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .absence-person em {
        grid-column: 2;
    }
}

/* Rekap dashboard: compact and readable on phones. */
@media (max-width: 600px) {
    .rekap-modern-page {
        gap: 14px;
        padding-inline: 12px;
    }

    .rekap-modern-hero {
        gap: 16px;
        padding: 18px;
        border-radius: 18px;
    }

    .rekap-modern-hero h1 {
        font-size: 23px;
        line-height: 1.2;
    }

    .rekap-modern-hero p {
        font-size: 13px;
    }

    .rekap-hero-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .rekap-hero-actions .btn {
        min-width: 0;
        min-height: 42px;
        padding: 9px 10px;
        white-space: normal;
    }

    .rekap-nav-card {
        padding: 10px;
        border-radius: 18px;
    }

    .rekap-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        overflow: visible;
    }

    .rekap-tabs a {
        display: flex;
        min-width: 0;
        min-height: 40px;
        align-items: center;
        justify-content: center;
        padding: 8px 7px;
        text-align: center;
        white-space: normal;
    }

    .rekap-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .rekap-stat-grid article {
        min-height: 126px;
        padding: 15px;
        border-radius: 18px;
    }

    .rekap-stat-grid article::after {
        width: 88px;
        height: 88px;
    }

    .rekap-stat-grid span {
        margin-top: 7px;
        font-size: 10px;
        line-height: 1.25;
    }

    .rekap-stat-grid strong {
        margin-top: 8px;
        font-size: 30px;
    }

    .rekap-stat-grid small {
        margin-top: 7px;
        font-size: 10px;
        line-height: 1.3;
    }

    .stat-icon {
        width: 32px;
        height: 32px;
        border-radius: 11px;
    }

    .monitor-card {
        padding: 16px;
        border-radius: 20px;
    }

    .monitor-card .section-head {
        align-items: flex-start;
        gap: 10px;
    }

    .monitor-card .section-head h2 {
        font-size: 19px;
    }

    .absence-view-all {
        padding: 8px 10px;
        font-size: 11px;
    }

    .absence-category-grid {
        gap: 12px;
    }

    .absence-category-card {
        gap: 10px;
        padding: 14px;
        border-radius: 17px;
    }

    .absence-person {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 9px;
        padding: 9px;
        border-radius: 13px;
    }

    .absence-person em {
        grid-column: auto;
        max-width: 92px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .avatar-initial {
        width: 34px;
        height: 34px;
        font-size: 11px;
    }

    .chart-shell {
        width: 100%;
        padding: 10px 8px 12px;
        overflow: hidden;
        border-radius: 16px;
    }

    #attendanceTrendChart {
        display: block;
        width: 100% !important;
        max-width: 100%;
        height: 220px;
    }

    .chart-legend {
        gap: 8px 10px;
        font-size: 10px;
    }

    .chart-legend span {
        width: 15px;
        height: 6px;
    }

    .trend-summary-card {
        min-height: 76px;
        padding: 13px;
        border-radius: 16px;
    }

    .trend-summary-card strong {
        font-size: 23px;
    }
}

@media (max-width: 360px) {
    .rekap-modern-page {
        padding-inline: 9px;
    }

    .rekap-stat-grid,
    .rekap-tabs,
    .rekap-hero-actions {
        grid-template-columns: 1fr;
    }

    .rekap-stat-grid article {
        min-height: 116px;
    }
}

/* Riwayat presensi: ringkasan dan koreksi status siswa. */
.history-summary-cards {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.history-summary-card {
    display: grid;
    gap: 5px;
    min-height: 118px;
    padding: 18px;
    color: #0f172a;
    border: 1px solid #dbe4ef;
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
    text-decoration: none;
}

.history-summary-card span { font-size: 12px; font-weight: 800; }
.history-summary-card strong { font-size: 31px; line-height: 1; }
.history-summary-card small { color: #64748b; font-size: 11px; }
.history-summary-card.total { background: #eff6ff; border-color: #bfdbfe; }
.history-summary-card.hadir { background: #ecfdf5; border-color: #a7f3d0; }
.history-summary-card.sakit { background: #fff7ed; border-color: #fed7aa; }
.history-summary-card.izin { background: #eff6ff; border-color: #bfdbfe; }
.history-summary-card.alpha { background: #fef2f2; border-color: #fecaca; }
.history-summary-card.disabled { opacity: .78; }
.history-summary-card.active { outline: 3px solid #0f766e; outline-offset: 2px; }
.history-summary-cards.is-interactive .history-summary-card:hover { transform: translateY(-2px); box-shadow: 0 16px 28px rgba(15, 118, 110, .15); }

.history-correction-form { display: grid; grid-template-columns: 110px minmax(150px, 1fr) auto; gap: 8px; align-items: center; min-width: 420px; }
.history-correction-form select, .history-correction-form input { min-width: 0; padding: 9px 10px; }

input[type="search"].is-searching {
    background-image: linear-gradient(90deg, transparent, rgba(15, 118, 110, .14), transparent);
    background-size: 200% 100%;
    animation: live-search-pulse 1s linear infinite;
}

@keyframes live-search-pulse {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

@media (max-width: 900px) {
    .history-summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .history-summary-cards { grid-template-columns: 1fr; }
    .history-correction-form { grid-template-columns: 1fr; min-width: 180px; }
}

/* Mode rombongan Satpam: pilihan izin individual tanpa mengubah alur QR. */
.gate-header-actions { display: flex; gap: 8px; align-items: center; }
.gate-batch-link { min-width: 74px; }
.satpam-batch-shell { padding-bottom: 124px; }
.satpam-batch-hero { padding: 18px; border: 1px solid #bfeee5; border-radius: 20px; background: linear-gradient(135deg, #ecfdf8, #f8fffd); }
.satpam-batch-hero > span { color: #0f766e; font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.satpam-batch-hero h1 { margin: 5px 0 6px; font-size: clamp(22px, 6vw, 30px); }
.satpam-batch-hero p { margin: 0; color: #506276; font-size: 13px; line-height: 1.5; }
.satpam-batch-hero p strong { color: #0f766e; font-size: 18px; }
.satpam-batch-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; padding: 5px; border-radius: 14px; background: #edf4f7; }
.satpam-batch-tabs a { min-height: 42px; display: grid; place-items: center; color: #52657a; font-size: 13px; font-weight: 800; text-decoration: none; border-radius: 10px; }
.satpam-batch-tabs a.active { color: #fff; background: #0f766e; box-shadow: 0 6px 14px rgba(15,118,110,.2); }
.satpam-batch-filter { display: grid; grid-template-columns: minmax(0, 1fr) repeat(2, minmax(110px, .6fr)) auto; gap: 8px; padding: 12px; border: 1px solid #dbe7ec; border-radius: 16px; background: #fff; }
.satpam-batch-filter label { display: grid; gap: 4px; min-width: 0; color: #52657a; font-size: 10px; font-weight: 800; }
.satpam-batch-filter input, .satpam-batch-filter select { width: 100%; min-width: 0; min-height: 40px; padding: 0 10px; border: 1px solid #cddce5; border-radius: 10px; color: #132238; background: #fff; }
.satpam-batch-filter button { min-height: 40px; align-self: end; padding: 0 15px; border: 0; border-radius: 10px; color: #fff; font-weight: 800; background: #0f766e; cursor: pointer; }
.satpam-batch-select-all { display: flex; justify-content: space-between; gap: 12px; margin: 14px 0 8px; color: #25364a; font-size: 13px; }
.satpam-batch-select-all label { font-weight: 800; }
.satpam-batch-select-all input, .satpam-batch-row input { width: 20px; height: 20px; accent-color: #0f766e; }
.satpam-batch-select-all small { color: #718096; font-size: 11px; }
.satpam-batch-list { display: grid; gap: 8px; }
.satpam-batch-row { display: grid; grid-template-columns: 22px 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 82px; padding: 11px; border: 1px solid #dce8ed; border-radius: 16px; color: #16243a; background: #fff; cursor: pointer; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.satpam-batch-row:has(input:checked) { border-color: #14b8a6; background: #f0fdfa; box-shadow: 0 6px 16px rgba(15,118,110,.1); }
.satpam-batch-avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: #0f766e; font-size: 14px; font-weight: 900; background: #d7f8f1; }
.satpam-batch-person { min-width: 0; display: grid; gap: 2px; }
.satpam-batch-person b { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.satpam-batch-person small { color: #66788c; font-size: 11px; }
.satpam-batch-person em { width: fit-content; max-width: 100%; overflow: hidden; color: #0f766e; font-size: 10px; font-style: normal; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.satpam-batch-time { display: grid; justify-items: end; gap: 3px; text-align: right; }
.satpam-batch-time b { font-size: 13px; }
.satpam-batch-time small { color: #76869a; font-size: 10px; }
.satpam-batch-actionbar { position: fixed; z-index: 40; right: 12px; bottom: calc(78px + env(safe-area-inset-bottom)); left: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; max-width: 640px; margin: auto; padding: 10px; border: 1px solid #bfeee5; border-radius: 16px; background: rgba(255,255,255,.97); box-shadow: 0 14px 32px rgba(15,23,42,.2); }
.satpam-batch-actionbar strong, .satpam-batch-actionbar small { display: block; }
.satpam-batch-actionbar strong { color: #0f766e; font-size: 13px; }.satpam-batch-actionbar small { color: #68798d; font-size: 10px; }
.satpam-batch-actionbar button { min-height: 42px; padding: 0 12px; border-radius: 11px; font-size: 12px; font-weight: 800; cursor: pointer; }
.satpam-batch-cancel { color: #5b6878; border: 1px solid #d6e1e8; background: #fff; }.satpam-batch-confirm { color: #fff; border: 0; background: #0f766e; }
.satpam-batch-modal[hidden] { display: none; }.satpam-batch-modal { position: fixed; z-index: 80; inset: 0; }.satpam-batch-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.5); }
.satpam-batch-sheet { position: absolute; right: 0; bottom: 0; left: 0; display: grid; gap: 12px; max-height: min(88dvh, 720px); padding: 14px 18px calc(18px + env(safe-area-inset-bottom)); overflow: auto; border-radius: 24px 24px 0 0; background: #fff; box-shadow: 0 -12px 35px rgba(15,23,42,.2); }
.satpam-batch-sheet h2, .satpam-batch-sheet p { margin: 0; text-align: center; }.satpam-batch-sheet h2 { font-size: 22px; }.satpam-batch-sheet p { color: #617286; font-size: 13px; line-height: 1.5; }
.satpam-batch-review { display: grid; gap: 6px; max-height: 180px; margin: 0; padding: 10px 12px; overflow: auto; border: 1px solid #dce9ed; border-radius: 12px; color: #34455a; font-size: 12px; }.satpam-batch-review li { margin-left: 16px; }
.satpam-batch-result { margin: 14px 0; padding: 13px; border: 1px solid #bce9d3; border-radius: 15px; background: #effcf5; color: #14532d; }.satpam-batch-result.partial { border-color: #fed7aa; background: #fff8ed; color: #9a4b0b; }.satpam-batch-result p { margin: 4px 0; font-size: 13px; }.satpam-batch-result ul { margin: 8px 0 0; padding-left: 18px; font-size: 12px; }.satpam-batch-empty { margin-top: 14px; }
@media (max-width: 620px) { .satpam-batch-filter { grid-template-columns: 1fr 1fr; }.satpam-batch-filter label:first-of-type { grid-column: 1 / -1; }.satpam-batch-filter button { grid-column: 1 / -1; }.satpam-batch-select-all { align-items: start; flex-direction: column; gap: 4px; }.satpam-batch-actionbar { grid-template-columns: 1fr auto; }.satpam-batch-actionbar > div { grid-column: 1 / -1; }.gate-bottom-nav a { min-width: 0; } }
