/* observability-stack Fleet and Docker table overrides.
 *
 * SigNoz v0.132 does not expose font size, row density, or cell borders in the
 * dashboard/widget schema. Scope these overrides to deterministic widget ids
 * generated by the Fleet/Docker dashboard scripts.
 */

:is(
		[id="0b271b23-40cb-5ad3-b92c-1e323d3edb4d"],
		[id="65188822-288c-5106-95fb-18821690dc12"],
		[id="d2c20ccb-3df5-5156-9787-318986368975"]
	)
	.ant-table {
	--fleet-ok: rgba(50, 172, 45, 0.97);
	--fleet-warning: rgba(237, 129, 40, 0.89);
	--fleet-critical: rgba(245, 54, 54, 0.9);
	--fleet-colored-border: rgba(15, 18, 24, 0.72);
	font-size: 11px !important;
}

:is(
		[id="0b271b23-40cb-5ad3-b92c-1e323d3edb4d"],
		[id="65188822-288c-5106-95fb-18821690dc12"],
		[id="d2c20ccb-3df5-5156-9787-318986368975"]
	)
	.ant-table-container {
	border-top: 1px solid var(--border) !important;
	border-left: 1px solid var(--border) !important;
}

:is(
		[id="0b271b23-40cb-5ad3-b92c-1e323d3edb4d"],
		[id="65188822-288c-5106-95fb-18821690dc12"],
		[id="d2c20ccb-3df5-5156-9787-318986368975"]
	)
	.ant-table-thead
	> tr
	> th,
:is(
		[id="0b271b23-40cb-5ad3-b92c-1e323d3edb4d"],
		[id="65188822-288c-5106-95fb-18821690dc12"],
		[id="d2c20ccb-3df5-5156-9787-318986368975"]
	)
	.ant-table-tbody
	> tr
	> td {
	padding: 3px 5px !important;
	font-size: 11px !important;
	line-height: 16px !important;
	border-right: 1px solid var(--border) !important;
	border-bottom: 1px solid var(--border) !important;
}

:is(
		[id="0b271b23-40cb-5ad3-b92c-1e323d3edb4d"],
		[id="65188822-288c-5106-95fb-18821690dc12"],
		[id="d2c20ccb-3df5-5156-9787-318986368975"]
	)
	.ant-table-thead
	> tr
	> th {
	font-weight: 600 !important;
}

:is(
		[id="0b271b23-40cb-5ad3-b92c-1e323d3edb4d"],
		[id="65188822-288c-5106-95fb-18821690dc12"],
		[id="d2c20ccb-3df5-5156-9787-318986368975"]
	)
	.ant-table-cell
	> div,
:is(
		[id="0b271b23-40cb-5ad3-b92c-1e323d3edb4d"],
		[id="65188822-288c-5106-95fb-18821690dc12"],
		[id="d2c20ccb-3df5-5156-9787-318986368975"]
	)
	.ant-table-cell
	.ant-space {
	line-height: 16px !important;
}

/* GPT Solver exact totals: compact columns, up to 30 rows, and no nested
 * vertical scrollbar. The dashboard panels own the required height. */
:is(
		[id="93b454e9-a05d-530a-a4e1-72a687b79444"],
		[id="fad4af94-71ee-5fbd-8d61-ba2d5daf5997"]
	)
	.ant-table {
	font-size: 11px !important;
}

:is(
		[id="93b454e9-a05d-530a-a4e1-72a687b79444"],
		[id="fad4af94-71ee-5fbd-8d61-ba2d5daf5997"]
	)
	.ant-table-container {
	border-top: 1px solid var(--border) !important;
	border-left: 1px solid var(--border) !important;
}

[id="93b454e9-a05d-530a-a4e1-72a687b79444"]
	:is(.ant-table-content, .ant-table-header, .ant-table-body)
	table {
	width: 320px !important;
	min-width: 320px !important;
	max-width: 320px !important;
	table-layout: fixed !important;
}

