/* WB Web — Central de Briefings | Estilos globais */

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

/* ============================================================
   VARIÁVEIS — Identidade Visual WB Web
   ============================================================ */
:root {
  --color-dark:        #16262b;
  --color-dark-light:  #1e3039;
  --color-orange:      #f6921e;
  --color-orange-dark: #c75c1a;
  --color-silver:      #bbbdbf;
  --color-bg:          #f9f9f9;
  --color-surface:     #ffffff;
  --color-text:        #16262b;
  --color-text-muted:  #6b7280;
  --color-border:      #e5e7eb;
  --color-error:       #dc2626;
  --color-success:     #16a34a;

  --sidebar-width: 260px;
  --font-primary: 'Inter', sans-serif;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);

  /* Escala tipográfica */
  --text-xs:   11px;  /* labels, badges, nav */
  --text-sm:   12px;  /* notas, helpers, botões de ação em tabela */
  --text-base: 14px;  /* corpo de tabelas, metadados */
  --text-md:   15px;  /* labels de formulário, itens de lista */
  --text-body: 16px;  /* inputs, conteúdo principal */
  --text-lg:   18px;  /* títulos de seção (content-header h1, modal h2) */
  --text-xl:   20px;  /* login title */
  --text-2xl:  24px;  /* welcome heading */
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-primary);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   TELA DE LOGIN
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-dark);
  background-image: radial-gradient(ellipse at 60% 40%, #1e3039 0%, #16262b 70%);
}

.login-card {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  text-align: center;
}

.login-logo {
  margin-bottom: 8px;
}

.login-logo img {
  height: 72px;
  width: auto;
}

.login-brand {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 32px;
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 16px;
  color: var(--color-text-muted);
  margin-bottom: 28px;
}

.form-group {
  text-align: left;
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-primary);
  font-size: 16px;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--color-orange);
  box-shadow: 0 0 0 3px rgba(246,146,30,.15);
}

.form-group input.is-error,
.form-group select.is-error,
.form-group textarea.is-error {
  border-color: var(--color-error);
}

.field-error {
  display: none;
  font-size: 12px;
  color: var(--color-error);
  margin-top: 4px;
}

.field-error.visible { display: block; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s, box-shadow .2s;
  text-decoration: none;
}

.btn:active { transform: scale(.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--color-orange), var(--color-orange-dark));
  color: #fff;
  box-shadow: 0 2px 8px rgba(246,146,30,.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f9a43e, var(--color-orange));
  box-shadow: 0 4px 12px rgba(246,146,30,.45);
}

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

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

.btn-full { width: 100%; }

.login-error {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--color-error);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: left;
}

.login-error.visible { display: block; }

/* ============================================================
   LAYOUT PRINCIPAL — SIDEBAR + CONTEÚDO
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo img {
  height: 40px;
  width: auto;
}

.sidebar-logo-text {
  color: #fff;
  font-size: 13px;
  line-height: 1.3;
}

.sidebar-logo-text strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.sidebar-logo-text span {
  color: var(--color-silver);
  font-size: 11px;
  font-weight: 400;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
}

.sidebar-nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.35);
  padding: 0 8px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius);
  color: rgba(255,255,255,.7);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, color .2s;
  margin-bottom: 2px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(135deg, var(--color-orange), var(--color-orange-dark));
  color: #fff;
  box-shadow: 0 2px 8px rgba(246,146,30,.3);
}

.nav-item-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: .8;
}

.nav-item.active .nav-item-icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.8);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

.nav-item.active .nav-badge {
  background: rgba(255,255,255,.25);
  color: #fff;
}

/* Item desabilitado / em breve */
.nav-item--disabled,
.nav-item[disabled] {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: none;
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.6);
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.btn-logout:hover {
  background: rgba(220,38,38,.15);
  border-color: rgba(220,38,38,.3);
  color: #fca5a5;
}

