/* ============================================================
   UI EXTENSIONS — shared custom components
   Подключается во все внутренние страницы.
   ============================================================ */

/* ===== Labeled filter blocks (Дата / Период / Номер / Контрагент / ...)
   Стилизованная карточка внутри .param.type2 .rows, если внутри есть <label>.
   Используется на page5.html, page10.html и т.д.
   ============================================================ */
.param.type2 .rows:has(label) {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 25px 24px;
	background: #F0F4F8;
	border-radius: 16px;
	min-height: 106px;
}

.param.type2 .rows:has(label) label {
	display: block;
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	color: #2B3F51;
}

.param.type2 .rows:has(label) select,
.param.type2 .rows:has(label) input[type="text"] {
	width: 100%;
	height: auto;
	padding: 0;
	background: transparent;
	background-image: none;
	border: none;
	border-radius: 0;
	font-size: 14px;
	color: rgba(43, 63, 81, 0.5);
	font-family: "Ubuntu", sans-serif;
	outline: none;
}

.param.type2 .rows:has(label) input[type="text"]::placeholder,
.param.type2 .rows:has(label) select::placeholder {
	color: #2B3F51;
	opacity: 0.35;
}

.param.type2 .rows:has(label) select {
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
}

/* Стрелка у селекта */
.param.type2 .rows:has(label):has(select)::after {
	content: "";
	position: absolute;
	top: 30px;
	right: 24px;
	width: 14px;
	height: 8px;
	background: url("data:image/svg+xml,%3Csvg width='14' height='8' viewBox='0 0 9 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.46337 4.64019C4.31692 4.78664 4.07952 4.78664 3.93307 4.64019L0.109834 0.816938C-0.0366113 0.670488 -0.0366113 0.433087 0.109834 0.286637L0.286614 0.109838C0.433059 -0.0366125 0.670494 -0.0366125 0.816944 0.109838L4.19822 3.49114L7.57952 0.109838C7.72597 -0.0366125 7.96337 -0.0366125 8.10982 0.109838L8.28662 0.286637C8.43307 0.433087 8.43307 0.670488 8.28662 0.816938L4.46337 4.64019Z' fill='%232B3F51'/%3E%3C/svg%3E") no-repeat center / contain;
	pointer-events: none;
}

/* ===== Pseudo-select (OSV filters — Номер / Год / Период with centered text + line break) */
.osv_filters .rows {
	min-height: 92px;
	padding: 0 !important;
	background: #f0f4f8;
	border-radius: 24px;
}

.osv_filters .rows .ps_select {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 92px;
	padding: 16px 36px 16px 20px;
	text-align: center;
	cursor: pointer;
}

.osv_filters .rows .ps_select span {
	font-size: 14px;
	color: #2B3F51;
	line-height: 1.3;
}

.osv_filters .rows .ps_arr {
	position: absolute;
	top: 50%;
	right: 20px;
	transform: translateY(-50%);
}

/* ===== "Скачать" dropdown button + menu (report-row) ===== */
.download_wrap {
	position: relative;
}

.download_btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding: 0 18px;
	background: rgba(10, 102, 194, 0.1);
	color: #0A66C2;
	border: none;
	border-radius: 14px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: 0.3s;
}

.download_btn:hover {
	background: rgba(10, 102, 194, 0.18);
}

.download_btn .arr {
	transition: 0.3s;
}

.report-row.open .download_btn .arr {
	transform: rotate(180deg);
}

.download_menu {
	display: none;
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	min-width: 200px;
	background: #FFFFFF;
	border-radius: 14px;
	box-shadow: 0 6px 24px rgba(10, 102, 194, 0.12);
	padding: 8px 0;
	z-index: 10;
}

.report-row.open .download_menu {
	display: block;
}

.download_menu a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 20px;
	text-decoration: none;
	color: #2B3F51;
	transition: 0.2s;
}

.download_menu a:hover {
	background: rgba(10, 102, 194, 0.06);
}

.download_menu a span {
	font-size: 13px;
	font-weight: 700;
	color: #0A66C2;
}

.download_menu a b {
	font-size: 13px;
	font-weight: 400;
	color: #2B3F51;
	opacity: 0.6;
}

/* ===== Pencil edit button inside .option_wrap .item .elem ===== */
.option_wrap .item .elem {
	position: relative;
}

.load-edit {
	position: absolute;
	top: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 22px;
	padding: 0;
	background: transparent;
	border: none;
	cursor: pointer;
	opacity: 0.6;
	transition: 0.2s;
}

