@import url(../../PurpleMine2/stylesheets/application.css);

/*
 * ModernDark — dark skin for PurpleMine2 on Redmine 4.2
 * Palette: GitHub/VS Code inspired neutrals + purple accent
 */

:root {
  --md-bg: #0d1117;
  --md-bg-elevated: #161b22;
  --md-bg-soft: #1c2128;
  --md-border: #30363d;
  --md-text: #e6edf3;
  --md-text-muted: #9da7b3;
  --md-link: #79c0ff;
  --md-link-hover: #a5d6ff;
  --md-accent: #8b7cf6;
  --md-accent-soft: #2a2348;
  --md-danger: #f85149;
  --md-success: #3fb950;
  --md-warning: #d29922;
}

html,
body {
  background: var(--md-bg) !important;
  color: var(--md-text) !important;
}

a,
a:link,
a:visited {
  color: var(--md-link);
}
a:hover,
a:focus {
  color: var(--md-link-hover);
}

#wrapper {
  background: var(--md-bg) !important;
}

#top-menu {
  background: #010409 !important;
  color: var(--md-text-muted) !important;
  border-bottom: 1px solid var(--md-border);
}
#top-menu a,
#top-menu a:link,
#top-menu a:visited {
  color: var(--md-text-muted) !important;
}
#top-menu a:hover {
  color: var(--md-text) !important;
}

#header {
  background: linear-gradient(180deg, #1a1430 0%, #14101f 100%) !important;
  border-bottom: 1px solid var(--md-border);
  color: var(--md-text) !important;
}
#header h1,
#header h1 a,
#header a,
#header a:link,
#header a:visited {
  color: var(--md-text) !important;
}
#header h1 .breadcrumbs a {
  color: var(--md-text-muted) !important;
}

#main-menu {
  background: transparent !important;
}
#main-menu li a {
  color: var(--md-text-muted) !important;
  border-radius: 6px 6px 0 0;
}
#main-menu li a:hover {
  background: var(--md-bg-soft) !important;
  color: var(--md-text) !important;
}
#main-menu li a.selected {
  background: var(--md-bg) !important;
  color: var(--md-text) !important;
  border-color: var(--md-border) !important;
  box-shadow: none !important;
}
#main-menu .menu-children {
  background: var(--md-bg-elevated) !important;
  border: 1px solid var(--md-border) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.45) !important;
}
#main-menu .menu-children li a {
  color: var(--md-text) !important;
}
#main-menu .menu-children li a:hover {
  background: var(--md-accent-soft) !important;
}

#main,
#content,
#sidebar {
  background: var(--md-bg) !important;
  color: var(--md-text) !important;
}

#sidebar {
  border-color: var(--md-border) !important;
}
#sidebar h3 {
  color: var(--md-text-muted) !important;
  border-bottom-color: var(--md-border) !important;
}
#sidebar a {
  color: var(--md-text-muted);
}
#sidebar a:hover,
#sidebar a.selected {
  background: var(--md-bg-soft) !important;
  color: var(--md-text) !important;
  border-color: var(--md-accent) !important;
}

#footer {
  background: var(--md-bg) !important;
  border-top: 1px solid var(--md-border);
  color: var(--md-text-muted) !important;
}
#footer a {
  color: var(--md-link);
}

h1, h2, h3, h4, h5, h6,
.wiki h1, .wiki h2, .wiki h3 {
  color: var(--md-text) !important;
  border-bottom-color: var(--md-border) !important;
}

div.issue,
.box,
.nodata,
.warning,
.controller-wiki .wiki-page,
fieldset,
.tabular,
div.filters,
.query-columns,
.splitcontentleft > .box,
.splitcontentright > .box,
#history,
#relations,
#issue_tree,
#attachments_form,
.attachments,
.journal,
.tabular.settings,
#tab-content-info,
.controller-activities #activity {
  background: var(--md-bg-elevated) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}

div.issue {
  border-left-color: var(--md-accent) !important;
}
div.issue .subject h3,
div.issue .attribute .label,
div.issue .attribute .value {
  color: var(--md-text) !important;
}
div.issue .attribute .label {
  color: var(--md-text-muted) !important;
}

table.list,
table.list th,
table.list td,
table.attributes,
table.attributes th,
table.attributes td,
.files table,
table.cal,
table.cal td,
table.cal th {
  background-color: var(--md-bg-elevated) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}
table.list thead th,
table.list th {
  background: var(--md-bg-soft) !important;
  color: var(--md-text-muted) !important;
}
table.list tr.odd,
table.list:not(.odd-even) tbody tr:nth-child(odd) {
  background: var(--md-bg-elevated) !important;
}
table.list tr.even,
table.list:not(.odd-even) tbody tr:nth-child(even) {
  background: var(--md-bg-soft) !important;
}
table.list tr:hover td,
table.list tr.odd:hover,
table.list tr.even:hover,
table.list:not(.odd-even) tbody tr:hover {
  background: #21262d !important;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="search"],
textarea,
select,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple,
#quick-search input {
  background: var(--md-bg) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--md-accent) !important;
  box-shadow: 0 0 0 2px rgba(139, 124, 246, 0.25) !important;
}