/* --- Conteúdo principal --- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.content-header-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--color-orange), var(--color-orange-dark));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.content-header-icon svg { color: #fff; }

.content-header-info h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-dark);
  line-height: 1.2;
}

.content-header-info p {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.content-body {
  padding: 32px;
  flex: 1;
}

/* --- Welcome screen --- */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 32px;
}

.welcome-logo img {
  height: 80px;
  margin-bottom: 24px;
}

.welcome-screen h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 8px;
}

.welcome-screen p {
  font-size: 16px;
  color: var(--color-text-muted);
  max-width: 480px;
  margin-bottom: 32px;
}

.welcome-cards {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.welcome-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  padding: 20px 24px;
  width: 220px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  text-align: left;
}

.welcome-card:hover {
  border-color: var(--color-orange);
  box-shadow: 0 4px 16px rgba(246,146,30,.15);
  transform: translateY(-2px);
}

.welcome-card-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-orange), var(--color-orange-dark));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.welcome-card-icon svg { color: #fff; }

.welcome-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 4px;
}

.welcome-card p {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 0;
}

/* Soluções por categoria */
.welcome-solutions {
  width: 100%;
  max-width: 680px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.welcome-category-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

/* Card desabilitado / em breve */
.welcome-card--soon {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

.welcome-card-icon--soon {
  background: var(--color-silver) !important;
}

/* ============================================================
   FORMULÁRIOS DE BRIEFING
   ============================================================ */
.briefing-form { max-width: 800px; }

/* Seções */
.form-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.form-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: linear-gradient(to right, #fafafa, var(--color-surface));
  border-bottom: 1px solid var(--color-border);
}

.section-number {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--color-orange), var(--color-orange-dark));
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.form-section-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-dark);
}

.form-section-body {
  padding: 24px;
  display: grid;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.form-row.col-full {
  grid-template-columns: 1fr;
}

/* Checkboxes e radios */
.checkbox-group,
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-item,
.radio-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  transition: border-color .2s, background .2s;
  user-select: none;
}

.checkbox-item:hover,
.radio-item:hover {
  border-color: var(--color-orange);
  background: rgba(246,146,30,.05);
}

.checkbox-item input,
.radio-item input {
  width: 15px;
  height: 15px;
  accent-color: var(--color-orange);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-item:has(input:checked),
.radio-item:has(input:checked) {
  border-color: var(--color-orange);
  background: rgba(246,146,30,.08);
  color: var(--color-orange-dark);
}

/* Botões Sim/Não */
.toggle-group {
  display: flex;
  gap: 8px;
}

.toggle-btn {
  padding: 9px 24px;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  background: none;
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: all .2s;
}

.toggle-btn:hover { border-color: var(--color-orange); }

.toggle-btn.active {
  background: var(--color-orange);
  border-color: var(--color-orange);
  color: #fff;
}

/* Lista dinâmica de serviços */
.dynamic-list { display: flex; flex-direction: column; gap: 8px; }

.dynamic-item {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dynamic-item input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-primary);
  font-size: 16px;
  color: var(--color-text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.dynamic-item input:focus {
  border-color: var(--color-orange);
  box-shadow: 0 0 0 3px rgba(246,146,30,.15);
}

.btn-remove-item {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color .2s, color .2s, background .2s;
  font-size: 16px;
  line-height: 1;
}

.btn-remove-item:hover {
  border-color: var(--color-error);
  color: var(--color-error);
  background: #fef2f2;
}

.btn-add-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px dashed var(--color-border);
  border-radius: 6px;
  background: none;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color .2s, color .2s;
  margin-top: 4px;
  width: fit-content;
}

.btn-add-item:hover {
  border-color: var(--color-orange);
  color: var(--color-orange);
}

/* Campo condicional */
.conditional-field {
  display: none;
}

.conditional-field.visible {
  display: block;
}

/* Textarea */
.form-group textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

/* Tabela de especificações técnicas */
.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.specs-table th {
  background: var(--color-bg);
  padding: 9px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.specs-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

.specs-table tr:last-child td { border-bottom: none; }

.specs-table tr:hover td { background: var(--color-bg); }

/* Botão de submissão */
.form-submit-area {
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-submit {
  padding: 13px 32px;
  font-size: 16px;
  background: linear-gradient(135deg, var(--color-orange), var(--color-orange-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-primary);
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow .2s, transform .1s;
  box-shadow: 0 3px 10px rgba(246,146,30,.35);
}

.btn-submit:hover { box-shadow: 0 5px 16px rgba(246,146,30,.45); }
.btn-submit:active { transform: scale(.98); }

/* ============================================================
   TELA DO PROMPT GERADO
   ============================================================ */
.prompt-result { max-width: 800px; }

.prompt-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 16px;
}

.prompt-badge.b01 {
  background: rgba(246,146,30,.12);
  color: var(--color-orange-dark);
  border: 1px solid rgba(246,146,30,.3);
}

.prompt-badge.b02 {
  background: rgba(22,38,43,.08);
  color: var(--color-dark);
  border: 1px solid rgba(22,38,43,.2);
}

.prompt-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.prompt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.prompt-card-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-dark);
}

.btn-copy {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--color-dark);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}

