* { margin:0; padding:0; box-sizing:border-box; }
html {
    height: 100%;
    overflow: hidden;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f4f6f8;
    height: 100vh;
    overflow: hidden;
    color: #1a1a2e;
}
.loading { text-align:center; padding:50px; color:#666; }
.spinner {
    border:3px solid #f3f3f3;
    border-top:3px solid #239687;
    border-radius:50%;
    width:40px;
    height:40px;
    animation: spin 1s linear infinite;
    margin:0 auto 20px;
}
@keyframes spin { 0%{transform:rotate(0deg);} 100%{transform:rotate(360deg);} }
.menu-item {
    padding: 12px 20px;
    cursor: pointer;
    color: #333;
    border-left: 3px solid transparent;
    transition: all 0.3s;
    position: relative;
    font-size: 14px;
}
.menu-item:hover { background:#f5f5f5; border-left-color:#239687; }
.menu-item.ativo { background:#e6f3f0; border-left-color:#239687; font-weight:bold; color:#0a645a; }
.menu-item .badge {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #dc3545;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    padding: 0 4px;
}
.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}
.card h2 {
    color: #0a645a;
    border-bottom: 2px solid #239687;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}
th {
    background: #239687;
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-size: 13px;
    white-space: nowrap;
}
td {
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
tr:hover { background:#f5f5f5; }
.btn {
    background: #239687;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
}
.btn:hover { background: #0a645a; }
.btn-editar { background: #ffc107; color: black; }
.btn-editar:hover { background: #e0a800; }
.btn-excluir { background: #dc3545; }
.btn-excluir:hover { background: #c82333; }
.btn-historico { background: #17a2b8; }
.btn-historico:hover { background: #138496; }
.btn-success { background: #28a745; }
.btn-success:hover { background: #218838; }
.btn-telefone {
    background: transparent;
    color: #239687;
    padding: 5px 10px;
    font-size: 16px;
    border: 1px solid #239687;
}
.btn-telefone:hover { background:#239687; color:white; }
.status-novo { background:#e8f5e9; color:#2e7d32; padding:4px 8px; border-radius:4px; display:inline-block; }
.status-negociacao { background:#e3f2fd; color:#1976d2; padding:4px 8px; border-radius:4px; display:inline-block; }
.status-migracao { background:linear-gradient(135deg,#667eea,#764ba2); color:white; padding:4px 8px; border-radius:4px; display:inline-block; font-weight:bold; }
.status-venda { background:#c8e6c9; color:#2e7d32; font-weight:bold; padding:4px 8px; border-radius:4px; display:inline-block; }
.status-perdido { background:#ffebee; color:#c62828; padding:4px 8px; border-radius:4px; display:inline-block; }
.status-ag-instalacao { background:#fff3e0; color:#e65100; padding:4px 8px; border-radius:4px; display:inline-block; font-weight:bold; }
.filtros {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #239687;
}
.filtro-group {
    flex: 1;
    min-width: 150px;
}
.filtro-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #0a645a;
    font-size: 12px;
}
.filtro-group select,
.filtro-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.filtro-group select:focus,
.filtro-group input:focus {
    outline: none;
    border-color: #239687;
}
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: white;
    width: 90%;
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
    border-radius: 8px;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #239687;
}
.modal-header h2 { color:#0a645a; margin:0; }
.modal-close { background:none; border:none; font-size:24px; cursor:pointer; color:#666; }
.modal-close:hover { color:#000; }
.form-field {
    margin-bottom: 12px;
}
.form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 13px;
    color: #333;
}
.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #239687;
    box-shadow: 0 0 0 3px rgba(35,150,135,0.1);
}
.field-feedback { font-size:12px; margin-top:4px; }
.field-feedback.ok { color:#28a745; }
.field-feedback.erro { color:#dc3545; }
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.dashboard-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-top: 4px solid #239687;
}
.dashboard-card h3 {
    color: #0a645a;
    font-size: 14px;
    margin-bottom: 10px;
}
.dashboard-card .valor {
    font-size: 32px;
    font-weight: bold;
    color: #239687;
}
@media (max-width: 768px) {
    #menu { width: 100%; border-right: none; border-bottom: 1px solid #ddd; }
    .filtros { flex-direction: column; }
    table { font-size: 12px; }
    th, td { padding: 6px 4px; }
    .modal-content { width: 95%; margin: 20px auto; }
}
/* refinamentos dashboard */
#dash-kpis > div {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#dash-kpis > div:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
#dash-charts > div {
    transition: box-shadow 0.2s ease;
}
#dash-charts > div:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}