:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --dark: #1e293b;
    --light: #f8fafc;
    --border: #e2e8f0;
    --text: #334155;
    --text-muted: #64748b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--light);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Sidebar Layout */
.sidebar-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.brand-text h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--dark);
    margin: 0;
    line-height: 1;
}

.brand-text span {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s;
}

.sidebar-close:hover {
    background: var(--light);
    color: var(--dark);
}

.sidebar-user {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.user-info h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.2;
}

.user-info p {
    font-size: 12px;
    margin: 0;
    opacity: 0.9;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    font-size: 15px;
    font-weight: 500;
}

.sidebar-menu a:hover {
    background: var(--light);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-menu li.active a {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, transparent 100%);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-menu i {
    width: 20px;
    font-size: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-logout:hover {
    background: #fecaca;
    transform: translateX(4px);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* Header */
.app-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: var(--light);
    border: none;
    color: var(--dark);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.menu-toggle:hover {
    background: var(--border);
}

.back-btn {
    background: var(--light);
    border: none;
    color: var(--dark);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    text-decoration: none;
}

.back-btn:hover {
    background: var(--border);
}

.header-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: var(--dark);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--light);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.header-user i {
    font-size: 20px;
    color: var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 20px;
}

/* Welcome Card */
.welcome-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 24px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.welcome-content h2 {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 8px;
}

.welcome-content p {
    margin: 4px 0;
    opacity: 0.9;
}

.welcome-icon {
    font-size: 60px;
    opacity: 0.3;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-primary .stat-icon { background: var(--primary); }
.stat-success .stat-icon { background: var(--success); }
.stat-warning .stat-icon { background: var(--warning); }
.stat-info .stat-icon { background: var(--info); }

.stat-info h3 {
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    color: var(--dark);
}

.stat-info p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* Sections */
.section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.quick-action {
    background: white;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.quick-action:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    color: var(--primary);
}

.quick-action i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 8px;
    display: block;
}

.quick-action span {
    font-size: 14px;
    font-weight: 600;
}

/* Activity List */
.activity-list {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.activity-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.activity-info {
    flex: 1;
}

.activity-info h4 {
    font-size: 15px;
    margin: 0 0 4px;
    font-weight: 600;
}

.activity-rhk {
    font-size: 13px;
    color: var(--text-muted);
    margin: 4px 0;
}

.activity-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.activity-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    align-items: end;
}

.form-row .form-group {
    margin-bottom: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: var(--light);
    color: var(--primary);
}

.text-danger {
    color: var(--danger) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* RHK Cards */
.rhk-section {
    margin-bottom: 24px;
}

.rhk-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.rhk-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

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

.rhk-badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-utama {
    background: #dbeafe;
    color: #1e40af;
}

.badge-tambahan {
    background: #fef3c7;
    color: #92400e;
}

.rhk-actions {
    display: flex;
    gap: 8px;
}

.rhk-body {
    margin-bottom: 16px;
}

.rhk-field {
    margin-bottom: 12px;
}

.rhk-field label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}

.rhk-field p {
    margin: 0;
    font-size: 14px;
}

.rhk-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
}

.rhk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.rhk-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Pekerjaan Cards */
.date-group {
    margin-bottom: 24px;
}

.date-header {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    padding: 12px 16px;
    background: var(--light);
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pekerjaan-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid var(--primary);
}

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

.pekerjaan-actions {
    display: flex;
    gap: 8px;
}

.pekerjaan-body {
    font-size: 14px;
}

.pekerjaan-rhk {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: start;
    gap: 8px;
}

.pekerjaan-desc {
    margin: 12px 0;
    line-height: 1.6;
}

.pekerjaan-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Filter */
.filter-form {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.filter-info {
    background: #fef3c7;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.filter-form {
    margin-bottom: 20px;
}

/* Alerts */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 64px;
    color: var(--border);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--dark);
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
    
    .sidebar-close {
        display: block;
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-title {
        font-size: 18px;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .header-user span {
        display: none;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   UPLOAD & BUKTI STYLES
   ============================================= */

/* File Upload Wrapper */
.file-upload-wrapper {
    margin-top: 8px;
}

.file-input {
    display: none;
}

.file-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.file-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.file-label i {
    font-size: 18px;
}

/* File Preview */
.file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.preview-item {
    position: relative;
    width: 80px;
}

.preview-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border);
}

.preview-name {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 4px;
}

/* Bukti Existing */
.bukti-existing {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.bukti-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.bukti-item {
    position: relative;
    width: 100px;
    height: 100px;
}

.bukti-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 2px solid var(--border);
}

.bukti-thumb:hover {
    transform: scale(1.05);
}

.bukti-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.bukti-delete:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Bukti Grid Small (for list view) */
.pekerjaan-bukti {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.bukti-grid-small {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.bukti-thumb-small {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid var(--border);
}

.bukti-thumb-small:hover {
    transform: scale(1.1);
    border-color: var(--primary);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.lightbox-close:hover {
    transform: scale(1.2);
}

/* Alert Warning */
.alert-warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 1px solid #f59e0b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-warning i {
    color: #f59e0b;
    margin-top: 2px;
}

/* Mobile responsive for bukti */
@media (max-width: 768px) {
    .bukti-item {
        width: 80px;
        height: 80px;
    }
    
    .bukti-thumb-small {
        width: 50px;
        height: 50px;
    }
    
    .file-label {
        width: 100%;
        justify-content: center;
    }
}

/* Preview Info */
.preview-info {
    width: 100%;
    padding: 8px 12px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 10px;
}

.preview-info i {
    color: #10b981;
    margin-right: 5px;
}

.preview-size {
    display: block;
    font-size: 9px;
    color: var(--text-muted);
}

/* Text Warning */
.text-warning {
    color: #b45309;
    background: #fef3c7;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
}

.text-warning i {
    margin-right: 5px;
}

/* MB utility */
.mb-2 {
    margin-bottom: 8px;
}