.btn-copy:hover { background: var(--color-dark-light); }

.btn-copy.copied {
  background: var(--color-success);
}

.prompt-textarea {
  width: 100%;
  min-height: 420px;
  max-height: 60vh;
  padding: 20px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 1.65;
  color: var(--color-text);
  background: #fafafa;
  border: none;
  outline: none;
  resize: none;
  overflow-y: auto;
}

.prompt-actions {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 10px;
}

/* ============================================================
   PROPOSTA COMERCIAL — iframe
   ============================================================ */
.proposta-frame {
  display: block;
  width: 100%;
  height: 100vh;
  border: none;
}

/* ============================================================
   IMPRESSÃO — oculta sidebar para PDF da Proposta Comercial
   ============================================================ */
@media print {
  .sidebar { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .proposta-frame { height: auto !important; }
}

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 900px) {
  .sidebar {
    width: 64px;
    overflow: visible;
  }

  .sidebar-logo-text,
  .nav-badge,
  .sidebar-nav-label,
  .btn-logout span,
  .nav-item span { display: none; }

  .nav-item { justify-content: center; padding: 12px; }
  .btn-logout { justify-content: center; padding: 10px; }
  .sidebar-logo { justify-content: center; }
  .sidebar-logo img { height: 32px; }

  .main-content { margin-left: 64px; }
  .content-body { padding: 20px 16px; }
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr; }
  .content-body { padding: 16px; }
  .login-card { padding: 32px 24px; }

  /* Content header empilha em mobile */
  .content-header {
    padding: 14px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .content-header-info h1 { font-size: 16px; }
  .content-header-info p  { font-size: 12px; }

  /* Totalizadores: 1 coluna em mobile */
  #hist-totais { grid-template-columns: 1fr !important; gap: 10px !important; }

  /* Toolbar propostas: empilha */
  .historico-toolbar { flex-direction: column; align-items: stretch !important; }
  .historico-search  { max-width: 100%; }

  /* Modais: largura total */
  .modal-box,
  .modal-box-lg { max-width: calc(100vw - 32px) !important; }

  /* Hub cliente: grid coluna única */
  .cli-hub-content { grid-template-columns: 1fr !important; }
  .cli-hub-label   { width: auto !important; min-width: 100px; }
}

/* ─── HISTÓRICO DE PROPOSTAS ─── */
.historico-toolbar {
  margin-bottom: 20px;
}

.historico-search {
  width: 100%;
  max-width: 480px;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  color: var(--color-text);
  background: #fff;
  outline: none;
  transition: border-color .15s;
}

.historico-search:focus { border-color: var(--color-orange); }