input[type="submit"],
input[type="button"],
button,
.button,
a.button,
.icon-only.button {
  background: var(--md-accent) !important;
  border-color: #6d5ce7 !important;
  color: #fff !important;
}
input[type="submit"]:hover,
a.button:hover {
  filter: brightness(1.08);
}

div.flash.notice,
#flash_notice {
  background: #12261a !important;
  border-color: var(--md-success) !important;
  color: #aff5b4 !important;
}
div.flash.error,
#errorExplanation,
#flash_error {
  background: #2d1214 !important;
  border-color: var(--md-danger) !important;
  color: #ffc1bd !important;
}
div.flash.warning,
#flash_warning {
  background: #2a2108 !important;
  border-color: var(--md-warning) !important;
  color: #f2cc60 !important;
}

.tabs ul {
  border-bottom-color: var(--md-border) !important;
}
.tabs ul li a {
  background: var(--md-bg-soft) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text-muted) !important;
}
.tabs ul li a.selected {
  background: var(--md-bg) !important;
  color: var(--md-text) !important;
  border-bottom-color: var(--md-bg) !important;
}

.pagination ul.pages li {
  border-color: var(--md-border) !important;
  background: var(--md-bg-elevated) !important;
}
.pagination ul.pages li a {
  color: var(--md-text) !important;
}
.pagination ul.pages li.current {
  background: var(--md-accent) !important;
  border-color: var(--md-accent) !important;
  color: #fff !important;
}

.wiki,
.wiki p,
.wiki li,
.wiki td {
  color: var(--md-text) !important;
}
.wiki pre,
.wiki code,
pre,
code,
.syntaxhl,
.coderay {
  background: #010409 !important;
  color: #c9d1d9 !important;
  border-color: var(--md-border) !important;
}
.wiki table,
.wiki table td,
.wiki table th {
  border-color: var(--md-border) !important;
  background: var(--md-bg-elevated) !important;
}

.journal,
#history .journal {
  border-color: var(--md-border) !important;
}
.journal .details,
.journal .wiki {
  color: var(--md-text-muted) !important;
}

.ui-widget-content,
.ui-dialog,
.ui-menu,
.ui-autocomplete,
.select2-dropdown {
  background: var(--md-bg-elevated) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}
.ui-widget-header {
  background: var(--md-bg-soft) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}
.ui-dialog .ui-dialog-buttonpane button {
  background: var(--md-accent) !important;
  color: #fff !important;
}

.context-menu-selection,
.drdn-content,
.dropdown-menu {
  background: var(--md-bg-elevated) !important;
  border: 1px solid var(--md-border) !important;
  color: var(--md-text) !important;
}

tr.closed,
tr.closed td {
  color: var(--md-text-muted) !important;
}
tr.overdue td.due_date,
div.issue.overdue .due-date .value {
  color: #ff7b72 !important;
}

.flyout-menu {
  background: var(--md-bg-elevated) !important;
  color: var(--md-text) !important;
}
.flyout-menu a {
  color: var(--md-text) !important;
}

.kanban-column,
.agile-board,
.issue-card {
  background: var(--md-bg-elevated) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}

#login-form,
#login-form table,
body.action-login #content {
  background: var(--md-bg-elevated) !important;
  color: var(--md-text) !important;
  border-color: var(--md-border) !important;
}

.gantt_hdr,
.gantt_subjects,
.task {
  background: var(--md-bg-soft) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--md-accent) !important;
  color: #fff !important;
}
.select2-container--default .select2-results__option[aria-selected=true] {
  background: var(--md-accent-soft) !important;
}

.icon,
.icon-only {
  filter: none;
  opacity: 0.9;
}

/* Project tiles (PurpleMine2 $use-project-tiles) */
#projects-index ul.projects.root > li {
  background: var(--md-bg-elevated) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}
#projects-index ul.projects.root > li:hover {
  border-color: #484f58 !important;
  background: var(--md-bg-soft) !important;
}
#projects-index a.project,
#projects-index a.project:link,
#projects-index a.project:visited {
  color: var(--md-link) !important;
}
#projects-index a.project:hover {
  color: var(--md-link-hover) !important;
}
#projects-index ul.projects .wiki,
#projects-index ul.projects .wiki p,
#projects-index ul.projects .description,
#projects-index ul.projects li {
  color: var(--md-text-muted) !important;
}
#projects-index ul.projects .wiki a,
#projects-index ul.projects .wiki a:link,
#projects-index ul.projects .wiki a:visited {
  color: var(--md-link) !important;
}
#projects-index ul.projects .wiki code,
#projects-index ul.projects .wiki tt,
#projects-index ul.projects code {
  background: #010409 !important;
  color: #c9d1d9 !important;
  border: 1px solid var(--md-border) !important;
  border-radius: 4px;
  padding: 0 4px;
}
#projects-index ul.projects .archived {
  color: #6e7681 !important;
}
#projects-index ul.projects ul.projects {
  border-left-color: var(--md-border) !important;
}

