/* Dark reading calibration: softer gray body text, white only in key highlights */
body.theme-dark .topbar h1,
body.theme-dark .panel h2,
body.theme-dark .card-title,
body.theme-dark .ticket-identity strong,
body.theme-dark .smart-list-title,
body.theme-dark .section-title-emphasis,
body.theme-dark .analysis-meta,
body.theme-dark .analysis-event-title,
body.theme-dark .dashboard-notification-text strong,
body.theme-dark .dashboard-compact-meta strong,
body.theme-dark .meta-note strong,
body.theme-dark .card-summary-line strong,
body.theme-dark .users-form-title,
body.theme-dark .dashboard-block h3 {
  color: var(--text-strong);
}

body.theme-dark .panel small,
body.theme-dark .muted,
body.theme-dark .meta,
body.theme-dark .analysis-event-time,
body.theme-dark .dashboard-notification-meta,
body.theme-dark .analysis-history-wrap > summary,
body.theme-dark .analysis-request-highlight h4,
body.theme-dark .analysis-protocol-top {
  color: var(--text-soft);
}

body.theme-dark .analysis-request,
body.theme-dark .analysis-event-note,
body.theme-dark .dashboard-notification-text,
body.theme-dark .summary,
body.theme-dark .dashboard-compact-meta,
body.theme-dark .card-summary-line,
body.theme-dark .meta-note,
body.theme-dark .management-assignee,
body.theme-dark .analysis-line,
body.theme-dark .analysis-line strong,
body.theme-dark .analysis-line span,
body.theme-dark .btn,
body.theme-dark .badge {
  color: var(--text);
}

body.theme-dark .btn.primary,
body.theme-dark .btn.analyze,
body.theme-dark .btn.contact,
body.theme-dark .nav-btn.is-active,
body.theme-dark .sidebar {
  color: var(--text-strong);
}

body.theme-dark .nav-btn,
body.theme-dark .sidebar-head small,
body.theme-dark .sidebar-theme-controls .theme-toggle-main,
body.theme-dark .sidebar-theme-controls .theme-style-toggle {
  color: var(--text-soft);
}

body.theme-dark .management-assignee {
  border-color: #47617a;
  background: #243749;
}

body.theme-dark .management-assignee-label {
  color: #b8cadb;
}

body.theme-dark .management-assignee strong {
  color: #f2f7fc;
}

body.theme-dark .management-assignee.is-unassigned {
  border-color: #445667;
  background: #222f3d;
  color: #b6c5d4;
}

body.theme-dark .management-assignee.is-unassigned .management-assignee-label,
body.theme-dark .management-assignee.is-unassigned strong {
  color: #b6c5d4;
}

body.theme-dark .ticket-queue-focus {
  border-color: #496582;
  background: #24384d;
  color: #d7e6f6;
}

body.theme-dark .ticket-queue-focus strong {
  color: #eef6ff;
}

body.theme-dark .ticket-company {
  border-color: var(--line);
  background: color-mix(in srgb, var(--card) 90%, var(--bg));
  color: var(--text);
}

body.theme-dark .ticket-identity-prominent {
  border-color: var(--line);
  background: color-mix(in srgb, var(--card) 90%, var(--bg));
}

body.theme-dark .ticket-client-label {
  border-color: var(--line);
  background: color-mix(in srgb, var(--card) 90%, var(--bg));
  color: var(--text);
}

body.theme-dark .ticket-company-label {
  color: var(--text-soft);
}

body.theme-dark .analysis-identity-item {
  border-color: #4b6887;
  background: #24384d;
}

body.theme-dark .analysis-identity-item span {
  color: #b0c7dc;
}

body.theme-dark .analysis-identity-item strong {
  color: #edf6ff;
}

/* Neutral dark containers: reduce blue saturation in text boxes on cards */
body.theme-dark .card-summary-line,
body.theme-dark .meta-note,
body.theme-dark .dashboard-compact-meta {
  background: #2a313a;
  border-color: #4f5a66;
  color: #d6dee8;
}

body.theme-dark .card-summary-line strong,
body.theme-dark .meta-note strong,
body.theme-dark .dashboard-compact-meta strong {
  color: #eef3f8;
}

body.theme-dark .ticket-identity-prominent {
  border-color: var(--line);
  background: color-mix(in srgb, var(--card) 90%, var(--bg));
}