.historico-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.historico-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-base); /* 14px — padrão para tabelas */
  min-width: 760px; /* garante scroll horizontal antes de quebrar */
}

.historico-table thead tr {
  background: var(--color-dark);
}

.historico-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: var(--text-xs); /* 11px */
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
  white-space: nowrap;
}

.historico-table tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background .1s;
}

.historico-table tbody tr:hover { background: #f8fafc; }

.historico-table td {
  padding: 11px 14px;
  color: var(--color-text);
  vertical-align: middle;
  font-size: var(--text-base); /* 14px */
}

.hist-num {
  font-weight: 700;
  color: var(--color-dark);
  white-space: nowrap;
  font-size: var(--text-base);
}

.hist-cliente {
  font-size: var(--text-base);
  font-weight: 500;
}

.hist-data {
  white-space: nowrap;
  color: var(--color-text-muted);
  font-size: var(--text-sm); /* 12px — metadado secundário */
}

.hist-servico {
  color: var(--color-text-muted);
  font-size: var(--text-sm); /* 12px */
}

.btn-ver {
  display: inline-block;
  padding: 5px 12px;
  background: var(--color-orange);
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .15s;
}

.btn-ver:hover { opacity: .85; }

.historico-loading,
.historico-vazio {
  padding: 40px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 16px;
}

.historico-total {
  margin-top: 12px;
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: right;
}

.btn-ver-disabled {
  display: inline-block;
  padding: 5px 12px;
  background: #e2e8f0;
  color: #94a3b8;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: default;
}

.btn-pdf-hist {
  display: inline-block;
  padding: 5px 12px;
  background: #1e40af;
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .15s;
}
.btn-pdf-hist:hover { opacity: .85; }

.btn-pdf-hist-disabled {
  display: inline-block;
  width: 44px;
}

/* ============================================================
   LOGIN — link e mensagem de sucesso
   ============================================================ */
.login-link {
  font-size: 13px;
  color: var(--color-orange);
  text-decoration: none;
  font-weight: 500;
}
.login-link:hover { text-decoration: underline; }

.login-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: var(--color-success);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: left;
}

/* ============================================================
   SIDEBAR — usuário logado
   ============================================================ */
.sidebar-user {
  margin-bottom: 8px;
  padding: 8px 12px;
}

.sidebar-user-name {
  font-size: 12px;
  color: rgba(255,255,255,.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   MODAL — gerenciamento de usuários
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-box {
  background: var(--color-surface);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  margin: 16px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
  font-size: var(--text-lg); /* 18px */
  font-weight: 700;
  color: var(--color-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.modal-close:hover { color: var(--color-error); }

.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
}

/* ============================================================
   BADGES e AÇÕES — tabela de usuários
   ============================================================ */
.badge-admin {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(246,146,30,.12);
  color: var(--color-orange-dark);
  border: 1px solid rgba(246,146,30,.3);
  border-radius: 20px;
  font-size: var(--text-sm); /* 12px */
  font-weight: 700;
}

.badge-ativo {
  display: inline-block;
  padding: 2px 10px;
  background: #f0fdf4;
  color: var(--color-success);
  border: 1px solid #bbf7d0;
  border-radius: 20px;
  font-size: var(--text-sm); /* 12px */
  font-weight: 700;
}

.badge-inativo {
  display: inline-block;
  padding: 2px 10px;
  background: #fef2f2;
  color: var(--color-error);
  border: 1px solid #fecaca;
  border-radius: 20px;
  font-size: var(--text-sm); /* 12px */
  font-weight: 700;
}

.btn-acao {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--color-border);
  background: none;
  color: var(--color-text);
  font-family: var(--font-primary);
  margin-right: 4px;
  transition: all .15s;
}

.btn-acao:hover { border-color: var(--color-orange); color: var(--color-orange); }

.btn-acao-toggle:hover { border-color: #f59e0b; color: #f59e0b; }

.btn-acao-delete:hover { border-color: var(--color-error); color: var(--color-error); }

/* ============================================================
   HISTÓRICO — botão duplicar e aviso
   ============================================================ */
.btn-duplicar {
  border: 1.5px solid var(--color-border);
  background: none;
  color: var(--color-text-muted);
}

.btn-duplicar:hover {
  border-color: var(--color-orange);
  color: var(--color-orange);
  background: rgba(246,146,30,.05);
}

.dup-aviso {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 8px;
}

/* ============================================================
   CLIENTES
   ============================================================ */
.cli-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.cli-busca {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: var(--text-body); /* 16px */
  font-family: var(--font-primary);
  color: var(--color-text);
  background: var(--color-surface);
}

.cli-busca:focus { outline: none; border-color: var(--color-orange); }

.modal-box-lg { max-width: 680px; }

.cli-secao-titulo {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-muted);
  padding: 14px 0 8px;
  border-top: 1px solid var(--color-border);
  margin-top: 4px;
}

.cli-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 20px;
}

.cli-tab {
  background: none;
  border: none;
  padding: 8px 18px;
  font-size: 16px;
  font-family: var(--font-primary);
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-weight: 500;
}

.cli-tab.active {
  color: var(--color-orange);
  border-bottom-color: var(--color-orange);
}

.cli-tab-content { animation: fadeIn .15s ease; }

.cli-tipo-wrap {
  display: flex;
  gap: 24px;
}

.cli-tipo-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  cursor: pointer;
}

