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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f0f2f5;
}

/* ===== LOGIN ===== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    width: 350px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-box h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 24px;
}

.login-box p {
    color: #666;
    margin-bottom: 25px;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.login-box input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.login-box button:hover {
    transform: scale(1.02);
}

#mensagemLogin {
    margin-top: 10px;
    font-weight: bold;
}

/* ===== CONTAINER PRINCIPAL ===== */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

/* ===== CABEÇALHO ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.header h1 {
    font-size: 24px;
    color: #333;
    letter-spacing: 2px;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.btn-copy {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-copy:hover {
    transform: scale(1.05);
}

.btn-sair {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-sair:hover {
    transform: scale(1.05);
}

/* ===== FORMULÁRIO ===== */
.form-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.form-group label {
    font-size: 13px;
    font-weight: bold;
    min-width: 130px;
    color: #333;
}

.date-input {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    width: 150px;
    font-size: 14px;
    transition: all 0.3s;
}

.date-input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.registro-input {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    width: 200px;
    font-size: 14px;
    transition: all 0.3s;
}

.registro-input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-gerar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 25px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-gerar:hover {
    transform: scale(1.05);
}

/* ===== RESULTADO ===== */
.result-section {
    margin: 15px 0;
    padding: 12px 20px;
    background: #fff3cd;
    border-radius: 8px;
    min-height: 45px;
    display: flex;
    align-items: center;
    border: 2px solid #ffc107;
}

.resultado {
    font-size: 16px;
    font-family: 'Courier New', monospace;
    color: #333;
    word-break: break-all;
    flex: 1;
    font-weight: bold;
}

/* ===== FILTROS ===== */
.filter-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 15px 0;
    border-top: 2px solid #f0f0f0;
    border-bottom: 2px solid #f0f0f0;
    margin: 15px 0;
}

.filter-section label {
    font-size: 13px;
    font-weight: bold;
    color: #333;
}

.busca-input {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    width: 200px;
    font-size: 14px;
    transition: all 0.3s;
}

.busca-input:focus {
    border-color: #667eea;
    outline: none;
}

.date-filter {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    width: 150px;
    font-size: 14px;
    transition: all 0.3s;
}

.date-filter:focus {
    border-color: #667eea;
    outline: none;
}

.filter-select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
}

.btn-ok {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 25px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-ok:hover {
    transform: scale(1.05);
}

.btn-buscar-email {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-buscar-email:hover {
    transform: scale(1.05);
}

.btn-buscar-email:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.btn-atualizar {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-atualizar:hover {
    transform: scale(1.05);
}

.contador {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
    min-width: 30px;
    text-align: center;
}

.btn-excluir {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-excluir:hover {
    transform: scale(1.05);
}

.btn-excluir:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* ===== TABELA ===== */
.table-container {
    overflow-x: auto;
    margin-top: 15px;
    max-height: 420px;
    overflow-y: auto;
    border: 2px solid #f0f0f0;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    padding: 12px 8px;
    text-align: left;
    color: white;
    font-weight: bold;
    white-space: nowrap;
}

td {
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

tr:hover {
    background: #f8f9fa;
}

tr.selecionado {
    background: #e3f2fd !important;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 35px;
    border-radius: 15px;
    width: 450px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 20px;
}

#statusMensagem {
    margin: 15px 0;
    color: #555;
    min-height: 40px;
    font-size: 15px;
}

#statusDetalhe {
    font-size: 13px;
    color: #888;
    margin: 5px 0 15px 0;
}

.progress-bar {
    width: 100%;
    height: 25px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.5s ease;
    border-radius: 12px;
}

.btn-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 35px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 14px;
    transition: transform 0.2s;
}

.btn-modal:hover {
    transform: scale(1.05);
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin: 10px;
    }
    
    .form-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-group label {
        min-width: auto;
    }
    
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-input, .registro-input, .busca-input, .date-filter {
        width: 100%;
    }
    
    .header {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        padding: 25px;
    }
    
    .filter-section {
        gap: 8px;
    }
}

/* Scrollbar */
.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}