@media print {
	#view-issue-page .bugnote .btn { display: none; }
	#view-issue-page .bugnote .btn-sm { display: none; }
	.noprint { display: none; }
}

span.print { font-size: 8pt; }
span.required 		{ font-size: 8pt; color: #bb0000; }

td.category, th.category,
td.category label, th.category label
{
    background-color: #EEF0FB !important;
    color: #000000;
    font-weight: bold;
    vertical-align : top;
}
td.category .small, th.category .small	{ font-weight: normal;  }

.small-caption	{
    border: 1px solid #fff;
    font-size: 8pt;
    padding: 0 5px;
}
tr.spacer			{ background-color: #ffffff !important; color: #000000; height: 5px; }

/* Issue Summary at bug_report_page.php, bug_update_page.php */
input[type="text"]#summary { width: 100%; }

/**
 * view_all_bug_page.php
 */
#buglist td, #buglist th	{ text-align: center; }
#buglist .column-summary,
#buglist .column-description,
#buglist .column-notes,
#buglist .column-steps-to-reproduce,
#buglist .column-additional-information,
#buglist .cftype-string,
#buglist .cftype-textarea
	{ text-align: left; }

.sticky-separator,
.test-langs th
	{ background-color: lightgrey; }

/* manage_plugin_page.php */
span.dependency_dated		{ color: maroon; }
span.dependency_met			{ color: green; }
span.dependency_unmet		{ color: red; }
span.dependency_upgrade		{ color: orange; }

tr.bugnote, div.widget-box, a#attachments, .test-langs tr {
	scroll-margin-top: 50px;
}
tr.bugnote .bugnote-note { background-color: #e8e8e8; color: #000000; width: 75%; vertical-align: top; }

.bugnote-private { background-color: #fcf8e3 !important;}

.nowrap
{
	white-space: nowrap;
}

.issue-status
{
	border-bottom: 1px dotted black;
}

.bug-attachments {
	margin: 0;
	padding: 0;
}

.bug-attachments > ul {
	list-style: none;
	margin: 0.5em;
	padding: 0;
}

.bug-attachments > ul > li {
	margin: 0.5em 0;
	padding: 0;
}

.bug-attachments > ul > li > div {
	margin: 0;
	padding: 0;
}

.bug-attachment-preview-text, .bug-attachment-preview-image {
	margin: 1em;
	padding: 1em;
}

.bug-attachment-preview-image img {
	max-width: 100%;
}

.bug-attachment-preview-text {
	white-space: pre-wrap;
}

#dates label[for=start_date], #dates > label[for=end_date] {
	float: left;
	width: 3em;
}

/* manage_config_* colors */
.color-global		{ background-color: LightBlue; }
.color-project		{ background-color: LightGreen; }

td.due-0, td.overdue { background-color: red; color: #ffffff; font-weight: bold; }
td.due-1             { background-color: darkorange; color: #ffffff; font-weight: bold; }
td.due-2             { background-color: green; color: #ffffff; font-weight: bold; }
td.print-overdue     { font-weight: bold; }

.collapse-link { cursor: pointer; }

.table-nonfluid {
   width: auto !important;
}

.login-logo {
	text-align: center;
}

/* strike-through resolved issues: #22492 */
.resolved  {
    text-decoration: line-through;
}

.error-details .code {
	font-family: monospace;
}

table.filters td.category {
	color: #4338CA;
}

.listjs-table .sort:after {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid transparent;
  content: "";
  position: relative;
  top: -10px;
  right: -5px;
}

.listjs-table .sort.desc:after {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #707070;
  content: "";
  position: relative;
  top: 4px;
  right: -5px;
}

.listjs-table .sort.asc:after {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid #707070;
  content: "";
  position: relative;
  top: -4px;
  right: -5px;
}

.listjs-table .sort:hover {
	text-decoration: underline;
}

.test-langs ol.plugins-toc {
    column-count: auto;
    column-width: 130px;
    column-gap: 60px;
    margin: 10px 15px 10px 30px;
}

.editable_access_level {
    display: inline-grid;
    grid-template-columns: 1fr 20px 1fr;
}

#log-event-list .duplicate-query {
    color: #E2755F;
}

/* ==========================================================================
   VISUAL REDESIGN
   Mantis loads this file BEFORE ace.css/ace-mantis.css, so overrides below
   rely on !important rather than load order to win the cascade.
   ========================================================================== */

:root {
    --brand-900: #2C2A77;
    --brand-700: #4338CA;
    --brand-600: #4F46E5;
    --brand-100: #ECEBFB;
    --accent: #F59E0B;
    --bg-app: #F5F6FA;
    --surface: #FFFFFF;
    --border: #E3E6EF;
    --text: #1F2430;
    --text-muted: #6B7280;

    /* status badge pairs: light fill + readable accent text/dot */
    --st-new-bg: #FBE3E3;     --st-new-fg: #A6434B;
    --st-feedback-bg: #F2DCEF; --st-feedback-fg: #8B4789;
    --st-ack-bg: #E0E6FA;      --st-ack-fg: #4453A6;
    --st-confirmed-bg: #D6E8FB; --st-confirmed-fg: #2D6FA3;
    --st-assigned-bg: #FCEFC7;  --st-assigned-fg: #97751B;
    --st-resolved-bg: #DFF3DE;  --st-resolved-fg: #3C7A3D;
    --st-closed-bg: #E9E9E9;    --st-closed-fg: #5A5A5A;

    --row-border: #AEBBEC;
    --row-stripe: #FAFBFD;
}

html.dark-mode {
    --brand-900: #1B1A3E;
    --brand-700: #9092F0;
    --brand-600: #A5A7F5;
    --brand-100: rgba(99, 102, 241, 0.18);
    --accent: #FBBF24;
    --bg-app: #14151F;
    --surface: #1C1E2C;
    --border: #2E3142;
    --text: #E7E8F2;
    --text-muted: #9298B3;

    --row-border: #323548;
    --row-stripe: #1F212F;
}

/* ---- base / typography ------------------------------------------------ */

body.skin-3 {
    background-color: var(--bg-app) !important;
    color: var(--text);
}

h1, h2, h3, h4, h5, .widget-title {
    font-weight: 600 !important;
}

.page-content a,
.widget-body a,
#buglist a,
.breadcrumb a {
    color: var(--brand-700);
}
.page-content a:hover,
.widget-body a:hover,
#buglist a:hover {
    color: var(--brand-900);
}

/* ---- top navbar -------------------------------------------------------- */

#navbar.navbar-default {
    /* keep both ends deep - stretching all the way to --brand-700 over the
       full navbar width washed out to a pale lavender on the right */
    background: linear-gradient(135deg, var(--brand-900), #38358f) !important;
    border: none !important;
    border-bottom: 3px solid var(--accent) !important;
    box-shadow: 0 2px 10px rgba(20, 20, 60, 0.18);
}

.navbar-brand,
.navbar-brand:hover,
.navbar-brand:focus {
    color: #ffffff !important;
    font-weight: 700;
    letter-spacing: .02em;
}
.navbar-brand::before {
    content: "";
    display: inline-block;
    width: 26px;
    height: 26px;
    margin-right: 8px;
    vertical-align: middle;
    border-radius: 6px;
    background-image: url("../images/mantis_logo.png");
    background-size: cover;
    background-position: center;
}

.ace-nav > li > a {
    color: rgba(255, 255, 255, 0.88) !important;
}
.ace-nav > li.open > a,
.ace-nav > li > a:hover {
    background-color: rgba(255, 255, 255, 0.14) !important;
}
.ace-nav .user-info {
    color: #ffffff !important;
}
/* ace.css gives the project-picker and user-menu dropdown a solid
   #555 box (".ace-nav > li.grey > a") - blend it into the navbar instead
   of letting it float as its own dark chip. */
.ace-nav > li.grey > a {
    background-color: transparent !important;
}
.ace-nav > li.grey > a:hover,
.ace-nav > li.grey > a:focus,
.ace-nav > li.open.grey > a {
    background-color: rgba(255, 255, 255, 0.14) !important;
}

#nav-search .nav-search-input {
    border-radius: 14px !important;
}

/* ---- theme toggle button ------------------------------------------------ */

.theme-toggle-btn {
    cursor: pointer;
}
.theme-icon-light {
    display: none;
}
html.dark-mode .theme-icon-dark {
    display: none;
}
html.dark-mode .theme-icon-light {
    display: inline-block;
}

/* ---- breadcrumb / utility bar ------------------------------------------ */

#breadcrumbs.breadcrumbs {
    background-color: var(--surface) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: none !important;
}
#breadcrumbs .label-default.arrowed,
#breadcrumbs .label-default.arrowed-right {
    background-color: var(--brand-100) !important;
    color: var(--brand-700) !important;
}
#breadcrumbs .label-default.arrowed:before,
#breadcrumbs .label-default.arrowed-right:before {
    border-color: transparent var(--brand-100) transparent transparent !important;
}