/* Filter / query box on projects index */
#query_form_content,
#query_form,
.filters,
fieldset#filters,
fieldset#options,
#list-definition {
  background: var(--md-bg-elevated) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}
fieldset#filters legend,
fieldset#options legend {
  color: var(--md-text-muted) !important;
}
#query_form a.icon-checked,
#query_form a,
.buttons a.icon {
  color: var(--md-link) !important;
}
/* Light gray action buttons from PurpleMine stay readable */
a.icon-add,
a.icon-settings,
#content .contextual a {
  color: var(--md-text) !important;
}

/* ModernDark journal bubbles + remaining light surfaces */

/* History note bubbles */
.journal,
div.journal,
#history .journal {
  background: var(--md-bg-elevated) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}
.journal > h4,
.journal > div > h4,
.journal.changeset h4 + p,
.journal form {
  background-color: var(--md-bg-soft) !important;
  color: var(--md-text-muted) !important;
  border-radius: 4px 4px 0 0;
}
.journal > h4 a,
.journal > div > h4 a,
.journal > h4 a.user,
.journal > div > h4 a.user,
.journal .journal-link,
.journal > div > .contextual > a.journal-link,
.journal > .contextual > a.journal-link {
  color: var(--md-text) !important;
}
.journal > h4 a.user,
.journal > div > h4 a.user {
  color: var(--md-link) !important;
  font-weight: 600;
}
/* Speech-bubble caret */
.journal > h4::after,
.journal > div > h4::after {
  border-right-color: var(--md-bg-soft) !important;
}
.journal > h4::before,
.journal > div > h4::before {
  border-right-color: var(--md-border) !important;
}
.journal .wiki,
.journal .details,
.journal form,
.journal .thumbnails {
  border-top-color: var(--md-border) !important;
  color: var(--md-text) !important;
  background: transparent !important;
}
.journal .wiki,
.journal .wiki p,
.journal .wiki li {
  color: var(--md-text) !important;
}
.journal .details,
.journal .details li {
  color: var(--md-text-muted) !important;
}
.private-notes {
  border-left-color: var(--md-warning) !important;
}

/* Keep old/new value chips readable on dark */
.journal del > i:first-of-type,
.journal i:first-of-type {
  background-color: #3d2914 !important;
  color: #ffb77c !important;
}
.journal i:last-of-type {
  background-color: #16321f !important;
  color: #7ee787 !important;
}

/* Issue card / description / attributes */
div.issue,
div.issue .description,
div.issue .description .wiki,
div.issue .subject,
div.issue .attributes,
div.issue table.attributes,
#issue-changesets,
#issue-changesets .changeset,
#relations,
#issue_tree,
#attachments_fields,
.attachments,
.box,
fieldset.collapsible,
fieldset#filters,
fieldset#options,
#sidebar .box,
.mypage-box,
div#roadmap .related-issues,
div#version-summary,
table.progress,
.controller-issues.action-show #content > .issue {
  background: var(--md-bg-elevated) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}
div.issue .attribute .label,
div.issue .author,
div.issue .other-formats {
  color: var(--md-text-muted) !important;
}
div.issue .subject h3,
div.issue .description .wiki,
div.issue .description .wiki p {
  color: var(--md-text) !important;
}

/* Related issues / subtasks lists */
#relations .issue,
#issue_tree .issue,
.related-issues,
table.list.issues,
table.list.related-issues {
  background: var(--md-bg-elevated) !important;
  color: var(--md-text) !important;
}

/* Action / contextual buttons — dark elevated, not light-gray+white-text */
p.buttons a,
p.buttons a.icon,
.contextual a,
.contextual a.icon,
#content > .contextual a,
#content .contextual a.icon,
.journal-actions > a,
.journal-actions .drdn-trigger,
a.icon-edit,
a.icon-comment,
a.icon-copy,
a.icon-del,
a.icon-time-add,
a.icon-fav,
a.icon-fav-off,
a.icon-reload,
a.icon-add,
a.icon-settings {
  background: var(--md-bg-soft) !important;
  border: 1px solid var(--md-border) !important;
  color: var(--md-text) !important;
  border-radius: 4px;
  text-shadow: none !important;
}
p.buttons a:hover,
.contextual a:hover,
#content .contextual a:hover {
  background: #2a2348 !important;
  border-color: var(--md-accent) !important;
  color: #fff !important;
}

/* Primary submit stays accent */
input[type="submit"],
button[type="submit"] {
  background: var(--md-accent) !important;
  border-color: #6d5ce7 !important;
  color: #fff !important;
}

/* Tabs under history */
#history .tabs ul li a,
.tabs ul li a {
  background: var(--md-bg-soft) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text-muted) !important;
}
#history .tabs ul li a.selected,
.tabs ul li a.selected {
  background: var(--md-bg) !important;
  color: var(--md-text) !important;
  border-bottom-color: var(--md-bg) !important;
}

