/* Estilos gerais + tema claro/escuro + telas de login */

:root {
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;    
    --bg-sidebar: #111827;
    --bg-topbar: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --border-default: #e5e7eb;
    --danger: #ef4444;
    --success: #10b981;
}

html[data-theme='dark'] {
    --bg-body: #020617;
    --bg-card: #020617;
    --bg-sidebar: #020617;
    --bg-topbar: #020617;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --border-default: #1f2937;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
}

/* Tela de autenticação */

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: #f9fafb;
}

.auth-container {
    display: flex;
    flex: 1;
}

.auth-left,
.auth-right {
    flex: 1;
}

.auth-left {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px;
    background: #f9fafb;
}

.auth-card {
    max-width: 360px;
    width: 100%;
    background: #ffffff;
    padding: 32px 28px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.auth-icon {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 24px;
    color: #2563eb;
}

.auth-card h1 {
    font-size: 24px;
    margin-bottom: 4px;
    color: #111827;
}

.auth-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 4px;
    display: block;
}

/* Força select a exibir estilo correto */
.form-group select {
    appearance: none;
    background-color: #fff;
    border: 1px solid #d6d6d6;
    padding: 10px;
    border-radius: 6px;
    font-size: 15px;
    width: 100%;
}

/* Mantém alinhamento com os demais campos */
.form-group select:focus {
    border-color: #4a8dff;
    box-shadow: 0 0 3px rgba(74,141,255,0.4);
    outline: none;
}


.input-icon {
    position: relative;
}

.input-icon .icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #9ca3af;
}

.input-icon input {
    width: 100%;
    padding: 10px 10px 10px 30px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
}

.btn-primary {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    border-radius: 8px;
    border: none;
    background: #3b82f6;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    border: none;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
}

.link-small {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    color: #4f46e5;
    text-decoration: none;
}

.link-small:hover {
    text-decoration: underline;
}

.alert {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 10px;
}

.alert-error {
    background: #fee2e2;
    color: #b91c1c;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

/* Lado direito da tela de login */

.auth-right {
    background: #021b33;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-logo {
    font-size: 40px;
    font-weight: 700;
    color: #22d3ee;
}

.logo-text {
    display: inline-block;
}

.logo-text.accent {
    color: #4f46e5;
}

/* Layout interno do app */

.app-body {
    min-height: 100vh;
    display: flex;
    background: var(--bg-body);
    color: var(--text-main);
    
}

.app-layout {
    display: contents;
}

.sidebar {
    width: 220px;
    background: var(--bg-sidebar);
    color: #e5e7eb;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
}

.sidebar .logo-text {
    color: #22D3EE;
}

.sidebar .logo-text.accent {
    color: #4F46E5;
}

.sidebar-nav a {
    display: block;
    padding: 8px 4px;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 14px;
}

.sidebar-nav a:hover {
    text-decoration: none;
}

.topbar {
    position: fixed;
    left: 220px;
    right: 0;
    height: 56px;
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    z-index: 10;
}

.topbar-company {
    font-weight: 600;
}

.empresa-select-form {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.empresa-select-form select {
    font-size: 13px;
    padding: 4px 6px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user {
    font-size: 13px;
    color: var(--text-muted);
}

.btn-logout {
    font-size: 13px;
    text-decoration: none;
    color: var(--primary);
}

.btn-logout:hover {
    text-decoration: underline;
}

.theme-toggle {
    border: 1px solid var(--border-default);
    border-radius: 999px;
    padding: 4px 8px;
    background: transparent;
    cursor: pointer;
}

/* Conteúdo */

.app-content {
    margin-left: 20px;
    padding: 74px 20px 24px 20px;
    width: calc(100% - 220px);
}

h1 {
    font-size: 22px;
    margin-bottom: 16px;
}

.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    flex: 1;
    min-width: 220px;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.card h3 {
    font-size: 13px;
    color: var(--text-muted);
}

.card .valor {
    margin-top: 4px;
    font-size: 22px;
    font-weight: 700;
}

.saldo-positivo {
    color: #16a34a;
}

.saldo-negativo {
    color: #b91c1c;
}

.grid-two {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr);
    gap: 16px;
    margin-bottom: 24px;
}

.panel {
    background: var(--bg-card);
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    margin-bottom: 24px;
}

.panel h2 {
    font-size: 16px;
    margin-bottom: 10px;
}

/* Tabelas */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th,
.table td {
    padding: 6px 8px;
    /* border-bottom: 1px solid var(--border-default); */
}

.table th {
    background: rgba(148, 163, 184, 0.15);
    text-align: left;
}

/* Formulários internos */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px 16px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-grid input,
.form-grid select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-default);
    font-size: 13px;
}

