@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette */
    --primary: #8B5CF6;       /* Ungu modern yang cerah */
    --primary-dark: #6D28D9;  /* Ungu gelap untuk fokus/hover */
    --primary-light: #EDE9FE; /* Ungu sangat pudar untuk latar aksen */
    --bg: #F8FAFC;            /* Latar belakang abu-abu sangat pudar */
    --text: #1E293B;          /* Warna teks utama (Slate 800) */
    --text-soft: #64748B;     /* Warna teks sekunder (Slate 500) */
    --white: #FFFFFF;
    --border: #E2E8F0;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --shadow-hover: 0 20px 25px -5px rgba(139, 92, 246, 0.15);
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;

    margin: 0;
    /* height: 100vh; */
    /* overflow: hidden; */
}

.app-layout {
    display: flex;
    height: 100vh; /* Full layar */
    width: 100vw;
}

.sidebar {
    width: 260px; /* Sesuaikan lebar sidebar kamu */
    height: 100vh;
    flex-shrink: 0; /* Mencegah sidebar menyusut */
    display: flex;
    flex-direction: column;
    background: white;
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-content {
    flex: 1;
    height: 100vh;
    overflow-y: auto; /* Hanya bagian ini yang boleh scroll */
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

/* Tambahan: Pastikan header tetap di atas saat konten di-scroll */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content {
    padding: 30px;
    flex: 1;
}

/* TYPOGRAPHY */
h1 { font-size: 52px; font-weight: 700; line-height: 1.15; }
h2 { font-size: 36px; font-weight: 600; line-height: 1.25; margin-bottom: 16px; }
h4 { font-size: 18px; font-weight: 600; color: var(--text); }
p { font-size: 16px; color: var(--text-soft); }

/* CONTAINER */
.container {
    max-width: 1200px;
    margin: auto;
    padding: 0 24px;
}

/* BUTTONS */
/* BUTTON BASE (Optional: Jika ingin semua tombol punya dasar yang sama) */
.btn-primary, .btn-delete {
    padding: 12px 20px; /* Ukuran standar yang proporsional */
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

/* BUTTON PRIMARY */
.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* BUTTON DELETE / DANGER */
.btn-delete {
    background-color: #ef4444;
    color: white !important;
}

.btn-delete:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* BACK LINK GLOBAL */
.back-link {
    color: var(--text-soft);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    transition: var(--transition);
    font-weight: 500;
    font-size: 14px;
}

.back-link:hover {
    color: var(--primary);
    transform: translateX(-4px);
}

/* Button */
.btn-login {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 10px 24px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.btn-login:hover {
    background: var(--primary);
    color: var(--white);
}

/* Alert Error Style */
.alert-error {
    color: #991b1b;
    background: #fee2e2;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid #ef4444;
    font-size: 14px;
}

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 4% ;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.logo {
    font-weight: 700;
    font-size: 20px;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Header */
/* GLOBAL PAGE HEADER */
.page-header {
    margin-top: 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Menjaga teks tetap rapi meski ada tombol */
    gap: 20px;
    flex-wrap: wrap; /* Agar responsif di layar kecil */
}

.page-header-info h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px; /* Jarak antara emoji/icon dan teks */
}

.page-header-info p {
    color: var(--text-soft);
    font-size: 14px;
    margin: 0;
}

.page-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Responsif untuk Mobile */
@media (max-width: 640px) {
    .page-header {
        flex-direction: column;
        gap: 15px;
    }
    .page-header-actions {
        width: 100%;
    }
    .page-header-actions .btn-primary, 
    .page-header-actions .btn-delete {
        flex: 1;
        justify-content: center;
    }
}

/* GLOBAL CARD BASE */
.card {
    background: var(--white);
    padding: 28px 24px;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

/* FOOTER */
.footer {
    background: #1E1B4B; /* Warna navy/ungu sangat gelap */
    color: var(--white);
    padding: 64px 0 32px 0;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 16px;
    font-size: 20px;
}

.footer-col p {
    color: #94A3B8;
    margin-bottom: 8px;
    font-size: 15px;
}

.footer-col .footer-desc {
    margin-top: 12px;
    max-width: 320px;
    line-height: 1.6;
}

.footer small {
    display: block;
    text-align: center;
    margin-top: 48px;
    padding-top: 24px;
    color: #64748B;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
}

/* GLOBAL TABLE STYLING */
.table-card { 
    background: var(--white); 
    border-radius: 16px; 
    border: 1px solid var(--border); 
    overflow: hidden; 
    box-shadow: var(--shadow-sm); 
    margin-top: 20px;
}

.table-custom { 
    width: 100%; 
    border-collapse: collapse; 
}

.table-custom th, .table-custom td { 
    padding: 16px 20px; 
    text-align: left; 
    border-bottom: 1px solid var(--border); 
}

.table-custom th { 
    background: #F9FAFB; 
    font-weight: 600; 
    font-size: 13px; 
    color: var(--text-soft); 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
}

.table-custom tbody tr:hover { 
    background-color: #F9FAFB; 
}

/* TABLE ACTION BUTTONS */
.action-btns { 
    display: flex; 
    gap: 8px; 
    align-items: center;
}

.btn-table-action { 
    padding: 8px 12px; 
    border-radius: 8px; 
    font-size: 13px; 
    font-weight: 500; 
    text-decoration: none; 
    display: inline-flex; 
    align-items: center; 
    gap: 5px; 
    cursor: pointer; 
    border: none; 
    transition: var(--transition); 
}

.btn-table-edit { background: #F3F4F6; color: #4B5563; }
.btn-table-edit:hover { background: #E5E7EB; color: #1F2937; }

.btn-table-delete { background: #FEE2E2; color: #DC2626; }
.btn-table-delete:hover { background: #FECACA; color: #B91C1C; }

.btn-table-save { background: #D1FAE5; color: #059669; }
.btn-table-cancel { background: #F3F4F6; color: #4B5563; }

/* BADGES */
.badge-role { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; display: inline-block; }
.role-admin { background: #DBEAFE; color: #2563EB; }
.role-client { background: #D1FAE5; color: #059669; }

/* INLINE INPUT FOR EDITING */
.inline-input { 
    width: 100%; 
    padding: 8px 12px; 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    font-family: inherit;
    outline: none;
}
.inline-input:focus { border-color: var(--primary); }


    /* Custom SweetAlert2 Font agar selaras dengan sistem */
    .swal2-popup {
        font-family: 'Poppins', sans-serif !important; /* Gunakan font sistem Anda */
        border-radius: 16px !important;
    }

    .swal2-title {
        color: var(--text) !important;
        font-weight: 700 !important;
    }

    .swal2-html-container {
        color: var(--text-soft) !important;
    }

    .swal2-styled.swal2-confirm {
        border-radius: 10px !important;
        font-weight: 600 !important;
    }

    .swal2-styled.swal2-cancel {
        border-radius: 10px !important;
    }