/* --- style.css --- */
:root {
    /* Color Palette - Elegant Blue & Clean White */
    --primary-color: #2c3e50;    /* Biru Gelap (Sidebar/Header) */
    --accent-color: #3498db;     /* Biru Terang (Tombol/Link) */
    --accent-hover: #2980b9;     /* Hover State */
    --danger-color: #e74c3c;     /* Merah (Hapus/Keluar) */
    --success-color: #27ae60;    /* Hijau (Sukses/Excel) */
    --bg-color: #f4f6f9;         /* Abu-abu sangat muda (Background Utama) */
    --card-bg: #ffffff;          /* Putih (Kartu) */
    --text-dark: #2c3e50;        /* Teks Utama */
    --text-light: #7f8c8d;       /* Teks Secondary */
    --border-radius: 10px;       /* Sudut melengkung yang konsisten */
    --shadow: 0 4px 6px rgba(0,0,0,0.05); /* Bayangan halus */
}

/* Reset Dasar */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Roboto, Helvetica, sans-serif; }

body { background-color: var(--bg-color); color: var(--text-dark); line-height: 1.6; }

/* --- Layout Container --- */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}
/* --- Header / Navbar --- */
.header {
    background: var(--card-bg);
    padding: 20px 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-left: 5px solid var(--accent-color);
}
.header h3 { font-size: 1.5rem; color: var(--primary-color); margin: 0; }
.header-actions { display: flex; gap: 10px; }

/* --- Dashboard Grid Menu --- */
.grid-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}
.menu-item {
    background: var(--card-bg);
    padding: 40px 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    text-decoration: none;
    color: var(--text-dark);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}
.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: var(--accent-color);
}
.menu-item h3 { margin-top: 15px; font-size: 1.25rem; }
.menu-item p { color: var(--text-light); font-size: 0.9rem; }
.menu-icon { font-size: 3rem; margin-bottom: 10px; }