[id="fad4af94-71ee-5fbd-8d61-ba2d5daf5997"]
	:is(.ant-table-content, .ant-table-header, .ant-table-body)
	table {
	width: 400px !important;
	min-width: 400px !important;
	max-width: 400px !important;
	table-layout: fixed !important;
}

:is(
		[id="93b454e9-a05d-530a-a4e1-72a687b79444"],
		[id="fad4af94-71ee-5fbd-8d61-ba2d5daf5997"]
	)
	.ant-table-thead
	> tr
	> th,
:is(
		[id="93b454e9-a05d-530a-a4e1-72a687b79444"],
		[id="fad4af94-71ee-5fbd-8d61-ba2d5daf5997"]
	)
	.ant-table-tbody
	> tr
	> td {
	padding: 3px 6px !important;
	font-size: 11px !important;
	line-height: 16px !important;
	border-right: 1px solid var(--border) !important;
	border-bottom: 1px solid var(--border) !important;
}

:is(
		[id="93b454e9-a05d-530a-a4e1-72a687b79444"],
		[id="fad4af94-71ee-5fbd-8d61-ba2d5daf5997"]
	)
	.ant-table-thead
	> tr
	> th {
	font-weight: 600 !important;
}

:is(
		[id="93b454e9-a05d-530a-a4e1-72a687b79444"],
		[id="fad4af94-71ee-5fbd-8d61-ba2d5daf5997"]
	)
	.ant-table-cell
	> div,
:is(
		[id="93b454e9-a05d-530a-a4e1-72a687b79444"],
		[id="fad4af94-71ee-5fbd-8d61-ba2d5daf5997"]
	)
	.ant-table-cell
	.ant-space {
	line-height: 16px !important;
}

:is(
		[id="93b454e9-a05d-530a-a4e1-72a687b79444"],
		[id="fad4af94-71ee-5fbd-8d61-ba2d5daf5997"]
	)
	.ant-table-body {
	max-height: none !important;
	height: auto !important;
	overflow: visible !important;
}

/* Grafana-style health cells. The node table starts health data at column 7;
 * both Docker tables start it at column 6. SigNoz only paints a small inner
 * div for thresholds; :has() promotes warning/critical to the whole cell.
 */
:is(
		[id="0b271b23-40cb-5ad3-b92c-1e323d3edb4d"]
			.ant-table-tbody
			> tr
			> td:nth-child(n + 7),
		[id="65188822-288c-5106-95fb-18821690dc12"]
			.ant-table-tbody
			> tr
			> td:nth-child(n + 6),
		[id="d2c20ccb-3df5-5156-9787-318986368975"]
			.ant-table-tbody
			> tr
			> td:nth-child(n + 6)
	) {
	background-color: var(--fleet-ok) !important;
	border-right-color: var(--fleet-colored-border) !important;
	border-bottom-color: var(--fleet-colored-border) !important;
	color: #fff !important;
	font-weight: 600 !important;
}

:is(
		[id="0b271b23-40cb-5ad3-b92c-1e323d3edb4d"] .ant-table-tbody > tr > td:nth-child(n + 7),
		[id="65188822-288c-5106-95fb-18821690dc12"] .ant-table-tbody > tr > td:nth-child(n + 6),
		[id="d2c20ccb-3df5-5156-9787-318986368975"] .ant-table-tbody > tr > td:nth-child(n + 6)
	):has([style*="background-color: orange" i]) {
	background-color: var(--fleet-warning) !important;
}

:is(
		[id="0b271b23-40cb-5ad3-b92c-1e323d3edb4d"] .ant-table-tbody > tr > td:nth-child(n + 7),
		[id="65188822-288c-5106-95fb-18821690dc12"] .ant-table-tbody > tr > td:nth-child(n + 6),
		[id="d2c20ccb-3df5-5156-9787-318986368975"] .ant-table-tbody > tr > td:nth-child(n + 6)
	):has([style*="background-color: red" i]) {
	background-color: var(--fleet-critical) !important;
}

