* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0f9ff 100%);
    color: #0f172a;
    line-height: 1.7;
    min-height: 100vh;
}

.login-page {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
}

.login-container {
    width: 100%;
    max-width: 480px;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 48px 40px;
    border-radius: 28px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.login-box h1 {
    text-align: center;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.login-box h2 {
    text-align: center;
    color: #64748b;
    font-size: 15px;
    margin-bottom: 36px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #334155;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0ea5e9;
    background: white;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15), 0 4px 6px -1px rgba(14, 165, 233, 0.1);
    transform: translateY(-1px);
}

.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    width: 100%;
    box-shadow: 0 4px 14px 0 rgba(14, 165, 233, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(14, 165, 233, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.5);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(245, 158, 11, 0.4);
}

.btn-warning:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.5);
}

.btn-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(6, 182, 212, 0.4);
}

.btn-info:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(6, 182, 212, 0.5);
}

.btn-sm {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 12px;
}

.alert {
    padding: 18px 20px;
    border-radius: 16px;
    margin-bottom: 28px;
    font-weight: 600;
    border: 1px solid;
}

.alert-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
    border-color: #fecaca;
}

.alert-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #d1fae5 100%);
    color: #059669;
    border-color: #a7f3d0;
}

.alert-info {
    background: linear-gradient(135deg, #f0f9ff 0%, #dbeafe 100%);
    color: #0369a1;
    border-color: #bfdbfe;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
    color: white;
    padding: 28px 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    box-shadow: 8px 0 30px rgba(15, 23, 42, 0.15);
}

.sidebar.collapsed {
    transform: translateX(-280px);
}

.sidebar h2 {
    text-align: center;
    padding: 0 28px;
    margin-bottom: 36px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 0 14px;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu a {
    display: block;
    padding: 16px 22px;
    color: white;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
    position: relative;
    overflow: hidden;
}

.sidebar-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: white;
    border-radius: 0 4px 4px 0;
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.18);
    transform: translateX(6px);
}

.sidebar-menu a:hover::before,
.sidebar-menu a.active::before {
    transform: scaleY(1);
}

.main-content {
    margin-left: 280px;
    padding: 36px;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.expanded {
    margin-left: 0;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
    flex-wrap: wrap;
    gap: 20px;
}

.header h1 {
    background: linear-gradient(135deg, #0f172a 0%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
}

.toggle-sidebar {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    border: none;
    padding: 14px 18px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 22px;
    display: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px 0 rgba(14, 165, 233, 0.4);
}

.toggle-sidebar:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 20px -4px rgba(14, 165, 233, 0.5);
}

.card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 10px 40px -10px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(148, 163, 184, 0.15);
    margin-bottom: 32px;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 16px;
}

.card-header h3 {
    color: #1e293b;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
    margin-bottom: 36px;
}

.stat-card {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 15px 35px -10px rgba(14, 165, 233, 0.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    transition: transform 0.6s;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(14, 165, 233, 0.6);
}

.stat-card:hover::before {
    transform: scale(1.2);
}

.stat-card h4 {
    font-size: 15px;
    opacity: 0.95;
    margin-bottom: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    position: relative;
}

.stat-card .number {
    font-size: 44px;
    font-weight: 800;
    position: relative;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px;
    padding: 0;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 16px;
    min-width: 900px; /* Ensure table has enough space for all columns */
}

.table th,
.table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap; /* Prevent text from wrapping */
    vertical-align: middle;
}

.table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #334155;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    position: sticky;
    top: 0;
}

.table tr:hover {
    background: #f8fafc;
}

.table tbody tr:first-child td {
    border-top: none;
}

/* Make buttons in table smaller */
.table .btn {
    padding: 6px 10px;
    font-size: 11px;
    margin: 2px 2px;
    white-space: nowrap;
    display: inline-block;
}

/* Make form buttons inline properly */
.table td form {
    display: inline-block;
    margin: 2px;
}

/* Make QR Code image smaller */
.table td img {
    max-width: 60px;
    max-height: 60px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.badge {
    padding: 8px 18px;
    border-radius: 24px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
    letter-spacing: 0.3px;
}

/* Make badges smaller in table */
.table .badge {
    padding: 5px 12px;
    font-size: 11px;
}

/* Fix overlapping buttons - ensure proper spacing */
.table td a.btn,
.table td button.btn {
    display: inline-block;
    margin: 3px 2px;
}

/* Fix column width for better layout */
.table td:nth-child(6), /* Dokumen */
.table td:nth-child(8) /* Aksi */ {
    min-width: 100px;
}

.badge-pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
}

.badge-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #059669;
}

.badge-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    padding: 36px;
    border-radius: 24px;
    max-width: 620px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.8);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.modal-header h3 {
    color: #1e293b;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.close-btn {
    background: #f1f5f9;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #64748b;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.close-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: rotate(90deg);
}

.profile-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 28px;
    border: 6px solid #0ea5e9;
    box-shadow: 0 15px 35px -10px rgba(14, 165, 233, 0.5);
}

.profile-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.profile-item {
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px -2px rgba(148, 163, 184, 0.2);
}

.profile-item label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
}

.profile-item .value {
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.sertifikat-viewer {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    margin-top: 28px;
    border: 1px solid #e2e8f0;
}

.sertifikat-viewer img,
.sertifikat-viewer iframe {
    max-width: 100%;
    max-height: 520px;
    border-radius: 16px;
    box-shadow: 0 8px 20px -4px rgba(148, 163, 184, 0.3);
}

@media (max-width: 768px) {
    .toggle-sidebar {
        display: block;
    }

    .sidebar {
        transform: translateX(-280px);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 24px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header h1 {
        font-size: 24px;
    }

    .profile-info {
        grid-template-columns: 1fr;
    }

    .table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 16px;
    }

    .card {
        padding: 24px;
        border-radius: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-box {
        padding: 36px 28px;
        border-radius: 24px;
    }
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    z-index: 998;
    backdrop-filter: blur(10px);
}

.overlay.active {
    display: block;
}
