:root {
    --cor-primaria: #22c55e;
    --cor-primaria-hover: #16a34a;
    --cor-secundaria: #64748b;
    --cor-secundaria-hover: #475569;
    --cor-foco: #3b82f6;
    --cor-fundo-pagina: #f8fafc;
    --cor-fundo-container: #ffffff;
    --cor-texto-principal: #1e293b;
    --cor-texto-secundario: #475569;
    --cor-texto-placeholder: #94a3b8;
    --cor-borda: #cbd5e1;
    --cor-obrigatorio: #ef4444;
    --sombra: 0 8px 24px rgba(149, 157, 165, 0.2);
    --raio-borda: 12px;
    --espacamento-padrao: 1rem;
    --familia-fonte: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--familia-fonte);
    background-color: var(--cor-fundo-pagina);
    color: var(--cor-texto-principal);
    display: grid;
    place-items: center;
    min-height: 100vh;
    margin: 0;
    padding: var(--espacamento-padrao);
}


.container {
    width: 100%;
    /* CORRIGIDO: Aumenta a largura para caber 4 colunas */
    max-width: 1300px; 
    background-color: var(--cor-fundo-container);
    padding: calc(var(--espacamento-padrao) * 2.5);
    border-radius: var(--raio-borda);
    box-shadow: var(--sombra);
    position: relative;
    /* Alinhamento do texto interno volta ao padrão (esquerda) */
    text-align: left; 
    margin-top: 80px;
}

.container strong {
    font-size: 1.25rem;
    color: var(--cor-texto-principal);
    display: block;
    margin-bottom: 0.5rem;
}

.container p {
    color: var(--cor-texto-secundario);
    line-height: 1.6;
}

.empreendimento-form {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.empreendimento-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 6px;
    background-color: var(--cor-primaria);
    width: 25%;
    transition: width 0.4s ease-in-out;
}

.form-step {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.form-step.active {
    display: block;
}

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

.form-title {
    font-size: 1.75rem;
    text-align: center;
    margin: 0 0 1.5rem 0;
}

.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cor-texto-secundario);
    margin-bottom: 0.5rem;
}

.required-indicator {
    color: var(--cor-obrigatorio);
    font-weight: bold;
    margin-left: 2px;
}

.form-input, textarea.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    background-color: #f8fafc;
    border: 1px solid var(--cor-borda);
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea.form-input {
    min-height: 80px;
    resize: vertical;
}

.form-input::placeholder { color: var(--cor-texto-placeholder); }