/* ---- sidebar ------------------------------------------------------------ */

/* ace-skins.css ships a "body.skin-3 .nav-list > li > a" rule (#E3E3E3 bg)
   and an !important pale-blue bg on the active item, both at the same
   specificity as a plain ".sidebar ..." override and loaded after this file
   -> they'd win cascade ties. Prefixing with "body.skin-3" matches their
   specificity exactly plus one extra element, so ours wins outright. */

body.skin-3 .sidebar {
    background: var(--surface) !important;
    border-right: 1px solid var(--border) !important;
    box-shadow: 1px 0 3px rgba(16, 24, 40, 0.03);
}
body.skin-3 .sidebar .nav-list > li {
    border-color: transparent !important;
}
body.skin-3 .sidebar .nav-list > li > a {
    /* color only - no margin/radius/padding overrides, so the hit target
       and row height stay exactly the stock Ace size (full-width, edge to
       edge), not a floating inset "chip". */
    background: transparent !important;
    color: #444B59 !important;
    border: none !important;
}
/* hover: color shift only, no filled background box - that's reserved for
   the active/current-page state below */
body.skin-3 .sidebar .nav-list > li:hover > a,
body.skin-3 .sidebar .nav-list > li > a:hover {
    background: transparent !important;
    color: var(--brand-700) !important;
}
body.skin-3 .sidebar .nav-list > li.open > a {
    background: var(--brand-100) !important;
    color: var(--brand-700) !important;
}
/* No filled background box for any state - hover, click, or even the
   active/current page - just a color + weight change on the text/icon. */
