/* Reset dan Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Login Page Styles */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-card h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
}

.login-card p {
    color: #666;
    margin-bottom: 30px;
}

.login-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.login-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e1e1e1;
}

.login-footer p {
    margin-bottom: 5px;
    font-size: 14px;
    color: #666;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Header Styles */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    color: #666;
    font-weight: 500;
}

/* Main Content */
.main {
    padding: 40px 0;
    min-height: calc(100vh - 80px);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.product-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.product-header h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 20px;
}

.product-type {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
}

.product-body {
    margin: 15px 0;
}

.product-category {
    color: #666;
    font-size: 14px;
}

.product-footer {
    text-align: right;
}

.view-details {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
}

.no-products, .no-files {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 18px;
}

.no-products a, .no-files a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.no-products a:hover, .no-files a:hover {
    text-decoration: underline;
}

/* Product Detail Page */
.product-detail {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.product-info h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 32px;
}

.product-meta {
    margin-bottom: 30px;
}

.product-meta p {
    margin-bottom: 10px;
    font-size: 16px;
}

.files-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.file-description {
    color: #666;
    margin-bottom: 5px;
}

.file-meta {
    color: #999;
    font-size: 12px;
}

.file-actions {
    margin-left: 20px;
}



/* Admin Layout */
.admin-body {
    background-color: #f8f9fa;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #2c3e50;
    color: white; /* Pastikan teks putih */
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease; /* Gunakan transform untuk toggle */
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: white; /* Pastikan teks putih */
}

.sidebar-nav ul {
    list-style: none;
    flex: 1;
}

.sidebar-nav li {
    border-bottom: 1px solid #34495e;
}

.sidebar-nav a {
    display: block;
    padding: 15px 20px;
    color: #ecf0f1; /* Pastikan teks putih */
    text-decoration: none;
    transition: background-color 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: #34495e;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #34495e;
}

.sidebar-footer .user-info {
    display: block;
    color: #bdc3c7; /* Pastikan teks terlihat */
    margin-bottom: 10px;
    font-size: 14px;
}

/* Overlay untuk mobile (saat sidebar terbuka) - BARU */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998; /* di bawah sidebar */
    display: none; /* sembunyikan default */
}

.sidebar-overlay-active {
    display: block; /* muncul saat sidebar aktif */
    pointer-events: auto; /* Izinkan klik untuk tutup */
}




/* Admin Main */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.admin-header {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid #e1e1e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    color: #333;
    font-size: 28px;
}

.admin-actions {
    display: flex;
    gap: 10px;
}

.admin-content {
    flex: 1;
    padding: 30px;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 40px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 10px;
}

.stat-info h3 {
    font-size: 32px;
    color: #333;
    margin-bottom: 5px;
}

.stat-info p {
    color: #666;
    font-size: 14px;
}

/* Dashboard Actions */
.dashboard-actions {
    margin-bottom: 30px;
}

.action-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.action-card h3 {
    color: #333;
    margin-bottom: 20px;
}

.action-buttons {
    display: flex;
    gap: 15px;
}

/* Recent Activity */
.recent-activity {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.recent-activity h3 {
    color: #333;
    margin-bottom: 20px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.activity-time {
    color: #999;
    font-size: 12px;
}

/* Form Styles */
.form-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.form-section h3 {
    color: #333;
    margin-bottom: 25px;
    font-size: 24px;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

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

.form-group small {
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

/* Table Styles */
.table-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.table-section h3 {
    color: #333;
    margin-bottom: 25px;
    font-size: 24px;
}

.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
}

.admin-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.admin-table tr:hover {
    background-color: #f8f9fa;
}

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

/* Button Styles */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5a6fd8;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-full {
    width: 100%;
}

/* Messages */
.success-message,
.error-message {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: 500;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* File Upload Styles */
.file-upload-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.file-input-wrapper {
    border: 2px dashed #ddd;
    padding: 20px;
    text-align: center;
    border-radius: 5px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.file-input-wrapper:hover {
    border-color: #007cba;
}

.file-input-wrapper.dragover {
    border-color: #007cba;
    background: #f0f8ff;
}

.file-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

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

.file-item-info {
    flex: 1;
    margin-right: 10px;
}

.file-item-name {
    font-weight: 500;
    color: #333;
}

.file-item-size {
    font-size: 12px;
    color: #666;
}

.file-item-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.file-item-remove:hover {
    background: #c82333;
}

.file-category-select {
    width: 150px;
    margin-right: 10px;
}

.file-description-input {
    flex: 1;
    margin-right: 10px;
}

.add-more-files {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 20px;
}

.add-more-files:hover {
    background: #218838;
}

.category-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 5px;
}

.category-gambar { background: #e3f2fd; color: #1976d2; }
.category-test_report { background: #f3e5f5; color: #7b1fa2; }
.category-copy_test_report { background: #e8f5e8; color: #388e3c; }
.category-tkdn { background: #fff3e0; color: #f57c00; }
.category-copy_tkdn { background: #fce4ec; color: #c2185b; }
.category-sni { background: #e0f2f1; color: #00796b; }
.category-copy_sni { background: #f1f8e9; color: #689f38; }
.category-lainnya { background: #f5f5f5; color: #616161; }

.upload-progress {
    display: none;
    margin-top: 10px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #007cba;
    width: 0%;
    transition: width 0.3s;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-layout {
        flex-direction: column; /* Tetap column */
    }
    
    .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
    }
    
    .sidebar.sidebar-open {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: none; /* default hidden */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 998;
    }
    
    .sidebar-overlay.sidebar-overlay-active {
        display: block;
    }
 

    
    .admin-main {
        order: 1;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .admin-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .file-actions {
        margin-left: 0;
        width: 100%;
    }
    
    .table-responsive {
        font-size: 14px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px;
    }
}



@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .header .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .admin-layout {
        flex-direction: column;
    }

    .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
    }
    
    .sidebar.sidebar-open {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: none; /* default hidden */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 998;
    }
    
    .sidebar-overlay.sidebar-overlay-active {
        display: block;
    }


    .admin-main {
        order: 1;
    }

    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .admin-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

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

    .action-buttons {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .file-actions {
        margin-left: 0;
        width: 100%;
    }

    .table-responsive {
        font-size: 12px;
    }

    .admin-table th,
    .admin-table td {
        padding: 6px;
    }

    /* Spesifik mobile */
    .login-card {
        padding: 25px 15px;
    }

    .product-detail {
        padding: 15px;
    }

    .admin-content {
        padding: 15px 10px;
    }

    .form-section,
    .table-section {
        padding: 15px;
    }

    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card,
.stat-card,
.action-card,
.recent-activity,
.form-section,
.table-section {
    animation: fadeIn 0.6s ease-out;
}

/* Focus and Accessibility */
.btn:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .sidebar,
    .header-actions,
    .admin-actions,
    .form-actions,
    .file-actions {
        display: none !important;
    }
    
    .admin-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
}