.form-input:focus {
    outline: none;
    border-color: var(--cor-foco);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.novo {
    position: absolute;
    top: -65px;
    right: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    padding: 0 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background-color: var(--cor-primaria);
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.novo:hover {
    background-color: var(--cor-primaria-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.5);
}

.novo:active {
    transform: translateY(0);
}

.form-buttons {
    display: flex;
    justify-content: space-between;
    gap: var(--espacamento-padrao);
    margin-top: 1.5rem;
}

.btn {
    width: 100%;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn:active { transform: scale(0.98); }

.next-btn, .submit-btn {
    background-color: var(--cor-primaria);
    color: white;
}
.next-btn:hover, .submit-btn:hover { background-color: var(--cor-primaria-hover); }

.prev-btn {
    background-color: var(--cor-secundaria);
    color: white;
}
.prev-btn:hover { background-color: var(--cor-secundaria-hover); }

.form-buttons:has(:last-child:first-child) { justify-content: flex-end; }

.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 8px 15px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    z-index: 10;
}

.back-button:hover {
    background-color: #5a6268;
}

.empreendimento-grid {
    display: grid;
    /* CORRIGIDO: Define 4 colunas fixas */
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card h3 {
    margin-top: 0;
    font-size: 1.2em;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.card-actions a, .card-actions button {
    padding: 8px 12px;
    text-decoration: none;
    color: white;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
}

.btn-edit { background-color: #007bff; }
.btn-edit:hover { background-color: #0056b3; }
.btn-delete { background-color: #dc3545; }
.btn-delete:hover { background-color: #c82333; }
.btn-report { background-color: #28a745; }
.btn-report:hover { background-color: #218838; }

.no-empreendimentos {
    text-align: center;
    margin-top: 50px;
    color: #666;
}

/* NOVO / CORRIGIDO: Estilos para a paginação */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 3rem;
    gap: 0.5rem;
}

.pagination a, .pagination span {
    color: var(--cor-secundaria);
    padding: 0.5rem 1rem;
    text-decoration: none;
    border: 1px solid var(--cor-borda);
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
}

.pagination a:hover {
    background-color: var(--cor-fundo-pagina);
    border-color: var(--cor-secundaria);
}

.pagination .active {
    background-color: var(--cor-primaria);
    color: white;
    border-color: var(--cor-primaria);
    font-weight: 600;
}

.pagination .disabled {
    color: var(--cor-borda);
    pointer-events: none;
}

/* --- Barra de Pesquisa --- */
.search-container {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    display: flex;
    gap: 10px;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s;
}

.search-input:focus {
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    border-color: #007bff;
}

/* --- Menu Flutuante de Seleção --- */
.floating-menu {
    position: fixed;
    bottom: -100px; /* Escondido inicialmente */
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: bottom 0.4s ease-in-out;
    z-index: 1000;
}

.floating-menu.active {
    bottom: 30px; /* Aparece quando ativo */
}

.floating-menu span {
    font-weight: bold;
}

.btn-float-action {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.btn-gerar-lote { background-color: #28a745; color: white; }
.btn-gerar-lote:hover { background-color: #218838; }

.btn-cancelar {
    background-color: #dc3545; 
    color: white;
    border-radius: 15%;
}
.btn-cancelar:hover { background-color: #c82333; }

/* Botão Flutuante Inicial (Para ativar o modo seleção) */
.fab-select {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    font-size: 48px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: transform 0.2s;
}

.fab-select:hover { transform: scale(1.1); }
.fab-select.hidden { display: none; }

/* --- Checkboxes nos Cards --- */
.card {
    position: relative; /* Necessário para posicionar o checkbox */
    transition: transform 0.2s, border 0.2s;
}

.card-checkbox {
    display: none; /* Escondido por padrão */
    position: absolute;
    top: 15px;
    right: 15px;
    width: 25px;
    height: 25px;
    cursor: pointer;
    z-index: 10;
}

/* Quando o modo de seleção está ativo */
.selection-mode .card-checkbox {
    display: block;
}

.selection-mode .card:hover {
    border: 2px solid #007bff;
}

/* Estilo para card selecionado visualmente */
.card.selected {
    background-color: #f0f8ff;
    border: 2px solid #007bff;
}

/* --- Botão de Configurações (Topo Esquerdo) --- */
.settings-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
}

.btn-settings {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.btn-settings:hover { transform: rotate(45deg); }

.settings-menu {
    display: none; /* Escondido por padrão */
    position: absolute;
    top: 50px;
    left: 0;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    width: 250px;
    border: 1px solid #eee;
}

.settings-menu.active { display: block; }

.settings-option {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

/* --- Modal de Progresso --- */
.modal-overlay {
    display: none; /* Escondido */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.progress-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
    border: 1px solid #eee;
    border-radius: 4px;
}

.progress-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-icon { font-weight: bold; }
.status-pending { color: #888; }
.status-loading { color: #007bff; }
.status-success { color: #28a745; }
.status-error { color: #dc3545; }

.modal-warning {
    color: #dc3545;
    font-size: 0.9em;
    margin-top: 10px;
    font-weight: bold;
}

/* --- Barra de Pesquisa --- */
.search-container {
    width: 100%; max-width: 600px; margin: 20px auto; display: flex; gap: 10px;
}
.search-input {
    width: 100%; padding: 12px 20px; font-size: 16px; border: 1px solid #ddd;
    border-radius: 25px; outline: none; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.search-input:focus { border-color: #007bff; box-shadow: 0 4px 10px rgba(0,0,0,0.15); }

/* --- Menu Flutuante --- */
.floating-menu {
    position: fixed; bottom: -100px; left: 50%; transform: translateX(-50%);
    background-color: #333; color: white; padding: 15px 30px; border-radius: 50px;
    display: flex; align-items: center; gap: 20px; z-index: 1000; transition: bottom 0.4s;
}
.floating-menu.active { bottom: 30px; }
.btn-float-action { padding: 8px 16px; border: none; border-radius: 20px; cursor: pointer; font-weight: bold; }
.btn-gerar-lote { background-color: #28a745; color: white; }
.btn-cancelar { background-color: #dc3545; color: white; }

/* FAB (Botão Redondo) */
.fab-select {
    position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px;
    border-radius: 50%; background-color: #007bff; color: white; font-size: 24px;
    border: none; cursor: pointer; z-index: 999; display: flex; justify-content: center; align-items: center;
}
.fab-select.hidden { display: none; }

/* --- Cards e Seleção --- */
.empreendimento-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }
.card {
    position: relative; transition: transform 0.2s, border 0.2s;
    /* Ajuste aqui largura do seu card conforme preferir */
    width: 300px; border: 1px solid #ddd; padding: 15px; border-radius: 8px; background: #fff;
}
.card-checkbox {
    display: none; position: absolute; top: 15px; right: 15px; width: 20px; height: 20px; z-index: 10;
}
.selection-mode .card-checkbox { display: block; }
.selection-mode .card:hover { border-color: #007bff; }
.card.selected { background-color: #f0f8ff; border: 2px solid #007bff; }

/* --- Configurações (Topo Esquerdo) --- */
.settings-container { position: fixed; top: 20px; left: 20px; z-index: 1001; }
.btn-settings {
    background: #fff; border: 1px solid #ddd; border-radius: 50%; width: 40px; height: 40px;
    cursor: pointer; font-size: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.settings-menu {
    display: none; position: absolute; top: 50px; left: 0; background: white;
    padding: 15px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); width: 250px;
}
.settings-menu.active { display: block; }

/* --- Modal de Progresso --- */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); z-index: 2000; justify-content: center; align-items: center;
}
.modal-content {
    background: white; padding: 25px; border-radius: 12px; width: 90%; max-width: 400px;
    text-align: center;
}
.progress-list { list-style: none; padding: 0; margin: 20px 0; max-height: 200px; overflow-y: auto; text-align: left; }
.progress-item { padding: 10px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; }
.status-loading { animation: spin 1s infinite linear; display: inline-block; }
@keyframes spin { 100% { transform: rotate(360deg); } }
.modal-warning { color: #dc3545; font-size: 0.9em; margin-top: 10px; font-weight: bold; }

/* Cores para os SVGs (usando fill="currentColor") */
.status-pending { color: #6c757d; } /* Cinza */
.status-loading { color: #007bff; } /* Azul */
.status-success { color: #28a745; } /* Verde */
.status-error { color: #dc3545; }   /* Vermelho */

/* Animação de rotação para o ícone de Loading */
.status-loading svg {
    animation: spin 1s infinite linear;
}

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

/* Alinhamento vertical do ícone SVG com o texto */
.progress-item {
    display: flex;
    align-items: center; /* Centraliza verticalmente */
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

/* Garante que o SVG não fique gigante ou muito pequeno */
.status-icon svg {
    display: block;
}