/* Note / edit forms */
#add_notes,
#update,
#issue-form,
.edit_issue,
textarea#issue_notes,
textarea#issue_description,
textarea.wiki-edit {
  background: var(--md-bg) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}

/* Activity / news / forum bubbles (same $bubble-bg) */
#activity dd,
#activity dt,
.news.box,
div.news,
.message.reply {
  background: var(--md-bg-elevated) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}
#activity dt .time,
#activity dd span.description {
  color: var(--md-text-muted) !important;
}

/* Dropdown menus in journal actions */
.drdn-content,
.drdn-items,
.dropdown-menu,
ul.menu-children {
  background: var(--md-bg-elevated) !important;
  border-color: var(--md-border) !important;
}
.drdn-items a,
.dropdown-menu a {
  color: var(--md-text) !important;
}
.drdn-items a:hover {
  background: var(--md-accent-soft) !important;
}

/* ModernDark selects / export / pagination / jump */

/* All native selects */
select,
select option,
#quick-search select,
#quick-search option,
#header select,
#header option,
#project_quick_jump_box,
.filter select,
.tabular select,
.query-columns select,
select.expandable {
  background-color: var(--md-bg) !important;
  background-image: none !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
  color-scheme: dark;
}
select:focus,
#quick-search select:focus {
  border-color: var(--md-accent) !important;
  box-shadow: 0 0 0 2px rgba(139, 124, 246, 0.25) !important;
}
select option:disabled {
  color: #6e7681 !important;
}

/* Project jump dropdown in header */
#project-jump .drdn-trigger,
#project-jump.expanded .drdn-trigger {
  background-color: var(--md-bg) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}
#project-jump .drdn-trigger::after {
  color: var(--md-text-muted) !important;
}
#project-jump .drdn-content {
  background: var(--md-bg-elevated) !important;
  border-color: var(--md-border) !important;
}
#project-jump .drdn-content > .quick-search {
  background: var(--md-bg-elevated) !important;
}
#project-jump .drdn-content > .quick-search > input {
  background: var(--md-bg) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}
#project-jump .drdn-items {
  border-top-color: var(--md-border) !important;
  background: var(--md-bg-elevated) !important;
}
#project-jump .drdn-items > a,
#project-jump .drdn-items > span,
#project-jump a {
  color: var(--md-text) !important;
  background: transparent !important;
}
#project-jump .drdn-items > a:hover,
#project-jump .drdn-items > a:focus,
#project-jump a:hover {
  background: var(--md-accent-soft) !important;
  color: #fff !important;
}

/* Export Atom / PDF and similar chip buttons */
.other-formats > span,
.other-formats > span > a,
.other-formats a,
p.other-formats a {
  background-color: var(--md-bg-soft) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}
.other-formats > span > a:hover,
.other-formats a:hover {
  background-color: #2a2348 !important;
  border-color: var(--md-accent) !important;
  color: #fff !important;
}

/* "..." more menu trigger in contextual */
#content > .contextual .drdn-trigger,
#content .contextual .drdn-trigger,
.contextual .drdn:not(.journal-actions) .drdn-trigger,
p.buttons .drdn-trigger,
.query_form .drdn-trigger {
  background-color: var(--md-bg-soft) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}
#content > .contextual .drdn-trigger:hover,
.contextual .drdn.expanded .drdn-trigger {
  background-color: #2a2348 !important;
  border-color: var(--md-accent) !important;
  color: #fff !important;
}

/* Pagination: links + current page chip */
.pagination ul.pages li,
.pagination ul.pages li a,
.pagination ul.pages li span,
span.pagination,
.pagination a,
.pagination .page,
.pagination .previous,
.pagination .next,
.pagination .current {
  background-color: var(--md-bg-soft) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}
.pagination ul.pages li.current,
.pagination ul.pages li.current span,
.pagination .current,
.pagination span.current {
  background-color: var(--md-accent) !important;
  border-color: var(--md-accent) !important;
  color: #fff !important;
}
.pagination a:hover,
.pagination ul.pages li a:hover {
  background-color: #2a2348 !important;
  border-color: var(--md-accent) !important;
  color: #fff !important;
}
/* Issue prev/next navigator (2/127) */
.contextual .position,
#content > .contextual > span:not(.drdn),
.next-prev-links,
.next-prev-links a,
.next-prev-links span {
  background-color: var(--md-bg-soft) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}

/* Generic form controls still light somewhere */
input[type="text"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="time"],
textarea,
.jstBlock .jstElements button,
.jstElements button {
  background-color: var(--md-bg) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}
.jstElements button:hover {
  background-color: var(--md-bg-soft) !important;
  color: #fff !important;
}

/* Ensure chip-style button groups from PurpleMine pagination tokens */
#content > .contextual > a,
#content > .contextual > span:not(.drdn),
#query_form > .contextual > a,
#query_form_with_buttons > .contextual > a,
#wiki_add_attachment > p > a {
  background-color: var(--md-bg-soft) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}