.load-edit::before {
	content: "";
	width: 16px;
	height: 16px;
	background: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20.71 7.04C21.1 6.65 21.1 6 20.71 5.63L18.37 3.29C18 2.9 17.35 2.9 16.96 3.29L15.12 5.12L18.87 8.87M3 17.25V21H6.75L17.81 9.93L14.06 6.18L3 17.25Z' fill='%230A66C2'/%3E%3C/svg%3E") no-repeat center / contain;
}

.load-edit:hover {
	opacity: 1;
}

/* Note column wraps text to multiple lines */
.option_wrap .item .elem textarea,
.option_wrap .item .elem input.wrap {
	width: 100%;
	min-height: 18px;
	padding: 0;
	margin: 0;
	border: none;
	outline: none;
	background: transparent;
	color: #2B3F51;
	font-size: 14px;
	line-height: 1.4;
	font-family: "Ubuntu", sans-serif;
	resize: none;
	overflow: hidden;
	white-space: pre-wrap;
	word-wrap: break-word;
	word-break: break-word;
}

.option_wrap .item .elem textarea::placeholder {
	color: #2B3F51;
	opacity: 0.5;
}

.option_wrap.grid2 .item,
.option_wrap.grid2 .hd {
	align-items: flex-start;
}

/* ===== history-table: shrink columns to fit container ===== */
.history-table-wrap {
	overflow-x: visible;
}

.history-table-wrap .history-table {
	min-width: 0;
	width: 100%;
	table-layout: fixed;
}

.history-table-wrap .history-table th,
.history-table-wrap .history-table td {
	padding: 14px 12px 14px 0;
	white-space: normal;
	word-break: normal;
	overflow-wrap: normal;
}

.history-table-wrap .history-table th:last-child,
.history-table-wrap .history-table td:last-child {
	padding-right: 0;
}

/* Column widths (6 columns) — wider ИНН */
.history-table-wrap .history-table th:nth-child(1),
.history-table-wrap .history-table td:nth-child(1) {
	width: 22%;
}

.history-table-wrap .history-table th:nth-child(2),
.history-table-wrap .history-table td:nth-child(2) {
	width: 20%;
}

.history-table-wrap .history-table th:nth-child(3),
.history-table-wrap .history-table td:nth-child(3) {
	width: 14%;
}

.history-table-wrap .history-table th:nth-child(4),
.history-table-wrap .history-table td:nth-child(4) {
	width: 12%;
}

.history-table-wrap .history-table th:nth-child(5),
.history-table-wrap .history-table td:nth-child(5),
.history-table-wrap .history-table th:nth-child(6),
.history-table-wrap .history-table td:nth-child(6) {
	width: 16%;
}

/* ===== "Предпросмотр данных" placeholder ===== */
.preview_placeholder {
	height: 338px;
	background: rgba(10, 102, 194, 0.04);
	border: 1px dashed rgba(10, 102, 194, 0.2);
	border-radius: 16px;
}

/* ===== Тарифы на главной: карусель ===== */
.s-tariff .control {
	justify-content: flex-end;
	margin-bottom: 24px;
}
.s-tariff .tariff_wrap .tariff_list.swiper-wrapper {
	display: flex;
	gap: 0;
}
.s-tariff .tariff_wrap .tariff_list li.swiper-slide {
	height: auto;
	display: flex;
	flex-direction: column;
}
.s-tariff .tariff_wrap .tariff_list li .top {
	flex: 1 1 auto;
}

.s-tariff .tariff_note {
	margin: 24px 0 0;
	text-align: center;
	font-size: 14px;
	line-height: 20px;
	color: #2B3F51;
	opacity: 0.5;
}

/* swiper-bundle.css подключается после style.css и возвращает кнопкам
   position:absolute — восстанавливаем расположение стрелок в .control */
.s-tariff .control .swiper-button-prev,
.s-tariff .control .swiper-button-next {
	position: relative;
	top: unset;
	left: unset;
	right: unset;
	margin: unset;
	width: 80px;
	height: 80px;
}

.s-tariff .tariff_wrap .tariff_list li .bottom .price {
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
}
.s-tariff .tariff_wrap .tariff_list li .bottom .price > p {
	max-width: none;
}

/* Тарифы в кабинете (без карусели): 4 карточки сеткой 2×2 */
.s-tariff .tariff_wrap .tariff_list:not(.swiper-wrapper) {
	grid-template-columns: repeat(2, 1fr);
}
