@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
    /* Palet Warna dari Logo Baru */
    --primary: #FF9F43;    /* Oranye O'Zan */
    --secondary: #00CEC9;  /* Cyan Catering */
    --accent: #FF6B6B;     /* Merah Aksen */
    --bg-app: #F0F3F8;     /* Abu sangat muda bersih */
    --text-dark: #2D3436;
    --text-grey: #636E72;
    --white: #ffffff;
    
    /* Efek Modern */
    --shadow-card: 0 10px 20px rgba(0,0,0,0.05);
    --shadow-float: 0 15px 30px rgba(255, 159, 67, 0.3);
    --radius: 20px;
}

body {
    font-family: 'Nunito', sans-serif; /* Font bulat & ramah */
    background-color: var(--bg-app);
    color: var(--text-dark);
    margin: 0;
    padding-bottom: 100px; /* Ruang untuk menu bawah */
    -webkit-tap-highlight-color: transparent;
}

/* --- HEADER --- */
.top-bar {
    background: var(--white);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 15px rgba(0,0,0,0.03);
    border-bottom-left-radius: 25px;
    border-bottom-right-radius: 25px;
}

.app-header-logo { height: 50px; width: auto; }

.user-info {
    font-size: 14px;
    color: var(--text-grey);
    font-weight: 700;
    display: flex; align-items: center; gap: 5px;
    cursor: pointer;
}

/* --- FILTER PERIODE (Bulan/Tahun) --- */
.period-selector {
    background: var(--white);
    margin: 20px;
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    display: flex;
    gap: 10px;
    align-items: center;
}

.period-select {
    border: 1px solid #eee;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 12px;
    flex: 1;
    font-family: 'Nunito';
    font-weight: bold;
    color: var(--text-dark);
    outline: none;
}