/* ModernDark finish: kanban + leftovers */

html,
body {
  color-scheme: dark;
}

/* ---- Kanban plugin cards ---- */
.my-issue-card,
.my-issue-card-small,
.my-issue-card-high-priority,
.my-issue-card-high-priority-small,
.my-issue-card-low-priority,
.my-issue-card-low-priority-small,
.dragged-issue-card {
  background-color: var(--md-bg-elevated) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.my-issue-card-high-priority,
.my-issue-card-high-priority-small {
  background-color: #2a1717 !important;
  border-color: #6e3030 !important;
  border-left: 3px solid #f85149 !important;
}
.my-issue-card-low-priority,
.my-issue-card-low-priority-small {
  background-color: #141d2a !important;
  border-color: #2f4060 !important;
  border-left: 3px solid #58a6ff !important;
}
.my-issue-card a,
.my-issue-card-small a,
.my-issue-card-high-priority a,
.my-issue-card-low-priority a,
.my-issue-card .issue-id,
.my-issue-card .issue-title,
.my-issue-card .issue-tracker,
.my-issue-card .issue-details,
.my-issue-card .issue-due-date,
.my-issue-card .issue-estimated-hours,
.my-issue-card .issue-header,
.my-issue-card p,
.my-issue-card span {
  color: var(--md-text) !important;
}
.my-issue-card .issue-id a,
.my-issue-card a.issue,
.my-issue-card .issue-title a {
  color: var(--md-link) !important;
}
.ancestor {
  color: #8b9cb3 !important;
}
.context-menu-selection p {
  color: var(--md-text) !important;
}

/* Kanban table / columns */
#kanban_table,
.kanban-table,
.kanban-column,
#kanban_table th,
#kanban_table td,
.floatThead-container,
.floatThead-table,
.floatThead-table th {
  background-color: var(--md-bg) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}
#kanban_table th,
.kanban-table th,
.floatThead-table th {
  background-color: var(--md-bg-soft) !important;
  color: var(--md-text) !important;
}
.kanban-column .count,
#kanban_table .count {
  background: #30363d !important;
  color: var(--md-text) !important;
}

/* Sidebar recent history (kanban) */
.my-journal-table,
.my-journal-table td,
.my-comment-table,
.my-comment-textarea {
  background-color: var(--md-bg-elevated) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}
.my-comment-textarea {
  background-color: var(--md-bg) !important;
}

/* RedmineUP agile boards if present */
.agile-board,
.agile-board .issue-card,
.issue-card {
  background-color: var(--md-bg-elevated) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}
.agile-board .issue-card a {
  color: var(--md-link) !important;
}

/* ---- Broad leftover light surfaces ---- */
.box,
fieldset,
fieldset.box,
div.filters,
#query_form_with_buttons,
#sidebar .box,
#sidebar p,
#history_sidebar,
#sidebar .wiki,
table.list,
table.list td,
table.list th,
.nodata,
.warning,
div#content > div.wiki,
.controller-my .mypage-box,
.splitcontentleft .mypage-box,
.splitcontentright .mypage-box,
#login-form table,
div.modal,
#ajax-modal,
.ui-widget-content,
.ui-dialog .ui-dialog-content {
  background-color: var(--md-bg-elevated) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}

/* Vertical swimlane / group labels (assignee column) */
.group,
tr.group,
tr.group span,
.kanban-table .group,
#kanban_table .project-name,
.project-name {
  color: var(--md-text) !important;
  background-color: var(--md-bg-soft) !important;
}

/* New issue / reload contextual on kanban */
.contextual a.icon-add,
.contextual a.new-issue,
a.icon-add.new-issue,
.contextual a.icon-reload {
  background-color: var(--md-bg-soft) !important;
  border: 1px solid var(--md-border) !important;
  color: var(--md-text) !important;
}

/* Collapsible filter legends */
fieldset.collapsible > legend,
fieldset.collapsible > legend a,
a.icon-collapsed,
a.icon-expanded {
  color: var(--md-link) !important;
  background: transparent !important;
}

/* Buttons that still look light */
input[type="submit"],
input[type="button"],
button,
.button-positive,
.button-negative {
  color: #fff !important;
}
input.button-small,
a.button,
span.button {
  background-color: var(--md-bg-soft) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}

/* Tooltips */
.ui-tooltip,
.tipsy-inner,
div.tooltip span.tip {
  background: #010409 !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}

/* Calendar / gantt leftovers */
table.cal thead,
table.cal td.week-number,
div.gantt_hdr,
.gantt_subjects_container,
#gantt_area {
  background: var(--md-bg-soft) !important;
  color: var(--md-text) !important;
  border-color: var(--md-border) !important;
}

/* Flash already done; ensure wiki toc */
#sidebar .wiki .toc,
div.toc,
ul.toc {
  background: var(--md-bg-soft) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}

