/* Dashboard chrome — cleaner modern defaults */

body {
	margin: 0;
	background: #ffffff;
	font-family: "Open Sans", system-ui, sans-serif;
	color: #0c1460;
}

.dash-header {
	background: #ffffff;
	position: relative;
	padding: 8px 12px 4px;
	border-bottom: 1px solid #e8ecf2;
}

.official_site_btn:hover {
	cursor: pointer;
	background-color: #025590;
	border-color: #025590;
}

.official_site_btn {
	transition: 0.2s ease;
	font-size: 15px;
	font-family: "Open Sans", system-ui, sans-serif;
	text-decoration: none;
	color: #fff;
	display: block;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	right: 250px;
	padding: 8px 14px;
	border: 1px solid #0d0d49;
	background-color: #0d0d49;
	border-radius: 8px;
	z-index: 210;
}

.download_data_btn {
	transition: 0.2s ease;
	border: 1px solid #0d0d49;
	background-color: #0d0d49;
	color: #fff;
	font-size: 16px;
	padding: 12px 20px;
	border-radius: 8px;
}

.download_data_btn:hover {
	cursor: pointer;
	background-color: #025590;
	border-color: #025590;
}

.tab--selected.tab.jsx-535771872 {
	border-top: 2px solid #F92838;
}

.tab.jsx-2472559086 {
	background-color: #eaf7ff;
	border: 1px solid transparent;
	font-family: "Open Sans", system-ui, sans-serif;
	font-size: 15px;
	color: rgb(4, 4, 58);
}

/* Navigation: one row of subjects, plus the time/compare switch */
.main_tab_wrapper {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 8px 12px 0;
	padding: 8px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(12, 20, 96, 0.06);
}

.nav_sections {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	flex: 1 1 auto;
}

.main_tab {
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 0.5rem 0.9rem;
	text-decoration: none;
	font-family: "Open Sans", system-ui, sans-serif;
	font-size: 1rem;
	font-weight: 600;
	color: #0C1460;
	background-color: #eef1f6;
	box-sizing: border-box;
	line-height: 1.2;
	transition: background-color 0.2s ease, color 0.2s ease;
	border-radius: 10px;
	border: 1px solid transparent;
}

.main_tab:hover {
	background-color: #d9f0ff;
}

.selected_main_tab {
	background-color: #04043A !important;
	color: #fff !important;
}

.selected_main_tab:hover {
	background-color: #025590 !important;
}

/* Segmented control: same subject, different view */
.nav_modes {
	display: flex;
	flex: 0 0 auto;
	padding: 3px;
	gap: 3px;
	background: #eef1f6;
	border-radius: 10px;
}

.nav_mode {
	padding: 0.35rem 0.8rem;
	border-radius: 8px;
	text-decoration: none;
	font-family: "Open Sans", system-ui, sans-serif;
	font-size: 0.9rem;
	font-weight: 600;
	color: #5a6480;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.nav_mode:hover {
	color: #0C1460;
}

.selected_nav_mode {
	background: #fff;
	color: #0C1460;
	box-shadow: 0 1px 2px rgba(12, 20, 96, 0.12);
}

/* Sections without a year-over-year page: the switch says so */
.disabled_nav_mode {
	opacity: 0.4;
	pointer-events: none;
}

.tab_subtitle {
	font-size: 0.9rem;
	font-style: italic;
	opacity: 0.85;
}

/* Hide legacy width/height sliders — charts are responsive */
.graph-size-controls {
	display: none !important;
}

.chart-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 8px;
	margin-bottom: 8px;
}

/* Fallback: hide Plotly-adjacent rc-sliders used only for graph size */
.graph-size-controls,
div[style*="flex-basis: 50px"],
div[style*="flexBasis: 50px"] {
	display: none !important;
}

/* Horizontal width sliders still mounted above charts on some pages */
[id^="graph_width_"],
[id^="graph_height_"] {
	display: none !important;
}

/* No Plotly rangeslider chrome when disabled; keep rule harmless if re-enabled */
.js-plotly-plot .rangeslider-container {
	display: none !important;
}

/* ---- Filter controls -------------------------------------------------
   Pages build these inline, so the hooks here are structural: the
   `margin-right: 30px` every filter group in the bar under the chart
   carries, and component ids. Radio markup differs between dash versions
   — 2.x puts the inline label style on <label>, 4.x on a nested
   <span class="dash-options-list-option-text"> — and the VPS runs 2.6
   while dev runs 4.x, so both are addressed everywhere below. */

/* One type scale for every filter: caption 12-13px muted, control 15px.
   Pages set 14px on dropdowns and 16px on radios and date fields inline,
   which put three sizes in a single sidebar column. */
