/* ============================================================
   Sistem Absensi QR Code Sekolah - Main Stylesheet
   Tema: Hijau Tua Primary, Putih, Abu Soft
   ============================================================ */

:root {
    --primary:        #0d6e3d;
    --primary-dark:   #0a5530;
    --primary-light:  #e8f5ee;
    --primary-hover:  #0a5832;

    --secondary:      #6c757d;
    --success:        #198754;
    --info:           #0dcaf0;
    --warning:        #ffc107;
    --danger:         #dc3545;
    --light:          #f4f6f8;
    --dark:           #212529;

    --bg-body:        #f4f6f8;
    --bg-card:        #ffffff;
    --bg-sidebar:     #ffffff;
    --bg-navbar:      #ffffff;
    --text-main:      #222831;
    --text-muted:     #6c757d;
    --text-sidebar:   #495057;
    --border-color:   #e6e8eb;

    --sidebar-width:  260px;
    --sidebar-collapsed: 70px;
    --navbar-height:  60px;

    --shadow-sm:      0 1px 3px rgba(0,0,0,0.04);
    --shadow:         0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg:      0 8px 24px rgba(0,0,0,0.10);

    --radius-sm:      6px;
    --radius:         10px;
    --radius-lg:      14px;

    --transition:     0.25s ease;
}

/* Dark mode tokens */
[data-bs-theme="dark"], .dark-mode {
    --bg-body:        #0f1419;
    --bg-card:        #1a1f26;
    --bg-sidebar:     #161b22;
    --bg-navbar:      #161b22;
    --text-main:      #e6edf3;
    --text-muted:     #8b949e;
    --text-sidebar:   #c9d1d9;
    --border-color:   #30363d;
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.3);
    --shadow:         0 2px 8px rgba(0,0,0,0.4);
    --shadow-lg:      0 8px 24px rgba(0,0,0,0.5);
    --primary-light:  rgba(13,110,61,0.2);
}

/* ============================================================
   GLOBAL
   ============================================================ */
* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji",
                 "Segoe UI Emoji", "Segoe UI Symbol";
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
    transition: background var(--transition), color var(--transition);
}

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

.text-primary { color: var(--primary) !important; }
.bg-primary   { background-color: var(--primary) !important; }
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}
.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    transition: transform var(--transition), width var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    padding: 0 18px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-logo img,
.sidebar-logo svg {
    height: 32px;
    width: 32px;
    flex-shrink: 0;
}

.sidebar-logo-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-menu {
    flex: 1;
    padding: 14px 10px;
    list-style: none;
    margin: 0;
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 12px 16px 14px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02);
    font-size: 11px;
    line-height: 1.4;
}

.brand-footer-sidebar a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.brand-footer-sidebar a:hover {
    text-decoration: underline;
}

.brand-footer-year {
    color: var(--text-muted);
    font-size: 10px;
}

.sidebar-menu .menu-header {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 12px 6px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    color: var(--text-sidebar);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-menu a i {
    font-size: 17px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-menu a:hover {
    background: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
}

.sidebar-menu a.active {
    background: var(--primary);
    color: #fff;
}

.sidebar-menu a.active:hover {
    background: var(--primary-hover);
    color: #fff;
}

.sidebar-menu a .badge {
    margin-left: auto;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    transition: margin-left var(--transition);
    display: flex;
    flex-direction: column;
}

/* NAVBAR */
.app-navbar {
    background: var(--bg-navbar);
    border-bottom: 1px solid var(--border-color);
    height: var(--navbar-height);
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
    backdrop-filter: blur(8px);
}

.app-navbar .navbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-toggle-sidebar {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 20px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.btn-toggle-sidebar:hover { background: var(--primary-light); color: var(--primary); }

.page-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-right .btn-icon {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 18px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    transition: all 0.15s;
}
.navbar-right .btn-icon:hover { background: var(--primary-light); color: var(--primary); }

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    background: none;
    color: var(--text-main);
}
.user-menu:hover { background: var(--primary-light); }

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-info { text-align: left; line-height: 1.2; }
.user-info .name { font-size: 13px; font-weight: 600; }
.user-info .role { font-size: 11px; color: var(--text-muted); }

/* CONTENT AREA */
.content-area {
    flex: 1;
    padding: 22px;
}

.page-header {
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header h1 i {
    color: var(--primary);
    font-size: 24px;
}

.page-header .subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* HERO HEADER (konsisten untuk halaman yang butuh highlight) */
.page-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 22px 26px;
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    box-shadow: 0 4px 16px rgba(13, 110, 61, 0.18);
    position: relative;
    overflow: hidden;
}

.page-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.page-hero h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.page-hero h1 i { color: #fff; font-size: 24px; }

.page-hero .subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    margin-top: 4px;
    position: relative;
    z-index: 2;
}

.page-hero .hero-actions {
    position: relative;
    z-index: 2;
}

/* CARDS */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), background var(--transition);
    margin-bottom: 18px;
}