.cli-tipo-opt input { width: auto; margin: 0; }

.btn-sm { padding: 6px 14px; font-size: 13px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   CONFIGURAÇÕES
   ============================================================ */
.cfg-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.cfg-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-dark);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.cfg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.cfg-info {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.cfg-db-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.cfg-readonly {
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: default;
}

.cfg-senha-wrap {
  position: relative;
  display: flex;
}

.cfg-senha-wrap input {
  flex: 1;
  border-radius: var(--radius) 0 0 var(--radius);
}

.cfg-toggle-senha {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0 12px;
  cursor: pointer;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
}

.cfg-toggle-senha:hover {
  color: var(--color-dark);
}

.cfg-msg {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 16px;
  margin-bottom: 16px;
}

.cfg-msg-ok {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

.cfg-msg-erro {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--color-error);
}

@media (max-width: 600px) {
  .cfg-grid { grid-template-columns: 1fr; }
}

/* ─── Seletor de Cliente (Briefings) ─── */
.cs-wrap { position: relative; }
.cs-input-row { display: flex; gap: 8px; }
.cs-input-row .cs-busca {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-primary);
  font-size: 16px;
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.cs-input-row .cs-busca:focus {
  border-color: var(--color-orange);
  box-shadow: 0 0 0 3px rgba(246,146,30,.15);
}
.cs-btn-add {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--color-orange);
  color: #fff;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  transition: background .15s;
}
.cs-btn-add:hover { background: var(--color-orange-dark); }
.cs-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  z-index: 999;
  max-height: 210px;
  overflow-y: auto;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.cs-dd-item {
  padding: 10px 14px;
  cursor: pointer;
  font-family: var(--font-primary);
  font-size: 16px;
  color: var(--color-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background .1s;
}
.cs-dd-item:hover { background: var(--color-bg); }
.cs-dd-tipo {
  font-size: 11px;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border-radius: 4px;
  padding: 2px 6px;
}
.cs-dd-vazio {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--color-text-muted);
  font-style: italic;
}
.cs-selecionado {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1.5px solid var(--color-orange);
  border-radius: var(--radius);
  background: rgba(246,146,30,.06);
}
.cs-selecionado span {
  font-size: 16px;
  color: var(--color-navy);
  font-weight: 600;
}
.cs-selecionado button {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 15px;
  padding: 0 4px;
  line-height: 1;
}
.cs-selecionado button:hover { color: var(--color-error); }
.cs-wrap.cs-error .cs-input-row .cs-busca,
.cs-wrap.cs-error .cs-selecionado { border-color: var(--color-error); }

