@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Nova Paleta de Cores - Moderna e Vibrante */
    --bg-sidebar: #0D1117; /* Preto azulado profundo */
    --bg-main: #F8F9FC;   /* Fundo principal ultra claro */
    --bg-content: #FFFFFF;
    --primary-color: #2563EB; /* Azul vibrante para ações */
    --primary-hover: #1D4ED8; /* Azul mais escuro para hover */
    --text-dark: #1F2937;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;

    --sidebar-width: 280px;
    --sidebar-width-collapsed: 90px;
    --header-height: 70px;
    --border-radius: 12px;
}

/* --- RESET & GLOBAIS --- */
html, body { overflow-x: hidden !important; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
* { box-sizing: border-box; }
body.page-template-default { background-color: var(--bg-main); }

/* --- PÁGINA DE LOGIN --- */
.sc-crm-login-page { font-family: 'Inter', sans-serif; background-color: var(--bg-sidebar); color: var(--text-light); display: flex; justify-content: center; align-items: center; padding: 40px 20px; min-height: 100vh; }
.sc-crm-login-box { background-color: #1F2937; padding: 48px; border-radius: var(--border-radius); width: 100%; max-width: 400px; text-align: center; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05); }
.sc-crm-login-logo { max-width: 250px; height: auto; margin-bottom: 30px; }
#sc-login-form p { margin-bottom: 20px; }
#sc-login-form label { display: block; text-align: left; font-weight: 500; margin-bottom: 8px; color: var(--text-muted); }
#sc-login-form .login-password, #sc-login-form .login-username { position: relative; }
#sc-login-form input[type="text"], #sc-login-form input[type="password"] { width: 100%; padding: 12px; border: 1px solid #374151; background-color: var(--bg-sidebar); border-radius: 8px; color: var(--text-light); font-size: 16px; transition: all 0.2s ease-in-out; }
#sc-login-form input[type="text"]:focus, #sc-login-form input[type="password"]:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3); }
#sc-login-form .login-remember { text-align: left; margin-bottom: 20px; }
#sc-login-form .login-submit input { width: 100%; padding: 14px; background-color: var(--primary-color); color: white; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background-color 0.2s ease-in-out; }
#sc-login-form .login-submit input:hover { background-color: var(--primary-hover); }
.toggle-password { position: absolute; top: 50%; transform: translateY(-50%); right: 15px; color: var(--text-muted); cursor: pointer; z-index: 5; }
.login-password input { padding-right: 45px !important; }

/* --- LAYOUT PRINCIPAL DO SISTEMA --- */
.sc-crm-wrapper { display: flex; background-color: var(--bg-main); color: var(--text-dark); min-height: 100vh; margin: 0; }
body.page .sc-crm-wrapper { margin: -2em; } 
.sc-crm-main { flex-grow: 1; margin-left: var(--sidebar-width); padding: 40px; transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1); min-width: 0; /* Correção para layout flexbox */ }
.sc-crm-content-area { background-color: var(--bg-content); padding: 32px; border-radius: var(--border-radius); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1); width: 100%; }