/* jstoolbar icons strip */
.jstElements,
.jstElements button,
.jstBlock .wiki-preview {
  background: var(--md-bg-soft) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}

/* Ensure plugin CSS yellow/pink never wins without !important fight — double weight */
body .my-issue-card { background-color: #161b22 !important; color: #e6edf3 !important; }
body .my-issue-card-high-priority { background-color: #2a1717 !important; color: #e6edf3 !important; }
body .my-issue-card-low-priority { background-color: #141d2a !important; color: #e6edf3 !important; }
body .my-journal-table { background-color: #161b22 !important; color: #e6edf3 !important; }

/* ModernDark gantt zoom/nav */
/* PurpleMine styles these as #content > .contextual > span chips (light $pagination-inactive-bg) */
#content > .contextual > span:not(.drdn),
#query_form > .contextual > span:not(.drdn),
#query_form_with_buttons > .contextual > span:not(.drdn),
p.contextual > span:not(.drdn),
.controller-gantts #content > .contextual > span,
.controller-gantts p.contextual > span {
  background-color: var(--md-bg-soft) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}

#content > .contextual > span:not(.drdn) > a,
#content > .contextual > span:not(.drdn) > span,
p.contextual > span a,
p.contextual > span .icon,
.controller-gantts .contextual a,
.controller-gantts a.icon-zoom-in,
.controller-gantts a.icon-zoom-out,
.controller-gantts span.icon-zoom-in,
.controller-gantts span.icon-zoom-out,
a.icon-zoom-in,
a.icon-zoom-out,
span.icon-zoom-in,
span.icon-zoom-out {
  background-color: transparent !important;
  color: var(--md-text) !important;
  border-color: transparent !important;
}

#content > .contextual > span:not(.drdn) > a:hover,
p.contextual > span a:hover,
.controller-gantts a.icon-zoom-in:hover,
.controller-gantts a.icon-zoom-out:hover {
  color: #fff !important;
}

/* Whole contextual chip group on gantt */
.controller-gantts #content > .contextual > span:not(.drdn):hover {
  background-color: #2a2348 !important;
  border-color: var(--md-accent) !important;
}

/* Gantt chart surface leftovers still light in core CSS */
.gantt_hdr,
#gantt_area .gantt_hdr,
.gantt_subjects,
.gantt_subjects_container,
.gantt_selected_column_content,
td.gantt_selected_column .gantt_hdr,
.gantt_selected_column_container,
table.gantt-table,
table.gantt-table td,
div.gantt_content {
  background-color: var(--md-bg) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text) !important;
}
.gantt_hdr.nwday {
  background-color: var(--md-bg-soft) !important;
  color: #6e7681 !important;
}
.gantt_subjects div.issue-subject:hover {
  background-color: #21262d !important;
}
.gantt_subjects a,
.gantt_hdr a {
  color: var(--md-link) !important;
}

/* ModernDark tabs-buttons — transparent arrow controls */
div.tabs-buttons,
#main-menu .tabs-buttons,
.tabs .tabs-buttons {
  background: transparent !important;
  background-color: transparent !important;
  border: 0 none !important;
  border-bottom: 0 none !important;
  width: 44px !important;
  height: auto !important;
  display: flex !important;
  align-items: stretch;
  gap: 2px;
  padding: 0 !important;
  box-shadow: none !important;
}

button.tab-left,
button.tab-right,
div.tabs-buttons > button,
#main-menu .tabs-buttons > button,
.tabs .tabs-buttons > button {
  position: static !important;
  right: auto !important;
  bottom: auto !important;
  width: 20px !important;
  min-width: 20px !important;
  height: 22px !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  border: 0 none !important;
  border-radius: 4px !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  opacity: 0.75 !important;
  filter: none !important;
  cursor: pointer !important;
  color: #c9d1d9 !important;
  font-size: 0 !important;
  line-height: 22px !important;
}

button.tab-left::before,
button.tab-right::before,
div.tabs-buttons > button.tab-left::before,
div.tabs-buttons > button.tab-right::before {
  font-size: 14px !important;
  line-height: 22px !important;
  font-weight: 600 !important;
  color: #c9d1d9 !important;
  display: block !important;
  text-align: center !important;
  filter: none !important;
}

button.tab-left::before,
div.tabs-buttons > button.tab-left::before {
  content: "‹" !important;
}

button.tab-right::before,
div.tabs-buttons > button.tab-right::before {
  content: "›" !important;
}

button.tab-left:hover,
button.tab-right:hover,
div.tabs-buttons > button:hover:not(.disabled) {
  background: rgba(139, 124, 246, 0.18) !important;
  opacity: 1 !important;
  color: #fff !important;
}

button.tab-left:hover::before,
button.tab-right:hover::before {
  color: #fff !important;
}

button.tab-left.disabled,
button.tab-right.disabled,
div.tabs-buttons > button.disabled {
  background: transparent !important;
  opacity: 0.28 !important;
  cursor: default !important;
  filter: none !important;
}

/* ModernDark harmony: progress + context-menu + list surfaces */

/* ---- Progress bars: visible track on dark ---- */
table.progress {
  background: transparent !important;
}
table.progress tr {
  background: transparent !important;
}
table.progress td {
  mix-blend-mode: normal !important;
}
table.progress td.todo {
  background-color: #30363d !important;
  mix-blend-mode: normal !important;
  box-shadow: inset 0 0 0 1px #484f58;
}
table.progress td.done {
  background-color: #8b7cf6 !important;
}
table.progress td.closed {
  background-color: #3fb950 !important;
}
.context-menu-selection table.progress td.todo {
  background-color: rgba(255, 255, 255, 0.25) !important;
  mix-blend-mode: normal !important;
}
p.percent,
p.progress-info {
  color: var(--md-text-muted) !important;
}

/* ---- Context menu: full dark, no white chrome ---- */
#context-menu ul,
#context-menu li > ul,
#context-menu ul ul {
  background: #161b22 !important;
  background-color: #161b22 !important;
  border: 1px solid #30363d !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55) !important;
  color: #e6edf3 !important;
}
#context-menu li {
  background: transparent !important;
  border: 1px solid transparent !important;
  color: #e6edf3 !important;
}
#context-menu li:hover {
  background-color: #2a2348 !important;
  border-color: #8b7cf6 !important;
}
#context-menu a,
#context-menu a:link,
#context-menu a:visited,
#wrapper #context-menu a:not(.easy-mindmup__icon) {
  color: #e6edf3 !important;
  background-color: transparent !important;
  border-color: transparent !important;
}
#context-menu a:hover,
#context-menu a:focus,
#wrapper #context-menu a:not(.easy-mindmup__icon):hover {
  color: #fff !important;
  background-color: #2a2348 !important;
  border-color: transparent !important;
}
#context-menu a.disabled,
#context-menu a.disabled:hover {
  color: #6e7681 !important;
  background: transparent !important;
}
/* submenu filter removed — see visibility block */
/* submenu hover filter removed */
#context-menu a.icon-checked {
  background-color: transparent !important;
}

