@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #008950; /* NU Green */
    --primary-dark: #005f37;
    --secondary: #f0c330; /* NU Yellow */
    --bg-color: #f4f7fe;
    --text-main: #2b3674;
    --text-muted: #a3aed1;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Auth Container */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(0, 137, 80, 0.1) 0%, rgba(240, 195, 48, 0.1) 100%);
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--primary);
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    top: -100px;
    left: -100px;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--secondary);
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    bottom: -50px;
    right: -50px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    z-index: 10;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.08);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--white);
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 137, 80, 0.1);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 137, 80, 0.2);
}

.auth-footer {
    margin-top: 25px;
    text-align: center;
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: var(--primary-dark);
}

/* Alert Messages */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.alert-danger {
    background-color: #fee2e2;
    color: var(--danger);
    border: 1px solid #fca5a5;
}

.alert-success {
    background-color: #dcfce7;
    color: var(--success);
    border: 1px solid #86efac;
}

/* Dashboard Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.nav-menu {
    list-style: none;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    padding: 0 16px;
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nav-link i {
    margin-right: 12px;
    font-size: 18px;
}

.nav-link:hover, .nav-link.active {
    background: var(--primary);
    color: var(--white);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
    overflow-y: auto;
}

.topbar {
    height: 70px;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-toggle {
    display: none;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: capitalize;
}

.content-wrapper {
    padding: 32px;
}

/* Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(0, 137, 80, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 20px;
}

.stat-details h3 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-details h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
}

/* Tables */
.card {
    background: var(--white);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    font-size: 14px;
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-pending { background: #fef3c7; color: #d97706; }
.badge-aktif { background: #dcfce7; color: #15803d; }
.badge-ditolak { background: #fee2e2; color: #b91c1c; }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    /* Auth Form Adjustments */
    .auth-card {
        padding: 25px;
        margin: 15px;
        width: calc(100% - 30px);
    }
    
    .auth-header h1 {
        font-size: 20px;
    }

    /* Dashboard Layout Adjustments */
    .wrapper {
        flex-direction: column;
    }

    /* Off-Canvas Sidebar */
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 260px;
        height: 100vh;
        z-index: 1000;
        border-right: 1px solid var(--border-color);
        transition: left 0.3s ease;
        padding-top: 20px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar.active {
        left: 0;
    }

    /* Overlay for sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .sidebar-header {
        margin-bottom: 15px;
        padding: 0 20px 15px;
    }

    .nav-menu {
        display: block;
        padding: 0;
    }

    .nav-item {
        margin-bottom: 8px;
        padding: 0 16px;
    }

    .nav-link {
        padding: 12px 16px;
        font-size: 15px;
        justify-content: flex-start;
    }
    
    .nav-link i {
        margin-right: 12px;
    }

    .topbar {
        padding: 0 15px;
        height: 60px;
        justify-content: flex-start; /* Align to left to make space for hamburger */
    }

    /* Hamburger Toggle Button */
    .mobile-toggle {
        display: block !important;
        background: none;
        border: none;
        font-size: 24px;
        color: var(--primary);
        cursor: pointer;
        margin-right: 15px;
        padding: 5px;
    }

    .page-title {
        font-size: 18px;
        flex: 1; /* Push the user profile to the right */
    }

    .content-wrapper {
        padding: 15px;
    }

    /* Table Adjustments */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
        border-radius: 8px;
        box-shadow: inset 0 0 5px rgba(0,0,0,0.05); /* Visual cue that it's scrollable */
    }

    .card {
        padding: 15px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
        margin-right: 15px;
    }

    .stat-details h2 {
        font-size: 22px;
    }
}
