* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f4f5f7;
    color: #1f2430;
    font-size: 15px;
    line-height: 1.5;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1f2430;
    color: #fff;
    padding: 12px 24px;
}
.navbar-brand { font-weight: 700; font-size: 17px; }
.navbar-links { display: flex; gap: 20px; }
.navbar-links a { color: #cbd2e1; }
.navbar-links a:hover { color: #fff; text-decoration: none; }
.navbar-user { display: flex; align-items: center; gap: 16px; color: #cbd2e1; }
.navbar-user a { color: #cbd2e1; }

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 24px;
}

/* Login */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #1f2430;
}
.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    width: 320px;
    text-align: center;
}
.login-box h1 { margin-bottom: 4px; }
.login-subtitulo { color: #6b7280; margin: 0 0 24px; font-size: 13px; }
.login-box label { display: block; text-align: left; font-size: 13px; margin: 12px 0 4px; color: #4b5563; }
.login-box input {
    width: 100%; padding: 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px;
}
.login-box button {
    width: 100%; margin-top: 20px; padding: 10px; border: none; border-radius: 6px;
    background: #2563eb; color: #fff; font-weight: 600; cursor: pointer; font-size: 14px;
}
.login-box button:hover { background: #1d4ed8; }

/* Cards genéricos */
.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

/* Formulários */
.form-linha { display: flex; gap: 16px; flex-wrap: wrap; }
.form-campo { flex: 1; min-width: 180px; margin-bottom: 14px; }
.form-campo-estreito { max-width: 110px; }
label { display: block; font-size: 13px; color: #4b5563; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
    width: 100%; padding: 9px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px;
    font-family: inherit;
}
textarea { resize: vertical; }
button, .botao {
    display: inline-block;
    background: #2563eb; color: #fff; border: none; border-radius: 6px;
    padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
}
button:hover, .botao:hover { background: #1d4ed8; text-decoration: none; color: #fff; }
.botao-destaque { background: #16a34a; margin-top: 12px; }
.botao-destaque:hover { background: #15803d; }
.botao-remover { background: #ef4444; padding: 4px 8px; font-size: 12px; }
.botao-remover:hover { background: #dc2626; }

.alerta-erro { background: #fee2e2; color: #991b1b; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.alerta-sucesso { background: #dcfce7; color: #166534; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }

.link-voltar { display: inline-block; margin-bottom: 16px; font-size: 14px; }
.dica { font-size: 12px; color: #6b7280; margin: 10px 0 6px; }

/* Kanban */
.kanban-board {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 12px;
    align-items: flex-start;
}
.kanban-coluna {
    background: #ebedf1;
    border-radius: 8px;
    min-width: 250px;
    max-width: 250px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 160px);
}
.kanban-coluna-titulo {
    font-weight: 600;
    font-size: 13px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.kanban-contador {
    background: #d1d5db;
    color: #374151;
    border-radius: 10px;
    padding: 0 8px;
    font-size: 12px;
}
.kanban-cards {
    padding: 0 10px 10px;
    overflow-y: auto;
    flex: 1;
    min-height: 60px;
}
.kanban-cards-alvo { background: #e0e7ff; border-radius: 6px; }
.kanban-vazio {
    font-size: 12px; color: #9ca3af; text-align: center; padding: 20px 8px;
    border: 1px dashed #d1d5db; border-radius: 6px;
}
.kanban-card {
    display: block;
    background: #fff;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    color: #1f2430;
    cursor: grab;
}
.kanban-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.12); text-decoration: none; }
.kanban-card.arrastando { opacity: 0.4; }
.kanban-card-atrasado { border-left: 3px solid #ef4444; }
.kanban-card-print { width: 100%; height: 80px; object-fit: cover; border-radius: 4px; margin-bottom: 6px; }
.kanban-card-nome { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.kanban-card-vendedor { font-size: 12px; color: #6b7280; }
.kanban-card-dias { font-size: 11px; color: #9ca3af; margin-top: 4px; }

/* Ficha do lead */
.lead-topo { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.lead-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .lead-grid { grid-template-columns: 1fr; } }

.badge {
    display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
    background: #e5e7eb; color: #374151;
}
.badge-novo, .badge-repassado { background: #dbeafe; color: #1e40af; }
.badge-em_atendimento, .badge-aguardando_orcamento { background: #fef3c7; color: #92400e; }
.badge-orcamento_finalizado, .badge-enviado_cliente { background: #ede9fe; color: #5b21b6; }
.badge-fechado_ganho { background: #dcfce7; color: #166534; }
.badge-standby { background: #ffedd5; color: #9a3412; }
.badge-perdido { background: #fee2e2; color: #991b1b; }

.prints-galeria { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.print-thumb { display: block; width: 110px; height: 110px; border-radius: 6px; overflow: hidden; border: 1px solid #e5e7eb; }
.print-thumb img { width: 100%; height: 100%; object-fit: cover; }
.form-upload-print { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.form-upload-print input[type=text] { flex: 1; min-width: 140px; }
.area-colar {
    border: 2px dashed #d1d5db; border-radius: 6px; padding: 24px; text-align: center;
    color: #6b7280; font-size: 13px; cursor: text;
}
.area-colar:focus { outline: none; border-color: #2563eb; color: #2563eb; }

.tabela-itens { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.tabela-itens th, .tabela-itens td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e5e7eb; font-size: 13px; }
.tabela-itens th { color: #6b7280; font-weight: 600; font-size: 12px; text-transform: uppercase; }
.valor-total-destaque { font-size: 15px; margin-top: 10px; }

.timeline { list-style: none; padding: 0; margin: 12px 0 0; }
.timeline li { padding: 8px 0; border-bottom: 1px solid #f0f1f3; font-size: 13px; }
.timeline-data { color: #9ca3af; font-size: 11px; display: block; }
.timeline-usuario { font-weight: 600; margin-right: 4px; }
.form-nota textarea { margin-bottom: 8px; }

.lista-orcamentos, .lista-standby { display: flex; flex-direction: column; gap: 10px; }
.orcamento-anterior-card { margin-bottom: 0; }
.lead-standby-card { display: flex; flex-direction: column; gap: 2px; color: #1f2430; }
.lead-standby-card.atrasado { border-left: 3px solid #ef4444; }
.tag-atrasado { color: #991b1b; font-weight: 600; font-size: 12px; }

/* Abas Quadro/Lista */
.view-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid #e5e7eb; }
.view-tab {
    padding: 8px 16px; font-size: 14px; font-weight: 600; color: #6b7280;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.view-tab:hover { color: #1f2430; text-decoration: none; }
.view-tab-ativa { color: #2563eb; border-bottom-color: #2563eb; }

/* Lista de leads */
.tabela-lista { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
.tabela-lista th, .tabela-lista td { text-align: left; padding: 12px 16px; border-bottom: 1px solid #f0f1f3; font-size: 14px; }
.tabela-lista th { color: #6b7280; font-weight: 600; font-size: 12px; text-transform: uppercase; user-select: none; }
.tabela-lista th:hover { color: #2563eb; }
.linha-lead { cursor: pointer; }
.linha-lead:hover { background: #f9fafb; }
.linha-atrasada { border-left: 3px solid #ef4444; }

/* Acordeao de status (visao Lista) */
.acordeon-status { display: flex; flex-direction: column; gap: 10px; }
.status-grupo { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.status-grupo summary {
    list-style: none; cursor: pointer; padding: 14px 18px; display: flex;
    justify-content: space-between; align-items: center; font-weight: 600; font-size: 14px;
    color: #374151;
}
.status-grupo summary::-webkit-details-marker { display: none; }
.status-grupo summary::marker { content: ''; }
.status-grupo summary::before { content: '▸'; margin-right: 10px; color: #9ca3af; }
.status-grupo[open] summary::before { content: '▾'; }
.status-grupo-titulo { flex: 1; }
.status-grupo-lista { padding: 0 18px 14px; display: flex; flex-direction: column; gap: 6px; }
.status-grupo-item {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 10px 14px; background: #f9fafb; border-radius: 6px; color: #1f2430;
}
.status-grupo-item:hover { background: #f0f1f3; text-decoration: none; }
.status-grupo-item.linha-atrasada { border-left: 3px solid #ef4444; }
.status-grupo-item-nome { font-weight: 600; flex: 1; }
.status-grupo-item-vendedor { font-size: 12px; color: #6b7280; }
.status-grupo-item-dias { font-size: 12px; color: #9ca3af; white-space: nowrap; }

/* Dashboard */
.dash-cards { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.dash-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 20px 24px;
    flex: 1; min-width: 180px; text-align: center;
}
.dash-card-valor { display: block; font-size: 28px; font-weight: 700; color: #1f2430; }
.dash-card-label { display: block; font-size: 13px; color: #6b7280; margin-top: 4px; }
.tabela-dash { width: 100%; border-collapse: collapse; }
.tabela-dash th, .tabela-dash td { text-align: left; padding: 10px 14px; border-bottom: 1px solid #f0f1f3; font-size: 13px; }
.tabela-dash th { color: #6b7280; font-weight: 600; font-size: 12px; text-transform: uppercase; }

/* Avisos automaticos no board */
.avisos-banner { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.aviso { background: #fef3c7; color: #92400e; padding: 10px 16px; border-radius: 6px; font-size: 14px; }
.aviso a { color: #92400e; font-weight: 600; }

/* Lightbox de prints */
.lightbox-overlay {
    display: none;
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 1000;
    align-items: center; justify-content: center;
}
.lightbox-overlay.lightbox-aberto { display: flex; }
.lightbox-imagem { max-width: 90%; max-height: 90%; border-radius: 6px; box-shadow: 0 4px 24px rgba(0,0,0,0.4); }
.lightbox-fechar {
    position: absolute; top: 20px; right: 30px; color: #fff; font-size: 36px;
    cursor: pointer; font-weight: 300; line-height: 1;
}

/* Link WhatsApp */
.link-whatsapp { display: inline-block; margin-top: 6px; font-size: 12px; color: #16a34a; font-weight: 600; }
.link-whatsapp:hover { color: #15803d; }
