/*
 * Final dark-theme accent overrides.
 *
 * This file loads after Tabler and the app theme so we can safely remap
 * Tabler's dark-mode primary/link variables and the legacy blue utility
 * aliases still used by the templates.
 */

:root,
[data-bs-theme="dark"] {
  --rg-accent: #10b981;
  --rg-accent-hover: #34d399;
  --rg-accent-dark: #059669;
  --rg-accent-bg: rgba(16, 185, 129, 0.12);
  --rg-accent-border: rgba(16, 185, 129, 0.22);
  --rg-accent-border-strong: rgba(16, 185, 129, 0.38);
  --rg-accent-contrast: #041510;

  --tblr-primary: #10b981;
  --tblr-primary-rgb: 16, 185, 129;
  --tblr-primary-fg: #041510;
  --tblr-primary-text-emphasis: #34d399;
  --tblr-primary-bg-subtle: rgba(6, 78, 59, 0.56);
  --tblr-primary-border-subtle: rgba(16, 185, 129, 0.32);

  --tblr-link-color: #94a3b8;
  --tblr-link-color-rgb: 148, 163, 184;
  --tblr-link-hover-color: #6ee7b7;
  --tblr-link-hover-color-rgb: 110, 231, 183;
  --tblr-focus-ring-color: rgba(16, 185, 129, 0.2);
  --tblr-border-color: rgba(148, 163, 184, 0.12);
  --tblr-border-color-translucent: rgba(148, 163, 184, 0.14);

  /*
   * The app still uses blue/azure/cyan utility classes for primary-looking
   * badges and pills. Remap those aliases to the brand accent instead of
   * editing each template individually.
   */
  --tblr-blue: #10b981;
  --tblr-blue-rgb: 16, 185, 129;
  --tblr-blue-lt: rgba(16, 185, 129, 0.12);
  --tblr-blue-fg: #041510;

  --tblr-azure: #10b981;
  --tblr-azure-rgb: 16, 185, 129;
  --tblr-azure-lt: rgba(16, 185, 129, 0.12);
  --tblr-azure-fg: #041510;

  --tblr-cyan: #10b981;
  --tblr-cyan-rgb: 16, 185, 129;
  --tblr-cyan-lt: rgba(16, 185, 129, 0.12);
  --tblr-cyan-fg: #041510;

  --tblr-teal: #10b981;
  --tblr-teal-rgb: 16, 185, 129;
  --tblr-teal-lt: rgba(16, 185, 129, 0.12);
  --tblr-teal-fg: #041510;

  --tblr-indigo: #10b981;
  --tblr-indigo-rgb: 16, 185, 129;
  --tblr-indigo-lt: rgba(16, 185, 129, 0.12);
  --tblr-indigo-fg: #041510;
}

a:not(.btn):not(.nav-link) {
  color: #94a3b8 !important;
}

a:not(.btn):not(.nav-link):hover {
  color: #6ee7b7 !important;
}

.link-primary,
.text-primary {
  color: #34d399 !important;
}

.btn-primary,
.btn-primary:hover,
.btn-primary:focus-visible,
.btn-primary:active,
.btn-check:checked + .btn-primary,
.show > .btn-primary.dropdown-toggle {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #041510 !important;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #34d399 !important;
  border-color: #34d399 !important;
}

.btn-primary:active,
.btn-check:checked + .btn-primary,
.show > .btn-primary.dropdown-toggle {
  background: #059669 !important;
  border-color: #059669 !important;
}

.btn-outline-primary,
.btn-check:checked + .btn-outline-primary,
.btn-outline-primary.active,
.btn-group > .btn-outline-primary.active {
  border-color: rgba(16, 185, 129, 0.22) !important;
  color: #34d399 !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus-visible,
.btn-check:checked + .btn-outline-primary,
.btn-outline-primary.active,
.btn-group > .btn-outline-primary.active {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.38) !important;
  color: #d1fae5 !important;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.input-group-flat:focus-within,
.btn:focus-visible,
.page-link:focus {
  border-color: rgba(16, 185, 129, 0.38) !important;
  box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.14) !important;
}

.form-check-input:checked {
  background-color: #10b981 !important;
  border-color: #10b981 !important;
}

.ic-nav .nav-link.active,
.nav-pills .nav-link.active,
.show > .nav-pills .nav-link {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #f8fafc !important;
}

.ic-nav .nav-link.active .nav-link-icon,
.nav-pills .nav-link.active .nav-link-icon {
  color: #10b981 !important;
}

.ic-nav .nav-link.active::before {
  background: #10b981 !important;
}

.ic-copilot-launcher,
.copilot-fab,
#copilotSend {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #041510 !important;
}

.ic-copilot-launcher:hover,
.copilot-fab:hover,
#copilotSend:hover {
  background: #34d399 !important;
  border-color: #34d399 !important;
  color: #041510 !important;
}

.ic-copilot-bubble--user,
.ic-copilot-insight-card,
.badge.bg-blue-lt,
.badge.bg-azure-lt,
.badge.bg-cyan-lt,
.bg-blue-lt,
.bg-azure-lt,
.bg-cyan-lt,
.bg-teal-lt,
.bg-indigo-lt {
  border-color: rgba(16, 185, 129, 0.22) !important;
  background: rgba(16, 185, 129, 0.12) !important;
  color: #34d399 !important;
}

.page-item.active .page-link {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #041510 !important;
}

.table-hover > tbody > tr:hover > *,
.table > tbody > tr:hover > * {
  background: rgba(16, 185, 129, 0.05) !important;
}

.card-accent-top,
.metric-card-accent,
.dashboard-accent,
.ic-copilot-insight-card {
  border-color: rgba(16, 185, 129, 0.22) !important;
  border-top-color: #10b981 !important;
}

.text-blue,
.text-azure,
.text-cyan,
.text-teal,
.text-indigo {
  color: #34d399 !important;
}
