:root {
    --primary-color: #00A389;
    --primary-dark: #008771;
    --primary-light: #DCFCE7;
    --bg-color: #F8FAFC;
    --text-main: #1E293B;
    --text-sub: #64748B;
    --white: #FFFFFF;
    --sidebar-width: 260px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--white);
    border-right: 1px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    transition: transform 0.3s ease, visibility 0.3s;
    z-index: 1100;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto; /* Tambahkan scroll internal jika menu terlalu banyak */
}

.sidebar-header {
    padding: 0 24px 20px;
    border-bottom: 1px solid #F1F5F9;
    margin-bottom: 20px;
}

.sidebar-header h2 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin: 0;
    font-weight: 800;
}

.menu-item {
    padding: 12px 24px;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
    border-left: 4px solid transparent;
}

.menu-item:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.menu-item.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.menu-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevent flex children from pushing container */
}

.header {
    background-color: var(--white);
    padding: 16px 32px;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.content-body {
    padding: 32px;
}

.card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

/* Modal */
.modal-overlay {
    backdrop-filter: blur(4px);
}

.modal-overlay label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

.modal-overlay input[type="text"],
.modal-overlay input[type="number"],
.modal-overlay input[type="date"],
.modal-overlay select,
.modal-overlay textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    font-size: 1rem;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
    min-height: 50px;
}

/* Hamburger Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    margin-right: 15px;
    padding: 5px;
}

/* RESPONSIVE BREAKPOINT */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        visibility: hidden;
        height: 100vh;
        box-shadow: 15px 0 50px rgba(0,0,0,0.2);
    }

    .sidebar.show {
        transform: translateX(0);
        visibility: visible;
    }

    .menu-toggle {
        display: block;
    }

    .header {
        padding: 12px 20px;
    }

    .content-body {
        padding: 15px;
    }
}

@media (max-width: 600px) {
    .header h3 {
        font-size: 1.1rem;
    }

    .user-info {
        display: none;
    }

    .card {
        padding: 15px;
    }

    /* Grid forms in modal become single column */
    #modalKaryawan .card form > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .btn-primary {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

/* Data Table Scrollability */
div[style*="overflow-x: auto"] {
    border-radius: 8px;
    border: 1px solid #eee;
    background: white;
}

table {
    min-width: 800px; /* Ensure tables have enough space to trigger horizontal scroll */
}