body.skin-3 .sidebar .nav-list > li.active > a {
    background: transparent !important;
    color: var(--brand-700) !important;
    font-weight: 600;
    box-shadow: none !important;
}
body.skin-3 .sidebar .nav-list > li > a:focus,
body.skin-3 .sidebar .nav-list > li > a:active,
body.skin-3 .sidebar .nav-list > li.active > a:focus,
body.skin-3 .sidebar .nav-list > li.active > a:active {
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}
body.skin-3 .sidebar .nav-list > li:before,
body.skin-3 .sidebar .nav-list > li.active:before,
body.skin-3 .sidebar .nav-list > li:hover:before {
    display: none !important;
}
body.skin-3 .sidebar .nav-list > li > a > .menu-icon {
    color: #9AA3B5 !important;
}
body.skin-3 .sidebar .nav-list > li.active > a > .menu-icon,
body.skin-3 .sidebar .nav-list > li:hover > a > .menu-icon {
    color: var(--brand-700) !important;
}
#sidebar-btn.sidebar-toggle {
    background-color: var(--brand-700) !important;
}

/* ---- widget boxes / panels ---------------------------------------------- */

/* Light mode: solid-fill header bar like stock Ace (".widget-color-blue2"
   etc.), just recolored to the brand indigo instead of ace's stock blue,
   plus an obvious matching border around the whole box. Dark mode keeps its
   own flat dark-surface treatment, overridden separately below. */
.widget-box {
    border: 1px solid var(--brand-700) !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08) !important;
    overflow: hidden;
}
.widget-header {
    background: var(--brand-700) !important;
    border: none !important;
    /* horizontal breathing room only - ace's own min-height/line-height on
       .widget-header-small (used by nearly every panel) already sizes the
       bar; adding vertical padding on top of that was inflating every
       header to ~50px instead of the stock ~31px. */
    padding: 0 14px !important;
}
.widget-title,
.widget-header .ace-icon {
    color: #ffffff !important;
}
/* My View's widget titles are clickable links rendered via print_link(...,
   'white'), which outputs <a class="white"> matching ace.css's ".white
   {color:#FFF !important}" directly - happens to be exactly the color we
   want now that the header is filled again, so no override needed here;
   dark mode re-points it back to a readable color below. */
