/* === FIX OVERFLOW - TAMBAHKAN DI ATAS === */
* {
    box-sizing: border-box !important;
    max-width: 100vw !important;
}

html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
}

body {
    min-height: 100vh;
}


/* Reset dan Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #f8961e;
    --info: #4895ef;
    --dark: #212529;
    --light: #f8f9fa;
    --gray: #6c757d;
    --sidebar-width: 250px;
    --topbar-height: 70px;
}


body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Login Container */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.login-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.login-header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.login-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    width: 80%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Button Styles */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* Alert Styles */
.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-danger {
    background: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #090;
    border: 1px solid #cfc;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
    box-sizing: border-box;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.sidebar-header h3 {
    color: white;
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-close {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 16px;
    color: white;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.sidebar-close:hover {
    background: rgba(255,255,255,0.3);
}

.sidebar-profile {
    padding: 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.profile-image {
    width: 50px;
    height: 50px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    margin-right: 15px;
}

.profile-info h4 {
    margin-bottom: 5px;
    font-size: 16px;
}

.role-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.role-badge.admin {
    background: #4361ee20;
    color: var(--primary);
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-menu a i {
    margin-right: 10px;
    width: 20px;
}

.sidebar-menu a:hover {
    background: #f8f9fa;
    border-left-color: var(--primary);
}

.sidebar-menu a.active {
    background: #4361ee10;
    border-left-color: var(--primary);
    color: var(--primary);
}

.sidebar-menu a.logout {
    color: var(--danger);
}

/* Perbaiki di file CSS utama Anda */
.main-content {
    width: calc(100% - 250px) !important; /* 100% minus sidebar */
    margin-left: 250px !important;
    float: none !important;
    clear: both !important;
    overflow-x: hidden !important;
    position: relative !important;
}

/* Untuk mobile */
@media (max-width: 768px) {
    .main-content {
        width: 100% !important;
        margin-left: 0 !important;
    }
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: white;
    display: flex;
    align-items: center;
    padding: 0 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    box-sizing: border-box;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--dark);
    cursor: pointer;
    margin-right: 20px;
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    z-index: 1001;
    position: relative;
}

.sidebar-toggle:hover {
    background-color: rgba(67, 97, 238, 0.1);
}

.sidebar-toggle i {
    pointer-events: none;
}


.topbar-title {
    flex: 1;
}

.topbar-title h2 {
    font-size: 1.5rem;
    color: var(--dark);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Content Area */
.content {
    padding: 30px;
    box-sizing: border-box;
    min-height: calc(100vh - var(--topbar-height));
    max-width: 100%;
    overflow-x: hidden;
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -15px;
}

.col-12 {
    padding: 15px;
    width: 100%;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 25px 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    height: 100%;
    border: 1px solid #eef2f7;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    font-size: 24px;
}

.stat-icon.bg-primary { background: var(--primary); color: white; }
.stat-icon.bg-success { background: var(--success); color: white; }
.stat-icon.bg-warning { background: var(--warning); color: white; }
.stat-icon.bg-danger { background: var(--danger); color: white; }

.stat-info h3 {
    font-size: 2.2rem;
    margin-bottom: 5px;
    color: var(--dark);
}

.stat-info p {
    color: var(--gray);
    font-size: 14px;
}

/* Card Styles - Perbaikan */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-top: 30px;
    border: 1px solid #eef2f7;
    overflow: hidden;
}

.card-header {
    padding: 25px;
    border-bottom: 1px solid #eef2f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.card-header h3 {
    margin: 0;
    color: var(--dark);
    font-size: 1.5rem;
}

.card-body {
    padding: 25px;
}



/* Table Styles */
.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #eef2f7;
    
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--dark);
    padding: 15px;
    border-bottom: 2px solid #eef2f7;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

/* Badge */
.badge {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #4cc9f020;
    color: #4cc9f0;
}

/* Responsive */
@media (min-width: 768px) {
    .col-md-6 { width: 50%; }
    .col-md-4 { width: 33.333%; }
    .col-md-3 { width: 25%; }
}

@media (min-width: 992px) {
    .col-lg-3 { width: 25%; }
}

@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1001;
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 2px 0 20px rgba(0,0,0,0.2);
    }
    
    .sidebar-close {
        display: flex;
        position: absolute;
        right: 15px;
        top: 15px;
        background: var(--danger);
        color: white;
        border: none;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1002;
    }
    
    .sidebar-close:hover {
        background: #e63757;
    }
    
    /* Perbaikan untuk overlay backdrop */
    body.sidebar-open {
        overflow: hidden;
    }
}
    
    /* Animation untuk sidebar */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .sidebar-toggle {
        display: flex !important;
        position: fixed;
        top: 15px;
        left: 15px;
        background: white;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        z-index: 1002;
    }
    
    .topbar {
        padding-left: 70px; /* Beri space untuk toggle button */
    }
    
    .content {
        padding: 20px 15px;
    }
    
    .login-card {
        padding: 30px 20px;
    }
    
    .login-header h1 {
        font-size: 2rem;
    }
    
    
    
    
/* Password field styling */
.password-field {
    position: relative;
}

.password-field input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
}

.toggle-password:hover {
    color: var(--primary);
}

/* Password strength */
.password-strength {
    margin-top: 5px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    transition: width 0.3s, background 0.3s;
}

.strength-weak { background: #f72585; width: 25%; }
.strength-fair { background: #f8961e; width: 50%; }
.strength-good { background: #4cc9f0; width: 75%; }
.strength-strong { background: #4CAF50; width: 100%; }

/* Required field indicator */
.required {
    color: #f72585;
    font-weight: bold;
}

/* Info box styling */
.info-box {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
}

.info-box h4 {
    margin: 0 0 10px 0;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-box p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Status badge for login messages */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.status-rejected {
    background: #fee2e2;
    color: #dc2626;
}

.status-approved {
    background: #d1fae5;
    color: #059669;
}