/* Aplica o mesmo estilo de input ao textarea */
.form-grid textarea {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid var(--border-default);
    resize: vertical;
    min-height: 90px;
}

/* ===== Ajuste visual dos gráficos ===== */

.chart-box{
    width:100%;
    max-width:100%;
    padding:16px;
}

.chart-large{
    height:460px;
}

.chart-medium{
    height:320px;
}

/* .chart-small{
    height:250px;
} */

.chart-row{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
    margin-top:20px;
}
/* ===== DASHBOARD REFINADO ===== */

.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top:20px;
}

/* altura ideal dos gráficos */
/* .chart-big   { height: 380px !important; }
.chart-small { height: 240px !important; } */

/* para gráficos canvas ficarem estáveis */
.panel canvas {
    width:100% !important;
    max-width:100%;
    display:block;
}

/* ajuste visual */
.panel {
    min-height: 300px;
}
/* ================== DASHBOARD BALANCEADO ================== */

/* Área do gráfico principal */
.chart-main {
    height: 430px !important;
}

/* Gráficos pequenos lado a lado */
.chart-small {
    
    height: 200px !important;
    
}

/* Painéis com limite adequado */
.panel {
    padding: 18px;
    min-height: auto;
}

/* Alinhamento responsivo (mantém 50% x 50%) */
.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-top: 20px;
}

/* Força o canvas a não esticar para fora */
.panel canvas {
    max-height: 100% !important;
    width: 100% !important;
    display:block;
}
/* ======================= PAINEL GRÁFICOS ======================= */

.dashboard-charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Gráfico principal – linha */
.chart-big-panel {
    height: 360px;      /* altura equilibrada */
    padding: 18px;
}

/* Gráficos menores lado a lado */
.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-small-panel {
    height: 320px;
    padding: 18px;
}

/* Evita distorção total */
canvas {
    width: 100% !important;
    height: 100% !important;
}


.panel canvas{
    width:100% !important;
    height:280px !important; /* pode ajustar para 280 ou 350 */
    display:block;
}

/* === CRM / Kanban === */

.crm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.crm-header-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-secondary {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    cursor: pointer;
    font-weight: 500;
}

.btn-secondary:hover {
    background: #f9fafb;
}

.crm-panel {
    overflow-x: auto;
}

.crm-board {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    min-height: 300px;
}

.crm-column {
    min-width: 260px;
    background: #f9fafb;
    border-radius: 10px;
    padding: 10px;
}

.crm-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    margin-bottom: 8px;
}

.crm-column-edit i {
    font-size: 16px;
}

.crm-column-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crm-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    cursor: grab;
}

.crm-card-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.crm-card-value {
    font-size: 13px;
    color: #0f766e;
    font-weight: 600;
    margin-bottom: 4px;
}

.crm-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

.crm-card-actions {
    margin-top: 6px;
    display: flex;
    gap: 8px;
    font-size: 16px;
}

.crm-card-actions a i {
    cursor: pointer;
}

/* ===== CRM – KANBAN ===== */

.crm-wrapper{
    display: flex;
    gap: 22px;
    overflow-x: auto;
    padding-bottom: 25px;
}

.kanban-column {
    background: #fff;
    border-radius: 10px;
    padding: 18px;
    min-width: 260px;
    max-height: 78vh;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
}

.kanban-column h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color:#333;
}

.card-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    border-left: 4px solid #0d6efd;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
}

.card-item strong{
    font-weight: 600;
    font-size: 14px;
}

.card-item p{
    font-size: 13px;
    margin-top: 4px;
    color:#5a5a5a;
}

