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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #475569;
    --accent: #3b82f6;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Navigation Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--surface);
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.tab {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab:hover {
    color: var(--text);
    background: var(--surface-light);
}

.tab.active {
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.tab.active[data-tab="sejo"] {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.tab.active[data-tab="ramirent"] {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.tab.active[data-tab="cramo"] {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.tab.active[data-tab="renta"] {
    background: linear-gradient(135deg, #10b981, #059669);
}

/* Upload Section */
.upload-section {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--surface-light);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.drop-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.drop-zone p {
    color: var(--text-muted);
}

.file-label {
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
}

.file-label:hover {
    color: var(--primary-dark);
}

/* File List */
.file-list {
    margin: 1.5rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.file-item {
    background: var(--surface-light);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-item .remove {
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.file-item .remove:hover {
    color: #ef4444;
}

/* Buttons */
.btn-extract {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-extract:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

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

/* Progress */
.progress-section {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    text-align: center;
}

.progress-bar {
    height: 8px;
    background: var(--surface-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    width: 0%;
    transition: width 0.3s ease;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

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

/* Results */
.results-section {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-header h2 {
    font-size: 1.5rem;
}

.metrics {
    display: flex;
    gap: 2rem;
}

.metric {
    text-align: center;
}

.metric-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Table */
.table-container {
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

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

th,
td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--surface-light);
    font-weight: 600;
    color: var(--text);
    position: sticky;
    top: 0;
}

tr:hover {
    background: var(--surface-light);
}

/* Drag and Drop */
tr.draggable {
    cursor: grab;
}

tr.draggable:active {
    cursor: grabbing;
}

tr.dragging {
    opacity: 0.5;
    background: var(--primary) !important;
}

tr.drag-over {
    border-top: 3px solid var(--primary);
}

.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    padding-right: 0.5rem;
    user-select: none;
}

/* Download Buttons */
.download-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-download {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--success);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

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

.btn-secondary:hover {
    box-shadow: 0 5px 15px rgba(100, 116, 139, 0.3);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .results-header {
        flex-direction: column;
        text-align: center;
    }

    .metrics {
        justify-content: center;
    }
}