:root {
    --primary: #008752;
    --primary-dark: #00663e;
    --secondary: #f4f6f8;
    --text-color: #333333;
    --white: #ffffff;
    --border: #e2e8f0;
    --danger: #d9534f;
    --gray-light: #f8fafc;
}

/* Universal Reset & Penanganan Ikon Global */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* Mengunci ukuran seluruh ikon SVG agar tidak tampil raksasa */
svg {
    width: 22px;
    height: 22px;
    max-width: 22px;
    max-height: 22px;
    fill: currentColor;
    flex-shrink: 0;
}

body {
    background-color: var(--secondary);
    color: var(--text-color);
    line-height: 1.5;
}

/* Top Navbar (Support Safe Area Notch) */
.top-nav {
    background: #ffffff;
    padding: calc(12px + env(safe-area-inset-top)) 16px 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 900;
}

.top-nav .nav-icon {
    font-size: 1.4rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-color);
}

.top-logo {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: #eef7f2;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Sidebar Drawer Navigation */
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 998;
}

.sidebar-drawer {
    position: fixed;
    top: 0; left: -280px;
    width: 280px; height: 100vh;
    background: #ffffff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
}

.sidebar-drawer.open {
    left: 0;
}

.sidebar-header {
    background: var(--primary);
    color: #fff;
    padding: 20px;
}

.sidebar-menu {
    list-style: none;
    padding: 15px 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.sidebar-menu li a:hover {
    background: #f4f6f8;
    color: var(--primary);
}

.container {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 15px;
}

/* Banner Waktu Sistem */
.time-banner {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    color: #0d47a1;
}

.time-banner .badge-time {
    background: rgba(255,255,255,0.6);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Card Component */
.card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    border: 1px solid var(--border);
}

/* Button Component */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-danger {
    background: var(--danger);
}

.btn-excel {
    background: #1D6F42;
}

/* Form Styles */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #4a5568;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background-color: var(--white);
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

/* Desktop Table Styles */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.data-table th, .data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.data-table th {
    background-color: #fafafa;
    color: #4a5568;
}

/* Login Page Layout */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--white);
    padding: 30px 20px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: center;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* =================================================== */
/* NATIVE MOBILE RESPONSIVE LAYOUT (HP)                */
/* =================================================== */
@media (max-width: 768px) {
    body {
        padding-bottom: calc(75px + env(safe-area-inset-bottom));
    }

    .container {
        margin: 10px auto;
        padding: 0 10px;
    }

    .card {
        padding: 15px;
        border-radius: 14px;
        margin-bottom: 15px;
    }

    .form-control {
        font-size: 16px;
        padding: 12px;
    }

    .desktop-table {
        display: none;
    }

    .mobile-cards {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    /* Native Card Item Display */
    .mobile-card-item {
        background: var(--white);
        border-radius: 12px;
        padding: 16px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        border: 1px solid var(--border);
        position: relative;
    }

    .mobile-card-title {
        font-weight: 700;
        font-size: 1.05rem;
        color: #1a202c;
        margin-bottom: 6px;
    }

    .mobile-card-subtitle {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.85rem;
        color: #4a5568;
        margin-bottom: 12px;
        padding-bottom: 10px;
        border-bottom: 1px dashed var(--border);
    }

    .mobile-card-body {
        font-size: 0.85rem;
        color: #4a5568;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .mobile-card-body div {
        display: flex;
        justify-content: space-between;
    }

    .mobile-card-body div b {
        color: #718096;
        font-weight: 500;
    }

    .mobile-card-actions {
        margin-top: 12px;
        padding-top: 10px;
        border-top: 1px solid var(--border);
        display: flex;
        justify-content: flex-end;
    }

    /* Native Bottom Navigation Bar */
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        padding-bottom: env(safe-area-inset-bottom);
        background: #ffffff;
        display: flex;
        justify-content: space-around;
        align-items: center;
        border-top: 1px solid var(--border);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
        z-index: 1000;
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: #718096;
        font-size: 0.7rem;
        font-weight: 500;
    }

    .bottom-nav-item.active {
        color: var(--primary);
        font-weight: 700;
    }

    .bottom-nav-item svg {
        width: 22px;
        height: 22px;
        fill: currentColor;
        margin-bottom: 2px;
    }
}

@media (min-width: 769px) {
    .mobile-cards {
        display: none;
    }

    .bottom-nav {
        display: none;
    }
}