.widget-title .badge {
    background: #ffffff !important;
    color: var(--brand-700) !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

/* ---- buttons -------------------------------------------------------------- */

.btn {
    border-radius: 6px !important;
    font-weight: 500;
}
.btn-primary.btn-white {
    background-color: #ffffff !important;
    border-color: var(--brand-700) !important;
    color: var(--brand-700) !important;
}
.btn-primary.btn-white:hover {
    background-color: var(--brand-700) !important;
    color: #ffffff !important;
}
.btn-primary:not(.btn-white) {
    background-color: var(--brand-700) !important;
    border-color: var(--brand-700) !important;
    color: #ffffff !important;
}
.btn-primary:not(.btn-white):hover {
    background-color: var(--brand-900) !important;
    border-color: var(--brand-900) !important;
}
.btn-success {
    background-color: var(--brand-700) !important;
    border-color: var(--brand-700) !important;
}
.btn-success:hover {
    background-color: var(--brand-900) !important;
    border-color: var(--brand-900) !important;
}

/* ---- forms ----------------------------------------------------------------- */

.form-control {
    border-radius: 6px !important;
    border-color: var(--border) !important;
}
.form-control:focus {
    border-color: var(--brand-700) !important;
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.15) !important;
}

/* ---- pagination & badges ---------------------------------------------------- */

.pagination > li > a,
.pagination > li > span {
    color: var(--brand-700);
}
.pagination > li.active > a,
.pagination > li.active > span {
    background-color: var(--brand-700) !important;
    border-color: var(--brand-700) !important;
}

/* ---- issue tables (View Issues / My View) ------------------------------------ */

#buglist thead th,
.buglist-headers th {
    background-color: #F8F9FC !important;
    color: #475467 !important;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: .04em;
    border-color: var(--row-border) !important;
    padding: 10px 8px !important;
}
#buglist td {
    padding: 9px 8px !important;
    vertical-align: middle !important;
}

/* Ace/bootstrap's default table border is nearly invisible against a white
   widget-body; force a real divider between every issue row, on every issue
   table (View Issues, My View widgets), not just #buglist. */
.table-bordered,
.table-bordered > tbody > tr > td,
.table-bordered > tbody > tr > th,
#buglist td,
#buglist th {
    border-color: var(--row-border) !important;
}
.table > tbody > tr > td,
.table > tbody > tr > th {
    border-top: 1px solid var(--row-border) !important;
}
.my-buglist-bug > td {
    border-bottom: 1px solid var(--row-border) !important;
}
.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: var(--row-stripe) !important;
}
#buglist tbody tr:hover,
.my-buglist-bug:hover {
    background-color: var(--brand-100) !important;
}

/* status dot: render as a circle instead of the default square glyph */
.fa-status-box {
    font-size: 11px !important;
    vertical-align: middle !important;
    margin-right: 6px;
}
.fa-status-box::before {
    content: "\f111" !important; /* fa-circle */
}

/* status pill badges: pale fill + accent text, scoped to the 3 places that
   wrap the label in a sibling <span> (view-issues list, my-view list, issue
   detail page). Status ids: 10 new, 20 feedback, 30 acknowledged, 40
   confirmed, 50 assigned, 80 resolved, 90 closed. */
.column-status .fa-status-box + span,
.my-buglist-id .fa-status-box + span,
.bug-status .fa-status-box + span {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.5;
}

.column-status .status-10-fg, .my-buglist-id .status-10-fg, .bug-status .status-10-fg { color: var(--st-new-fg) !important; }
.column-status .status-10-fg + span, .my-buglist-id .status-10-fg + span, .bug-status .status-10-fg + span { background: var(--st-new-bg) !important; color: var(--st-new-fg) !important; }

.column-status .status-20-fg, .my-buglist-id .status-20-fg, .bug-status .status-20-fg { color: var(--st-feedback-fg) !important; }
.column-status .status-20-fg + span, .my-buglist-id .status-20-fg + span, .bug-status .status-20-fg + span { background: var(--st-feedback-bg) !important; color: var(--st-feedback-fg) !important; }

.column-status .status-30-fg, .my-buglist-id .status-30-fg, .bug-status .status-30-fg { color: var(--st-ack-fg) !important; }
.column-status .status-30-fg + span, .my-buglist-id .status-30-fg + span, .bug-status .status-30-fg + span { background: var(--st-ack-bg) !important; color: var(--st-ack-fg) !important; }

