/* Reset e Variáveis */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* Header */
.header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: var(--radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.header h1 i {
    margin-right: 15px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 400;
}

/* Sections */
.section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-md);
}

.section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section h2 i {
    color: var(--primary-color);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group label i {
    margin-right: 5px;
    color: var(--primary-color);
}

.required {
    color: var(--error-color);
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.help-text {
    display: block;
    margin-top: 6px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.help-text i {
    margin-right: 4px;
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 50px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-color);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.upload-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.upload-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.upload-subtext {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: var(--bg-color);
    border-radius: var(--radius);
    margin-top: 15px;
}

.file-info i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--radius);
    transition: all 0.2s;
    margin-left: auto;
}

.btn-icon:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

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

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

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-link {
    background: transparent;
    color: var(--primary-color);
    padding: 8px 16px;
}

.btn-link:hover {
    background: rgba(37, 99, 235, 0.1);
}

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

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

/* Info Box */
.info-box {
    background: rgba(37, 99, 235, 0.05);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    border-radius: var(--radius);
    margin-top: 20px;
}

.info-box h4 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.info-box ul {
    margin: 15px 0;
    padding-left: 25px;
}

.info-box li {
    margin-bottom: 8px;
}

/* Warning Box */
.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border: 2px solid var(--warning-color);
    padding: 15px;
    border-radius: var(--radius);
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #92400e;
}

.warning-box i {
    color: var(--warning-color);
    font-size: 1.2rem;
}

/* Tables */
.table-container,
.results-table-container {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

thead {
    background: var(--bg-color);
}

th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background: var(--bg-color);
}

.row-approved {
    background: rgba(16, 185, 129, 0.03);
}

.row-declined {
    background: rgba(239, 68, 68, 0.03);
}

.row-error {
    background: rgba(245, 158, 11, 0.03);
}

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.stat-card.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.stat-card.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.stat-card.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.stat-card i {
    font-size: 2.5rem;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
}

.status-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.status-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.status-approved {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
    font-weight: 600;
}

.status-declined {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error-color);
    font-weight: 600;
}

/* Actions */
.actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Link Cell */
.link-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-text {
    color: var(--primary-color);
    text-decoration: none;
}

.link-text:hover {
    text-decoration: underline;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-progress {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 10px;
}

.loading-subtext {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 5px;
    font-style: italic;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .section {
        padding: 20px;
    }
    
    .upload-area {
        padding: 30px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 8px;
    }
}