/* ─── Status de Aprovação (Histórico) ─── */
.hist-status { white-space: nowrap; }

.badge-aprovada {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: default;
}

.badge-pendente {
  display: inline-flex;
  align-items: center;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: default;
}

.badge-reprovada {
  display: inline-flex;
  align-items: center;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: default;
}

.btn-aprovar-hist,
.btn-reprovar-hist,
.btn-desfazer-aprov,
.btn-duplicar {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 6px;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}

.btn-aprovar-hist {
  border: 1.5px solid #22c55e;
  background: #f0fdf4;
  color: #15803d;
}
.btn-aprovar-hist:hover { background: #dcfce7; }

.btn-reprovar-hist {
  border: 1.5px solid #fca5a5;
  background: #fef2f2;
  color: #dc2626;
}
.btn-reprovar-hist:hover { background: #fee2e2; }

.btn-desfazer-aprov {
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #64748b;
}
.btn-desfazer-aprov:hover { background: #f1f5f9; }

/* ─── Totalizadores ─── */
.hist-total-card {
  border-radius: 10px;
  padding: 16px 20px;
  border: 1px solid var(--color-border);
}
.hist-total-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.hist-total-count {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}
.hist-total-valor { font-size: 13px; font-weight: 600; }

.hist-total-neg   { background:#fff7ed; border-color:#fed7aa; color:#c2410c; }
.hist-total-aprov { background:#f0fdf4; border-color:#86efac; color:#15803d; }
.hist-total-reprov{ background:#fef2f2; border-color:#fca5a5; color:#dc2626; }

/* ─── Valor inline ─── */
.hist-valor { white-space: nowrap; }
.hist-valor-display { cursor: pointer; text-decoration: underline dotted #9ca3af; }
.hist-valor-display:hover { color: var(--color-orange); }

/* ============================================================
   DNA DO CLIENTE
   ============================================================ */

/* Toolbar */
.dna-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.dna-busca {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-primary);
  font-size: 16px;
  color: var(--color-text);
  outline: none;
  transition: border-color .15s;
}
.dna-busca:focus { border-color: var(--color-orange); }

/* Status badges */
.dna-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}
.dna-badge-none     { background: #f1f5f9; color: #64748b; }
.dna-badge-rascunho { background: #fef3c7; color: #92400e; }
.dna-badge-ok       { background: #dcfce7; color: #15803d; }

/* Panel (full-page overlay dentro do main) */
.dna-panel {
  position: fixed;
  inset: 0;
  left: var(--sidebar-width);
  background: var(--color-bg);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.dna-panel-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}

/* Link box */
.dna-link-box {
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
  padding: 14px 28px;
}
.dna-link-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.dna-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dna-link-input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-primary);
  font-size: 13px;
  color: var(--color-text-muted);
  background: #fff;
  outline: none;
  cursor: text;
}

/* Body do painel */
.dna-panel-body {
  padding: 28px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

/* Seções do DNA */
.dna-secao {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}
.dna-secao-titulo {
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-dark);
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
}
.dna-campos { padding: 4px 0; }

.dna-campo {
  display: flex;
  gap: 16px;
  padding: 10px 20px;
  border-bottom: 1px solid #f1f5f9;
  align-items: flex-start;
}
.dna-campo:last-child { border-bottom: none; }
.dna-campo-label {
  flex-shrink: 0;
  width: 220px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  padding-top: 2px;
}
.dna-campo-valor {
  flex: 1;
  font-size: 16px;
  color: var(--color-text);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Edit mode */
.dna-edit-input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  font-family: var(--font-primary);
  font-size: 16px;
  color: var(--color-text);
  outline: none;
  transition: border-color .15s;
  resize: vertical;
}
.dna-edit-input:focus { border-color: var(--color-orange); }

.dna-edit-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dna-edit-chip {
  padding: 4px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  color: var(--color-text-muted);
}
.dna-edit-chip:hover { border-color: var(--color-orange); }
.dna-edit-chip.selected {
  border-color: var(--color-orange);
  background: #fff8f0;
  color: var(--color-orange-dark);
  font-weight: 600;
}

@media (max-width: 768px) {
  .dna-panel { left: 0; }
  .dna-panel-body { padding: 16px; }
  .dna-campo { flex-direction: column; gap: 4px; }
  .dna-campo-label { width: auto; }
}

/* ============================================================
   DNA DA MARCA
   ============================================================ */

.dm-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

/* Diagnóstico — estilo documento */
.dm-descricao-view {
  display: flex;
  flex-direction: column;
}

.dm-secao {
  padding: 18px 0;
  border-bottom: 1px solid var(--color-border);
}
.dm-secao:first-child { padding-top: 0; }
.dm-secao:last-child  { border-bottom: none; padding-bottom: 0; }

.dm-secao-titulo {
  display: flex;
  align-items: baseline;
  gap: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-dark);
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.dm-secao-num {
  color: var(--color-orange);
  margin-right: 6px;
  font-weight: 700;
}

.dm-secao-intro {
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text);
  margin: 0 0 10px 0;
}

.dm-secao-lista {
  list-style: disc;
  margin: 0;
  padding-left: 20px;
}

.dm-secao-lista li {
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: 4px;
}
.dm-secao-lista li:last-child { margin-bottom: 0; }

/* Fallback para texto sem seções */
.dm-secao-simples {
  font-size: 14px;
  line-height: 1.75;
  color: var(--color-text);
}
.dm-secao-simples p { margin: 0 0 14px 0; }
.dm-secao-simples p:last-child { margin-bottom: 0; }

/* Abas */
.dm-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 24px;
}
.dm-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.dm-tab:hover { color: var(--color-dark); }
.dm-tab-active {
  color: var(--color-orange);
  border-bottom-color: var(--color-orange);
}
.dm-tab-content { display: block; }

/* Cards / blocos */
.dm-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}
.dm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
  user-select: none;
}
.dm-card-titulo {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-dark);
}
.dm-card-body {
  padding: 20px;
}

/* Seções do DNA */
.dm-secao {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.dm-secao-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
}
.dm-secao-titulo {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-dark);
}
.dm-secao-salvo {
  font-size: 12px;
  font-weight: 600;
  color: #15803d;
  background: #dcfce7;
  padding: 2px 10px;
  border-radius: 20px;
}
.dm-secao-body {
  padding: 16px 20px;
}