.dash-options-list-option-text,
.dash-options-list-option-text span,
div:has(> div[style*="margin-right: 30px"]) label,
#_pages_content div[style*="0 0 300px"] label,
.dash-dropdown,
.dash-dropdown-value,
.dash-dropdown-value-item,
.dash-dropdown-value-item span,
.dash-dropdown-placeholder,
.Select-control,
.Select-value-label,
.Select-placeholder,
div[id^="date_picker_"] div,
div[id^="unit_gcv_input_"] {
	font-size: 15px !important;
}

/* Options never touch the next radio, and keep one vertical rhythm */
.dash-options-list-option {
	margin: 0 2px 2px 0;
}

/* :not(:has(...)) keeps dash 4 from padding both the label and the span */
.dash-options-list-option-text,
div:has(> div[style*="margin-right: 30px"]) label:not(:has(.dash-options-list-option-text)),
#_pages_content div[style*="0 0 300px"] label:not(:has(.dash-options-list-option-text)) {
	padding-left: 6px !important;
	padding-right: 16px !important;
	padding-bottom: 0 !important;
	margin-bottom: 4px !important;
	line-height: 1.35;
	white-space: nowrap;
}

.dash-options-list-option:hover .dash-options-list-option-text,
div:has(> div[style*="margin-right: 30px"]) label:hover,
#_pages_content div[style*="0 0 300px"] label:hover {
	color: #025590 !important;
	cursor: pointer;
}

.dash-options-list-option.selected .dash-options-list-option-text {
	font-weight: 600;
}

/* The bar itself: one panel instead of five floating stacks */
div:has(> div[style*="margin-right: 30px"]) {
	flex-wrap: wrap;
	align-items: stretch;
	gap: 10px;
	margin: 6px 10px 0;
	padding: 10px !important;
	background: #f7f9fc;
	border: 1px solid #e8ecf2;
	border-radius: 12px;
}

/* Each filter group reads as its own field — including the checklists that
   some pages put in the bar without the margin marker */
div:has(> div[style*="margin-right: 30px"]) > div:not(.download_data_btn_parent) {
	margin-right: 0 !important;
	padding: 8px 12px;
	background: #fff;
	border: 1px solid #e8ecf2;
	border-radius: 10px;
}

/* Group caption: quieter than the options it labels */
div:has(> div[style*="margin-right: 30px"]) > div:not(.download_data_btn_parent) > div:first-child {
	margin-bottom: 8px !important;
	text-align: left !important;
	font-size: 12px !important;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #7a86a1;
	white-space: nowrap;
}

/* Actions sit at the far end of the bar, not mid-row */
.download_data_btn_parent {
	margin-left: auto;
	align-self: center;
}

/* Period presets are short and sit in a narrow sidebar — tighter than the
   bar options so 1м/1г/3г/5л/10л wrap evenly instead of 2 / 2 / 1 */
div[id^="date_preset_"] {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	gap: 0 2px;
}

div[id^="date_preset_"] .dash-options-list-option-text {
	padding-right: 8px !important;
}

/* Sidebar section rules: separate blocks, don't box them in */
div[style*="border-top"] {
	border-top-width: 1px !important;
	border-top-color: #e3e8f0 !important;
}

/* ---- Page chrome -----------------------------------------------------
   Every page opens with a caption that restates the tab it was opened
   from ("Валовые поставки" -> "Временной ряд валовых поставок газа"), so
   it is demoted to a subtitle instead of competing with the tab. */
#_pages_content > div > div > div:first-child {
	font-size: 15px !important;
	font-weight: 600;
	color: #7a86a1 !important;
	padding-top: 0 !important;
	padding-bottom: 10px !important;
}

/* Sidebar: captions left of the field they describe, tighter blocks —
   the height saved goes to the chart. Browsers fold the page's flexBasis /
   flexGrow / flexShrink trio into the `flex` shorthand, so match that. */
#_pages_content div[style*="0 0 300px"] > div {
	padding-top: 10px !important;
	padding-bottom: 10px !important;
}

/* Nothing in the sidebar is centred — inline styles say otherwise, and
   text-align does not inherit past them */
#_pages_content div[style*="0 0 300px"] div[style*="text-align: center"] {
	text-align: left !important;
}

/* A caption is whatever sits right before a field, at any nesting depth */
#_pages_content div[style*="0 0 300px"] > div > div:first-child,
#_pages_content div[style*="0 0 300px"] div:has(+ .dash-dropdown-wrapper),
div:has(+ div[id^="date_preset_"]) {
	text-align: left !important;
	font-size: 13px !important;
	font-weight: 600;
	color: #7a86a1 !important;
	margin-bottom: 6px !important;
	line-height: 1.3;
}

/* Plotly toolbar out of the legend's row (legend is horizontal, on top) */
.js-plotly-plot .modebar--vertical {
	top: 46px !important;
	background: rgba(255, 255, 255, 0.85);
	border-radius: 8px;
}