body.theme-dark .ticket-client-label {
  border-color: var(--line);
  background: color-mix(in srgb, var(--card) 90%, var(--bg));
  color: var(--text);
}

body.theme-dark .ticket-company {
  border-color: var(--line);
  background: color-mix(in srgb, var(--card) 90%, var(--bg));
  color: var(--text);
}

body.theme-dark .ticket-company-label {
  color: var(--text-soft);
}

body.theme-dark .management-assignee {
  border-color: #4b5764;
  background: #272f38;
  color: #d2dbe5;
}

body.theme-dark .management-assignee-label {
  color: #b3bec9;
}

body.theme-dark .management-assignee strong {
  color: #edf2f7;
}

body.theme-dark .team-session-badge {
  border-color: #4d5b69;
  background: #252d36;
  color: #d6dee8;
}

body.theme-dark .ticket-queue-focus {
  border-color: #4d5865;
  background: #282f38;
  color: #d7e0ea;
}

body.theme-dark .ticket-queue-focus strong {
  color: #eff4f8;
}

/* Commercial cards keep a subtle distinct tone, without going back to blue */
body.theme-dark .card.commercial-card.pending-gestao {
  border-left-color: #bc8b52;
}

body.theme-dark .card.commercial-card.resolved-urgent {
  border-left-color: #d37a58;
}

body.theme-dark .search-control::placeholder,
body.theme-dark .ticket-form input::placeholder,
body.theme-dark .ticket-form textarea::placeholder,
body.theme-dark .settings-form input::placeholder,
body.theme-dark .note-modal-form textarea::placeholder,
body.theme-dark .users-form input::placeholder {
  color: var(--text-dim);
}

/* High-contrast overrides for operation/support/commercial cards in dark mode */
body.theme-dark .panel[data-view='operacao'] .card,
body.theme-dark .panel[data-view='suporte'] .card,
body.theme-dark .panel[data-view='comercial'] .card {
  color: var(--text);
}

body.theme-dark .panel[data-view='operacao'] .card-title,
body.theme-dark .panel[data-view='suporte'] .card-title,
body.theme-dark .panel[data-view='comercial'] .card-title,
body.theme-dark .panel[data-view='operacao'] .card.module-commercial .card-title,
body.theme-dark .panel[data-view='operacao'] .card.module-support .card-title,
body.theme-dark .panel[data-view='operacao'] .card.module-management .card-title {
  color: var(--text-strong) !important;
}

body.theme-dark .panel[data-view='operacao'] .ticket-identity strong,
body.theme-dark .panel[data-view='suporte'] .ticket-identity strong,
body.theme-dark .panel[data-view='comercial'] .ticket-identity strong,
body.theme-dark .panel[data-view='operacao'] .ticket-identity-clean strong,
body.theme-dark .panel[data-view='suporte'] .ticket-identity-clean strong,
body.theme-dark .panel[data-view='comercial'] .ticket-identity-clean strong,
body.theme-dark .panel[data-view='operacao'] .ticket-company,
body.theme-dark .panel[data-view='suporte'] .ticket-company,
body.theme-dark .panel[data-view='comercial'] .ticket-company,
body.theme-dark .panel[data-view='operacao'] .ticket-company-label,
body.theme-dark .panel[data-view='suporte'] .ticket-company-label,
body.theme-dark .panel[data-view='comercial'] .ticket-company-label {
  color: var(--text-strong) !important;
}

body.theme-dark .panel[data-view='operacao'] .dashboard-card-main .ticket-line,
body.theme-dark .panel[data-view='suporte'] .dashboard-card-main .ticket-line,
body.theme-dark .panel[data-view='comercial'] .dashboard-card-main .ticket-line,
body.theme-dark .panel[data-view='operacao'] .dashboard-card-main .ticket-line strong,
body.theme-dark .panel[data-view='suporte'] .dashboard-card-main .ticket-line strong,
body.theme-dark .panel[data-view='comercial'] .dashboard-card-main .ticket-line strong,
body.theme-dark .panel[data-view='operacao'] .meta,
body.theme-dark .panel[data-view='suporte'] .meta,
body.theme-dark .panel[data-view='comercial'] .meta {
  color: var(--text-soft) !important;
}