/* Textarea */
.dm-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-primary);
  font-size: 16px;
  color: var(--color-text);
  background: #fff;
  outline: none;
  resize: vertical;
  transition: border-color .15s;
  box-sizing: border-box;
  line-height: 1.6;
}
.dm-textarea:focus { border-color: var(--color-orange); }

/* Labels e hints */
.dm-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.dm-hint {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Estado vazio */
.dm-vazio {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* Arquivos */
.dm-arquivo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 13px;
}
.dm-arquivo-nome {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text);
}
.dm-arquivo-tamanho {
  color: var(--color-text-muted);
  white-space: nowrap;
}
.dm-arquivo-del {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
  transition: color .15s;
}
.dm-arquivo-del:hover { color: #dc2626; }

/* Histórico */
.dm-historico-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  gap: 12px;
}
.dm-historico-item:last-child { border-bottom: none; }
.dm-historico-data {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}
.dm-historico-por {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-left: 8px;
}

/* Modal item de seleção */
.dm-modal-item {
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 15px;
  color: var(--color-text);
  transition: background .12s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dm-modal-item:hover { background: #f0f9ff; }

/* Animação de spin para o botão de gerar */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Chat da IA */
.dm-chat-messages {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 120px;
  max-height: 520px;
  overflow-y: auto;
}

.dm-chat-input {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  background: #fafafa;
}

/* Estado inicial (antes de iniciar análise) */
.dm-chat-inicio {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 20px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Bubbles */
.dm-bubble {
  max-width: 88%;
  border-radius: 12px;
  padding: 12px 16px;
  line-height: 1.6;
  font-size: 15px;
}
.dm-bubble-ia {
  align-self: flex-start;
  background: #f1f5f9;
  border-bottom-left-radius: 4px;
}
.dm-bubble-usuario {
  align-self: flex-end;
  background: #fff4e8;
  border: 1px solid #fde8c8;
  border-bottom-right-radius: 4px;
}
.dm-bubble-autor {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
}
.dm-bubble-corpo p {
  margin: 0 0 8px;
}
.dm-bubble-corpo p:last-child { margin-bottom: 0; }

/* Análise resumida */
.dm-bubble-analise {
  font-size: 13px;
  color: var(--color-text-muted);
  background: rgba(0,0,0,.04);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 10px;
  line-height: 1.5;
}

/* Lista de perguntas */
.dm-perguntas {
  margin: 10px 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dm-perguntas li {
  font-weight: 600;
  color: var(--color-dark);
}

/* Typing indicator */
.dm-typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
  background: #f1f5f9;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}
.dm-typing span {
  width: 7px;
  height: 7px;
  background: var(--color-text-muted);
  border-radius: 50%;
  display: inline-block;
  animation: dmBounce 1.2s infinite ease-in-out;
}
.dm-typing span:nth-child(1) { animation-delay: 0s; }
.dm-typing span:nth-child(2) { animation-delay: .2s; }
.dm-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes dmBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .4; }
  40%           { transform: translateY(-6px); opacity: 1; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .dm-card-body { padding: 14px; }
  .dm-secao-body { padding: 12px 14px; }
  .dm-bubble { max-width: 96%; }
  .dm-chat-messages { max-height: 360px; }
}

/* ============================================================
   HUB DO CLIENTE
   ============================================================ */

/* Nome clicável na tabela */
.cli-nome-link {
  font-weight: 600;
  color: var(--color-orange);
  cursor: pointer;
  text-decoration: none;
  transition: color .15s;
}
.cli-nome-link:hover { color: var(--color-orange-dark); text-decoration: underline; }

/* Abas do hub */
.cli-hub-tabs {
  display: flex;
  border-bottom: 2px solid var(--color-border);
  padding: 0 28px;
  background: var(--color-surface);
  gap: 0;
}

.cli-hub-tab {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.cli-hub-tab:hover  { color: var(--color-dark); }
.cli-hub-tab.active { color: var(--color-orange); border-bottom-color: var(--color-orange); font-weight: 600; }

/* Conteúdo das abas */
#cliHubContent { min-height: 300px; }

/* Layout interno da aba Dados */
.cli-hub-content {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 760px;
}

/* Card de informações */
.cli-hub-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cli-hub-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
  background: #f8fafc;
}
.cli-hub-card-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-dark);
}
.cli-hub-card-body { padding: 0; }

/* Linhas de dado */
.cli-hub-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--color-border);
}
.cli-hub-row:last-child { border-bottom: none; }
.cli-hub-label {
  width: 140px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
  padding-top: 1px;
}
.cli-hub-value { font-size: 14px; color: var(--color-text); }

/* Contatos no hub */
.cli-hub-contato {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-border);
}
.cli-hub-contato:last-child { border-bottom: none; }

/* Header de ações no painel de briefing/DNA embutido */
.cli-hub-painel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .cli-hub-tabs { padding: 0 16px; }
  .cli-hub-tab  { padding: 10px 14px; font-size: 13px; }
  .cli-hub-content { padding: 16px; }
  .cli-hub-label { width: 110px; }
}
