/* Modal Styles - Import Excel & Barang Baru */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
}

.modal-overlay.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-width: 800px;
    width: 90%;
    max-height: 75vh;
    overflow: hidden;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    margin: 20px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(75vh - 140px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 92%;
        max-height: 70vh;
        border-radius: 12px;
        margin: 15px;
    }

    .modal-header {
        padding: 16px;
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .modal-header h3 {
        font-size: 16px;
    }

    .modal-body {
        padding: 16px;
        max-height: calc(70vh - 130px);
    }
}

@media (max-width: 480px) {
    .modal-body {
        padding: 16px;
    }
}

/* Import Excel Specific Styles */
.import-section {
    margin-bottom: 24px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.import-section h4 {
    margin: 0 0 16px 0;
    color: #374151;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-section h4::before {
    content: '';
    width: 4px;
    height: 20px;
    background: #10b981;
    border-radius: 2px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.form-group input[type="file"]:hover {
    border-color: #10b981;
    background: #f0fdf4;
}

.form-group input[type="file"]:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.text-muted {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 8px;
    display: block;
}

/* Preview Table */
.table-container {
    margin: 16px 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: white;
}

.table-container th {
    background: #f8fafc;
    padding: 8px 6px;
    text-align: center;
    font-weight: 600;
    color: #374151;
    border: 1px solid #e5e7eb;
    font-size: 11px;
}

.table-container td {
    padding: 6px 4px;
    text-align: left;
    border: 1px solid #e5e7eb;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.header-row {
    background: #f8fafc !important;
    font-weight: 600 !important;
}

/* Import Errors */
.import-errors {
    margin: 16px 0;
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
}

.error-title {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
    color: #991b1b;
}

.error-item {
    margin: 6px 0;
    font-size: 13px;
    color: #dc2626;
}

/* Import Progress */
#importProgress {
    text-align: center;
    padding: 40px 20px;
}

#importProgress .fa-spinner {
    color: #10b981;
    font-size: 48px;
    margin-bottom: 16px;
}

#importProgress h4 {
    color: #374151;
    margin: 0 0 8px 0;
    font-size: 18px;
}

#importProgress p {
    color: #6b7280;
    margin: 0;
    font-size: 14px;
}

/* Import Result */
.import-result {
    padding: 32px 24px;
    border-radius: 8px;
    text-align: center;
}

.import-result.success {
    background: #f0fdf4;
    border: 2px solid #86efac;
    color: #166534;
}

.import-result.error {
    background: #fef2f2;
    border: 2px solid #fca5a5;
    color: #dc2626;
}

.import-result i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.import-result.success i {
    color: #10b981;
}

.import-result.error i {
    color: #dc2626;
}

.import-result h4 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
}

.import-result p {
    margin: 6px 0;
    font-size: 14px;
}

/* Button Group */
.btn-group {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.import-section .btn {
    margin-right: 0;
    margin-bottom: 0;
}

/* Mobile Modal Positioning - Removed duplicate */

    .import-section {
        padding: 16px;
        margin-bottom: 20px;
    }

    .import-section h4 {
        font-size: 15px;
        margin-bottom: 12px;
    }

    .table-container {
        overflow-x: auto;
        margin: 12px 0;
    }

    .table-container th,
    .table-container td {
        padding: 6px 4px;
        font-size: 10px;
    }

    .import-section .btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 8px;
    }

    .import-result {
        padding: 24px 16px;
    }

    .import-result h4 {
        font-size: 18px;
    }
}

/* Pagination Buttons */
.page-btn {
    padding: 6px 12px;
    margin: 0 2px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #374151;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 36px;
    text-align: center;
}

.page-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-btn.active {
    background: #10b981;
    border-color: #10b981;
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.page-btn:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 0;
    gap: 4px;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .page-btn {
        padding: 8px 10px;
        font-size: 13px;
        margin: 0 1px;
    }

    .pagination {
        gap: 2px;
        padding: 12px 0;
    }
}

/* Button Base Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    white-space: nowrap;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.2);
}

.btn-outline-success {
    background: transparent;
    color: #10b981;
    border: 2px solid #10b981;
}

.btn-outline-success:hover:not(:disabled) {
    background: #10b981;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.2);
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.2);
}

/* Detail Button */
.btn-detail {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-detail:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

/* Mobile Buttons */
@media (max-width: 768px) {
    .btn {
        padding: 12px 16px;
        font-size: 15px;
    }

    .header-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .header-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 92%;
        max-height: 75vh;
        border-radius: 10px;
        margin: 15px;
    }

    .modal-body {
        padding: 14px;
        max-height: calc(75vh - 120px);
        overflow-y: auto;
    }

    .modal-header {
        padding: 14px;
    }

    .modal-header h3 {
        font-size: 15px;
    }

    .btn {
        padding: 14px 16px;
        font-size: 16px;
    }
}

/* Tab System */
.tab-navigation {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 24px;
    background: #f8fafc;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 16px 20px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    background: #f1f5f9;
    color: #374151;
}

.tab-btn.active {
    background: white;
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    font-weight: 600;
}

.tab-btn i {
    font-size: 16px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Upload Area */
.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #fafafa;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.upload-area.dragover {
    border-color: #3b82f6;
    background: #dbeafe;
    transform: scale(1.02);
}

.upload-content i {
    font-size: 48px;
    color: #6b7280;
    margin-bottom: 16px;
    display: block;
}

.upload-area:hover .upload-content i {
    color: #3b82f6;
}

.upload-area h4 {
    margin: 0 0 8px 0;
    color: #374151;
    font-size: 18px;
    font-weight: 600;
}

.upload-area p {
    margin: 4px 0 16px 0;
    color: #6b7280;
    font-size: 14px;
}

.upload-area .text-muted {
    color: #9ca3af;
    font-size: 12px;
    margin-top: 12px;
    display: block;
}

/* File Info */
.file-info {
    background: #f0f9ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-details {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-details i {
    font-size: 24px;
    color: #10b981;
}

.file-text {
    flex: 1;
}

.file-text strong {
    display: block;
    color: #374151;
    font-weight: 600;
    margin-bottom: 2px;
}

.file-text span {
    color: #6b7280;
    font-size: 13px;
}

/* No File Message */
.no-file-message {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.no-file-message i {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 16px;
    display: block;
}

.no-file-message p {
    margin: 8px 0;
    font-size: 16px;
}

.no-file-message p:first-child {
    font-weight: 600;
    color: #374151;
}

/* Mobile Tab Styles */
@media (max-width: 768px) {
    .tab-navigation {
        flex-direction: column;
        margin-bottom: 16px;
    }

    .tab-btn {
        border-bottom: 1px solid #e5e7eb;
        border-radius: 0;
        padding: 14px 16px;
        justify-content: flex-start;
    }

    .tab-btn.active {
        border-bottom-color: #3b82f6;
        background: white;
    }

    .upload-area {
        padding: 30px 16px;
    }

    .upload-content i {
        font-size: 36px;
    }

    .upload-area h4 {
        font-size: 16px;
    }

    .file-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .no-file-message {
        padding: 40px 16px;
    }

    .no-file-message i {
        font-size: 48px;
    }
}

@media (max-width: 480px) {
    .tab-btn {
        padding: 12px 14px;
        font-size: 13px;
    }

    .tab-btn i {
        font-size: 14px;
    }

    .upload-area {
        padding: 24px 12px;
    }

    .upload-content i {
        font-size: 32px;
    }

    .upload-area h4 {
        font-size: 15px;
    }

    .upload-area p {
        font-size: 13px;
    }
}