/*
 * Identidade visual Delega IA
 * A paleta foi consolidada a partir da apresentação institucional: azul cobalto,
 * azul elétrico e superfícies claras/azuladas. Este arquivo é carregado por último
 * para manter a identidade consistente sem alterar os fluxos funcionais das telas.
 */
:root{
  --delega-cobalt:#0b3194;
  --delega-electric:#1774ff;
  --delega-navy:#061a52;
  --delega-night:#07142f;
  --delega-surface:#f5f8ff;
  --delega-line:#d9e4f7;
  --purple:var(--delega-cobalt);
  --lightpurple:#eaf2ff;
  --bg:var(--delega-surface);
}

/* A marca horizontal oficial evita recortes e preserva o símbolo e a tipografia juntos. */
.delega-wordmark{display:block;width:182px;height:auto;max-height:42px;object-fit:contain}
.brand .delega-wordmark{width:166px;filter:brightness(0) invert(1)}
.login-brand{margin-bottom:72px}

/* Azul institucional aplicado às ações, destaques e estados de foco. */
.primary,.chat footer .send{background:linear-gradient(135deg,var(--delega-cobalt),var(--delega-electric)};box-shadow:0 5px 13px #0b319433}
.primary:hover,.chat footer .send:hover{background:linear-gradient(135deg,#082678,#0b63e8)}
.text-btn,.link,.secondary,.toolbar-clear,.eyebrow{color:var(--delega-cobalt)}
.secondary,.outline{border-color:#b9d0ff;color:var(--delega-cobalt)}
.toolbar-clear,.insight{background:#eef5ff}
.insight{border-color:#c9ddff}
.insight-icon,.empty-state:before,.empty-icon{background:#dceaff;color:var(--delega-cobalt)}
.conversation.selected{background:#e8f1ff}
.message.user{background:linear-gradient(135deg,var(--delega-cobalt),#176ff2)}
.ai-label,.page-heading h1 span{color:var(--delega-cobalt)}
.agent-progress u{background:linear-gradient(90deg,var(--delega-cobalt),var(--delega-electric)}
.brand,.sidebar{background-color:var(--delega-navy)}
.sidebar{background:linear-gradient(180deg,#08276f 0%,var(--delega-navy) 68%,#04133d 100%)}
.sidebar .brand{background:transparent}
.nav-link.active,.nav-link:hover{background:#17479b}
.office{border-color:#28509b}
.login-aside{background:radial-gradient(circle at 22% 22%,#2387ff 0%,var(--delega-cobalt) 42%,#061a52 100%)}
.login-aside span{background:#ffffff1c;border-color:#ffffff42}
.topbar{border-bottom-color:var(--delega-line)}

/* O tema escuro mantém o mesmo azul profundo da identidade institucional. */
body[data-theme="dark"]{--ink:#edf5ff;--muted:#aec4ea;--line:#274477;--bg:var(--delega-night);background:var(--delega-night)}
body[data-theme="dark"] .login-screen{background:var(--delega-night)}
body[data-theme="dark"] .login-panel{background:#0a1d42}
body[data-theme="dark"] .login-panel input,body[data-theme="dark"] input,body[data-theme="dark"] select,body[data-theme="dark"] textarea{background:#081a3a;border-color:#31538a}
body[data-theme="dark"] .topbar,body[data-theme="dark"] .stats article,body[data-theme="dark"] .panel,body[data-theme="dark"] .toolbar,body[data-theme="dark"] .company-card,body[data-theme="dark"] .agent-card,body[data-theme="dark"] .conversation-layout,body[data-theme="dark"] .conversation-list,body[data-theme="dark"] .conversation,body[data-theme="dark"] .message.ai,body[data-theme="dark"] .modal,body[data-theme="dark"] .secondary,body[data-theme="dark"] .outline,body[data-theme="dark"] .contract-history{background:#0b2046;border-color:#274477}
body[data-theme="dark"] .messages{background:#081a3a}
body[data-theme="dark"] .conversation.selected,body[data-theme="dark"] .conversation:hover{background:#123773}
body[data-theme="dark"] .insight{background:#0b2a62;border-color:#2b5ca9}
body[data-theme="dark"] .chat footer{background:#0b2046;border-color:#274477}
body[data-theme="dark"] .toolbar select,body[data-theme="dark"] .toolbar input,body[data-theme="dark"] .conversation-list input{background:#081a3a;border-color:#31538a}
body[data-theme="dark"] .account-shortcut,body[data-theme="dark"] .theme-toggle{background:#0e2b5c!important;border-color:#436ba9!important;color:#e8f2ff!important}
body[data-theme="dark"] .chat-actions-menu{background:#0b2046;border-color:#31538a}
body[data-theme="dark"] #conversas .chat header{background:#0b2046;box-shadow:0 7px 14px #020818cc}
body[data-theme="dark"] .ai-markdown th{background:#10316a;color:#e8f2ff}
body[data-theme="dark"] .ai-markdown tbody tr:nth-child(even){background:#0d2651}
body[data-theme="dark"] .ai-markdown blockquote{background:#0d2a5d;border-color:#3987ff;color:#d7e8ff}
body[data-theme="dark"] .message.ai.thinking-ai{background:#0d2a5d;border-color:#3978d3;color:#e3efff}

@media(max-width:700px){.brand-mark{width:29px;height:29px}}

/*
 * Aplicação global da paleta oficial.
 * O objetivo é eliminar o roxo herdado do protótipo e manter todos os módulos
 * — inclusive SUP, conversas, formulários e tabelas — no mesmo sistema visual.
 */
:root{
  --delega-blue-950:#071b51;
  --delega-blue-900:#0b2c84;
  --delega-blue-800:#103a98;
  --delega-blue-700:#0e56b3;
  --delega-blue-600:#1375ca;
  --delega-blue-100:#e7f0ff;
  --delega-blue-050:#f5f8ff;
  --ink:#0b235c;
  --muted:#58709d;
  --line:#d5e2f6;
  --bg:#f4f7fc;
}

/* Estrutura, cartões e filtros usam superfícies claras e bordas azuladas no tema claro. */
body{background:var(--bg);color:var(--ink)}
.topbar{background:#fff;border-color:var(--line)}
.breadcrumb{color:#315487}
.page-heading h1,.simple h1,.panel h2,.company-card h3,.agent-card h3{color:var(--delega-blue-950)}
.page-heading p,.panel-title p,.simple p,.activity-row p,.company-card p,.agent-card p{color:#5b739d}
.stats article,.panel,.toolbar,.company-card,.agent-card,.conversation-layout,.conversation-list,.modal,.secondary,.outline{border-color:var(--line)}
.stats article,.panel,.toolbar,.company-card,.agent-card,.conversation-layout,.conversation-list,.modal{border-radius:12px}
.toolbar,.stats article,.panel,.company-card,.agent-card{box-shadow:0 8px 22px #0a2d7910}
.toolbar input,.toolbar select,.conversation-list input,.modal input,.modal select,.modal textarea,.audit-toolbar input,.audit-toolbar select{border-color:#c9daef;outline-color:var(--delega-blue-600)}
.toolbar-clear,.secondary,.outline{background:#f4f8ff;color:var(--delega-blue-800)}
.toolbar-clear:hover,.secondary:hover,.outline:hover{background:#e6f0ff}
.text-btn,.link{color:var(--delega-blue-700)}
.text-btn:hover,.link:hover{color:var(--delega-blue-900)}
.eyebrow,.ai-label{color:var(--delega-blue-700)}

/* Componentes de ação e seleção seguem o degradê azul visto nos materiais da marca. */
.primary,.chat footer .send{background:linear-gradient(135deg,#0b2c84 0%,#1375ca 100%);box-shadow:0 6px 15px #0a3d9930}
.primary:hover,.chat footer .send:hover{background:linear-gradient(135deg,#071e63 0%,#0d62bb 100%)}
.conversation.selected{background:#e7f0ff;box-shadow:inset 3px 0 0 var(--delega-blue-600)}
.conversation:hover{background:#f0f6ff}
.message.user{background:linear-gradient(135deg,#0b2c84,#1375ca)}
.message.ai{border-color:#d5e2f6;background:#fff}
.finding{border-left-color:var(--delega-blue-600);background:#f0f6ff}
.insight{background:linear-gradient(115deg,#e9f2ff,#f6f9ff);border-color:#bdd5fb}
.insight-icon,.empty-state:before,.empty-icon,.purple{background:#dceaff;color:var(--delega-blue-800)}
.agent-progress u{background:linear-gradient(90deg,#0b2c84,#1375ca)}
.chat-actions-toggle{border-color:#b9d1fb!important;background:#f3f7ff!important;color:var(--delega-blue-800)!important}
.chat-actions-menu{border-color:#d5e2f6;box-shadow:0 14px 32px #09245a20}
.chat-actions-menu button:hover{background:#edf4ff!important;color:var(--delega-blue-800)!important}

/* Sidebar com fundo cobalto sólido e estados de navegação de alto contraste. */
.sidebar{background:linear-gradient(180deg,#0b2c84 0%,#09266f 62%,#071b51 100%)}
.office,.profile{border-color:#28529b}
.nav-link{color:#d7e5ff}
.nav-link.active,.nav-link:hover{background:#1a55af;color:#fff}
nav p{color:#9dbceb}
.office small,.profile small{color:#bfd3f3}
.office button,.profile button{color:#dce9ff}
.avatar{background:#dbeaff;color:#0b2c84}

/* Formulários e feedbacks ficam alinhados à linguagem azul, sem alterar alertas críticos. */
input:focus,select:focus,textarea:focus{border-color:var(--delega-blue-600)!important;box-shadow:0 0 0 3px #1375ca20}
.status.done{background:#e6f7ef;color:#167446}
.status.warning,.running{background:#fff4d9;color:#9b6707}
.status.suspended{background:#fff0f2;color:#bc2941}
.login-aside{background:radial-gradient(circle at 72% 24%,#1f88dc 0%,#0d56af 35%,#0b2c84 68%,#071b51 100%)}
.login-panel{background:#fff}
.login-brand .delega-wordmark{width:194px;max-height:47px}
.modal-backdrop{background:#04163bb8}
.modal{box-shadow:0 22px 56px #06183f40}

/* Tema escuro: a interface inteira passa a usar a escala azul oficial. */
body[data-theme="dark"]{--ink:#f1f6ff;--muted:#b3c8eb;--line:#315889;--bg:#071b51;background:#071b51;color:#f1f6ff}
body[data-theme="dark"] .login-screen{background:#071b51}
body[data-theme="dark"] .login-panel{background:#0a265c}
body[data-theme="dark"] .topbar{background:#0a2861;border-color:#315889}
body[data-theme="dark"] .stats article,body[data-theme="dark"] .panel,body[data-theme="dark"] .toolbar,body[data-theme="dark"] .company-card,body[data-theme="dark"] .agent-card,body[data-theme="dark"] .conversation-layout,body[data-theme="dark"] .conversation-list,body[data-theme="dark"] .conversation,body[data-theme="dark"] .message.ai,body[data-theme="dark"] .modal,body[data-theme="dark"] .secondary,body[data-theme="dark"] .outline,body[data-theme="dark"] .contract-history{background:#0b2b66;border-color:#315889}
body[data-theme="dark"] .messages{background:#081f4d}
body[data-theme="dark"] .chat footer,body[data-theme="dark"] #conversas .chat header{background:#0b2b66;border-color:#315889}
body[data-theme="dark"] .chat header{border-color:#315889}
body[data-theme="dark"] .conversation.selected,body[data-theme="dark"] .conversation:hover{background:#164894;box-shadow:inset 3px 0 0 #48a1ff}
body[data-theme="dark"] .toolbar select,body[data-theme="dark"] .toolbar input,body[data-theme="dark"] .conversation-list input,body[data-theme="dark"] .audit-toolbar input,body[data-theme="dark"] .audit-toolbar select{background:#081f4d;border-color:#3a66a0;color:#f1f6ff}
body[data-theme="dark"] .insight{background:linear-gradient(120deg,#0c3478,#0d2960);border-color:#3468b0}
body[data-theme="dark"] .finding{background:#0c3478;color:#dcecff;border-color:#49a0ff}
body[data-theme="dark"] .chat-actions-menu{background:#0b2b66;border-color:#3a66a0}
body[data-theme="dark"] .chat-actions-menu button:hover{background:#164894!important;color:#fff!important}
body[data-theme="dark"] .account-shortcut,body[data-theme="dark"] .theme-toggle{background:#123b80!important;border-color:#4f7fbd!important;color:#f0f6ff!important}
body[data-theme="dark"] .chat-actions-toggle{background:#123b80!important;border-color:#4f7fbd!important;color:#f0f6ff!important}
body[data-theme="dark"] .ai-markdown h1,body[data-theme="dark"] .ai-markdown h2,body[data-theme="dark"] .ai-markdown h3,body[data-theme="dark"] .ai-markdown strong{color:#f4f8ff}
body[data-theme="dark"] .ai-markdown th{background:#123d86;color:#f0f6ff;border-color:#3a66a0}
body[data-theme="dark"] .ai-markdown td,body[data-theme="dark"] .ai-markdown hr,body[data-theme="dark"] .markdown-table-wrap{border-color:#315889}
body[data-theme="dark"] .ai-markdown tbody tr:nth-child(even){background:#0e326f}
body[data-theme="dark"] .ai-markdown blockquote{background:#0c3478;border-color:#49a0ff;color:#dcecff}
body[data-theme="dark"] .message.ai.thinking-ai{background:#0c3478;border-color:#4381d0;color:#eff6ff}
body[data-theme="dark"] .audit-table th,body[data-theme="dark"] .consumption-head,body[data-theme="dark"] .consumption-user-head{background:#081f4d;color:#b9d0f2}
body[data-theme="dark"] .audit-table td,body[data-theme="dark"] .consumption-row,body[data-theme="dark"] .consumption-user-row{border-color:#315889;color:#edf5ff}
body[data-theme="dark"] .audit-table tbody tr:hover{background:#113b80}
body[data-theme="dark"] .audit-table td:nth-child(3){color:#75b7ff}

@media(max-width:700px){
  .delega-wordmark{width:168px;max-height:39px}
  .brand .delega-wordmark{width:152px}
  .login-brand{margin-bottom:48px}
}