.card:hover { box-shadow: var(--shadow); }

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 14px 18px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body { padding: 18px; }
.card-footer {
    background: transparent;
    border-top: 1px solid var(--border-color);
    padding: 12px 18px;
}

/* STAT CARDS */
.stat-card {
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card .card-body {
    padding: 20px 22px;
    position: relative;
    z-index: 2;
}

.stat-card::after {
    content: '';
    position: absolute;
    right: -10px;
    bottom: -15px;
    font-family: 'bootstrap-icons';
    font-size: 5rem;
    opacity: 0.15;
    z-index: 1;
    line-height: 1;
}

.stat-card .stat-label,
.stat-card .stat-card-label {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255,255,255,0.92);
    margin: 0 0 6px;
    font-weight: 600;
    display: block;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.stat-card .stat-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    margin-top: 4px;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.18);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

/* Varian warna (gradient) */
.stat-card.stat-primary  { background: linear-gradient(135deg, #0d6e3d 0%, #0a5530 100%); }
.stat-card.stat-primary::after  { content: '\f4d8'; } /* bi-bar-chart */

.stat-card.stat-success  { background: linear-gradient(135deg, #198754 0%, #0f5132 100%); }
.stat-card.stat-success::after  { content: '\f26b'; } /* bi-check-circle */

.stat-card.stat-warning  { background: linear-gradient(135deg, #d97706 0%, #92400e 100%); }
.stat-card.stat-warning::after  { content: '\f469'; } /* bi-clock */

.stat-card.stat-danger   { background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%); }
.stat-card.stat-danger::after   { content: '\f622'; } /* bi-x-circle */

.stat-card.stat-info     { background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%); }
.stat-card.stat-info::after     { content: '\f4d8'; } /* bi-bar-chart */

.stat-card.stat-purple   { background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%); }
.stat-card.stat-purple::after   { content: '\f5b1'; } /* bi-people */

/* PANEL (konsisten untuk semua halaman) */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 18px;
    transition: box-shadow var(--transition);
}

.panel:hover { box-shadow: var(--shadow); }

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    flex-wrap: wrap;
    gap: 8px;
}

.panel-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.panel-title i { color: var(--primary); font-size: 16px; }

.panel-body { padding: 18px 20px; }

.panel-badge {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-body);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* TABLES */
.table {
    margin-bottom: 0;
    color: var(--text-main);
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-main);
}

.table > :not(caption) > * > * {
    padding: 12px 14px;
    border-bottom-color: var(--border-color);
    background: transparent;
    color: var(--text-main);
}

.table thead th {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    border-top: none;
}

.table-hover tbody tr:hover { background: var(--primary-light); }

.table-actions { white-space: nowrap; text-align: right; }
.table-actions .btn { padding: 4px 10px; font-size: 12px; margin-left: 2px; }

/* BADGES */
.badge {
    font-weight: 600;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 50px;
}

