/* Correções do tema escuro (Grafite). Partes antigas do index.html usam fundos claros fixos
   (#fff, degradês claros); aqui elas passam a usar as cores do tema. Só vale com data-theme="graphite". */

body[data-theme="graphite"] {
  --tz-dark-pill: #3a4559;
  --tz-dark-pill-ink: #d4dce9;
}

/* Botões redondos do topo (tema, busca, notificações) */
body[data-theme="graphite"] .top .round,
body[data-theme="graphite"] .global-theme-button {
  background: var(--panel);
  border-color: var(--line);
  color: var(--tz-dark-pill-ink);
}
body[data-theme="graphite"] .top .round:hover { background: var(--blue2); color: var(--blue); }

/* Quadros de título e painéis com degradê claro */
body[data-theme="graphite"] .crud-page-action,
body[data-theme="graphite"] .contact-create-panel,
body[data-theme="graphite"] .connection-help,
body[data-theme="graphite"] .search-breakdown-card {
  background: var(--surface) !important;
  background-image: none !important;
  border-color: var(--line) !important;
  color: var(--ink);
}
body[data-theme="graphite"] .crud-page-action strong,
body[data-theme="graphite"] .crud-page-action span { color: inherit; }
body[data-theme="graphite"] .crud-page-action span { color: var(--muted); }

/* Cabeçalhos de tabelas/listas */
body[data-theme="graphite"] .crud-list-head,
body[data-theme="graphite"] .contacts-list-head,
body[data-theme="graphite"] .search-results-head {
  background: var(--panel) !important;
  color: var(--muted) !important;
  border-color: var(--line) !important;
}

/* Campos de formulário em qualquer tela ou janela (pesquisa, filtros, cadastros, modais) */
body[data-theme="graphite"] input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
body[data-theme="graphite"] select,
body[data-theme="graphite"] textarea {
  background-color: var(--panel) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}
body[data-theme="graphite"] input::placeholder,
body[data-theme="graphite"] textarea::placeholder { color: #8a97ab !important; }
body[data-theme="graphite"] select option { background: var(--surface); color: var(--ink); }
body[data-theme="graphite"] input:focus,
body[data-theme="graphite"] select:focus,
body[data-theme="graphite"] textarea:focus { border-color: var(--blue) !important; }

/* Janelas de cadastro (Equipe, Tags, Respostas rápidas, Setores...) */
body[data-theme="graphite"] .standard-crud-dialog,
body[data-theme="graphite"] .standard-crud-header,
body[data-theme="graphite"] .standard-crud-footer {
  background: var(--surface) !important;
  background-image: none !important;
  color: var(--ink);
  border-color: var(--line) !important;
}
body[data-theme="graphite"] .contact-crud-dialog,
body[data-theme="graphite"] .contact-crud-header,
body[data-theme="graphite"] .contact-crud-footer {
  background: var(--surface) !important;
  background-image: none !important;
  color: var(--ink);
  border-color: var(--line) !important;
}
body[data-theme="graphite"] .contact-crud-header span,
body[data-theme="graphite"] .contact-crud-field label { color: var(--muted) !important; }
body[data-theme="graphite"] .contact-crud-footer .cancel {
  background: #303a4e !important;
  color: #e3e9f2 !important;
  border-color: #4f5e78 !important;
}
body[data-theme="graphite"] .standard-crud-check {
  background: var(--panel) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}
body[data-theme="graphite"] .standard-crud-field label,
body[data-theme="graphite"] .standard-crud-form label { color: var(--muted); }
body[data-theme="graphite"] #standardCrudDeleteTomZap.danger { background: #4a2229 !important; border-color: #6b2c36 !important; color: #ff9aa8 !important; }

/* Etiquetas de status */
body[data-theme="graphite"] .crud-status,
body[data-theme="graphite"] .search-status,
body[data-theme="graphite"] .contact-status,
body[data-theme="graphite"] .contact-card-tag {
  background: var(--green2) !important;
  color: #8fe0b8 !important;
}
body[data-theme="graphite"] .crud-status.inactive,
body[data-theme="graphite"] .search-status.closed,
body[data-theme="graphite"] .contact-card-tag.more {
  background: var(--tz-dark-pill) !important;
  color: var(--tz-dark-pill-ink) !important;
}
body[data-theme="graphite"] .crud-status.pending,
body[data-theme="graphite"] .search-status.waiting {
  background: var(--amber2) !important;
  color: #f3c96b !important;
}
body[data-theme="graphite"] .tzd-pill.late { background: #5a2626; color: #ff9a9a; }
body[data-theme="graphite"] .tzm-pending { background: var(--amber2); color: #f3c96b; }

/* Ícones com fundo claro */
body[data-theme="graphite"] .search-summary-icon,
body[data-theme="graphite"] .contacts-stat-icon,
body[data-theme="graphite"] .contact-create-title > i {
  background: var(--blue2) !important;
  color: var(--blue) !important;
}

/* Agenda */
body[data-theme="graphite"] .agenda-event {
  background: var(--blue2) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}