/* --- SIDEBAR --- */
.sc-crm-sidebar { width: var(--sidebar-width); background-color: var(--bg-sidebar); color: var(--text-light); padding: 24px; display: flex; flex-direction: column; flex-shrink: 0; position: fixed; top: 0; left: 0; height: 100%; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 1000; }
.sc-crm-sidebar-header { display: flex; justify-content: center; align-items: center; height: 60px; margin-bottom: 30px; position: relative; flex-shrink: 0; }
.sc-crm-sidebar-header .sc-crm-logo { max-width: 180px; height: auto; opacity: 1; transition: opacity 0.3s ease-out, visibility 0.3s; position: absolute; visibility: visible; }
.sc-crm-sidebar-header .sc-crm-favicon { width: 40px; height: 40px; position: absolute; opacity: 0; visibility: hidden; transition: opacity 0.3s ease-in-out, visibility 0.3s; }
.sc-crm-nav { flex-grow: 1; overflow: hidden; }
.sc-crm-nav ul { list-style: none; padding: 0; margin: 0; }
.sc-crm-nav li a { position: relative; display: flex; align-items: center; padding: 10px 16px 10px 20px; color: var(--text-muted); text-decoration: none; border-radius: 8px; margin-bottom: 4px; transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out; white-space: nowrap; }
.sc-crm-nav li a::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); height: 0; width: 4px; background-color: var(--primary-color); border-radius: 0 4px 4px 0; transition: height 0.2s ease-in-out; }
.sc-crm-nav li a:hover { background-color: #1F2937; color: #fff; }
.sc-crm-nav li.active a { background-color: rgba(37, 99, 235, 0.1); color: #fff; font-weight: 600; }
.sc-crm-nav li.active a::before { height: 60%; }
.sc-crm-nav i { width: 24px; margin-right: 16px; text-align: center; font-size: 1.1em; flex-shrink: 0; transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.sc-crm-sidebar-footer { border-top: 1px solid #374151; padding-top: 20px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.sc-user-profile-link { text-decoration: none; display: flex; flex-grow: 1; min-width: 0; border-radius: 8px; padding: 4px; margin-right: 8px; transition: background-color 0.2s; }
.sc-user-profile-link:hover { background-color: #1F2937; }
.sc-user-profile { display: flex; align-items: center; overflow: hidden; transition: opacity 0.3s ease-in-out, width 0.3s ease-in-out; flex-grow: 1; min-width: 0; }
.sc-user-profile img.avatar { border-radius: 50%; margin-right: 12px; }
.sc-user-info { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity 0.2s, visibility 0.2s, width 0.2s; }
.sc-user-name { display: block; font-weight: 600; color: var(--text-light); }
.sc-user-role { font-size: 0.85em; color: var(--text-muted); }
.sc-logout-button { color: var(--text-muted); font-size: 1.2em; padding: 8px; border-radius: 8px; text-decoration: none; transition: all 0.2s ease-in-out; flex-shrink: 0; }
.sc-sidebar-toggle { position: absolute; bottom: 20px; right: -15px; width: 30px; height: 30px; background-color: var(--primary-color); color: white; border: none; border-radius: 50%; cursor: pointer; display: flex; justify-content: center; align-items: center; box-shadow: 0 4px 10px rgba(0,0,0,0.2); transition: background-color 0.2s, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 10; }
.sc-sidebar-toggle:hover { background-color: var(--primary-hover); }

/* --- ESTILOS SIDEBAR RECOLHIDA --- */
.sc-crm-wrapper.sidebar-collapsed .sc-crm-main { 
    margin-left: var(--sidebar-width-collapsed); 
}
.sc-crm-wrapper.sidebar-collapsed .sc-crm-sidebar { 
    width: var(--sidebar-width-collapsed); 
}

/* Header e Logo: Garante que o logo grande desapareça sem espremer */
.sc-crm-wrapper.sidebar-collapsed .sc-crm-sidebar-header {
    overflow: hidden; /* Previne que o conteúdo vaze durante a transição */
}
.sc-crm-wrapper.sidebar-collapsed .sc-crm-sidebar-header .sc-crm-logo { 
    opacity: 0; 
    visibility: hidden; 
}
.sc-crm-wrapper.sidebar-collapsed .sc-crm-sidebar-header .sc-crm-favicon { 
    opacity: 1; 
    visibility: visible; 
}

/* Itens de Navegação */
.sc-crm-wrapper.sidebar-collapsed .sc-crm-nav span { 
    display: none; 
}
.sc-crm-wrapper.sidebar-collapsed .sc-crm-nav i { 
    margin-right: 0; 
}
.sc-crm-wrapper.sidebar-collapsed .sc-crm-nav li a { 
    justify-content: center; 
}

/* Rodapé e Perfil do Usuário: Mantém o avatar visível e com tamanho correto */
.sc-crm-wrapper.sidebar-collapsed .sc-sidebar-footer { 
    justify-content: center; 
}
.sc-crm-wrapper.sidebar-collapsed .sc-user-profile-link { 
    padding: 4px; 
    margin-right: 0; 
    flex-grow: 0; /* Impede que o link tente crescer */
}
.sc-crm-wrapper.sidebar-collapsed .sc-user-profile {
    width: auto; /* Permite que o container se ajuste ao avatar */
}
.sc-crm-wrapper.sidebar-collapsed .sc-user-profile img.avatar { 
    margin-right: 0; 
    width: 40px;
    height: 40px;
}
.sc-crm-wrapper.sidebar-collapsed .sc-user-info,
.sc-crm-wrapper.sidebar-collapsed .sc-logout-button { 
    display: none;
}

/* --- COMPONENTES GERAIS --- */
.sc-page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.sc-page-header h1, .sc-crm-content-area h1 { color: var(--text-dark); font-size: 2rem; font-weight: 800; margin: 0; }
.sc-page-header h1 i, .sc-crm-content-area h1 i { color: var(--primary-color); margin-right: 12px; }
.sc-crm-content-area p { margin-top: 8px; font-size: 1rem; color: var(--text-muted); }
.sc-btn { padding: 10px 20px; border-radius: 8px; border: none; font-size: 15px; font-weight: 600; cursor: pointer; transform: translateY(0); transition: transform 0.1s ease-out, background-color 0.2s; display: inline-flex; align-items: center; gap: 8px; }
.sc-btn:active { transform: translateY(1px); }
.sc-btn-primary { background-color: var(--primary-color); color: white; }
.sc-btn-primary:hover { background-color: var(--primary-hover); }
.sc-btn-secondary { background-color: #F3F4F6; color: #374151; }
.sc-btn-secondary:hover { background-color: #E5E7EB; }
.sc-btn-danger { background-color: #EF4444; color: white; }
.sc-btn-danger:hover { background-color: #DC2626; }
.sc-header-buttons { display: flex; gap: 12px; }
.sc-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 12px;
    background-color: #e9ecef;
    color: #495057;
}

/* Cores dos Badges por Etapa */
.sc-badge-novo-lead { background-color: #cfe2ff; color: #0a58ca; }
.sc-badge-em-atendimento { background-color: #ffedb3; color: #664d03; }
.sc-badge-qualificado { background-color: #e2d9f3; color: #582f87; } /* Roxo para Qualificado */
.sc-badge-visita-agendada { background-color: #a3cfbb; color: #0a3622; }
.sc-badge-em-proposta { background-color: #9eeaf9; color: #087990; } /* Renomeado de proposta-enviada */
.sc-badge-negocio-fechado { background-color: #d1e7dd; color: #0f5132; } /* Renomeado de vendido */
.sc-badge-perdido { background-color: #f8d7da; color: #842029; }

/* Status de Expiração */
.sc-status-expired-actionable {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    color: #dc3545;
    font-weight: bold;
}
.sc-status-expired-actionable:hover {
    color: #a71d2a;
}
.sc-status-warning {
    color: #ffc107;
    font-weight: bold;
}
.sc-status-active {
    color: #495057;
}
.sc-status-expired {
    color: #6c757d;
}
.sc-badge-ativo { background-color: #22C55E; }
.sc-badge-inativo { background-color: #EF4444; }
.sc-badge-creci { background-color: #3B82F6; }
.sc-badge-estagiario { background-color: #F59E0B; }

/* FILTROS */
.sc-filters-bar { display: flex; gap: 16px; background-color: transparent; padding: 0; margin-bottom: 24px; }
.sc-filters-bar form { display: flex; gap: 16px; width: 100%; flex-wrap: wrap; }
.sc-filters-bar .filter-item { flex-grow: 1; display: flex; align-items: center; }
.sc-filters-bar .filter-search { flex-grow: 2; position: relative; }
.sc-filters-bar .filter-search i { position: absolute; left: 15px; color: var(--text-muted); }
.sc-filters-bar input, .sc-filters-bar select { width: 100%; padding: 12px 15px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 15px; background-color: #fff; }
.sc-filters-bar .filter-search input { padding-left: 40px; }
.sc-filters-bar .filter-item .sc-btn { height: 100%; }

/* TABELAS */
.sc-table-wrapper { overflow-x: auto; background: var(--bg-content); border-radius: var(--border-radius); border: 1px solid var(--border-color); }
.sc-table { width: 100%; border-collapse: collapse; }
.sc-table th, .sc-table td { padding: 20px; text-align: left; border-bottom: 1px solid var(--border-color); }
.sc-table th { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.sc-table td { color: var(--text-dark); font-weight: 500; }
.sc-table tbody tr:last-child td { border-bottom: none; }
.sc-table tbody tr:hover { background-color: var(--bg-main); }
.sc-table td a { color: var(--primary-color); text-decoration: none; font-weight: 600; }
.sc-table td a:hover { color: var(--primary-hover); }
.sc-table-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.sc-table-actions { display: flex; gap: 8px; justify-content: flex-end; }
.sc-action-btn { background: none; border: none; cursor: pointer; font-size: 1em; padding: 8px; border-radius: 50%; width: 36px; height: 36px; line-height: 1; transition: background-color 0.2s; }
.sc-delete-btn { color: #EF4444; }
.sc-delete-btn:hover { background-color: #FEF2F2; }

/* FORMULÁRIOS */
.sc-form-wrapper { background-color: transparent; padding: 0; }
.sc-form-section { background-color: #fff; padding: 32px; border-radius: var(--border-radius); box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06); margin-bottom: 32px; border: 1px solid var(--border-color); }
.sc-form-section:last-of-type { border-bottom: none; }
.sc-form-section h2 { font-size: 1.5em; font-weight: 700; margin-top: 0; margin-bottom: 24px; color: var(--text-dark); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }
.form-grid-three-cols { display: grid; grid-template-columns: 1fr 2fr; gap: 32px; align-items: flex-start; }
.form-col-span-2 { grid-column: span 2; }
.form-row { display: flex; flex-direction: column; }
.form-row label { font-weight: 500; margin-bottom: 8px; color: #4B5563; }
.form-row input[type="text"], .form-row input[type="email"], .form-row input[type="tel"], .form-row input[type="password"], .form-row select { width: 100%; padding: 12px; border: 1px solid #D1D5DB; border-radius: 8px; font-size: 16px; background-color: #F9FAFB; transition: all 0.2s ease-in-out; }
.form-row input:focus, .form-row select:focus { background-color: #fff; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2); }
.form-row small { margin-top: 6px; font-size: 0.85em; color: var(--text-muted); }
.form-row-photo-upload { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.form-row-photo-upload #photo-preview { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-color); }
.form-row-photo-upload input[type="file"] { display: none; }
.form-actions { margin-top: 32px; text-align: right; }

/* PÁGINA DE PERFIL */
.sc-profile-wrapper { max-width: 800px; margin: 0 auto; }
.sc-profile-card { border: 1px solid var(--border-color); }
.profile-main-info { display: flex; align-items: center; gap: 24px; padding: 32px; }
.profile-photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.profile-name-role h2 { font-weight: 800; font-size: 2.25rem; }
.profile-name-role p { margin: 4px 0 0 0; }
.sc-info-grid { border-top: 1px solid var(--border-color); }
.info-item span { text-transform: uppercase; letter-spacing: 0.05em; }
.info-item strong { font-weight: 600; }

/* NOTIFICAÇÕES E MODAIS */
.sc-notice { border-radius: 8px; border-left-width: 4px; border-left-style: solid; }
.sc-notice p { font-weight: 500; }
.sc-notice-error { background-color: #FEF2F2; border-color: #EF4444; color: #991B1B; }
.sc-notice-success { background-color: #F0FDF4; border-color: #22C55E; color: #166534; }
.sc-modal-overlay { background-color: rgba(17, 24, 39, 0.6); backdrop-filter: blur(5px); }
.sc-modal-box { border-radius: 16px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04); }
.sc-modal-title { font-size: 1.5em; }
.sc-modal-actions { margin-top: 24px; gap: 16px; }

/* RESPONSIVIDADE */
.sc-crm-main-header { display: none; }
.sc-mobile-menu-toggle { background: none; border: none; font-size: 24px; color: var(--text-dark); cursor: pointer; padding: 0; }
.sc-mobile-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); z-index: 999; }
.sidebar-visible .sc-mobile-overlay { display: block; }
@media (max-width: 992px) {
    .sc-sidebar-toggle { display: none; }
    .sc-crm-sidebar { transform: translateX(-100%); transition: transform 0.3s ease-in-out; }
    .sidebar-visible .sc-crm-sidebar { transform: translateX(0); }
    .sc-crm-main { margin-left: 0; padding: 0; }
    .sc-crm-main-header { display: flex; align-items: center; height: var(--header-height); padding: 0 24px; background: var(--bg-content); box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); }
    .sc-crm-content-area { margin: 0; box-shadow: none; border-radius: 0; padding: 24px; }
    .sc-table-wrapper { border: none; border-radius: 0; }
    .sc-table thead { display: none; }
    .sc-table tr { display: block; margin-bottom: 16px; border: 1px solid var(--border-color); border-radius: 8px; }
    .sc-table td { display: block; text-align: right; padding-left: 50%; position: relative; border-bottom: 1px solid var(--border-color); }
    .sc-table td:last-child { border-bottom: none; }
    .sc-table td::before { content: attr(data-label); position: absolute; left: 16px; font-weight: 600; color: var(--text-muted); }
    .form-grid-three-cols { grid-template-columns: 1fr; }
}

/* Estilos para o modal de reatribuição */
.sc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.sc-modal-box {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: center;
}
.modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    font-size: 2rem;
}
.modal-icon-danger {
    background-color: #FEF2F2; /* Fundo vermelho claro */
    color: #EF4444; /* Ícone vermelho */
}
.sc-modal-title {
    font-size: 1.5em;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 8px;
    color: var(--text-dark);
}
.sc-modal-box p {
    color: var(--text-muted);
    line-height: 1.6;
}
.sc-modal-actions {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* --- PÁGINA DE INFORMAÇÕES DO LEAD --- */
.sc-lead-info-page {
    display: grid;
    grid-template-columns: 1fr 320px; /* Coluna principal e sidebar */
    gap: 32px;
    align-items: flex-start;
}

.sc-lead-main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sc-lead-actions-sidebar {
    position: sticky;
    top: 24px; /* Fixa a sidebar ao rolar */
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sc-lead-actions-sidebar .sc-btn {
    width: 100%;
    justify-content: center; /* Centraliza o conteúdo do botão */
}

.sc-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
}

.sc-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sc-card-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dark);
}

.sc-card-header h4 i {
    color: var(--primary-color);
}

.sc-card-body {
    padding: 20px;
    display: grid;
    gap: 16px;
}

.sc-card-body p {
    margin: 0;
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.sc-card-body p strong {
    font-weight: 500;
    color: var(--text-dark);
}

/* --- Modal Genérico (Usado no Kanban) --- */
.sc-modal {
    display: none; /* Oculto por padrão */
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(5px);
    overflow-y: auto; /* Para modais com muito conteúdo */
}

.sc-modal.is-visible {
    display: block; /* Ativa o modal */
}

.sc-modal-content {
    position: fixed; /* Centraliza na PÁGINA (viewport) */
    z-index: 1051; /* Acima do overlay */
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--bg-content);
    padding: 32px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 550px;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    animation: sc-modal-fade-in 0.3s ease-out;
}

@keyframes sc-modal-fade-in {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.sc-modal-close {
    color: var(--text-muted);
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.sc-modal-close:hover,
.sc-modal-close:focus {
    color: var(--text-dark);
    text-decoration: none;
}

.sc-modal-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 24px;
    color: var(--text-dark);
    text-align: left;
}

/* Ajustes no formulário dentro do modal do Kanban */
#form-agendar-visita-kanban .form-row {
    margin-bottom: 20px;
}

#form-agendar-visita-kanban .form-actions {
    margin-top: 32px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}


.sc-lead-profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.sc-lead-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 600;
}

.sc-lead-title h1 {
    margin: 0 0 4px 0;
    font-size: 2rem;
}

.sc-lead-title p {
    margin: 0;
    color: var(--text-muted);
}

@media (max-width: 992px) {
    .sc-lead-info-page {
        grid-template-columns: 1fr; /* Coluna única em telas menores */
    }
}


/* Adicione estas regras ao final do arquivo */

/* Estilos das Abas (Tabs) */
.sc-tabs-container {
    width: 100%;
}

.sc-tabs-nav {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    border-bottom: 2px solid #ddd;
}

.sc-tab-item {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #555;
    background-color: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px; /* Alinha com a borda do container */
    transition: all 0.2s ease-in-out;
}

.sc-tab-item i {
    margin-right: 8px;
}

.sc-tab-item:hover {
    color: #0073aa;
    background-color: #f7f7f7;
}

.sc-tab-item.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
    font-weight: 600;
}

.sc-tabs-content .sc-tab-panel {
    display: none;
}

.sc-tabs-content .sc-tab-panel.active {
    display: block;
}

/* --- PÁGINA DE ANOTAÇÕES (TIMELINE) --- */

.sc-anotacoes-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sc-new-anotacao-card .sc-form-actions {
    margin-top: 16px;
    text-align: right;
}

.sc-timeline-container h4 {
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sc-timeline {
    position: relative;
    padding: 20px 0;
    list-style: none;
}

.sc-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    height: 100%;
    width: 2px;
    background: #e2e8f0;
}

.sc-timeline-item {
    position: relative;
    margin-bottom: 24px;
    padding-left: 50px;
}

.sc-timeline-avatar {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #cbd5e1;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #e2e8f0;
}

.sc-timeline-content {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    position: relative;
}

.sc-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sc-timeline-author {
    font-weight: 600;
    color: var(--text-dark);
}

.sc-timeline-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sc-timeline-text p {
    margin: 0;
    line-height: 1.6;
    color: #4a5568;
}

.sc-timeline-actions {
    position: absolute;
    top: 10px;
    right: 10px;
}

.sc-timeline-delete-btn {
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s;
}

.sc-timeline-delete-btn:hover {
    color: #ef4444;
    background-color: #fef2f2;
}

.sc-timeline-item-loading {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
}

.sc-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--primary-color);
    margin: 0 auto 16px auto;
    animation: spin 1s ease infinite;
}

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


/* --- PÁGINA DE AGENDAMENTOS --- */

.sc-agendamentos-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sc-new-agendamento-card .sc-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.sc-new-agendamento-card .sc-form-group {
    flex: 1;
    margin-bottom: 0;
}

.sc-agendamentos-list-container h4 {
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

#sc-agendamentos-list .sc-list-loading {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
}

.sc-agendamento-item {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow 0.2s;
}

.sc-agendamento-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.sc-agendamento-item.status-realizado {
    border-left-color: #22c55e; /* green-500 */
}

.sc-agendamento-item.status-cancelado {
    border-left-color: #ef4444; /* red-500 */
    opacity: 0.7;
}

.sc-agendamento-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.sc-agendamento-titulo {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.sc-agendamento-data {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
    background-color: var(--primary-light);
    padding: 4px 10px;
    border-radius: 12px;
}

.sc-agendamento-body p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sc-agendamento-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #a0aec0;
    margin-top: 8px;
}


/* --- PAGINAÇÃO --- */
.sc-pagination {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.sc-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    min-width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fff;
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}
.sc-pagination .page-numbers:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.sc-pagination .page-numbers.current {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    cursor: default;
}
.sc-pagination .page-numbers.dots {
    border: none;
    background: none;
}

/* Estilos para o formulário de criação de usuário */
#create-user-form .sc-form-group {
    margin-bottom: 20px;
}

#create-user-form .sc-form-control {

/* --- Estilos do Formulário de Cadastro Público (v2 - Sofisticado) --- */
body.page-with-sc-form {
    background-color: #f4f7f9;
}

.sc-cadastro-form {
    max-width: 950px;
    margin: 50px auto;
    background-color: #ffffff;
    padding: 40px 50px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    font-family: 'Poppins', sans-serif;
    color: #333;
}

.sc-cadastro-form .sc-form-header {
    text-align: center;
    margin-bottom: 40px;
}

.sc-cadastro-form .sc-form-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.sc-cadastro-form .sc-form-header p {
    font-size: 16px;
    color: #7f8c8d;
}

.sc-cadastro-form .form-section {
    margin-bottom: 40px;
}

.sc-cadastro-form .form-section h3 {
    font-size: 20px;
    font-weight: 600;
    color: #3498db;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    align-items: center;
}

.sc-cadastro-form .form-section h3 i {
    margin-right: 12px;
    font-size: 22px;
    width: 30px;
    text-align: center;
}

.sc-cadastro-form .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px 30px;
}

.sc-cadastro-form .form-group {
    position: relative;
    display: flex;
    flex-direction: column;
}

.sc-cadastro-form .grid-col-2 { grid-column: span 2; }
.sc-cadastro-form .grid-col-3 { grid-column: span 3; }

.sc-cadastro-form .form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.sc-cadastro-form .form-group input[type="text"],
.sc-cadastro-form .form-group input[type="email"],
.sc-cadastro-form .form-group input[type="tel"],
.sc-cadastro-form .form-group input[type="date"],
.sc-cadastro-form .form-group input[type="password"],
.sc-cadastro-form .form-group select {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    background-color: #fdfdfd;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.sc-cadastro-form .form-group input:focus,
.sc-cadastro-form .form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    background-color: #fff;
}

.sc-cadastro-form .form-group input[readonly] {
    background-color: #ecf0f1;
    cursor: not-allowed;
    color: #7f8c8d;
}

.sc-cadastro-form .form-group .field-description {
    font-size: 13px;
    color: #95a5a6;
    margin-top: 6px;
}

/* Photo Upload */
.sc-photo-upload {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

#photo-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background-color: #e9ecef;
}

.sc-photo-upload input[type="file"] {
    display: none;
}

.sc-photo-upload label {
    cursor: pointer;
    margin-bottom: 0 !important; /* Override default margin */
}

#file-name {
    font-style: italic;
    color: #6c757d;
}

/* Form Actions */
.sc-cadastro-form .form-actions {
    text-align: right;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.sc-cadastro-form .sc-btn-primary {
    padding: 14px 35px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    background-color: #3498db;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

.sc-cadastro-form .sc-btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

/* Estilos para as notificações */
.sc-notice {
    padding: 18px 25px;
    margin-bottom: 25px;
    border-radius: 8px;
    border-left-width: 5px;
    font-size: 15px;
    border-style: solid;
}

.sc-notice-error {
    background-color: #fbe9e7;
    border-color: #ff5722;
    color: #c8370e;
}

.sc-notice-error ul {
    margin: 0;
    padding-left: 20px;
}

.sc-notice-success {
    background-color: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#create-user-form .sc-form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.25);
    outline: none;
}

#create-user-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

#create-user-form .sc-form-actions {
    display: flex;
    justify-content: flex-start;
    gap: 15px;
    margin-top: 30px;
}

/* Estilo específico para o input de arquivo */
#create-user-form input[type="file"] {
    padding: 10px;
    background-color: #f9f9f9;
    cursor: pointer;
}

#create-user-form input[type="file"]:hover {
    background-color: #f1f1f1;
}

/* Estilos para a célula de Ações na tabela de equipe */
.sc-actions-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sc-delete-form {
    display: inline-flex;
    margin: 0;
}

/* --- Estilos Modernos para a Página de Equipe --- */

/* Barra de Filtros */
.sc-filters-bar {
    margin-bottom: 25px;
}
.sc-filters-bar form {
    display: flex;
    gap: 15px;
    align-items: center;
}
.sc-filters-bar .filter-search {
    flex-grow: 1;
    position: relative;
}
.sc-filters-bar .filter-search .fa-search {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}
.sc-filters-bar input[type="search"],
.sc-filters-bar select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #fff;
    font-size: 1rem;
}
.sc-filters-bar input[type="search"] {
    padding-left: 40px;
}

/* Tabela de Equipe */
.sc-table-wrapper {
    overflow-x: auto;
}
.sc-table {
    border-collapse: separate;
    border-spacing: 0 10px;
}
.sc-table thead th {
    background-color: transparent;
    border: none;
    color: #6b7280;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    text-align: left;
    padding: 10px 20px;
}
.sc-table tbody tr {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}
.sc-table tbody tr:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}
.sc-table td {
    padding: 15px 20px;
    vertical-align: middle;
    border: none;
}
.sc-table td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}
.sc-table td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Avatar na Tabela */
.sc-table-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
}

/* Apelido e Links */
.sc-table td a {
    color: #3b82f6;
    font-weight: 600;
    text-decoration: none;
}
.sc-table td a:hover {
    text-decoration: underline;
}

/* Badges */
.sc-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}
/* Badges de Status com Melhor Visibilidade */
.sc-badge-status-ativo {
    background-color: #16a34a; /* Verde mais forte */
    color: #ffffff;           /* Texto branco */
}

.sc-badge-status-inativo {
    background-color: #6b7280; /* Cinza mais escuro */
    color: #ffffff;           /* Texto branco */
}

/* --- Célula e Botões de Ação --- */

.sc-actions-cell {
    display: flex;
    align-items: center;
    gap: 8px; /* Espaçamento entre os botões */
}

.sc-btn-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    border: none;
    background-color: transparent;
    padding: 0;
    cursor: pointer;
}

.sc-btn-icon i {
    font-size: 1rem;
}

/* Botão de Visualizar */
.sc-btn-icon[title="Ver Detalhes"] {
    color: #3b82f6; /* Azul */
}
.sc-btn-icon[title="Ver Detalhes"]:hover {
    background-color: #eff6ff; /* Fundo azul claro */
}

/* Botão de Excluir */
.sc-btn-icon.sc-btn-danger {
    color: #ef4444; /* Vermelho */
}
.sc-btn-icon.sc-btn-danger:hover {
    background-color: #fef2f2; /* Fundo vermelho claro */
    color: #dc2626; /* Vermelho mais escuro */
}

/* Botão de Excluir */
.sc-btn-icon.sc-btn-danger {
    color: #ef4444; /* Vermelho */
}
.sc-table-wrapper .sc-table .sc-action-buttons a:hover {
    background-color: #e9ecef;
}

/* --- Comportamento do Menu Lateral (Sidebar) --- */
#sc-crm-wrapper.sidebar-collapsed #sc-crm-sidebar {
    width: 80px;
}
#sc-crm-wrapper.sidebar-collapsed #sc-crm-sidebar .sc-sidebar-logo .full-logo {
    display: none;
}
#sc-crm-wrapper.sidebar-collapsed #sc-crm-sidebar .sc-sidebar-logo .icon-logo {
    display: block;
}
#sc-crm-wrapper.sidebar-collapsed #sc-crm-sidebar .sc-sidebar-menu .menu-text {
    display: none;
}
#sc-crm-wrapper.sidebar-collapsed #sc-crm-sidebar .sc-sidebar-menu a {
    justify-content: center;
}
#sc-crm-wrapper.sidebar-collapsed #sc-crm-sidebar .sc-sidebar-footer {
    display: none;
}
#sc-crm-wrapper.sidebar-collapsed #sc-crm-content {
    margin-left: 80px;
}

/* --- Estilos do Formulário de Cadastro (v2 - Sofisticado) --- */
body.page-with-sc-form {
    background-color: #f4f7f9;
}

.sc-cadastro-form {
    max-width: 950px;
    margin: 50px auto;
    background-color: #ffffff;
    padding: 40px 50px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    font-family: 'Poppins', sans-serif;
    color: #333;
}

.sc-cadastro-form .sc-form-header {
    text-align: center;
    margin-bottom: 40px;
}

.sc-cadastro-form .sc-form-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.sc-cadastro-form .sc-form-header p {
    font-size: 16px;
    color: #7f8c8d;
}

.sc-cadastro-form .form-section {
    margin-bottom: 40px;
}

.sc-cadastro-form .form-section h3 {
    font-size: 20px;
    font-weight: 600;
    color: #3498db;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    align-items: center;
}

.sc-cadastro-form .form-section h3 i {
    margin-right: 12px;
    font-size: 22px;
    width: 30px;
    text-align: center;
}

.sc-cadastro-form .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px 30px;
}

.sc-cadastro-form .form-group {
    position: relative;
    display: flex;
    flex-direction: column;
}

.sc-cadastro-form .grid-col-2 { grid-column: span 2; }
.sc-cadastro-form .grid-col-3 { grid-column: span 3; }

.sc-cadastro-form .form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.sc-cadastro-form .form-group input[type="text"],
.sc-cadastro-form .form-group input[type="email"],
.sc-cadastro-form .form-group input[type="tel"],
.sc-cadastro-form .form-group input[type="date"],
.sc-cadastro-form .form-group input[type="password"],
.sc-cadastro-form .form-group select {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    background-color: #fdfdfd;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.sc-cadastro-form .form-group input:focus,
.sc-cadastro-form .form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    background-color: #fff;
}

.sc-cadastro-form .form-group input[readonly] {
    background-color: #ecf0f1;
    cursor: not-allowed;
    color: #7f8c8d;
}

.sc-cadastro-form .form-group .field-description {
    font-size: 13px;
    color: #95a5a6;
    margin-top: 6px;
}

/* Photo Upload */
.sc-photo-upload {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

#photo-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sc-photo-upload input[type="file"] {
    border: none;
    padding: 0;
}

/* Form Actions */
.sc-cadastro-form .form-actions {
    text-align: right;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.sc-cadastro-form .sc-btn-primary {
    padding: 14px 35px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    background-color: #3498db;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

.sc-cadastro-form .sc-btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

/* Estilos para as notificações */
.sc-notice {
    padding: 18px 25px;
    margin-bottom: 25px;
    border-radius: 8px;
    border-left-width: 5px;
    font-size: 15px;
    border-style: solid;
}

.sc-notice-error {
    background-color: #fbe9e7;
    border-color: #ff5722;
    color: #c8370e;
}

.sc-notice-error ul {
    margin: 0;
    padding-left: 20px;
}

.sc-notice-success {
    background-color: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

/* Estilos para permitir scroll lateral no container do Kanban */
.kanban-board-container {
    overflow-x: auto;
    white-space: nowrap;
    width: 100%;
    max-width: none; /* Garante que não haja limite de largura */
    padding-bottom: 10px;
}

#kanban-board {
    display: flex;
    overflow-x: auto;
    width: max-content;
    min-width: 100%;
}

.kanban-column {
    flex: 0 0 300px;
    margin-right: 20px;
    min-height: 500px;
}