@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4F46E5; /* Indigo 600 */
    --primary-hover: #4338ca;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    --bg-body: #F1F5F9; /* Slate 100 */
    --bg-card: #FFFFFF;
    
    --text-main: #0F172A; /* Slate 900 */
    --text-muted: #64748B; /* Slate 500 */
    
    --border: #E2E8F0;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- LAYOUT UTAMA (SaaS Structure) --- */
.app-wrapper {
    display: flex;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 50;
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 260px;
    transition: margin-left 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    width: calc(100% - 260px);
}

/* Top Header */
.top-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    height: 70px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

/* Content Body */
.content-body {
    padding: 2rem;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .content-body {
        padding: 1rem;
    }
}

/* --- COMPONENTS --- */

/* Logo */
.brand-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}

/* Navigation Sidebar */
.nav-menu {
    padding: 1.5rem 1rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    background-color: #EEF2FF; /* Indigo 50 */
    color: var(--primary);
}

/* Hamburger Button */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-main);
}

@media (max-width: 1024px) {
    .hamburger { display: block; margin-right: 1rem; }
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    transition: transform 0.2s;
}

.card:hover { transform: translateY(-2px); }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info h3 { font-size: 2rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.25rem; }
.stat-info p { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.stat-icon {
    width: 50px; height: 50px;
    border-radius: 12px;
    background: #EEF2FF;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Forms */
.form-group { margin-bottom: 1.25rem; }
label { display: block; margin-bottom: 0.5rem; font-weight: 600; font-size: 0.9rem; color: var(--text-main); }
input, select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    transition: all 0.2s;
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: white; border: 1px solid var(--border); color: var(--text-main); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.w-full { width: 100%; }

/* Tables */
.table-container { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: white; min-width: 600px; }
th { background: #F8FAFC; padding: 1rem; text-align: left; font-weight: 600; color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
td { padding: 1rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; color: var(--text-main); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover { background-color: #F8FAFC; }

/* Badges */
.badge { padding: 0.25rem 0.75rem; border-radius: 99px; font-size: 0.75rem; font-weight: 600; }
.bg-sakit { background: #DBEAFE; color: #1E40AF; }
.bg-izin { background: #F3E8FF; color: #6B21A8; }
.bg-pending { background: #FEF3C7; color: #92400E; }
.bg-approved { background: #D1FAE5; color: #065F46; }
.bg-rejected { background: #FEE2E2; color: #991B1B; }

/* Utilities */
.text-center { text-align: center; }
.hidden { display: none !important; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.text-sm { font-size: 0.875rem; color: var(--text-muted); }

/* --- LOGIN PAGE SPECIFIC --- */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #E0E7FF 0%, #F1F5F9 100%);
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}


/* --- OVERLAY FOR MOBILE SIDEBAR --- */
.overlay {
    display: none;
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 45;
}

@media (max-width: 1024px) {
    .overlay.active { 
        display: block; 
    }
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    min-width: 300px;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-left: 4px solid var(--primary);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    opacity: 0;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }

.toast-icon {
    font-size: 1.2rem;
    margin-top: 2px;
}
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }

.toast-message {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
}

/* --- SEARCH INPUT STYLE --- */
.search-wrapper {
    position: relative;
    max-width: 300px;
}
.search-wrapper input {
    padding-left: 2.5rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-body);
    transition: all 0.2s;
}
.search-wrapper input:focus {
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.search-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}