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

:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-bg: #eff6ff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --bg: #f8fafc;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text-dark);
    min-height: 100vh;
    line-height: 1.5;
}

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

/* Zona de carga */
.upload-section {
    margin-bottom: 0;
}

.dropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.dropzone:hover,
.dropzone.drag-over {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.dropzone-content {
    pointer-events: none;
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: var(--primary-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-icon i {
    font-size: 1.75rem;
    color: var(--primary);
}

.dropzone-text {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.dropzone-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Sección de archivos */
.files-section {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem 0 0;
}

.section-divider {
    height: 3px;
    background: var(--primary);
    margin-bottom: 1rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.25rem 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-dot {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
}

.section-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.file-count-badge {
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-weight: 500;
}

.header-options {
    position: relative;
}

.options-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
}

.options-btn:hover {
    color: var(--text-dark);
}

.options-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.25rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    z-index: 10;
}

.options-menu.hidden {
    display: none;
}

.options-menu button {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.options-menu button:hover {
    background: var(--bg);
}

/* Lista de archivos */
.files-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.file-item:first-of-type {
    border-top: none;
}

.drag-handle {
    color: var(--text-muted);
    cursor: grab;
    font-size: 1rem;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.file-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.file-status {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

.status-processing {
    background: #fef3c7;
    color: #92400e;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
}

.badge-extract {
    margin-top: 0.25rem;
    display: inline-block;
}

.badge-ok {
    background: #d1fae5;
    color: #065f46;
}

.badge-faltantes {
    background: #fef3c7;
    color: #92400e;
}

.file-step {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-download {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-download:hover {
    background: var(--primary-light);
}

.btn-download:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.hidden {
    display: none !important;
}
