/*
 * Final dark-theme contrast layer.
 * Loaded after page, shell and driver styles so dark surfaces never
 * inherit the light-theme navy, dark red, dark green or dark gray text.
 */
:root[data-theme="dark"] {
  --dark-text-brand: #9fc8ff;
  --dark-text-brand-hover: #d6e8ff;
  --dark-text-danger: #ff9eab;
  --dark-text-warning: #ffe08a;
  --dark-text-success: #7ee4ab;
  --dark-text-neutral: #bdcad8;
}

:root[data-theme="dark"] :where(.inline-link, .link-button, .eyebrow, .section-kicker) {
  color: var(--dark-text-brand);
}

:root[data-theme="dark"] :where(.inline-link, .link-button):hover {
  color: var(--dark-text-brand-hover);
}

:root[data-theme="dark"] :where(.primary-tab, .ui-button--secondary, .ui-button--ghost) {
  color: var(--text-soft);
}

:root[data-theme="dark"] .ui-drawer .ui-icon-button,
:root[data-theme="dark"] .side-panel-item a.inline-link {
  color: var(--dark-text-brand);
}

:root[data-theme="dark"] .app-shell:not(.public-shell) .user-chip strong,
:root[data-theme="dark"] .app-shell:not(.public-shell) .app-topbar .secondary-button,
:root[data-theme="dark"] .app-shell:not(.public-shell) .drawer-toggle,
:root[data-theme="dark"] .app-shell:not(.public-shell) .topbar-brand {
  color: var(--text-soft);
}

:root[data-theme="dark"] .app-shell:not(.public-shell) .app-topbar .secondary-button:hover {
  color: var(--color-white);
  background: var(--primary-hover);
}

:root[data-theme="dark"]
  :where(.priority-low, .status-active, .status-done, .status-resolved, .status-success) {
  color: var(--dark-text-success);
}

:root[data-theme="dark"] :where(.priority-medium, .status-due, .status-inreview, .status-warning) {
  color: var(--dark-text-warning);
}

:root[data-theme="dark"] :where(.priority-high, .status-overdue, .status-open, .status-danger) {
  color: var(--dark-text-danger);
}

:root[data-theme="dark"]
  :where(
    .status-muted,
    .status-inactive,
    .status-cancelled,
    .status-archived,
    .status-sold,
    .status-outofservice
  ) {
  color: var(--dark-text-neutral);
}

:root[data-theme="dark"] .status-info {
  color: var(--dark-text-brand);
}

:root[data-theme="dark"] .report-icon {
  color: var(--text);
}

:root[data-theme="dark"] .login-panel code {
  color: var(--text);
  background: var(--surface-3);
}

:root[data-theme="dark"] .deadline-center-filter-panel {
  color: var(--text);
  background: var(--surface);
}

/* Deadline cards stay light yellow in dark mode and therefore require
 * opaque dark text instead of the general light dark-mode text colors. */
:root[data-theme="dark"] .deadline-card-link,
:root[data-theme="dark"] .deadline-card-title,
:root[data-theme="dark"] .deadline-card-meta {
  color: var(--color-premio-blue, #002855);
}

:root[data-theme="dark"] .deadline-card-meta {
  font-size: 0.82rem;
  font-weight: 800;
  opacity: 1;
}

:root[data-theme="dark"] :where(input, select, textarea, option) {
  color: var(--text);
}

:root[data-theme="dark"] :where(input, textarea)::placeholder {
  color: var(--text-muted);
  opacity: 1;
}