.card-actions{
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

/* botão novo card */
.btn-novo-card{
    width:100%;
    background:#0d6efd;    
    color:#fff;
    padding:8px 0;
    text-align:center;
    border-radius:6px;
    margin-top:12px;
    font-size:14px;
    font-weight:600;
    cursor:pointer;
    transition:.3s;
}
.btn-novo-card:hover{
    background:#094ec4;
}

/* mensagem "nenhum pipeline" */
.no-pipeline-box{
    background:#fff;
    text-align:center;
    padding:30px;
    border-radius:10px;
    box-shadow:0 2px 6px rgba(0,0,0,.08);
}
.no-pipeline-box a.btn-criar{
    background:#0d6efd;
    padding:8px 18px;
    display:inline-block;
    border-radius:6px;
    margin-top:12px;
    color:#fff;
    font-weight:600;
}
.no-pipeline-box a.btn-criar:hover{
    background:#0b54d8;
}

/* ===================== CRM – AJUSTES FINAIS ===================== */

/* Colunas e board (caso não existam ou para reforçar) */
.crm-panel {
    overflow-x: auto;
}

.crm-wrapper {
    display: flex;
    gap: 22px;
    overflow-x: auto;
    padding-bottom: 22px;
}

.kanban-column {
    background: #ffffff;
    border-radius: 10px;
    padding: 16px;
    min-width: 260px;
    max-height: 78vh;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.kanban-count {
    font-size: 12px;
    color: #6b7280;
}

.kanban-column-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Cards */
.card-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 6px;
    border-left: 4px solid #0d6efd;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
    cursor: grab;
}

.card-item.dragging {
    opacity: 0.7;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.35);
}

.card-header-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.card-title {
    font-weight: 600;
    font-size: 14px;
}

.card-value {
    font-size: 13px;
    font-weight: 600;
    color: #0f766e;
    margin-bottom: 4px;
}

