/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
    color: #334155;
    line-height: 1.6;
}

/* Layout */
.screen {
    display: none;
    min-height: 100vh;
    padding: 1.5rem;
}

.screen.active {
    display: block;
}

.container {
    max-width: 1024px;
    margin: 0 auto;
}

.container-full {
    max-width: 1400px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: white;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
    border-radius: 4px;
}

.icon-large {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.header p {
    color: rgb(187 247 208);
    font-size: 0.875rem;
}

/* Botões */
.btn-primary, .btn-secondary, .btn-batch, .file-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn-primary {
    background: #16a34a;
    color: white;
}

.btn-primary:hover {
    background: #15803d;
}

.btn-secondary {
    background: #166534;
    color: white;
}

.btn-secondary:hover {
    background: #14532d;
}

.btn-batch {
    background: #2563eb;
    color: white;
}

.btn-batch:hover {
    background: #1d4ed8;
}

.btn-primary svg, .btn-secondary svg, .btn-batch svg {
    width: 1rem;
    height: 1rem;
}

/* Upload Screen */
.upload-content {
    padding: 3rem;
    text-align: center;
}

.upload-area {
    max-width: 600px;
    margin: 0 auto;
}

.upload-icon {
    width: 4rem;
    height: 4rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

.upload-area h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

.upload-area > p {
    color: #64748b;
    margin-bottom: 2rem;
}

.drop-area {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 3rem 2rem;
    transition: border-color 0.2s;
    margin-bottom: 2rem;
}

.drop-area:hover {
    border-color: #16a34a;
}

.drop-area.dragover {
    border-color: #16a34a;
    background: #f0fdf4;
}

.file-input {
    display: none;
}

.file-label {
    background: #16a34a;
    color: white;
    margin-bottom: 1rem;
}

.file-label:hover {
    background: #15803d;
}

.file-label.loading {
    opacity: 0.5;
    cursor: not-allowed;
}

.file-label svg {
    width: 1.25rem;
    height: 1.25rem;
}

.drop-text {
    font-size: 0.875rem;
    color: #64748b;
}

.loading-indicator {
    display: none;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    margin: 1.5rem 0;
    color: #64748b;
}

.loading-indicator.show {
    display: flex;
}

.spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #e2e8f0;
    border-top-color: #16a34a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-message {
    display: none;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
}

.error-message.show {
    display: flex;
}

.error-message svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.instructions {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: left;
    margin-top: 2rem;
}

.instructions h3 {
    color: #1e40af;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.instructions ul {
    list-style: none;
    color: #1e40af;
}

.instructions li {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.blue { color: #2563eb; }
.stat-icon.green { color: #16a34a; }
.stat-icon.purple { color: #9333ea; }

.stat-card p {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.stat-card span {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

.left-panel, .right-panel {
    display: flex;
    flex-direction: column;
}

.left-panel h2, .right-panel h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

/* Search */
.search-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: #9ca3af;
}

#searchInput {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

#searchInput:focus {
    outline: none;
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgb(22 163 74 / 0.1);
}

/* Lista de Funcionários */
.funcionarios-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.funcionario-item {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background-color 0.2s;
}

.funcionario-item:last-child {
    border-bottom: none;
}

.funcionario-item:hover {
    background: #f9fafb;
}

.funcionario-item.selected {
    background: #f0fdf4;
    border-left: 4px solid #16a34a;
}

.funcionario-nome {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.funcionario-info {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.funcionario-valor {
    font-size: 0.875rem;
    font-weight: 600;
    color: #16a34a;
}

/* Preview */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.recibo-preview {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    min-height: 400px;
    position: relative;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #64748b;
}

.empty-state svg {
    width: 3rem;
    height: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.recibo-content {
    padding: 1.5rem;
    background: #f9fafb;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    white-space: pre-line;
    max-height: 400px;
    overflow-y: auto;
}

/* Batch Actions */
.batch-actions {
    background: #f8fafc;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e2e8f0;
}

.batch-actions h3 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

.batch-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.batch-info {
    font-size: 0.875rem;
    color: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .preview-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .batch-buttons {
        flex-direction: column;
    }
}

/* Scrollbar personalizada */
.funcionarios-list::-webkit-scrollbar,
.recibo-content::-webkit-scrollbar {
    width: 8px;
}

.funcionarios-list::-webkit-scrollbar-track,
.recibo-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.funcionarios-list::-webkit-scrollbar-thumb,
.recibo-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.funcionarios-list::-webkit-scrollbar-thumb:hover,
.recibo-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}