:is(
		[id="0b271b23-40cb-5ad3-b92c-1e323d3edb4d"] .ant-table-tbody > tr > td:nth-child(n + 7),
		[id="65188822-288c-5106-95fb-18821690dc12"] .ant-table-tbody > tr > td:nth-child(n + 6),
		[id="d2c20ccb-3df5-5156-9787-318986368975"] .ant-table-tbody > tr > td:nth-child(n + 6)
	)
	* {
	color: #fff !important;
}

:is(
		[id="0b271b23-40cb-5ad3-b92c-1e323d3edb4d"] .ant-table-tbody > tr > td:nth-child(n + 7),
		[id="65188822-288c-5106-95fb-18821690dc12"] .ant-table-tbody > tr > td:nth-child(n + 6),
		[id="d2c20ccb-3df5-5156-9787-318986368975"] .ant-table-tbody > tr > td:nth-child(n + 6)
	)
	[style*="background-color" i] {
	background-color: transparent !important;
}

[id="0b271b23-40cb-5ad3-b92c-1e323d3edb4d"]
	.ant-table-tbody
	> tr:not(.ant-table-measure-row)
	> td:nth-child(-n + 2) {
	cursor: pointer;
}

:is(
		[id="65188822-288c-5106-95fb-18821690dc12"],
		[id="d2c20ccb-3df5-5156-9787-318986368975"]
	)
	.ant-table-tbody
	> tr:not(.ant-table-measure-row)
	> td:nth-child(-n + 2) {
	cursor: pointer;
}

.fleet-host-menu {
	position: fixed;
	z-index: 10000;
	min-width: 270px;
	padding: 6px;
	border: 1px solid var(--l2-border);
	border-radius: 6px;
	background: var(--l2-background);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
	color: var(--l1-foreground);
	font-size: 12px;
}

.fleet-host-menu__title {
	padding: 6px 8px;
	border-bottom: 1px solid var(--l2-border);
	color: var(--l2-foreground);
	font-size: 11px;
}

.fleet-host-menu__link {
	display: block;
	margin-top: 4px;
	padding: 7px 8px;
	border-radius: 4px;
	color: var(--l1-foreground) !important;
	text-decoration: none !important;
}

.fleet-host-menu__link:hover {
	background: var(--l3-background);
}

/* Per-host services overview cards. ValueGraph only paints the value area; promote
 * its warning/critical marker to the whole Ant card, including the header.
 * Cards without a matching threshold are healthy/informational and stay green.
 */
.ant-card:has(
	:is(
		[id="b33f0bad-e623-4c2b-b854-12270f211690"],
		[id="0ce16128-ff8d-479d-8db2-10ac8fb47bc2"],
		[id="6e6f8eea-dec8-40df-87ce-5bf185f6143b"],
		[id="622849bd-1d19-4863-8edc-e650488a00c9"],
		[id="32d053ce-f777-5a1a-939c-b0fe3a6775a6"],
		[id="2f789419-c177-5dbf-bc6a-6ebecc1101d9"],
		[id="bf88bed9-2f06-5091-b5c4-3f73d9cb96bd"],
		[id="864b6e26-332f-5c44-b297-cacc8c19ddf8"]
	)
) {
	--host-overview-ok: rgba(50, 172, 45, 0.97);
	--host-overview-warning: rgba(237, 129, 40, 0.89);
	--host-overview-critical: rgba(245, 54, 54, 0.9);
	background-color: var(--host-overview-ok) !important;
	border-color: rgba(15, 18, 24, 0.72) !important;
}