.column-status .status-40-fg, .my-buglist-id .status-40-fg, .bug-status .status-40-fg { color: var(--st-confirmed-fg) !important; }
.column-status .status-40-fg + span, .my-buglist-id .status-40-fg + span, .bug-status .status-40-fg + span { background: var(--st-confirmed-bg) !important; color: var(--st-confirmed-fg) !important; }

.column-status .status-50-fg, .my-buglist-id .status-50-fg, .bug-status .status-50-fg { color: var(--st-assigned-fg) !important; }
.column-status .status-50-fg + span, .my-buglist-id .status-50-fg + span, .bug-status .status-50-fg + span { background: var(--st-assigned-bg) !important; color: var(--st-assigned-fg) !important; }

.column-status .status-80-fg, .my-buglist-id .status-80-fg, .bug-status .status-80-fg { color: var(--st-resolved-fg) !important; }
.column-status .status-80-fg + span, .my-buglist-id .status-80-fg + span, .bug-status .status-80-fg + span { background: var(--st-resolved-bg) !important; color: var(--st-resolved-fg) !important; }

.column-status .status-90-fg, .my-buglist-id .status-90-fg, .bug-status .status-90-fg { color: var(--st-closed-fg) !important; }
.column-status .status-90-fg + span, .my-buglist-id .status-90-fg + span, .bug-status .status-90-fg + span { background: var(--st-closed-bg) !important; color: var(--st-closed-fg) !important; }

/* ---- login / signup ---------------------------------------------------------- */

/* login-style pages (login, re-authenticate, signup, lost password) render
   via layout_login_page_*() which sets body class "login-layout light-login"
   instead of the usual "skin-3" - none of the body.skin-3-scoped rules
   above apply here, and ace-mantis.css's plain ".light-login{background:
   #fff !important}" otherwise wins on source order. "body.light-login" has
   one extra element in its specificity, so this wins outright in both
   modes regardless of load order. */
body.light-login,
.skin-3 .main-container:before {
    background: linear-gradient(160deg, #EEF0FB 0%, #F5F6FA 60%) !important;
}
html.dark-mode body.light-login {
    background: var(--bg-app) !important;
}
.login-container {
    max-width: 420px;
    margin: 40px auto 0;
}
#login-box.widget-box {
    border-radius: 12px !important;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.14) !important;
}
.login-logo img {
    max-height: 56px;
}
#login-box .btn-success {
    background-color: var(--brand-700) !important;
    border-color: var(--brand-700) !important;
}
#login-box .btn-success:hover {
    background-color: var(--brand-900) !important;
    border-color: var(--brand-900) !important;
}

/* ---- footer ------------------------------------------------------------------ */

.footer .footer-inner {
    color: var(--text-muted);
    font-size: 12px;
}

/* ==========================================================================
   DARK MODE
   :root variables above already swap most colors automatically. Everything
   below targets surfaces that ace.css/ace-mantis.css set with hardcoded
   (often !important) hex values, which variables alone can't reach.
   ========================================================================== */

html.dark-mode body.skin-3 {
    background-color: var(--bg-app) !important;
    color: var(--text) !important;
}

html.dark-mode .main-container:before {
    background: var(--bg-app) !important;
}

/* panels / widgets */
html.dark-mode .widget-box {
    background-color: var(--surface) !important;
    border-color: var(--border) !important;
}
html.dark-mode .widget-header,
html.dark-mode .widget-body,
html.dark-mode .widget-main,
html.dark-mode .page-content {
    background-color: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}
/* light mode hardcodes white text/icon for the solid-fill header; dark mode
   keeps the flat dark-surface header, so all of this needs to flip back */
html.dark-mode .widget-title,
html.dark-mode .widget-header .ace-icon,
html.dark-mode .widget-title a.white,
html.dark-mode .widget-title .white {
    color: var(--text) !important;
}
html.dark-mode .widget-title .badge {
    background: transparent !important;
    color: var(--text-muted) !important;
}
/* bootstrap's ".well" (used to box each bug attachment preview) hardcodes
   a light-grey fill/border that never picked up the theme. */
