/* =======================================================
   PENILAIAN.CSS — diselaraskan dengan page-daftar-siswa
   Bg hijau muda, card/container putih, shadow ringan
   ======================================================= */

:root {
    --primary:      #059669;
    --primary-dark: #064e3b;
    --secondary:    #64748b;
    --bg-light:     #f8fafc;
    --white:        #ffffff;
    --shadow-card:  0 4px 12px rgba(0, 0, 0, 0.02);
    
}

* { box-sizing: border-box; }

/* ── Background halaman ── */
.page-penilaian {
    background:  #f8fafc;
    min-height: calc(100vh - 65px);
}

/* ── Header judul (no-print-nav) ── */
.no-print-nav {
    padding: 20px 24px;
    display: flex;
    align-items: center;
}

/* ── Container utama: putih, shadow ringan, dengan border tipis ── */
.main-container {
    width: 96%;
    max-width: 1800px;
    margin: 0 auto 2rem;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 6px;
    box-shadow: var(--shadow-card);
    border: 1px solid #e2e8f0; 
}

/* ── Filter Section ── */
.filter-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    background: #f8fafc;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}
.search-box {
    flex: 2;
    padding: 10px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    transition: 0.2s;
    font-size: 14px;
    background: #fff;
}
.search-box:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.08);
}
.filter-select {
    flex: 1;
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    background: white;
    font-weight: 600;
    font-size: 13px;
}

/* ── Table ── */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
}
.data-table thead {
    background-color: #f8fafc;
}
.data-table th {
    color: var(--secondary);
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
}
.data-table tr.siswa-row {
    background: white;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.data-table tr.siswa-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}
.data-table td {
    padding: 1rem;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}
.data-table td:first-child {
    border-left: 1px solid #f1f5f9;
    border-radius: 10px 0 0 10px;
}
.data-table td:last-child {
    border-right: 1px solid #f1f5f9;
    border-radius: 0 10px 10px 0;
}

/* ── Warna indikator penilaian (tidak berubah) ── */
.row-lengkap  { background-color: #dcfce7 !important; }
.row-setengah { background-color: #fef9c3 !important; }
.row-kosong   { background-color: #ffffff !important; }

.siswa-row.row-lengkap:hover  { background-color: #bbf7d0 !important; }
.siswa-row.row-setengah:hover { background-color: #fef08a !important; }

/* ── Tombol Aksi ── */
.btn-action {
    padding: 7px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid transparent;
}
.btn-print  { background: #ecfdf5; color: #059669; border-color: #10b981; }
.btn-print:hover  { background: #10b981; color: white; }

.btn-edit   { background: #eff6ff; color: #2563eb; border-color: #3b82f6; }
.btn-edit:hover   { background: #3b82f6; color: white; }

.btn-delete { background: #fef2f2; color: #dc2626; border-color: #ef4444; }
.btn-delete:hover { background: #ef4444; color: white; }

.btn-cetak-filter {
    background: white;
    color: var(--primary-dark);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}
.btn-cetak-filter:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.12);
}

/* ── Modal ── */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    overflow-y: auto;
    padding: 20px 10px;
}
.modal-content {
    background-color: #fff;
    margin: 30px auto;
    padding: 20px;
    border-radius: 12px;
    width: 95%;
    max-width: 650px;
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    position: relative;
}
.modal-content form {
    overflow-y: auto;
    padding-right: 8px;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

#printArea { display: none; }

/* ── Mobile ── */
@media (max-width: 768px) {
    .no-print-nav { padding: 16px; }
    .main-container {
        width: 97%;
        margin: 8px auto;
        padding: 0.75rem;
        border-radius: 10px;
    }
    .filter-group { flex-direction: column; padding: 0.75rem; }
    .data-table thead { display: none; }
    .data-table td {
        display: block;
        text-align: right;
        padding-left: 50%;
        position: relative;
        border: none !important;
    }
    .data-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        font-weight: bold;
        color: var(--secondary);
    }
    .data-table tr.siswa-row {
        display: block;
        margin-bottom: 16px;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        padding: 8px;
    }
    .modal-content {
        width: 92%;
        margin-top: 10%;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 12px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    }
}

@media print {
    @page {
        size: A4;
        margin: 0;
    }

    /* Reset body — override flex dari layout.css */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        color: #000 !important;
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Sembunyikan semua elemen layout satu per satu — JANGAN pakai body > * */
    .sidebar,
    .offcanvas,
    .navbar-custom,
    .no-print-nav,
    .main-container,
    .modal,
    .filter-group { display: none !important; }

    /* Buka semua wrapper yang membungkus #printArea */
    .main-content,
    .konten-wrapper,
    .page-penilaian {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    /* Tampilkan printArea */
    #printArea {
        display: block !important;
        background: white !important;
        width: 100% !important;
    }

   .raport-page {
    width: 210mm;
    min-height: 297mm;
    padding: 15mm;
    margin: 0 auto;
    box-sizing: border-box;
    page-break-after: always;
    break-after: page;
    background: white;
    color: #000;
    overflow: hidden;
}

.raport-page:last-child {
    page-break-after: avoid;
    break-after: avoid;
}

    /* Tabel */
    .main-table,
    .main-table td,
    .table-info td { border-color: #000 !important; color: #000 !important; }

    .header {
        text-align: center;
        border-bottom: 2px solid #000;
        margin-bottom: 8px;
        padding-bottom: 5px;
    }
    .header h3 { margin: 0; font-size: 14px; }
    .header h2 { margin: 2px 0; font-size: 16px; }

    .table-info { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
    .table-info td { padding: 1px; font-size: 11px; }

    .text-bold { font-weight: bold; text-transform: uppercase; }

    .main-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 10px;
        border: 1.5pt solid #000 !important;
    }
    .main-table td {
        border: 1pt solid #000 !important;
        padding: 4px 8px;
        font-size: 11px;
        vertical-align: top;
    }

    .bg-title {
        background-color: #c5e0b4 !important;
        text-align: center;
        font-weight: bold;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .bg-sub {
        background-color: #e2efda !important;
        font-weight: bold;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .rtl {
        direction: rtl;
        text-align: right;
        font-family: 'Traditional Arabic', serif;
        font-size: 18px;
        line-height: 1.8;
    }

    .footer-table {
        width: 100%;
        margin-top: 15px;
        font-size: 11px;
        text-align: center;
    }

    .no-print { display: none !important; }
}