/* ========== ADMIN STYLING ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f8fafc;
    color: #1e293b;
}

/* ===== LOGIN ADMIN ===== */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 32px;
    padding: 40px 40px 35px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 55px;
    background: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.login-header h1 {
    font-size: 26px;
    color: #1e293b;
    margin-bottom: 6px;
}

.login-header p {
    color: #64748b;
    font-size: 13px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.input-group label i {
    margin-right: 8px;
    color: #8e2de2;
}

.input-group input {
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s;
    background: white;
    color: #1e293b;
}

.input-group input:focus {
    outline: none;
    border-color: #8e2de2;
    box-shadow: 0 0 0 3px rgba(142, 45, 226, 0.15);
}

.btn-login {
    padding: 12px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%);
    color: white;
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(78, 0, 224, 0.4);
}

/* ===== ADMIN CONTAINER ===== */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    box-shadow: 4px 0 10px rgba(0,0,0,0.02);
    z-index: 100;
    transition: transform 0.3s ease;
}

.admin-sidebar .logo {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.admin-sidebar .logo i {
    font-size: 28px;
    color: #8e2de2;
}

.admin-sidebar .logo span {
    font-size: 20px;
    font-weight: 700;
    color: #8e2de2;
}

.admin-sidebar .sidebar-nav {
    flex: 1;
    padding: 24px 16px;
}

.admin-sidebar .sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #64748b;
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 4px;
    transition: all 0.3s;
}

.admin-sidebar .sidebar-nav a:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.admin-sidebar .sidebar-nav a.active {
    background: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%);
    color: white;
    box-shadow: 0 10px 20px rgba(78, 0, 224, 0.3);
}

.admin-sidebar .sidebar-nav a i {
    width: 20px;
}

.admin-sidebar .sidebar-footer {
    padding: 16px 20px 20px 20px;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
}

.admin-sidebar .sidebar-footer .logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

.admin-sidebar .sidebar-footer .logout-btn i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.admin-sidebar .sidebar-footer .logout-btn:hover {
    background: #fef2f2;
    color: #ef4444;
}

/* ===== HAMBURGER BUTTON ===== */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #1e293b;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s;
}

.hamburger-btn:hover {
    background: #f1f5f9;
}

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* ===== MAIN CONTENT ===== */
.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 24px 32px;
    min-height: 100vh;
    width: calc(100% - 260px);
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

.greeting {
    color: #64748b;
    font-size: 14px;
}