.ant-card:has(
	:is(
		[id="b33f0bad-e623-4c2b-b854-12270f211690"],
		[id="0ce16128-ff8d-479d-8db2-10ac8fb47bc2"],
		[id="6e6f8eea-dec8-40df-87ce-5bf185f6143b"],
		[id="622849bd-1d19-4863-8edc-e650488a00c9"]
	)
	.value-graph-container[style*="background-color: orange" i]
) {
	background-color: var(--host-overview-warning) !important;
}

.ant-card:has(
	:is(
		[id="b33f0bad-e623-4c2b-b854-12270f211690"],
		[id="0ce16128-ff8d-479d-8db2-10ac8fb47bc2"],
		[id="6e6f8eea-dec8-40df-87ce-5bf185f6143b"],
		[id="622849bd-1d19-4863-8edc-e650488a00c9"]
	)
	.value-graph-container[style*="background-color: red" i]
) {
	background-color: var(--host-overview-critical) !important;
}

.ant-card:has(
	:is(
		[id="b33f0bad-e623-4c2b-b854-12270f211690"],
		[id="0ce16128-ff8d-479d-8db2-10ac8fb47bc2"],
		[id="6e6f8eea-dec8-40df-87ce-5bf185f6143b"],
		[id="622849bd-1d19-4863-8edc-e650488a00c9"],
		[id="32d053ce-f777-5a1a-939c-b0fe3a6775a6"],
		[id="2f789419-c177-5dbf-bc6a-6ebecc1101d9"],
		[id="bf88bed9-2f06-5091-b5c4-3f73d9cb96bd"],
		[id="864b6e26-332f-5c44-b297-cacc8c19ddf8"]
	)
)
	:is(
		.widget-header-title,
		.value-graph-text,
		.value-graph-unit,
		.widget-header-actions,
		.signoz-icon
	) {
	color: #fff !important;
}

.ant-card:has(
	:is(
		[id="b33f0bad-e623-4c2b-b854-12270f211690"],
		[id="0ce16128-ff8d-479d-8db2-10ac8fb47bc2"],
		[id="6e6f8eea-dec8-40df-87ce-5bf185f6143b"],
		[id="622849bd-1d19-4863-8edc-e650488a00c9"],
		[id="32d053ce-f777-5a1a-939c-b0fe3a6775a6"],
		[id="2f789419-c177-5dbf-bc6a-6ebecc1101d9"],
		[id="bf88bed9-2f06-5091-b5c4-3f73d9cb96bd"],
		[id="864b6e26-332f-5c44-b297-cacc8c19ddf8"]
	)
)
	.value-graph-container {
	background-color: transparent !important;
}

.ant-card:has(
	:is(
		[id="b33f0bad-e623-4c2b-b854-12270f211690"],
		[id="0ce16128-ff8d-479d-8db2-10ac8fb47bc2"],
		[id="6e6f8eea-dec8-40df-87ce-5bf185f6143b"],
		[id="622849bd-1d19-4863-8edc-e650488a00c9"]
	)
)
	.value-graph-bgconflict {
	display: none !important;
}

/* Nginx Gateway overview. Threshold backgrounds are useful at a glance, but
 * SigNoz v0.132 keeps black text on saturated colors. Promote the threshold to
 * the whole card/cell and force a high-contrast white foreground.
 */
.ant-card:has(
	:is(
		[id="83a167cf-9ab9-5e14-b521-5bd7ac7ad6a1"],
		[id="f2247100-b2ba-5042-a216-89d1a3c9dcfb"],
		[id="b1f66fec-4f5f-5afc-9c98-47765412d3b6"],
		[id="71651fb1-a640-540c-bb7e-a1c767ca0ce5"]
	)
) {
	--nginx-ok: rgba(50, 172, 45, 0.97);
	--nginx-warning: rgba(237, 129, 40, 0.89);
	--nginx-critical: rgba(245, 54, 54, 0.9);
	background-color: var(--nginx-ok) !important;
	border-color: rgba(15, 18, 24, 0.72) !important;
}

