/* assets/css/style.css - Versi Mobile Fix */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f1f5f9;
    --text-main: #334155;
    --text-muted: #64748b;
    --sidebar-width: 260px;
    --bottom-nav-height: 65px;
}

/* --- GLOBAL RESET --- */
* { 
    margin: 0; padding: 0; box-sizing: border-box; 
    font-family: 'Inter', sans-serif; 
}

body { 
    background-color: var(--bg-color); 
    color: var(--text-main); 
    font-size: 14px; /* Kecilkan sikit font asas untuk mobile */
    line-height: 1.5;
    overflow-x: hidden; /* Elak body scroll ke tepi */
}

/* Font Tajuk */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: #1e293b;
}

a { text-decoration: none; color: inherit; }

/* --- LAYOUT STRUCTURE (Mobile First) --- */
.wrapper { 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
    width: 100%;
}

.main-content { 
    width: 100%;
    padding: 15px; /* Padding kecil untuk mobile */
    padding-bottom: 80px; /* Ruang untuk bottom nav */
    transition: margin-left 0.3s ease;
}

/* --- SIDEBAR (Desktop Only) --- */
.sidebar {
    display: none; /* Default: Hidden di Mobile */
    width: var(--sidebar-width);
    background: white;
    height: 100vh;
    position: fixed;
    border-right: 1px solid #e2e8f0;
    top: 0; left: 0;
    z-index: 50;
    overflow-y: auto;
}

.sidebar-header { padding: 20px; text-align: center; border-bottom: 1px solid #f1f5f9; }
.sidebar-nav a {
    display: block; padding: 12px 20px;
    color: var(--text-main); font-weight: 500;
}
.sidebar-nav a:hover { background: #eff6ff; color: var(--primary-color); }

/* --- RESPONSIVE BREAKPOINT (Tablet & Desktop) --- */
@media (min-width: 768px) {
    .sidebar { display: block !important; } /* Paksa tunjuk di desktop */
    .bottom-nav { display: none !important; } /* Sorok menu bawah */
    .main-content { 
        margin-left: var(--sidebar-width); 
        padding: 30px; 
        max-width: calc(100% - var(--sidebar-width));
    }
    body { font-size: 15px; } /* Kembalikan saiz font normal */
}

/* --- BOTTOM NAV (Mobile Only) --- */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: white; border-top: 1px solid #e2e8f0;
    display: flex; justify-content: space-around;
    height: var(--bottom-nav-height);
    z-index: 999;
}
.nav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    font-size: 10px; color: var(--text-muted);
}
.nav-icon { font-size: 18px; margin-bottom: 2px; }

/* --- TABLE RESPONSIVE FIX (PENTING) --- */
.table-container {
    background: white; 
    border-radius: 10px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    margin-top: 20px;
    
    /* Kunci utama mobile responsive table: */
    width: 100%;
    overflow-x: auto; /* Membolehkan scroll ke tepi */
    -webkit-overflow-scrolling: touch; /* Smooth scroll di iPhone */
    display: block;
}

.data-table { 
    width: 100%; 
    border-collapse: collapse; 
    white-space: nowrap; /* Paksa teks sebaris supaya tak pecah ke bawah */
}

.data-table th, .data-table td { 
    padding: 12px 15px; 
    text-align: left; 
    border-bottom: 1px solid #f1f5f9;
}

.data-table th { background: #f8fafc; font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); }

/* --- FORMS & BUTTONS --- */
.btn-sm { 
    padding: 5px 10px; 
    font-size: 12px; 
    border-radius: 4px; border: none; cursor: pointer; color: white;
}
.btn-primary { background: var(--primary-color); color: white; border: none; padding: 10px 20px; border-radius: 6px; }
.form-select-sm { padding: 5px; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 13px; max-width: 100px; }

/* Kad User (Dashboard) */
.user-list { display: flex; flex-direction: column; gap: 10px; }
.user-card { 
    background: white; padding: 15px; border-radius: 8px; border: 1px solid #e2e8f0;
    display: flex; flex-direction: column; gap: 10px;
}
@media (min-width: 600px) {
    .user-card { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* Utility */
.text-muted { color: var(--text-muted); font-size: 0.85rem; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 15px; } /* Grid 2 column di mobile */
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; } }
.stat-card { background: white; padding: 15px; border-radius: 10px; border: 1px solid #e2e8f0; }