/* =====================================================================
   assets/style.css
   Stylesheet umum aplikasi + style cetak (@media print)
   ===================================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f4f6f9;
    color: #222;
}

/* ---------------- LOGIN ---------------- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}
.login-box {
    background: #fff;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 360px;
}
.login-box h2 { font-size: 18px; margin-bottom: 4px; text-align: center; }
.login-box .subtitle { text-align: center; color: #777; margin-bottom: 20px; font-size: 13px; }
.login-box label { display: block; margin-top: 12px; margin-bottom: 4px; font-size: 13px; font-weight: 600; }
.login-box input {
    width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px;
}
.login-box button {
    margin-top: 18px; width: 100%; padding: 10px; background: #2563eb; color: #fff;
    border: none; border-radius: 4px; font-size: 14px; cursor: pointer;
}
.login-box button:hover { background: #1d4ed8; }

.alert { padding: 8px 12px; border-radius: 4px; font-size: 13px; margin-bottom: 8px; }
.alert-error { background: #fde2e1; color: #b91c1c; }
.alert-success { background: #dcfce7; color: #15803d; }

/* ---------------- LAYOUT / NAVBAR ---------------- */
.navbar {
    background: #1e293b; color: #fff; padding: 12px 24px;
    display: flex; justify-content: space-between; align-items: center;
}
.navbar a { color: #fff; text-decoration: none; margin-right: 16px; font-size: 14px; }
.navbar a:hover { text-decoration: underline; }
.navbar .brand { font-weight: 700; font-size: 16px; }

.container { padding: 24px; max-width: 1100px; margin: 0 auto; }

.card {
    background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th, table.data-table td {
    border: 1px solid #ddd; padding: 8px 10px; text-align: left;
}
table.data-table th { background: #f1f5f9; }
table.data-table tr:hover { background: #f9fafb; }

.btn {
    display: inline-block; padding: 6px 12px; border-radius: 4px; font-size: 13px;
    text-decoration: none; border: none; cursor: pointer;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-success { background: #16a34a; color: #fff; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-secondary { background: #64748b; color: #fff; }
.btn:hover { opacity: 0.9; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.form-group input, .form-group select {
    width: 100%; padding: 7px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 13px;
}

.badge { padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-red { background: #fde2e1; color: #b91c1c; }

/* ---------------- HALAMAN CETAK TRANSKRIP ---------------- */
.transkrip-page {
    position: relative;  /* wajib agar ::before tertampung di dalam halaman */
    width: 210mm; /* A4 */
    min-height: 297mm;
    margin: 20px auto;
    background: #fff;
    padding: 15mm;
    box-shadow: 0 0 6px rgba(0,0,0,0.15);
    overflow: hidden;
}

/* Watermark tutwuri di tengah halaman, di belakang semua konten */
.transkrip-page::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    height: 320px;
    background-image: url('assets/tutwuri.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    opacity: 0.10;   /* transparan — sesuaikan 0.08–0.15 sesuai selera */
    pointer-events: none;
    z-index: 0;
}

.kop-surat {
    position: relative; z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: center;
    border-bottom: 3px solid #000;
    padding-bottom: 8px;
    margin-bottom: 16px;
}
.kop-surat .logo-box {
    width: 80px;
    flex-shrink: 0;
}
.kop-surat .logo-box img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}
.kop-surat .teks-kop {
    flex: 1;
}
.kop-surat h3 { font-size: 14px; letter-spacing: 0.5px; font-weight: 400; }
.kop-surat h2 { font-size: 20px; font-weight: 700; text-transform: uppercase; margin: 2px 0; }
.kop-surat p { font-size: 11px; }

.judul-transkrip { position: relative; z-index: 1; text-align: center; margin-bottom: 14px; }
.judul-transkrip h3 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 4px;
    color: #000000 !important; /* Tambahkan !important */
    text-decoration: none;
}
.judul-transkrip p { 
    font-size: 12px; 
    margin-top: 4px; 
    color: #000000 !important; /* Tambahkan !important */ }

.identitas-siswa { position: relative; z-index: 1; font-size: 13px; margin-bottom: 16px; }
.identitas-siswa table { border-collapse: collapse; }
.identitas-siswa td { padding: 3px 4px; vertical-align: top; font-weight: 400; }
.identitas-siswa td.label { width: 230px; }
.identitas-siswa td.colon { width: 15px; }
.identitas-siswa td b { font-weight: 700; }

table.tabel-nilai {
    position: relative; z-index: 1;
    width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 24px;
}
table.tabel-nilai th, table.tabel-nilai td {
    border: 1px solid #000; padding: 7px 10px;
}
table.tabel-nilai th { text-align: center; background: transparent; font-weight: 700; }
table.tabel-nilai td.no { text-align: center; width: 40px; }
table.tabel-nilai td.nilai { text-align: center; width: 100px; font-weight: 700; }

/* =====================================================================
   PERBAIKAN FOOTER TANDA TANGAN (GANTI BARIS 131-137 DENGAN INI)
   ===================================================================== */
.footer-transkrip {
    position: relative; z-index: 1;
    display: block !important;
    width: 100% !important;
    clear: both !important;
    margin-top: 40px;
    font-size: 13px;
}

.footer-transkrip .ttd-box { 
    text-align: left !important; 
    width: 260px !important; 
    margin-left: auto !important; /* Mendorong paksa kotak ke kanan halaman */
    margin-right: 0 !important;
}

.footer-transkrip .ttd-box .nama-kepsek { 
    font-weight: normal; 
    text-decoration: none; 
    margin-top: 60px; 
    display: block; /* Memastikan margin-top bekerja dengan baik */
}

.print-actions { text-align: center; margin: 16px 0; }

/* ---------------- MODAL ---------------- */
.modal-overlay {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    align-items: center; justify-content: center;
    z-index: 1000;
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: #fff; border-radius: 8px; padding: 20px;
    width: 420px; max-width: 90%;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.modal-box h3 { margin-bottom: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ---------------- MEDIA PRINT ---------------- */
@media print {
    body { background: #fff; }
    .navbar, .print-actions, .no-print { display: none !important; }
    .transkrip-page {
        margin: 0; box-shadow: none; width: 100%; min-height: auto;
        page-break-after: always;
    }
    .transkrip-page:last-child { page-break-after: auto; }

    /* Watermark tetap muncul saat cetak */
    .transkrip-page::before {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    @page {
        size: A4;
        margin: 15mm;
    }
}