.header-right .badge {
    background: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid #e2e8f0;
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon i {
    font-size: 24px;
    color: white;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
}

/* ===== TABLES ===== */
.admin-table-container {
    background: white;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    overflow-x: auto;
}

.admin-table-container h3 {
    margin-bottom: 16px;
    color: #1e293b;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.admin-table th {
    text-align: left;
    padding: 12px 16px;
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.admin-table tr:hover td {
    background: #f8fafc;
}

.admin-table .no-data {
    text-align: center;
    color: #94a3b8;
    padding: 40px !important;
}

/* ===== PAGE HEADER & FILTER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

.date-filter {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.date-filter input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    background: white;
    color: #1e293b;
    outline: none;
    transition: border-color 0.3s;
    height: 38px;
}

.date-filter input[type="date"]:focus {
    border-color: #8e2de2;
    box-shadow: 0 0 0 3px rgba(142, 45, 226, 0.15);
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    background: white;
    color: #1e293b;
    outline: none;
    transition: border-color 0.3s;
    min-width: 150px;
    height: 38px;
    cursor: pointer;
}

.filter-select:focus {
    border-color: #8e2de2;
    box-shadow: 0 0 0 3px rgba(142, 45, 226, 0.15);
}

.filter-btn,
.export-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    white-space: nowrap;
}

.filter-btn {
    background: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%);
    color: white;
}

.filter-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(78, 0, 224, 0.3);
}

.export-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(78, 0, 224, 0.3);
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* ===== PASSWORD TOGGLE ===== */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-wrapper input {
    width: 100%;
    padding-right: 45px;
    padding-left: 14px;
    height: 46px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s;
    background: white;
    color: #1e293b;
}

.password-wrapper input:focus {
    border-color: #8e2de2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(142, 45, 226, 0.15);
}

.password-wrapper .toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #94a3b8;
    font-size: 18px;
    transition: all 0.3s;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    padding: 0;
}

.password-wrapper .toggle-password:hover {
    color: #8e2de2;
}

/* ===== PAGE ===== */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* ============================================================ */
/* ========== RESPONSIVE ======================================= */
/* ============================================================ */

/* TABLET (max-width: 1024px) */
@media screen and (max-width: 1024px) {
    .admin-sidebar {
        width: 80px;
    }
    
    .admin-sidebar .logo span,
    .admin-sidebar .sidebar-nav a span,
    .admin-sidebar .sidebar-footer .logout-btn span {
        display: none;
    }
    
    .admin-sidebar .logo {
        justify-content: center;
        padding: 16px;
    }
    
    .admin-sidebar .sidebar-nav a {
        justify-content: center;
        padding: 12px;
    }
    
    .admin-sidebar .sidebar-nav a i {
        margin: 0;
        font-size: 20px;
        width: auto;
    }
    
    .admin-main {
        margin-left: 80px;
        padding: 20px 24px;
        width: calc(100% - 80px);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* HP (max-width: 768px) */
@media screen and (max-width: 768px) {
    .hamburger-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    .admin-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -300px !important;
        width: 280px !important;
        height: 100vh !important;    /* Fallback */
        height: 100dvh !important;    /* ✅ Solusi Chrome HP */
        background: white !important;
        z-index: 1001 !important;
        transition: left 0.3s ease !important;
        box-shadow: 4px 0 30px rgba(0,0,0,0.2) !important;
        border-right: 1px solid #e2e8f0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }
    
    .admin-sidebar.open {
        left: 0 !important;
    }
    
    .admin-sidebar .logo span,
    .admin-sidebar .sidebar-nav a span,
    .admin-sidebar .sidebar-footer .logout-btn span {
        display: inline !important;
    }
    
    .admin-sidebar .logo {
        flex-shrink: 0 !important;
        padding: 16px 20px !important;
        justify-content: flex-start !important;
    }
    
    .admin-sidebar .sidebar-nav a {
        justify-content: flex-start;
        padding: 12px 16px;
    }
    
    .admin-sidebar .sidebar-nav a i {
        margin: 0 12px 0 0;
        font-size: 18px;
        width: 20px;
    }
    
    .admin-main {
        margin-left: 0 !important;
        padding: 16px !important;
        width: 100% !important;
    }
    
    .header-left {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .header-left h1 {
        font-size: 20px;
    }
    
    .greeting {
        font-size: 13px;
        margin-left: 0;
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
    }
    
    .stat-icon i {
        font-size: 18px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .page-header h2 {
        font-size: 18px;
    }
    
    .date-filter {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .date-filter input[type="date"],
    .filter-select,
    .filter-btn,
    .export-btn {
        width: 100%;
        height: 40px;
        min-width: unset;
    }
    
    .filter-btn,
    .export-btn {
        justify-content: center;
    }
    
    .admin-table-container {
        padding: 12px;
        border-radius: 12px;
    }
    
    .admin-table {
        min-width: 500px;
        font-size: 12px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .admin-table th {
        font-size: 11px;
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    .btn-danger {
        padding: 4px 10px;
        font-size: 11px;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 99;
    }
    
    .sidebar-overlay.active {
        display: block;
    }

        /* Nav - fleksibel & scrollable */
    .sidebar-nav {
        flex: 1 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 16px !important;
        padding-bottom: 16px !important;   /* ✅ Cukup */
        -webkit-overflow-scrolling: touch !important;
        min-height: 0 !important;           /* ✅ Penting */
    }

    /* Footer - tetap di bawah, tidak absolute */
    .sidebar-footer {
        position: relative !important;      /* ✅ Ubah dari absolute */
        flex-shrink: 0 !important;          /* ✅ Jangan menyusut */
        padding: 16px !important;
        background: white !important;
        border-top: 1px solid #e2e8f0 !important;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.05) !important;
        margin-top: auto !important;         /* ✅ Dorong ke bawah */
    }
}

/* HP KECIL (max-width: 480px) */
@media screen and (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }
    
    .login-header i {
        font-size: 48px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .admin-main {
        padding: 12px !important;
    }
    
    .header-left h1 {
        font-size: 18px;
    }
    
    .admin-table {
        min-width: 400px;
        font-size: 11px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .admin-table-container {
        padding: 8px;
    }
}