/* Import Google Fonts - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #eef2f3 0%, #8e9eab 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

/* Card Container Utama (Desktop First) */
.table-container, .form-container {
    background: #ffffff;
    width: 100%;
    max-width: 950px;
    padding: 35px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.form-container {
    max-width: 500px;
}

/* Judul Halaman */
h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

h3::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #007bff;
    margin: 8px auto 0;
    border-radius: 2px;
}

/* Alert Peringatan */
.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    margin-bottom: 20px;
}

/* Menu Navigasi Tab Header */
.nav-menu {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.btn-nav {
    padding: 8px 16px;
    background-color: #f1f5f9;
    color: #475569;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-nav:hover {
    background-color: #e2e8f0;
    color: #1e293b;
}

.btn-nav.active {
    background-color: #007bff;
    color: #ffffff;
}

/* Header Tombol Tambah */
.action-header {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-tambah {
    display: inline-block;
    padding: 10px 18px;
    background-color: #10b981;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.88rem;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn-tambah:hover {
    background-color: #059669;
}

.btn-tambah:active {
    transform: scale(0.98);
}

/* Responsive Table Wrapper */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    -webkit-overflow-scrolling: touch; /* Smooth scroll di iOS */
}

/* Styling Tabel Modern */
.styled-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.styled-table thead tr {
    background-color: #007bff;
    color: #ffffff;
    text-align: left;
}

.styled-table th, 
.styled-table td {
    padding: 14px 16px;
    white-space: nowrap;
}

.styled-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
}

.styled-table tbody tr:nth-of-type(even) {
    background-color: #f8fafc;
}

.styled-table tbody tr:hover {
    background-color: #f1f5f9;
}

.empty-cell {
    text-align: center;
    color: #64748b;
    padding: 25px !important;
}

/* Link Aksi Hapus */
.link-hapus {
    color: #ef4444;
    text-decoration: none;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    background-color: #fee2e2;
    transition: all 0.2s ease;
}

.link-hapus:hover {
    background-color: #ef4444;
    color: #ffffff;
}

/* Form Styles */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #2d3748;
    background-color: #f8fafc;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #007bff;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* Tombol Submit */
.btn-submit {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: 10px;
}

.btn-submit:hover {
    background: #0056b3;
}

/* Link Bawah */
.btn-kembali {
    display: block;
    text-align: center;
    margin-top: 18px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

/* =================================================== */
/* MEDIA QUERIES (KHUSUS TAMPILAN MOBILE / LAYAR HP)  */
/* =================================================== */
@media screen and (max-width: 600px) {
    body {
        padding: 10px 5px;
    }

    .table-container, .form-container {
        padding: 16px 10px;
        border-radius: 12px;
    }

    h3 {
        font-size: 1.1rem;
    }

    /* Navigasi Sejajar di Mobile */
    .nav-menu {
        display: flex;
        flex-direction: row !important;
        justify-content: space-between;
        gap: 6px;
    }

    .btn-nav {
        flex: 1;
        text-align: center;
        padding: 8px 4px;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .btn-tambah {
        width: 100%;
        text-align: center;
        padding: 10px;
        font-size: 0.85rem;
    }

    /* Pembungkus Tabel Agar Bisa di-Scroll Kesamping di HP */
    .table-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Ukuran Teks Tabel Lebih Ringkas di HP */
    .styled-table th, 
    .styled-table td {
        padding: 8px 10px;
        font-size: 0.78rem;
    }

    /* Styling Khusus Tombol Aksi di HP */
    .action-group {
        display: flex;
        gap: 4px;
    }

    .btn-edit-mobile {
        background-color: #f59e0b;
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        text-decoration: none;
        font-size: 0.72rem;
        font-weight: 500;
    }

    .link-hapus {
        padding: 4px 8px;
        font-size: 0.72rem;
    }
}