/* --- KARTU STATISTIK --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 0 20px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}

.stat-card:active { transform: scale(0.98); }

.stat-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    margin-bottom: 10px;
}

.stat-card.orange .stat-icon { background: #FFF0E1; color: var(--primary); }
.stat-card.cyan .stat-icon { background: #E0FBFB; color: var(--secondary); }
.stat-card.blue .stat-icon { background: #E1F0FF; color: #0984E3; }

.stat-number { font-size: 24px; font-weight: 800; color: var(--text-dark); line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-grey); font-weight: 600; }

/* Kartu Saldo (Gradient) */
.stat-card.balance {
    grid-column: span 2;
    background: linear-gradient(135deg, var(--secondary), #0984E3);
    color: var(--white);
}
.stat-card.balance .stat-number { color: var(--white); }
.stat-card.balance .stat-label { color: rgba(255,255,255,0.8); }
.stat-card.balance .stat-icon { background: rgba(255,255,255,0.2); color: white; }

/* --- MATRIX TABLE (Absensi) --- */
.matrix-wrapper {
    margin: 0 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    padding-bottom: 10px;
}
.matrix-scroll { overflow-x: auto; padding-bottom: 5px; }
.matrix-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.matrix-table th { padding: 10px; font-size: 12px; color: var(--text-grey); background: #FAFAFA; }
.col-name { position: sticky; left: 0; background: var(--white); z-index: 2; padding: 10px; font-weight: 700; border-right: 2px solid #f5f5f5; min-width: 100px;}
.status-box { 
    width: 35px; height: 35px; border-radius: 10px; 
    display: flex; align-items: center; justify-content: center; 
    margin: 0 auto; font-weight: bold; font-size: 10px; cursor: pointer;
}
.status-box.empty { background: #F0F3F8; color: #ccc; border: 1px solid #eee; }
.status-box.catering { background: var(--secondary); color: white; box-shadow: 0 3px 8px rgba(0, 206, 201, 0.4); }

/* --- NAVIGASI BAWAH (Glassmorphism) --- */
.bottom-nav {
    position: fixed; bottom: 20px; left: 20px; right: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px); /* Efek kaca */
    border-radius: 25px;
    height: 70px;
    display: flex; justify-content: space-around; align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 999;
}

.nav-item { text-align: center; color: #B2BEC3; text-decoration: none; font-size: 10px; transition: 0.3s; }
.nav-item i { font-size: 22px; margin-bottom: 4px; display: block; transition: 0.3s; }
.nav-item.active { color: var(--primary); }
.nav-item.active i { transform: translateY(-5px); color: var(--primary); filter: drop-shadow(0 5px 10px rgba(255, 159, 67, 0.4)); }

/* --- FORM & BUTTONS --- */
.fab {
    background: linear-gradient(135deg, var(--primary), #FF7675);
    box-shadow: var(--shadow-float);
    color: white; border: none; border-radius: 50px;
    padding: 15px 25px; font-weight: 800; display: flex; align-items: center; gap: 10px;
    position: fixed; bottom: 100px; right: 20px; cursor: pointer; z-index: 99;
}

.btn {
    background: var(--secondary); color: white; padding: 12px; border-radius: 12px;
    border: none; font-weight: 800; width: 100%; cursor: pointer;
}

.login-input {
    background: #F8F9FA; border: 1px solid #eee;
    padding: 15px; border-radius: 15px; width: 100%; box-sizing: border-box;
    margin-bottom: 10px; font-family: 'Nunito'; font-weight: 600;
}
.modal-content { border-radius: 25px; padding: 25px; border: none; }
.modal h3 { color: var(--text-dark); margin-top: 0; }
/* --- HALAMAN LOGIN MODERN --- */
#login-page {
    display: flex;
    justify-content: center; /* Rata Tengah Horizontal */
    align-items: center;     /* Rata Tengah Vertikal */
    min-height: 100vh;       /* Tinggi selayar penuh */
    background-color: var(--bg-app);
    padding: 20px;
    box-sizing: border-box;
}

.login-card {
    background: var(--white);
    width: 100%;
    max-width: 400px; /* Agar tidak terlalu lebar di Laptop */
    padding: 40px 30px;
    border-radius: 30px; /* Sudut membulat modern */
    box-shadow: var(--shadow-float); /* Efek melayang */
    text-align: center; /* Teks rata tengah */
}

.login-logo {
    width: 140px; /* Kunci ukuran logo */
    height: auto;
    margin-bottom: 10px;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.05));
}

.login-card h2 {
    color: var(--primary); /* Warna Oranye */
    margin-bottom: 5px;
    font-size: 24px;
}

.login-card p {
    color: var(--text-grey);
    font-size: 14px;
    margin-bottom: 30px;
}

.login-card .btn {
    background: linear-gradient(to right, var(--secondary), #00b894); /* Gradasi Cyan */
    margin-top: 10px;
    box-shadow: 0 5px 15px rgba(0, 206, 201, 0.4);
}
/* --- MODE GELAP (DARK MODE) --- */
[data-theme="dark"] {
    --bg-app: #1e272e;
    --white: #2d3436;
    --text-dark: #dfe6e9;
    --text-grey: #b2bec3;
    --shadow-card: 0 10px 20px rgba(0,0,0,0.2);
}

/* Perbaikan warna elemen di Dark Mode */
[data-theme="dark"] .login-input { background: #353b48; border-color: #444; color: white; }
[data-theme="dark"] .matrix-table th { background: #353b48; color: #dfe6e9; }
[data-theme="dark"] .col-name { background: #2d3436; border-right: 1px solid #444; }
[data-theme="dark"] .status-box.empty { background: #353b48; border-color: #444; }

/* --- PENGATURAN CETAK (PRINT) PROFESIONAL --- */

/* Sembunyikan Kop Surat di tampilan layar biasa */
.print-header, .print-divider {
    display: none;
}

/* === SETTINGAN KHUSUS CETAK (PRINT) === */
.print-header, .print-divider { display: none; } /* Sembunyi di HP */

@media print {
    @page { size: landscape; margin: 5mm; } /* Paksa Landscape, Margin Tipis */
    
    /* 1. Reset Warna */
    body { background: white !important; color: black !important; padding: 0 !important; margin: 0 !important; font-family: 'Times New Roman', serif; }
    
    /* 2. Sembunyikan Elemen Pengganggu (Input, Tombol, Navigasi) */
    .bottom-nav, .fab, .top-bar, .period-selector, .btn, .action-btn-group, 
    .user-info, button, .login-logo, input, select, .no-print, 
    span[onclick^="hapus"] { /* Sembunyikan tombol hapus */
        display: none !important;
    }
    
    /* 3. Tampilkan Kop Surat */
    .print-header { display: flex !important; align-items: center; justify-content: center; gap: 20px; margin-bottom: 20px; text-align: left; border-bottom: 2px solid black; padding-bottom: 10px; }
    .print-logo { width: 80px; height: auto; }
    .print-info h1 { font-size: 24px; margin: 0; text-transform: uppercase; }

    /* 4. Judul Laporan */
    h2 { text-align: center; text-decoration: underline; font-size: 16pt; margin: 10px 0; color: black !important; }

    /* 5. Perbaikan Tabel & Kartu */
    .matrix-wrapper, .card, .stat-card, .matrix-container, .dashboard-grid { 
        box-shadow: none !important; border: none !important; border-radius: 0 !important;
        width: 100% !important; margin: 0 !important; padding: 0 !important;
        display: block !important; /* Reset grid jadi block biasa */
    }
    
    /* Kartu Statistik jadi baris biasa */
    .stat-card { border: 1px solid #ddd !important; margin-bottom: 10px !important; page-break-inside: avoid; }
    .stat-number { color: black !important; font-size: 14pt; }
    .stat-icon { display: none; } /* Sembunyikan ikon di print */
    
    /* TABEL ABSENSI (MATRIX) */
    .matrix-scroll { overflow: visible !important; display: block !important; }
    .matrix-table { width: 100% !important; table-layout: fixed; }
    
    /* Font Tabel Dikecilkan Agar Muat 30 Hari */
    .matrix-table th, .matrix-table td {
        font-size: 8pt !important; /* Font kecil */
        padding: 2px !important;
        border: 1px solid #000 !important;
        text-align: center !important;
        height: 20px !important;
    }
    .col-name { width: 100px !important; text-align: left !important; padding-left: 5px !important; }
    
    /* Kotak Status Hemat Tinta */
    .status-box { width: 100% !important; height: 100% !important; border-radius: 0 !important; box-shadow: none !important; }
    .status-box.catering { background: #ddd !important; color: black !important; border: none !important; content: "V"; }
    .status-box.empty { display: none; } /* Jangan cetak kotak kosong */
    
    /* LIST BELANJA */
    .expense-item { border-bottom: 1px solid #000 !important; padding: 5px 0 !important; }
    .expense-amount { color: black !important; }
}