.status-hadir, .status-aktif   { background: rgba(25,135,84,0.15);  color: #0f5132; }
.status-terlambat              { background: rgba(255,193,7,0.18);   color: #b08400; }
.status-izin                   { background: rgba(13,202,240,0.15); color: #087990; }
.status-sakit                  { background: rgba(102,16,242,0.12); color: #5e2d8e; }
.status-alfa                   { background: rgba(220,53,69,0.15);  color: #b02a37; }
.status-pending                { background: rgba(255,193,7,0.18);   color: #b08400; }
.status-approved               { background: rgba(25,135,84,0.15);  color: #0f5132; }
.status-rejected               { background: rgba(220,53,69,0.15);  color: #b02a37; }
.status-lulus, .status-pulang_cepat { background: rgba(13,110,61,0.12); color: #0a5530; }
.status-pindah, .status-keluar, .status-nonaktif { background: rgba(108,117,125,0.15); color: #495057; }

[data-bs-theme="dark"] .status-hadir, [data-bs-theme="dark"] .status-aktif { background: rgba(25,135,84,0.25); color: #75e6a4; }
[data-bs-theme="dark"] .status-terlambat { background: rgba(255,193,7,0.25); color: #ffd966; }
[data-bs-theme="dark"] .status-izin { background: rgba(13,202,240,0.25); color: #6edff6; }
[data-bs-theme="dark"] .status-sakit { background: rgba(102,16,242,0.25); color: #c5b0f0; }
[data-bs-theme="dark"] .status-alfa { background: rgba(220,53,69,0.25); color: #f1949b; }
[data-bs-theme="dark"] .status-pending { background: rgba(255,193,7,0.25); color: #ffd966; }
[data-bs-theme="dark"] .status-approved { background: rgba(25,135,84,0.25); color: #75e6a4; }
[data-bs-theme="dark"] .status-rejected { background: rgba(220,53,69,0.25); color: #f1949b; }
[data-bs-theme="dark"] .status-pindah, [data-bs-theme="dark"] .status-keluar, [data-bs-theme="dark"] .status-nonaktif { background: rgba(108,117,125,0.25); color: #c9d1d9; }
[data-bs-theme="dark"] .status-lulus, [data-bs-theme="dark"] .status-pulang_cepat { background: rgba(13,110,61,0.3); color: #75e6a4; }

/* FORMS */
.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-label .required { color: var(--danger); }

.form-control, .form-select {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    padding: 8px 12px;
    transition: all 0.15s;
}

.form-control:focus, .form-select:focus {
    background: var(--bg-card);
    color: var(--text-main);
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(13,110,61,0.15);
}

.input-group-text {
    background: var(--bg-body);
    color: var(--text-muted);
    border-color: var(--border-color);
    font-size: 14px;
}

.form-text { font-size: 12px; color: var(--text-muted); }
.invalid-feedback { font-size: 12px; }

/* BUTTONS */
.btn {
    font-size: 13.5px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 10px 20px; font-size: 15px; }

.btn-soft-primary {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid transparent;
}
.btn-soft-primary:hover {
    background: var(--primary);
    color: #fff;
}

.btn-icon-square {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ALERTS */
.alert {
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 13.5px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.alert-success { background: rgba(25,135,84,0.1); color: #0f5132; border-color: rgba(25,135,84,0.2); }
.alert-danger  { background: rgba(220,53,69,0.1); color: #842029; border-color: rgba(220,53,69,0.2); }
.alert-warning { background: rgba(255,193,7,0.12); color: #997404; border-color: rgba(255,193,7,0.3); }
.alert-info    { background: rgba(13,202,240,0.1); color: #055160; border-color: rgba(13,202,240,0.25); }

[data-bs-theme="dark"] .alert-success { background: rgba(25,135,84,0.15); color: #75e6a4; }
[data-bs-theme="dark"] .alert-danger  { background: rgba(220,53,69,0.15); color: #f1949b; }
[data-bs-theme="dark"] .alert-warning { background: rgba(255,193,7,0.15); color: #ffd966; }
[data-bs-theme="dark"] .alert-info    { background: rgba(13,202,240,0.15); color: #6edff6; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.3); }

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* LOADING */
.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner 0.75s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-body) 0%, var(--border-color) 50%, var(--bg-body) 100%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state i { font-size: 48px; opacity: 0.5; margin-bottom: 12px; display: block; }
.empty-state h5 { color: var(--text-main); margin-bottom: 6px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-backdrop {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1030;
        display: none;
    }
    .sidebar-backdrop.show { display: block; }
    .user-info { display: none; }
    .content-area { padding: 16px; }
}

@media (max-width: 575.98px) {
    .stat-card .stat-value { font-size: 22px; }
    .stat-card .stat-icon { width: 40px; height: 40px; font-size: 20px; }
    .page-header h1 { font-size: 18px; }
    .app-navbar { padding: 0 12px; }
}

/* PRINT */
@media print {
    .sidebar, .app-navbar, .btn, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content-area { padding: 0 !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* UTILITY */
.cursor-pointer { cursor: pointer; }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bg-soft-primary { background: var(--primary-light) !important; }
.fs-xs { font-size: 11.5px; }
.fs-sm { font-size: 12.5px; }

/* ==========================================================================
   PRINT STYLESHEET - Laporan (kop sekolah + tanda tangan, A4)
   ========================================================================== */

@page {
    size: A4 portrait;
    margin: 1.5cm 2cm 1.5cm 2cm;
}
@page :first { margin-top: 1cm; }
@page landscape { size: A4 landscape; }

/* Override orientasi via class di body (untuk switch dari form laporan) */
body.print-orientation-landscape {
    /* Class ini di-handle oleh <style> inline di view laporan */
}

@media print {
    /* Hide UI non-cetak */
    .sidebar, .topbar, .navbar, .page-header .btn, .no-print,
    .breadcrumb, .pagination, nav, .modal, .toast, .alert-dismissible .btn-close {
        display: none !important;
    }

    /* Reset layout untuk cetak */
    body, html {
        background: #fff !important;
        color: #000 !important;
        font-size: 11pt;
        margin: 0;
        padding: 0;
    }
    .main-content, .content, .page-content, .container-fluid {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .page-header { display: block; border: 0; padding: 0; margin: 0 0 12pt; }
    .page-header h1 { font-size: 16pt; }
    .card { border: 0 !important; box-shadow: none !important; page-break-inside: avoid; }
    .card-header { background: transparent !important; border-bottom: 1px solid #333 !important; }

    /* Tabel hitam-putih friendly */
    table { border-collapse: collapse !important; width: 100% !important; }
    table.table th, table.table td {
        border: 1px solid #333 !important;
        padding: 4pt 6pt !important;
        background: #fff !important;
        color: #000 !important;
    }
    table.table thead th { background: #eee !important; font-weight: bold; }
    table.table tbody tr:hover { background: transparent !important; }

    /* Page break utilities */
    .page-break-before { page-break-before: always; }
    .page-break-after  { page-break-after: always; }
    .no-break { page-break-inside: avoid; }

    /* Links: tampilkan URL di belakang text */
    a[href^="http"]:after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
    a:after { content: ""; }  /* jangan tampilkan anchor link */

    /* === KOP SEKOLAH === */
    .kop-sekolah {
        display: flex !important;
        align-items: center;
        gap: 16pt;
        border-bottom: 3px double #000;
        padding-bottom: 8pt;
        margin-bottom: 14pt;
    }
    .kop-sekolah .kop-logo {
        width: 70pt; height: 70pt;
        object-fit: contain;
        flex-shrink: 0;
    }
    .kop-sekolah .kop-text { flex: 1; text-align: center; }
    .kop-sekolah .kop-line1 {
        font-size: 16pt; font-weight: bold; text-transform: uppercase;
        line-height: 1.15; margin-bottom: 2pt;
    }
    .kop-sekolah .kop-line2 { font-size: 10pt; line-height: 1.2; }
    .kop-sekolah .kop-line3 { font-size: 9pt; line-height: 1.2; }

    .kop-judul-lap {
        text-align: center;
        margin: 16pt 0 10pt;
    }
    .kop-judul-lap h3 {
        font-size: 13pt; font-weight: bold;
        text-transform: uppercase;
        margin: 0 0 4pt;
    }
    .kop-judul-lap .kop-periode { font-size: 10pt; }

    /* === TANDA TANGAN === */
    .ttd-block {
        margin-top: 8pt;
        page-break-inside: avoid;
    }
    .ttd-table { width: 100% !important; border: 0 !important; }
    .ttd-table td.ttd-col {
        width: 50%;
        border: 0 !important;
        text-align: center;
        vertical-align: top;
        padding: 0 10pt !important;
    }
    .ttd-table td.ttd-tanggal {
        width: 50%;
        text-align: center;
        font-size: 10pt;
        vertical-align: bottom;
        padding: 0 10pt 2pt !important;
    }
    .ttd-table td.ttd-mengetahui {
        text-align: center;
        font-weight: bold;
        font-size: 11pt;
        padding-bottom: 2pt !important;
    }
    .ttd-label { font-weight: bold; }
    .ttd-spacer { height: 45pt; }
    .ttd-nama { text-decoration: underline; }
    .ttd-nip { font-size: 9pt; }

    /* Util: hanya muncul saat print */
    .only-print { display: block !important; }
}

/* Default di screen: hide elemen khusus print */
.only-print { display: none; }
