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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #333;
}

/* Login Styles */
#login-form {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    background: #ffffff !important;
    z-index: 1000 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#login-form.hidden {
    display: none !important;
}

.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ffffff;
    z-index: 1000;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    width: 400px;
    max-width: 90vw;
    text-align: center;
    margin: 0;
}

.login-card h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #495057;
}

.login-card h2 {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #6c757d;
}

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

.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus {
    outline: none;
    border-color: #007bff;
}

.logout-btn {
    position: absolute;
    top: 20px;
    right: 20px;
}

.error {
    color: #dc3545;
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
}

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

header {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    color: #495057;
}

header p {
    font-size: 1rem;
    color: #6c757d;
}

.tabs {
    display: flex;
    margin-bottom: 15px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.tab-button {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #495057;
}

.tab-button:hover {
    background: #f8f9fa;
}

.tab-button.active {
    background: #007bff;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}
.templates-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.template-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
}
.template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.template-items {
    margin-top: 8px;
}
.template-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px dashed #eee;
}
.template-actions button {
    margin-left: 8px;
}
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-active {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.warning {
    color: #b36b00;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.card h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

.contract-type-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.contract-type-selector label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
}

.contract-type-selector input[type="radio"] {
    width: 16px;
    height: 16px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: #007bff;
}

.example-data {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.example-data h3 {
    margin-bottom: 12px;
    color: #555;
    font-size: 1.1rem;
}

.example-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.example-buttons button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.example-buttons button:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: normal;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-outline-secondary {
    background: transparent;
    color: #6c757d;
    border: 1px solid #6c757d;
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-outline-secondary:hover {
    background: rgba(108,117,125,0.1);
}

.btn-success {
    background: #28a745;
    color: white;
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-danger:hover {
    background: #c82333;
}

.result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    display: none;
}

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

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

.filters {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.filter-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.filter-group input,
.filter-group select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
}

.jobs-list {
    display: grid;
    gap: 12px;
}

.job-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.job-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

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

.job-id {
    font-family: monospace;
    font-weight: bold;
    color: #007bff;
    font-size: 0.9rem;
}

.job-status {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-processing {
    background: #fff3cd;
    color: #856404;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.status-converting {
    background: #d1ecf1;
    color: #0c5460;
}

.job-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.job-detail {
    font-size: 0.8rem;
}

.job-detail strong {
    color: #555;
}

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

.loading {
    text-align: center;
    padding: 30px;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: #666;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 0.9rem;
    border: 1px solid #f5c6cb;
}

/* Pagination styles */
.pagination-container {
    margin-top: 15px;
    padding: 15px 0;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.pagination-info {
    color: #666;
    font-size: 13px;
    text-align: center;
}

.pagination {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    padding: 6px 10px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s;
    min-width: 36px;
    text-align: center;
}

.pagination-btn:hover {
    background: #f5f5f5;
    border-color: #007bff;
}

.pagination-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-dots {
    padding: 6px 4px;
    color: #666;
}

.pagination-size {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.pagination-size select {
    padding: 3px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 13px;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .contract-type-selector {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-group {
        grid-template-columns: 1fr;
    }
    
    .job-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .job-actions {
        justify-content: flex-start;
    }
    
    .pagination-container {
        padding: 15px 0;
    }
    
    .pagination {
        gap: 3px;
    }
    
    .pagination-btn {
        padding: 6px 8px;
        font-size: 12px;
        min-width: 32px;
    }
    
    .pagination-size {
        font-size: 12px;
    }
    
    .pagination-size select {
        font-size: 12px;
        padding: 2px 4px;
    }
}