.ant-card:has(
	:is(
		[id="83a167cf-9ab9-5e14-b521-5bd7ac7ad6a1"],
		[id="f2247100-b2ba-5042-a216-89d1a3c9dcfb"],
		[id="b1f66fec-4f5f-5afc-9c98-47765412d3b6"],
		[id="71651fb1-a640-540c-bb7e-a1c767ca0ce5"]
	)
	.value-graph-container[style*="background-color: orange" i]
) {
	background-color: var(--nginx-warning) !important;
}

.ant-card:has(
	:is(
		[id="83a167cf-9ab9-5e14-b521-5bd7ac7ad6a1"],
		[id="f2247100-b2ba-5042-a216-89d1a3c9dcfb"],
		[id="b1f66fec-4f5f-5afc-9c98-47765412d3b6"],
		[id="71651fb1-a640-540c-bb7e-a1c767ca0ce5"]
	)
	.value-graph-container[style*="background-color: red" i]
) {
	background-color: var(--nginx-critical) !important;
}

.ant-card:has(
	:is(
		[id="83a167cf-9ab9-5e14-b521-5bd7ac7ad6a1"],
		[id="f2247100-b2ba-5042-a216-89d1a3c9dcfb"],
		[id="b1f66fec-4f5f-5afc-9c98-47765412d3b6"],
		[id="71651fb1-a640-540c-bb7e-a1c767ca0ce5"]
	)
)
	:is(
		.widget-header-title,
		.value-graph-text,
		.value-graph-unit,
		.widget-header-actions,
		.signoz-icon
	) {
	color: #fff !important;
}

.ant-card:has(
	:is(
		[id="83a167cf-9ab9-5e14-b521-5bd7ac7ad6a1"],
		[id="f2247100-b2ba-5042-a216-89d1a3c9dcfb"],
		[id="b1f66fec-4f5f-5afc-9c98-47765412d3b6"],
		[id="71651fb1-a640-540c-bb7e-a1c767ca0ce5"]
	)
)
	.value-graph-container {
	background-color: transparent !important;
}

.ant-card:has(
	:is(
		[id="83a167cf-9ab9-5e14-b521-5bd7ac7ad6a1"],
		[id="f2247100-b2ba-5042-a216-89d1a3c9dcfb"],
		[id="b1f66fec-4f5f-5afc-9c98-47765412d3b6"],
		[id="71651fb1-a640-540c-bb7e-a1c767ca0ce5"]
	)
)
	.value-graph-bgconflict {
	display: none !important;
}

[id="68a32f1f-4f0b-5764-85c4-3a267660bd90"] .ant-table {
	--nginx-ok: rgba(50, 172, 45, 0.97);
	--nginx-warning: rgba(237, 129, 40, 0.89);
	--nginx-critical: rgba(245, 54, 54, 0.9);
	--nginx-colored-border: rgba(15, 18, 24, 0.72);
}

[id="68a32f1f-4f0b-5764-85c4-3a267660bd90"]
	.ant-table-tbody
	> tr
	> td:nth-child(n + 2) {
	background-color: var(--nginx-ok) !important;
	border-color: var(--nginx-colored-border) !important;
	color: #fff !important;
	font-weight: 600 !important;
}

[id="68a32f1f-4f0b-5764-85c4-3a267660bd90"]
	.ant-table-tbody
	> tr
	> td:nth-child(n + 2):has([style*="background-color: orange" i]) {
	background-color: var(--nginx-warning) !important;
}

[id="68a32f1f-4f0b-5764-85c4-3a267660bd90"]
	.ant-table-tbody
	> tr
	> td:nth-child(n + 2):has([style*="background-color: red" i]) {
	background-color: var(--nginx-critical) !important;
}

[id="68a32f1f-4f0b-5764-85c4-3a267660bd90"]
	.ant-table-tbody
	> tr
	> td:nth-child(n + 2)
	* {
	color: #fff !important;
}

