/* 1. RESET E BASE */
* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
}

body { 
    margin: 0; 
    padding: 0; 
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif; 
    background-color: #f1f5f9; 
    color: #1e293b; 
    line-height: 1.6;
}

.app-container { 
    max-width: 600px; 
    margin: 0 auto; 
    padding: 20px 15px; 
}

/* 2. HEADER */
.header { 
    background: linear-gradient(135deg, #2563eb, #1e40af); 
    padding: 40px 20px; 
    border-radius: 24px; 
    text-align: center; 
    color: white; 
    margin-bottom: 25px; 
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.3);
}

#logo-empresa { 
    width: 90px; height: 90px; border-radius: 50%; object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.2); margin-bottom: 15px; background: white;
}

#nome-empresa { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }

#nome-atendente { 
    margin-top: 5px; font-size: 14px; font-weight: 500;
    background: rgba(255, 255, 255, 0.15); display: inline-block;
    padding: 4px 12px; border-radius: 20px;
}

/* 3. CARDS E GRUPOS */
.card, .grupo-modelagem { 
    background: white; border-radius: 20px; padding: 24px; 
    margin-bottom: 24px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.card h2 { 
    margin-top: 0; font-size: 15px; color: #64748b; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid #f1f5f9; 
    padding-bottom: 12px; margin-bottom: 20px;
}

/* 4. CONFIGURAÇÃO DE GRIDS E ALINHAMENTOS */
.grid-campos {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
}

.header-modelagem {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.row-modelagem {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 5. FORMULÁRIO, INPUTS E SELECT PROFISSIONAL */
.campo { margin-bottom: 20px; }
.campo label, .label-modelagem { 
    display: block; 
    font-size: 14px; 
    font-weight: 600; 
    margin-bottom: 8px; 
    color: #475569; 
}

input, textarea, select { 
    width: 100%; padding: 14px; border: 1.5px solid #e2e8f0; 
    border-radius: 12px; font-size: 16px; outline: none; transition: all 0.2s ease;
    background-color: #f8fafc; color: #1e293b; 
}

input:focus, textarea:focus, select:focus { 
    border-color: #3b82f6; 
    background-color: #ffffff; 
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); 
}

/* Estilo específico para o SELECT moderno */
select.i-mod-nome {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 40px;
    font-weight: 600;
    cursor: pointer;
}

/* Campo Manual "Outra" */
.i-mod-manual {
    margin-top: 10px;
    border: 1.5px dashed #3b82f6;
    background-color: #eff6ff;
    animation: fadeIn 0.3s ease-out;
}

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

/* 6. TABELA E SCROLL */
.tabela-wrapper { 
    overflow-x: auto; margin-bottom: 15px; -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth; border-radius: 12px; border: 1px solid #f1f5f9;
}

table { width: 100%; border-collapse: collapse; min-width: 550px; }
th { background: #f8fafc; text-align: left; font-size: 11px; color: #64748b; padding: 12px 8px; text-transform: uppercase; font-weight: 700; }
td { padding: 8px 5px; }
td input { padding: 10px; height: 42px; font-size: 14px; border-width: 1px; }

/* 7. BOTÕES */
button { 
    border: none; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    font-family: inherit; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

/* Botão de Adicionar Nova Modelagem (Verde Secundário) */
.btn-sec { 
    width: 100%; 
    background: #02a834;      /* Verde Esmeralda */
    color: #ffffff;           /* Texto Branco */
    padding: 16px; 
    border-radius: 12px; 
    font-weight: 700; 
    font-size: 15px;
    border: 2px solid #b4b4b4; /* Borda Verde Escura */
    margin-bottom: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-sec:hover {
    background: #0d9488;      /* Escurece levemente o verde ao passar o mouse */
    transform: translateY(-2px); 
}

/* Botão de Adicionar Item (Dentro da tabela - Azul Suave) */
.btn-add-item {
    background: #eff6ff; 
    color: #2563eb; 
    padding: 14px; 
    border-radius: 12px;
    font-weight: 700; 
    font-size: 14px; 
    width: 100%; 
    margin-top: 10px; 
    border: 2px dashed #bfdbfe;
}

.btn-add-item:hover {
    background: #dbeafe;
    border-color: #3b82f6;
}

/* Botão Principal (Verde Vibrante - Finalizar) */
.btn-main { 
    width: 100%; 
    background: #02b419;      /* Verde limão vibrante */
    color: #ffffff;           /* Texto em verde muito escuro para contraste */
    padding: 20px; 
    border-radius: 16px; 
    font-size: 18px; 
    font-weight: 800; 
    margin-top: 15px;
    text-transform: uppercase;
    box-shadow: 0 10px 20px -5px rgba(0, 241, 32, 0.4);
}

.btn-main:hover {
    background: #00d81c;      /* Brilho ajustado */
    transform: scale(1.01);   /* Leve pulsação */
}

/* Botões de Excluir (Vermelho Suave) */
.btn-del-header, .btn-del { 
    background: #fee2e2; 
    color: #ef4444; 
    border-radius: 12px; 
    width: 48px; 
    height: 48px; 
    flex-shrink: 0;
    font-size: 18px;
    font-weight: bold;
}

.btn-del-header:hover, .btn-del:hover {
    background: #fecaca;
    color: #dc2626;
}
/* 8. SUCESSO E RESPONSIVIDADE */
.icone-sucesso { font-size: 64px; margin-bottom: 15px; }

@media (max-width: 480px) {
    .app-container { padding: 10px; }
    .card, .grupo-modelagem { padding: 18px; }
    .header { padding: 30px 15px; border-radius: 0 0 24px 24px; margin: -10px -10px 20px -10px; }
    .grid-campos { grid-template-columns: 1fr; gap: 0; }
}
/* Muda a cor dos textos de exemplo (placeholders) em todos os campos */
input::placeholder, 
textarea::placeholder {
    color: #d1d4d6; /* Cor cinza suave (você pode trocar pelo código que desejar) */
    opacity: 1;    /* Garante que a cor apareça com clareza no Firefox */
}

/* Caso queira mudar especificamente os exemplos da tabela */
td input::placeholder {
    color: #d0d3d6;
    font-size: 13px;
}
/* Efeito de girar no botão enquanto envia */
.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #ffffff;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s linear infinite;
    margin-right: 8px;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* --- NOVA JANELA DE CONFERÊNCIA (CSS EXCLUSIVO) --- */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.85);
    display: none;
    align-items: center; justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
    animation: fadeInOverlay 0.3s ease-out;
}

.modal-content {
    background: white;
    width: 95%;
    max-width: 500px; 
    border-radius: 24px;
    padding: 18px; 
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    border: 1px solid #f1f5f9;
    max-height: 92vh;
    overflow-y: auto;
    display: flex; 
    flex-direction: column;
}

.modal-header h3 {
    color: #1e40af;
    font-size: 19px; 
    font-weight: 800;
    margin-bottom: 12px; 
    text-align: center;
}

.resumo-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 10px; 
    border: 1px dotted #e2e8f0;
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
}

.tabela-resumo-wrapper {
    width: 100%;
    overflow-x: hidden; /* Evita que a tabela dance para os lados */
    margin-bottom: 8px;
}

.resumo-tabela {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Crucial para as larguras abaixo funcionarem */
}

.resumo-tabela th {
    padding: 8px 2px;
    border-bottom: 2px solid #f1f5f9;
    font-size: 10.5px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    white-space: nowrap; 
    letter-spacing: 0.2px;
}

.resumo-tabela td {
    padding: 10px 2px; /* Aumentei levemente para melhor leitura */
    border-bottom: 1px solid #f8fafc;
    font-size: 12.5px;
    word-wrap: break-word;
    vertical-align: middle;
}

/* --- SOLUÇÃO DO VAZIO: LARGURAS RÍGIDAS --- */

/* 1. QTD: Fixo e estreito */
.resumo-tabela th:nth-child(1), 
.resumo-tabela td:nth-child(1) { width: 35px; text-align: center; }

/* 2. ITEM: Largura maior, mas controlada para não empurrar os outros para longe */
.resumo-tabela th:nth-child(2), 
.resumo-tabela td:nth-child(2) { width: 160px; text-align: left; padding-left: 5px; }

/* 3. Nº: Puxado para perto do item */
.resumo-tabela th:nth-child(3), 
.resumo-tabela td:nth-child(3) { width: 40px; text-align: center; }

/* 4. ADICIONAL: Ocupa o restante sem criar buracos */
.resumo-tabela th:nth-child(4), 
.resumo-tabela td:nth-child(4) { width: auto; text-align: left; padding-left: 10px; }

/* --- COMPONENTES VISUAIS --- */

.resumo-tabela td strong {
    font-size: 12.5px;
    color: #1e293b;
    text-transform: uppercase;
}

.badge-tamanho {
    background: #f1f5f9;
    color: #1e40af !important;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 12px;
    margin-left: 3px;
    display: inline-block;
    border: 1px solid #dbeafe;
}

.badge-qtd {
    background: #f8fafc;
    color: #475569;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 10px;
    border: 1px solid #e2e8f0;
    margin: 0 auto;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.btn-main-green {
    background: #22c55e;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.25);
}

/* Localize esta classe no seu CSS */
.btn-edit-gray {
    background: #22c55e; /* <--- MUDE AQUI A COR DE FUNDO (Ex: #ff0000 para vermelho) */
    color: #ffffff;      /* <--- MUDE AQUI A COR DO TEXTO */
    border: 1px solid #00df77;
    padding: 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer; /* Adicione isso para aparecer a mãozinha ao passar o mouse */
}

.vazio-tab { color: #cbd5e1; font-weight: normal; }

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}