/* Selected row in issue list */
.context-menu-selection,
.context-menu-selection > td {
  background-color: #3d2a6d !important;
  color: #fff !important;
}
.context-menu-selection a,
.context-menu-selection a:hover {
  color: #fff !important;
}

/* ---- Issue list: buttons column without light chips ---- */
table.list td.buttons a,
table.list td.buttons .icon,
table.list td.buttons .icon-only,
div.buttons a.icon-only,
td.buttons a.icon-only {
  background-color: transparent !important;
  border: 0 none !important;
  box-shadow: none !important;
  color: var(--md-link) !important;
  opacity: 0.9;
}
table.list td.buttons a:hover,
td.buttons a.icon-only:hover {
  color: #fff !important;
  opacity: 1;
  background-color: transparent !important;
}

/* ---- List / group rows: harmonious surfaces ---- */
table.list,
table.list.issues {
  background: var(--md-bg) !important;
  border-color: var(--md-border) !important;
}
table.list thead th,
table.list th {
  background: var(--md-bg-soft) !important;
  border-color: var(--md-border) !important;
  color: var(--md-text-muted) !important;
}
table.list td {
  background-color: transparent !important;
  border-color: #21262d !important;
  color: var(--md-text) !important;
}
table.list tr.odd,
table.list:not(.odd-even) tbody tr:nth-child(odd) {
  background: #0d1117 !important;
}
table.list tr.even,
table.list:not(.odd-even) tbody tr:nth-child(even) {
  background: #12171e !important;
}
table.list tr:hover,
table.list tr.odd:hover,
table.list tr.even:hover,
table.list:not(.odd-even) tbody tr:hover {
  background: #1c2128 !important;
}
table.list tr.odd td,
table.list tr.even td,
table.list:not(.odd-even) tbody tr td {
  background-color: transparent !important;
}

/* Group headers (version / assignee blocks) */
table.list tr.group,
table.list tr.group td,
tr.group span.name {
  background: #161b22 !important;
  border-color: #30363d !important;
  color: var(--md-text) !important;
}
table.list tr.group td {
  border-top: 1px solid #30363d !important;
  border-bottom: 1px solid #30363d !important;
}
table.list tr.group span.count {
  background: #30363d !important;
  color: var(--md-text-muted) !important;
}

/* Closed / overdue readability */
table.list tr.closed td,
table.list tr.closed a {
  color: #8b949e !important;
}
table.list a,
table.list a:link,
table.list a:visited {
  color: var(--md-link) !important;
}
table.list a:hover {
  color: var(--md-link-hover) !important;
}

/* Status / tracker badges if any stay light */
table.list .badge,
span.badge,
.status,
td.status span {
  /* don't force white pills */
}
span.expander {
  color: var(--md-text-muted) !important;
}

/* Soften harsh separators under section titles */
#content h3,
#content h4,
.wiki h2,
.wiki h3 {
  border-bottom-color: #21262d !important;
}