.card-desc {
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 4px;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.card-meta i {
    margin-right: 3px;
}

.card-actions {
    margin-top: 6px;
    display: flex;
    gap: 10px;
    font-size: 16px;
}

.card-actions a i {
    cursor: pointer;
}

/* Dropzone highlight */
.dropzone.drop-hover {
    outline: 2px dashed #3b82f6;
    outline-offset: 4px;
}

/* Botão "+ Novo Card" já existia mas reforçamos */
.btn-novo-card {
    width: 100%;
    background:#0d6efd;  
    color:#fff;
    padding:8px 0;
    text-align:center;
    border-radius:6px;
    margin-top:12px;
    font-size:14px;
    font-weight:600;
    cursor:pointer;
    border:none;
    transition:.2s;
}
.btn-novo-card:hover {
    background:#094ec4;
}

/* ===== Prioridades (pontos coloridos) ===== */
.priority-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.priority-baixa {
    background: #22c55e;
}

.priority-media {
    background: #facc15;
}

.priority-alta {
    background: #ef4444;
}

/* ===== Mensagem quando não há pipeline ===== */
.no-pipeline-box {
    background:#fff;
    text-align:center;
    padding:30px;
    border-radius:10px;
    box-shadow:0 2px 6px rgba(0,0,0,.08);
}
.no-pipeline-box h2 {
    font-size:18px;
    margin-bottom:8px;
}
.no-pipeline-box p {
    font-size:14px;
    color:#4b5563;
}
.no-pipeline-box a.btn-criar {
    background:#0d6efd;
    padding:8px 18px;
    display:inline-block;
    border-radius:6px;
    margin-top:12px;
    color:#fff;
    font-weight:600;
}
.no-pipeline-box a.btn-criar:hover {
    background:#0b54d8;
}

/* ===== Modal CRM ===== */
.crm-modal {
    position: fixed;
    inset: 0;
    display: none;          /* JS muda para flex */
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.crm-modal-backdrop {
    position:absolute;
    inset:0;
    background: rgba(15,23,42,0.45);
}

.crm-modal-content {
    position: relative;
    background:#ffffff;
    padding: 20px 20px 16px;
    border-radius: 14px;
    box-shadow:0 10px 40px rgba(15,23,42,0.35);
    max-width: 640px;
    width: 95%;
    z-index: 51;
}

.crm-modal-header {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:14px;
}

.crm-modal-header h2 {
    font-size:18px;
    font-weight:600;
}

.crm-modal-close {
    background:transparent;
    border:none;
    cursor:pointer;
    font-size:18px;
    color:#6b7280;
}
.crm-modal-close:hover {
    color:#111827;
}

/* ===== Botões secundários (anchors e buttons) ===== */

.btn-secondary {
    display: inline-flex;          /* deixa alinhado com ícone/texto */
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;         /* tira sublinhado do <a> */
}

.btn-secondary:hover {
    background: #f3f4f6;
    color: #111827;
    text-decoration: none;         /* garante que não volte o sublinhado */
}

.edit-icon {
    font-size: 16px;
    color: #2563eb;
    margin-top: 6px;
    display: inline-block;
    cursor: pointer;
    text-decoration: none;
}

.edit-icon:hover i {
    color: #1d4ed8;
    transform: scale(1.15);
    transition: .2s;
}

/* opcional → move o ícone para direita */
.card-item .edit-icon { 
    margin-top: 8px;
}

/* ----- DROPDOWN MENU ----- */
.dropdown {
    width: 100%;
}

/* Botão principal igual aos <a> do menu */
.dropdown-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: #f1f5f9;
    font-size: 14px;
    /* padding: 12px 20px;  <-- alinhamento igual aos outros menus */
    padding: 2px;  /*<-- alinhamento igual aos outros menus  */
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;

    /* Para o botão ocupar a mesma largura do menu */
    box-sizing: border-box;
}

.dropdown-btn:hover {
    background: rgba(255,255,255,0.08);
}

/* seta */
.dropdown .arrow {
    transition: transform .25s;
}

/* conteúdo do submenu */
.dropdown-content {
    display: none;
    flex-direction: column;
    /*margin-left: 32px;  <-- alinhamento da indentação */
    margin-top: 5px;
}

.dropdown-content a {
    padding: 8px 10px;
    font-size: 14px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-content a:hover {
    background: rgba(255,255,255,0.06);
}

.card {
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.10);
}

.chart-container {
    width: 100%;
    height: 400px;
    max-height: 400px;
}

.chart-small {
    width: 100%;
    height: 300px;
    max-height: 300px;
}

.acoes {
    white-space: nowrap;
}

.acoes a {
    text-decoration: none !important;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    text-decoration: none;
    margin-right: 6px;
    transition: background 0.2s ease;
    font-size: 14px;
}

/* Editar */
.btn-edit {
    /* background: #e0f2fe; */
    color: #0369a1;
}

.btn-edit:hover {
    background: #bae6fd;
}

/* Excluir */
.btn-delete {
    /* background: #fee2e2; */
    color: #b91c1c;
}

.btn-delete:hover {
    background: #fecaca;
}

/* ATIVAR / DESATIVAR */
.btn-toggle {
    background: #f0fdf4;
    color: #15803d;
}

.btn-toggle i {
    color: #15803d;
}

.btn-toggle:hover {
    background: #dcfce7;
}

/* STATUS (VISUAL) */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.ativo {
    background: #22c55e;
}

.status-dot.inativo {
    background: #ef4444;
}

/* ===== RADIO GROUP PADRÃO (ALINHAMENTO PERFEITO) ===== */

.form-group.radio-full {
    grid-column: 1 / -1;
}

.form-group.radio-full .radio-group {
    display: grid;
    grid-template-columns: 18px auto;
    row-gap: 10px;
    column-gap: 10px;
    margin-top: 6px;
    max-width: 360px;
}

.form-group.radio-full .radio-group input[type="radio"] {
    margin: 0;
    align-self: center;
}

.form-group.radio-full .radio-group span {
    font-size: 14px;
    line-height: 1.4;
    align-self: center;
    cursor: pointer;
}

/* ===== CONCILIAÇÃO BANCÁRIA ===== */

.conciliacao-table td {
    vertical-align: top;
}

/* Coluna Memo */
.memo-box {
    display: grid;
    grid-template-columns: 1fr 110px;
    gap: 8px;
    align-items: center;
}

.memo-box input[type="text"] {
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-default);
    font-size: 13px;
}

.memo-box select {
    padding: 6px;
    border-radius: 6px;
    border: 1px solid var(--border-default);
    font-size: 13px;
}

/* Possíveis vínculos */
.vinculos-box label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #dbeafe;
    color: #1e40af;
    margin-bottom: 6px;
}

/* Ajustes */
.ajuste-box span {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #fef9c3;
    color: #854d0e;
    margin-bottom: 6px;
}

/* Ação */
.acao-box {
    display: flex;
    justify-content: center;
}

.acao-box select {
    width: 140px;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid var(--border-default);
    font-size: 13px;
}



