/* Import Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Desain Dasar */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif; /* Font lebih modern */
    margin: 0;
    background-color: #f4f7f6;
    color: #333;
    overflow-x: hidden;
}

/* ================= ANIMASI (KEYFRAMES) ================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ================= HALAMAN LOGIN ================= */
#loginPage {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: linear-gradient(135deg, #1b5e20 0%, #4caf50 100%);
    display: flex; justify-content: center; align-items: center; z-index: 9999;
}

.login-card {
    background: white; padding: 40px; border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2); width: 350px; text-align: center;
}

.login-card h2 { margin: 0; color: #1b5e20; font-size: 1.8rem; font-weight: 700; }
.login-card p { color: #666; margin: 10px 0 30px; font-size: 0.95rem; }

.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #444; font-size: 0.9rem; }
.form-group input { 
    width: 100%; padding: 12px; border: 2px solid #e0e0e0; 
    border-radius: 8px; box-sizing: border-box; font-size: 1rem; 
    transition: all 0.3s ease; 
}
.form-group input:focus { border-color: #4caf50; outline: none; box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1); }

#loginError { color: #d32f2f; font-size: 0.85rem; margin-top: 15px; min-height: 20px; font-weight: 600; }

/* ================= WRAPPER APLIKASI ================= */
#appPage { display: none; width: 100%; min-height: 100vh; }

/* Sidebar & Menu Hover Animasi */
.sidebar {
    width: 280px; background: #2e7d32; color: white; height: 100vh;
    position: fixed; display: flex; flex-direction: column; 
    box-shadow: 4px 0 15px rgba(0,0,0,0.1); z-index: 10;
}
.sidebar-header { padding: 25px 20px; background: #1b5e20; text-align: center; }
.sidebar-header h2 { margin: 0; font-size: 1.3rem; font-weight: 700; letter-spacing: 0.5px;}
.sidebar-header p { margin: 8px 0 0; font-size: 0.9rem; color: #c8e6c9; }
.sidebar ul { list-style: none; padding: 0; margin: 0; overflow-y: auto; flex-grow: 1; }

.sidebar li {
    padding: 15px 20px; cursor: pointer; border-left: 0px solid #fff;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
    font-size: 0.95rem; font-weight: 500; border-bottom: 1px solid #388e3c;
}
.sidebar li:hover { 
    background: #43a047; 
    padding-left: 28px; /* Efek bergeser ke kanan saat di-hover */
}
.sidebar li.active {
    background: #4caf50; padding-left: 28px; 
    border-left: 6px solid #fff; font-weight: 600;
}
.sidebar-footer { padding: 20px; background: #1b5e20; }

/* ================= TOMBOL (BUTTON ANIMATIONS) ================= */
.btn {
    color: white; border: none; padding: 10px 16px; font-size: 0.9rem; 
    font-weight: 600; border-radius: 8px; cursor: pointer; display: flex; 
    align-items: center; gap: 8px; justify-content: center;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Efek membal */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 6px 12px rgba(0,0,0,0.15); }
.btn:active { transform: translateY(1px); box-shadow: 0 2px 4px rgba(0,0,0,0.1); } /* Efek tertekan */

.btn-login { background-color: #4caf50; width: 100%; padding: 14px; font-size: 1.05rem; margin-top: 10px; }
.btn-login:hover { background-color: #43a047; }
.btn-logout { background: #d32f2f; width: 100%; }
.btn-logout:hover { background: #b71c1c; }
.btn-print { background-color: #1b5e20; }
.btn-reset { background-color: #e53935; }

/* ================= KONTEN UTAMA ================= */
.main-content { margin-left: 280px; padding: 30px; width: calc(100% - 280px); box-sizing: border-box; }
.header {
    background: white; padding: 25px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    margin-bottom: 25px; display: flex; justify-content: space-between; align-items: center;
    border-left: 6px solid #2e7d32;
}
.header-text h1 { color: #1b5e20; margin: 0; font-size: 1.8rem; }
.header-text p { color: #666; margin: 8px 0 0; font-size: 1rem; }
.header-info { display: inline-block; background: #e8f5e9; color: #2e7d32; padding: 6px 12px; border-radius: 6px; font-size: 0.85rem; margin-top: 12px; font-weight: 600; }
.action-buttons { display: flex; gap: 12px; }

/* ================= TABEL & INTERAKSI ================= */
.table-container {
    background: white; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    overflow-x: auto; overflow-y: auto; max-height: 70vh; border: 1px solid #eee;
}
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { border: 1px solid #eee; padding: 12px; text-align: left; font-size: 0.9rem; }
th { background-color: #f1f8e9; color: #1b5e20; position: sticky; top: 0; z-index: 2; font-weight: 600; }
thead tr:nth-child(2) th { top: 46px; z-index: 2; }
th:nth-child(1), th:nth-child(2) { z-index: 3; left: 0; }
td:nth-child(1), td:nth-child(2) { position: sticky; left: 0; background-color: #fff; z-index: 1; box-shadow: 2px 0 5px rgba(0,0,0,0.03); }
td:nth-child(2) { white-space: normal; min-width: 350px; line-height: 1.5; }
th.month-header { text-align: center; background-color: #c8e6c9; border-bottom: 2px solid #fff; }
tr:nth-child(even) td:nth-child(1), tr:nth-child(even) td:nth-child(2) { background-color: #fafafa; }
tr:nth-child(even) { background-color: #fafafa; }

/* Interaksi Sel (Hover & PopIn) */
.editable-cell { cursor: pointer; text-align: center; user-select: none; transition: background 0.2s; }
.editable-cell:hover { background-color: #dcedc8 !important; }
.empty-cell { color: #ccc; }

.badge-v { 
    background: #4caf50; color: white; width: 24px; height: 24px; 
    border-radius: 50%; font-size: 0.8rem; font-weight: bold; 
    display: flex; align-items: center; justify-content: center; 
    margin: 0 auto; box-shadow: 0 2px 5px rgba(76,175,80,0.4);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; /* Efek Muncul Animasi */
}

/* ================= CETAK / PRINT ================= */
@media print {
    @page { size: A3 landscape; margin: 15mm; }
    body { background-color: #fff; color: #000; }
    .sidebar, .action-buttons, .header-info, #loginPage { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; width: 100% !important; }
    .header { box-shadow: none !important; border: none !important; padding: 0 0 20px 0 !important; margin-bottom: 20px !important; border-bottom: 3px double #333 !important; text-align: center; }
    .table-container { box-shadow: none !important; border: none !important; max-height: none !important; }
    table { width: 100% !important; }
    th, td { font-size: 8pt !important; padding: 5px !important; border: 1px solid #000 !important; }
    td:nth-child(1), td:nth-child(2) { position: static !important; box-shadow: none !important;}
    th.month-header { background-color: #e8f5e9 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .badge-v { background-color: #4caf50 !important; border-radius: 0; animation: none; -webkit-print-color-adjust: exact; print-color-adjust: exact;}
}