html.dark-mode .well {
    background-color: var(--bg-app) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

/* tables */
html.dark-mode table,
html.dark-mode .table {
    background-color: var(--surface) !important;
    color: var(--text) !important;
}
html.dark-mode #buglist thead th,
html.dark-mode .buglist-headers th {
    background-color: #20222F !important;
    color: var(--text-muted) !important;
}
html.dark-mode .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: var(--row-stripe) !important;
}
/* ace.css paints its own light gradient directly on "<tr>" and "<th>"
   inside every plain .table's thead (not just the <table> element), which a
   table-level background override can never beat - has to be killed at the
   row/cell level itself, with !important since ace's gradient has none. */
html.dark-mode .table > thead > tr,
html.dark-mode .table > thead > tr > th,
html.dark-mode .table > tbody > tr,
html.dark-mode .table > tbody > tr > td,
html.dark-mode .table > tbody > tr > th {
    background: var(--surface) !important;
    background-image: none !important;
    color: var(--text) !important;
    border-color: var(--row-border) !important;
}
html.dark-mode #buglist tbody tr:hover,
html.dark-mode .my-buglist-bug:hover {
    background-color: var(--brand-100) !important;
}
/* category cells get a distinct tint by stock Mantis design (light mode:
   a pale lavender, subtle enough to blend in). In dark mode the same
   mechanism becomes a visibly darker box against the near-black page,
   reading as an unwanted highlight - match it flush to the surrounding
   panel/surface instead of giving it its own tint. */
html.dark-mode td.category,
html.dark-mode th.category,
html.dark-mode td.category label,
html.dark-mode th.category label {
    background-color: var(--surface) !important;
    color: var(--text) !important;
}
html.dark-mode .sticky-separator,
html.dark-mode .test-langs th {
    background-color: var(--border) !important;
}

/* sidebar */
html.dark-mode .sidebar {
    background-color: var(--surface) !important;
    border-color: var(--border) !important;
}
html.dark-mode .sidebar .nav-list > li > a {
    color: var(--text-muted) !important;
}

/* breadcrumb / utility bar */
html.dark-mode #breadcrumbs.breadcrumbs {
    background-color: var(--surface) !important;
    border-color: var(--border) !important;
}
html.dark-mode .nav-recent {
    color: var(--text-muted);
}