/* My page / version progress overview */
.version-overview table.progress td.todo,
#roadmap table.progress td.todo {
  background-color: #30363d !important;
  mix-blend-mode: normal !important;
}

/* ModernDark context-menu visibility */
#context-menu a,
#context-menu a:link,
#context-menu a:visited,
#context-menu li a,
#context-menu li a.submenu,
#wrapper #context-menu a:not(.easy-mindmup__icon),
#wrapper #context-menu a.submenu {
  color: #e6edf3 !important;
  filter: none !important;
  opacity: 1 !important;
  background-image: none !important; /* drop light-theme arrow png if broken */
}
/* Custom chevron for folders without invert filter */
#context-menu li a.submenu {
  position: relative;
  padding-right: 18px !important;
}
#context-menu li a.submenu::after {
  content: "›";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  color: #9da7b3 !important;
  font-size: 14px;
  font-weight: bold;
  filter: none !important;
  background: none !important;
}
#context-menu a.disabled,
#context-menu a.disabled:hover,
#context-menu li a.disabled {
  color: #8b949e !important;
  opacity: 0.85 !important;
  filter: none !important;
}
#context-menu li:hover > a,
#context-menu li:hover > a.submenu {
  color: #ffffff !important;
  filter: none !important;
}
#context-menu li:hover > a.submenu::after {
  color: #ffffff !important;
}

/* ModernDark issue tracker badges — readable in roadmap / lists */
a.issue,
a.issue:link,
a.issue:visited,
tr.issue .id > a,
tr.issue .issue_id > a,
tr.issue .legacy_id > a,
.relations > span > a.issue,
.parent > a.issue,
#roadmap a.issue,
.related-issues a.issue,
.version-article a.issue,
div#roadmap a.issue {
  background-color: #30363d !important;
  color: #f0f3f6 !important;
  text-decoration: none !important;
  border-radius: 3px !important;
  padding: 1px 6px !important;
  font-weight: 600 !important;
  opacity: 1 !important;
  mix-blend-mode: normal !important;
  filter: none !important;
}
a.issue:hover,
a.issue:focus,
tr.issue .id > a:hover {
  background-color: #484f58 !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

/* Closed: keep badge readable, soft strike without killing contrast */
a.issue.closed,
a.issue.closed:link,
a.issue.closed:visited,
table.list tr.closed a.issue,
table.list tr.closed td a.issue {
  background-color: #21262d !important;
  color: #c9d1d9 !important;
  text-decoration: none !important;
  opacity: 1 !important;
}
a.issue.closed::after {
  border-top-color: rgba(240, 243, 246, 0.55) !important;
  height: calc(50% - 1px) !important;
}
a.issue.closed:hover {
  background-color: #30363d !important;
  color: #ffffff !important;
}
a.issue.closed:hover::after {
  border-top-color: rgba(255, 255, 255, 0.35) !important;
}

/* Subject text after badge stays readable even in closed rows */
table.list tr.closed td.subject,
table.list tr.closed td.subject > a:not(.issue),
#roadmap .related-issues tr.closed td,
div#roadmap .wiki,
div#roadmap .related-issues a:not(.issue) {
  color: #c9d1d9 !important;
}
table.list tr.closed td.subject > a:not(.issue):hover {
  color: #ffffff !important;
}

/* Override earlier blanket closed mute that washed out badges */
table.list tr.closed a.issue,
table.list tr.closed td a.issue {
  color: #c9d1d9 !important;
}

/* Status column / badge labels */
.badge-status-open {
  border-color: #58a6ff !important;
  color: #79c0ff !important;
  background: rgba(56, 139, 253, 0.12) !important;
}
.badge-status-locked {
  border-color: #8b949e !important;
  color: #c9d1d9 !important;
  background: rgba(139, 148, 158, 0.12) !important;
}
.badge-status-closed {
  border-color: #3fb950 !important;
  color: #7ee787 !important;
  background: rgba(63, 185, 80, 0.12) !important;
}
.badge-issues-count,
.badge-count,
tr.group .count {
  background: #30363d !important;
  color: #e6edf3 !important;
  border-color: #484f58 !important;
}

/* Tracker-colored variants: ensure text never goes muddy on dark */
a.issue[class*="tracker-"],
a.issue.tracker-1,
a.issue.tracker-2,
a.issue.tracker-3,
a.issue.tracker-4,
a.issue.tracker-5,
a.issue.tracker-6,
a.issue.tracker-7,
a.issue.tracker-8,
a.issue.tracker-9,
a.issue.tracker-10 {
  color: #ffffff !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}
a.issue.closed[class*="tracker-"],
a.issue.closed.tracker-1,
a.issue.closed.tracker-2,
a.issue.closed.tracker-3,
a.issue.closed.tracker-4,
a.issue.closed.tracker-5 {
  color: #f0f3f6 !important;
  filter: saturate(0.85) brightness(0.95);
}