/* --- Card & Forms --- */
.card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    border: 1px solid #f0f0f0;
}
input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    margin: 8px 0 20px;
    display: block;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    font-size: 14px;
    transition: 0.3s;
}
input:focus, select:focus {
    border-color: var(--accent-color);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* --- Buttons --- */
.btn-small, .btn-back, button {
    cursor: pointer;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    transition: 0.2s;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.btn-small { background: var(--accent-color); color: white; }
.btn-small:hover { background: var(--accent-hover); }

.btn-back { background: var(--primary-color); color: white; }
.btn-back:hover { background: #34495e; transform: translateY(-2px); }

.btn-danger { background: var(--danger-color); }
.btn-danger:hover { background: #c0392b; }

.btn-success { background: var(--success-color); }
.btn-success:hover { background: #219150; }

.btn-add {
    background: var(--success-color);
    color: white;
    padding: 12px 25px;
    border-radius: 50px; /* Tombol bulat lonjong */
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.3);
}

/* --- Responsive Table (Magic Part) --- */
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th { background: #f8f9fa; color: var(--text-dark); font-weight: 700; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.5px; padding: 15px; border-bottom: 2px solid #eee; text-align: left; }
td { padding: 15px; border-bottom: 1px solid #eee; color: #555; vertical-align: middle; }
tr:hover { background-color: #fbfbfb; }

/* Responsive untuk Mobile (Layar Kecil) */
@media screen and (max-width: 768px) {
    /* Layout Container */
    .container { width: 100%; padding: 10px; margin: 10px auto; }
    
    /* Header */
    .header { flex-direction: column; text-align: center; gap: 15px; padding: 20px; }
    
/* --- MODERN TABLE STYLES --- */

/* Container agar tabel ada scroll jika layar nanggung */
.table-responsive {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap; /* Mencegah teks turun baris sembarangan di desktop */
}

/* Header Tabel */
thead th {
    background-color: var(--primary-color); /* Warna Tosca */
    color: white;
    padding: 18px 15px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    font-weight: 700;
    border: none;
    /* Sticky Header: Judul tetap terlihat saat scroll ke bawah */
    position: sticky;
    top: 0;
    z-index: 10; 
}

/* Isi Tabel */
tbody td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
    font-size: 0.95rem;
    vertical-align: middle;
}

/* Zebra Striping (Baris ganjil genap beda warna dikit) */
tbody tr:nth-child(even) { background-color: #fbfbfb; }
tbody tr:hover { background-color: #e0f2f1; transition: 0.2s; } /* Hover Efek */

/* --- HELPER CLASSES (PERATAAN) --- */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* Font khusus Angka/Uang (Monospace agar sejajar) */
.font-money {
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: 600;
    font-size: 1rem;
}

/* Badge Status (Kapsul Warna) */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: capitalize;
    display: inline-block;
}
.badge-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; } /* Hijau */
.badge-warning { background: #fff3e0; color: #ef6c00; border: 1px solid #ffe0b2; } /* Oranye */

/* --- FOOTER (TOTAL) --- */
tfoot tr { background-color: #fafafa; border-top: 2px solid #ddd; }
tfoot td { padding: 15px; font-weight: bold; }

/* --- MODERN TABLE STYLES --- */

/* Container agar tabel ada scroll jika layar nanggung */
.table-responsive {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap; /* Mencegah teks turun baris sembarangan di desktop */
}

/* Header Tabel */
thead th {
    background-color: var(--primary-color); /* Warna Tosca */
    color: white;
    padding: 18px 15px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    font-weight: 700;
    border: none;
    /* Sticky Header: Judul tetap terlihat saat scroll ke bawah */
    position: sticky;
    top: 0;
    z-index: 10; 
}

/* Isi Tabel */
tbody td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
    font-size: 0.95rem;
    vertical-align: middle;
}

/* Zebra Striping (Baris ganjil genap beda warna dikit) */
tbody tr:nth-child(even) { background-color: #fbfbfb; }
tbody tr:hover { background-color: #e0f2f1; transition: 0.2s; } /* Hover Efek */

/* --- HELPER CLASSES (PERATAAN) --- */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* Font khusus Angka/Uang (Monospace agar sejajar) */
.font-money {
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: 600;
    font-size: 1rem;
}

/* Badge Status (Kapsul Warna) */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: capitalize;
    display: inline-block;
}
.badge-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; } /* Hijau */
.badge-warning { background: #fff3e0; color: #ef6c00; border: 1px solid #ffe0b2; } /* Oranye */

/* --- FOOTER (TOTAL) --- */
tfoot tr { background-color: #fafafa; border-top: 2px solid #ddd; }
tfoot td { padding: 15px; font-weight: bold; }


/* --- MODERN TABLE STYLES --- */

/* Container agar tabel ada scroll jika layar nanggung */
.table-responsive {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap; /* Mencegah teks turun baris sembarangan di desktop */
}

/* Header Tabel */
thead th {
    background-color: var(--primary-color); /* Warna Tosca */
    color: white;
    padding: 18px 15px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    font-weight: 700;
    border: none;
    /* Sticky Header: Judul tetap terlihat saat scroll ke bawah */
    position: sticky;
    top: 0;
    z-index: 10; 
}

/* Isi Tabel */
tbody td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
    font-size: 0.95rem;
    vertical-align: middle;
}

/* Zebra Striping (Baris ganjil genap beda warna dikit) */
tbody tr:nth-child(even) { background-color: #fbfbfb; }
tbody tr:hover { background-color: #e0f2f1; transition: 0.2s; } /* Hover Efek */

/* --- HELPER CLASSES (PERATAAN) --- */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* Font khusus Angka/Uang (Monospace agar sejajar) */
.font-money {
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: 600;
    font-size: 1rem;
}

/* Badge Status (Kapsul Warna) */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: capitalize;
    display: inline-block;
}
.badge-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; } /* Hijau */
.badge-warning { background: #fff3e0; color: #ef6c00; border: 1px solid #ffe0b2; } /* Oranye */

/* --- FOOTER (TOTAL) --- */
tfoot tr { background-color: #fafafa; border-top: 2px solid #ddd; }
tfoot td { padding: 15px; font-weight: bold; }


/* --- MOBILE RESPONSIVE VIEW (CARD STYLE) --- */
@media screen and (max-width: 768px) {
    /* Reset struktur tabel jadi blok */
    table, thead, tbody, th, td, tr { display: block; }
    
    /* Sembunyikan Header Desktop */
    thead tr { position: absolute; top: -9999px; left: -9999px; }
    
    /* Styling Kartu */
    tbody tr {
        background: white;
        margin-bottom: 20px;
        border: 1px solid #e0e0e0;
        border-radius: 10px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.03);
        padding: 15px;
        border-left: 5px solid var(--primary-color); /* Aksen warna kiri */
    }

    /* Isi Data dalam Kartu */
    td {
        border: none;
        border-bottom: 1px dashed #eee;
        position: relative;
        padding: 12px 0;
        display: flex; /* Flexbox untuk kiri kanan */
        justify-content: space-between;
        align-items: center;
        text-align: right;
    }
    
    td:last-child { border-bottom: none; }

    /* Label Judul (Diambil dari data-label) */
    td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--primary-color);
        font-size: 0.8rem;
        text-transform: uppercase;
        text-align: left;
        margin-right: 20px;
    }

    /* Penyesuaian Footer di Mobile */
    tfoot { margin-top: 20px; display: block; }
    tfoot tr { display: block; margin-bottom: 10px; border: 1px solid #ddd; border-radius: 10px; padding: 10px; }
    tfoot td { display: flex; justify-content: space-between; border: none; border-bottom: 1px solid #eee; padding: 10px 0; }
}
}