/* forms */
html.dark-mode .form-control,
html.dark-mode select,
html.dark-mode textarea,
html.dark-mode input[type="text"],
html.dark-mode input[type="password"],
html.dark-mode input[type="email"],
html.dark-mode input[type="number"] {
    background-color: #1A1C29 !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}
/* browser autofill (e.g. Summary remembering a previously-typed value)
   forces its own background with very high priority - high enough that
   even !important background-color above can't beat it. The only reliable
   override is the inset box-shadow trick. */
html.dark-mode input:-webkit-autofill,
html.dark-mode input:-webkit-autofill:hover,
html.dark-mode input:-webkit-autofill:focus,
html.dark-mode textarea:-webkit-autofill {
    -webkit-text-fill-color: var(--text) !important;
    -webkit-box-shadow: 0 0 0 1000px #1A1C29 inset !important;
    box-shadow: 0 0 0 1000px #1A1C29 inset !important;
    caret-color: var(--text);
}
/* the closed <select> box above picks up dark colors automatically, but
   the native dropdown *popup list* of <option>s is a separate, browser-
   rendered surface that doesn't inherit page CSS unless styled directly -
   left unstyled it falls back to the OS's default white list */
html.dark-mode select option {
    background-color: #1A1C29 !important;
    color: var(--text) !important;
}
html.dark-mode .btn-default,
html.dark-mode .btn-white:not(.btn-primary) {
    background-color: #232540 !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}
html.dark-mode .btn-primary.btn-white {
    background-color: var(--surface) !important;
    border-color: var(--brand-700) !important;
    color: var(--brand-700) !important;
}
html.dark-mode .btn-primary.btn-white:hover {
    background-color: var(--brand-700) !important;
    color: var(--surface) !important;
}
html.dark-mode .label-grey,
html.dark-mode .label.label-grey {
    background-color: #2C2F40 !important;
    color: var(--text-muted) !important;
}

/* every plain bootstrap table (Manage / admin pages use these directly,
   not #buglist) needs the same dark surface + a non-white hover state */
html.dark-mode .table-hover > tbody > tr:hover,
html.dark-mode .table-hover > tbody > tr:hover > td,
html.dark-mode .table-hover > tbody > tr:hover > th {
    background-color: var(--brand-100) !important;
    color: var(--text) !important;
}
html.dark-mode .table > tbody > tr > td,
html.dark-mode .table > tbody > tr > th {
    border-color: var(--row-border) !important;
}
html.dark-mode tr.spacer {
    background-color: var(--surface) !important;
}
html.dark-mode .dropdown-menu {
    background-color: var(--surface) !important;
    border-color: var(--border) !important;
}
html.dark-mode .dropdown-menu > li > a {
    color: var(--text) !important;
}
html.dark-mode .dropdown-menu > li > a:hover {
    background-color: var(--brand-100) !important;
}

/* admin page tab bars (Manage Overview's Users/Projects/Tags/... tabs) -
   bootstrap and ace both set the active tab's background to plain #fff with
   no !important */
html.dark-mode .nav-tabs > li > a {
    background-color: transparent !important;
    color: var(--text-muted) !important;
    border-color: var(--border) !important;
}
html.dark-mode .nav-tabs > li.active > a,
html.dark-mode .nav-tabs > li.active > a:hover,
html.dark-mode .nav-tabs > li.active > a:focus {
    background-color: var(--surface) !important;
    color: var(--brand-700) !important;
    border-color: var(--border) !important;
}

/* toolbar strips inside widgets (View Issues' Print/Export row, the
   Select All/Copy row, Timeline's Prev/date row) - ace hardcodes #EEE */
html.dark-mode .widget-toolbox {
    background-color: var(--surface) !important;
    border-color: var(--border) !important;
}

/* Timeline widget's activity feed */
html.dark-mode .profile-activity {
    background-color: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}
html.dark-mode .profile-activity .time {
    color: var(--text-muted) !important;
}

/* collapsed/icon-only sidebar (menu-min) flyout label that appears on
   hover - ace-skins.css hardcodes a light blue-grey box, no !important */
html.dark-mode .sidebar.menu-min .nav-list > li > a > .menu-text,
html.dark-mode .sidebar.compact .nav-list > li > a > .menu-text {
    background-color: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

/* misc components */
html.dark-mode .label-default {
    background-color: var(--brand-100) !important;
    color: var(--brand-700) !important;
}
html.dark-mode .alert {
    background-color: #232540;
    border-color: var(--border);
    color: var(--text);
}
html.dark-mode hr {
    border-color: var(--border) !important;
}
html.dark-mode .pagination > li > a,
html.dark-mode .pagination > li > span {
    background-color: var(--surface) !important;
    border-color: var(--border) !important;
}

/* login - logo is a full-color navy/amber mark, reads fine on dark
   backgrounds already, so no filter needed here */
.login-logo img {
    border-radius: 8px;
}

/* text selection - browser default light-blue selection box looks like an
   unwanted "highlight" against a dark page; tie it to the brand color.
   NOT using var(--brand-700) here - in dark mode that variable is
   deliberately lightened (for link/text contrast) to a pale periwinkle,
   which as a *selection fill* behind white text reads as a washed-out
   glow rather than a solid highlight. Selection needs its own fixed,
   properly-saturated color in each mode. */
::selection {
    background: #4338ca;
    color: #ffffff;
}
html.dark-mode ::selection {
    background: #4f46e5;
    color: #ffffff;
}

/* typeahead/tag-autocomplete inputs (e.g. Tags field) hardcode a white
   background in ace-mantis.css independent of the regular .form-control
   styling above */
html.dark-mode input.typeahead,
html.dark-mode input.tt-query,
html.dark-mode input.tt-hint,
html.dark-mode .form-group input.tt-hint {
    background-color: #1A1C29 !important;
    color: var(--text) !important;
}
html.dark-mode .tt-menu {
    background-color: var(--surface) !important;
    border-color: var(--border) !important;
}
html.dark-mode .tt-suggestion {
    color: var(--text) !important;
}

/* footer "powered by" logo - layout_api.php hardcodes width="102"
   height="35" (sized for the old wide rectangular logo); our square mark
   gets squished into that aspect ratio. Override with equal dimensions. */
#powered-by-mantisbt-logo img {
    width: 48px !important;
    height: 48px !important;
    border-radius: 4px;
}