[id="68a32f1f-4f0b-5764-85c4-3a267660bd90"]
	.ant-table-tbody
	> tr
	> td:nth-child(n + 2)
	[style*="background-color" i] {
	background-color: transparent !important;
}

:is(
		[id="949f1118-09cf-51a7-98f0-cb4b45c49923"],
		[id="dd114db8-898b-5863-80eb-44adc7f98981"]
	)
	.ant-table-tbody
	> tr
	> td:has([style*="background-color" i]) {
	color: #fff !important;
	font-weight: 600 !important;
}

:is(
		[id="949f1118-09cf-51a7-98f0-cb4b45c49923"],
		[id="dd114db8-898b-5863-80eb-44adc7f98981"]
	)
	.ant-table-tbody
	> tr
	> td:has([style*="background-color" i])
	* {
	color: #fff !important;
}

/* Host services → «Disk Space Used Basic». Тот же Grafana-стиль, что у Fleet:
 * плотные строки, границы ячеек и сплошная заливка колонки Used. SigNoz красит
 * только внутренний div бейджа (style="background-color: Green|Orange|Red"),
 * поэтому :has() поднимает цвет на весь td — привязки к номеру колонки нет,
 * красятся ровно те ячейки, для которых сработал порог.
 */
[id="109ad6ea-55d3-59d8-abed-0d4c6fbcbd2b"] .ant-table {
	--fs-ok: rgba(50, 172, 45, 0.97);
	--fs-warning: rgba(237, 129, 40, 0.89);
	--fs-critical: rgba(245, 54, 54, 0.9);
	--fs-colored-border: rgba(15, 18, 24, 0.72);
	font-size: 11px !important;
}

[id="109ad6ea-55d3-59d8-abed-0d4c6fbcbd2b"] .ant-table-container {
	border-top: 1px solid var(--border) !important;
	border-left: 1px solid var(--border) !important;
}

[id="109ad6ea-55d3-59d8-abed-0d4c6fbcbd2b"] .ant-table-thead > tr > th,
[id="109ad6ea-55d3-59d8-abed-0d4c6fbcbd2b"] .ant-table-tbody > tr > td {
	padding: 3px 5px !important;
	font-size: 11px !important;
	line-height: 16px !important;
	border-right: 1px solid var(--border) !important;
	border-bottom: 1px solid var(--border) !important;
}

[id="109ad6ea-55d3-59d8-abed-0d4c6fbcbd2b"] .ant-table-thead > tr > th {
	font-weight: 600 !important;
}

[id="109ad6ea-55d3-59d8-abed-0d4c6fbcbd2b"]
	.ant-table-tbody
	> tr
	> td:has([style*="background-color" i]) {
	border-right-color: var(--fs-colored-border) !important;
	border-bottom-color: var(--fs-colored-border) !important;
	color: #fff !important;
	font-weight: 600 !important;
}

[id="109ad6ea-55d3-59d8-abed-0d4c6fbcbd2b"]
	.ant-table-tbody
	> tr
	> td:has([style*="background-color: green" i]) {
	background-color: var(--fs-ok) !important;
}

[id="109ad6ea-55d3-59d8-abed-0d4c6fbcbd2b"]
	.ant-table-tbody
	> tr
	> td:has([style*="background-color: orange" i]) {
	background-color: var(--fs-warning) !important;
}

[id="109ad6ea-55d3-59d8-abed-0d4c6fbcbd2b"]
	.ant-table-tbody
	> tr
	> td:has([style*="background-color: red" i]) {
	background-color: var(--fs-critical) !important;
}

[id="109ad6ea-55d3-59d8-abed-0d4c6fbcbd2b"]
	.ant-table-tbody
	> tr
	> td:has([style*="background-color" i])
	* {
	color: #fff !important;
}

[id="109ad6ea-55d3-59d8-abed-0d4c6fbcbd2b"]
	.ant-table-tbody
	> tr
	> td
	[style*="background-color" i] {
	background-color: transparent !important;
}
