/*
 * Заявки на размут.
 *
 * Страница списка равняется на заявки на разбан из Banlist Plus: значения ниже
 * скопированы из modules_extra/banlist_plus/templates/assets/banlist-plus.css,
 * чтобы обе страницы выглядели одинаково. Классы свои (mta-), поэтому модуль
 * остаётся автономным и не ломается, если Banlist Plus отключить.
 * При рестайле Banlist Plus эти значения нужно обновить вручную.
 *
 * Страницы подачи и просмотра заявки Banlist Plus не трогает — они используют
 * штатную разметку flat и своего оформления здесь почти не требуют.
 */

/* ── Тулбар списка ───────────────────────────────────────────── */
.mta-toolbar {
	background: #f5f8fb;
	border: 1px solid #d5e0e8;
	border-radius: 7px;
	box-shadow: 0 2px 7px rgba(35, 55, 72, .08);
	margin: 0 0 12px;
	padding: 12px;
}

.mta-toolbar-section-label,
.mta-filter-group label {
	color: #586b7b;
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .035em;
	margin: 0 0 5px;
	text-transform: uppercase;
}

.mta-filter-row {
	align-items: flex-end;
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	margin-top: 11px;
}

.mta-filter-group {
	flex: 0 1 205px;
	min-width: 150px;
}

.mta-server-filter {
	flex: 1 1 175px;
	min-width: 160px;
}

.mta-server-select {
	position: relative;
}

.mta-server-select > .glyphicon {
	color: #47749f;
	left: 11px;
	pointer-events: none;
	position: absolute;
	top: 12px;
	z-index: 2;
}

.mta-server-select .form-control {
	background: #fff;
	border-color: #c7d3dc;
	border-radius: 5px;
	cursor: pointer;
	font-weight: 600;
	height: 38px;
	overflow: hidden;
	padding-left: 32px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mta-server-select .form-control:focus {
	border-color: #477fae;
	box-shadow: 0 0 0 2px rgba(71, 127, 174, .16);
}

.mta-toolbar-action {
	flex: 0 0 auto;
	margin-left: auto;
}

.mta-add-button {
	align-items: center;
	border-radius: 5px !important;
	display: inline-flex;
	font-weight: 600;
	gap: 7px;
	height: 38px;
	justify-content: center;
	margin: 0 !important;
	padding: 8px 15px;
}

/* ── Фильтры статусов ────────────────────────────────────────── */
.mta-status-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.mta-status-filter {
	align-items: center;
	background: #fff;
	border: 1px solid #c8d4dd;
	border-radius: 17px;
	color: #455b6c;
	display: inline-flex;
	font-weight: 600;
	gap: 7px;
	min-height: 34px;
	padding: 5px 11px;
	text-decoration: none !important;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.mta-status-filter:hover,
.mta-status-filter:focus {
	background: #edf5fa;
	border-color: #98b5ca;
	color: #284f6d;
}

.mta-status-filter.active {
	background: #356f9f;
	border-color: #356f9f;
	color: #fff;
}

.mta-status-filter strong {
	background: rgba(53, 111, 159, .12);
	border-radius: 10px;
	font-size: 11px;
	line-height: 20px;
	min-width: 20px;
	padding: 0 5px;
	text-align: center;
}

.mta-status-filter.active strong {
	background: rgba(255, 255, 255, .22);
}

/* ── Статус-пилюли ───────────────────────────────────────────── */
/* Имена классов зафиксированы: main.js переписывает class у #mta-status. */
.mta-status {
	align-items: center;
	border: 1px solid transparent;
	border-radius: 4px;
	display: inline-flex;
	font-size: 12px;
	font-weight: 700;
	gap: 6px;
	justify-content: center;
	min-height: 27px;
	padding: 4px 10px;
	white-space: nowrap;
}

.mta-status-success { background: #d9f2df; border-color: #9dd5aa; color: #226e38; }
.mta-status-danger  { background: #fde1df; border-color: #efaaa5; color: #a42e28; }
.mta-status-warning { background: #fff0bd; border-color: #e8c865; color: #775a00; }

/* ── Таблица списка ──────────────────────────────────────────── */
.mta-appeals-table {
	border-collapse: separate;
	border-spacing: 0;
	table-layout: fixed;
	width: 100%;
}

.mta-appeals-table > thead > tr > td {
	background: #edf3f7;
	border-bottom: 2px solid #c9d7e1 !important;
	color: #43596b;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .025em;
	padding: 10px 8px !important;
	text-transform: uppercase;
}

.mta-appeals-table > thead td:nth-child(1) { width: 29%; }
.mta-appeals-table > thead td:nth-child(2) { width: 17%; }
.mta-appeals-table > thead td:nth-child(3) { width: 15%; }
.mta-appeals-table > thead td:nth-child(4) { width: 20%; }
.mta-appeals-table > thead td:nth-child(5) { width: 19%; }

.mta-appeals-table > thead td:not(:first-child),
.mta-appeals-table > tbody > .mta-appeal-row > td:not(:first-child) {
	text-align: center;
}

.mta-appeals-table > tbody > .mta-appeal-row > td {
	border-color: #dde5eb !important;
	overflow-wrap: anywhere;
	padding: 10px 8px !important;
	transition: background-color .15s ease, box-shadow .15s ease;
	vertical-align: middle;
}

.mta-appeals-table > tbody > .mta-appeal-row:hover > td {
	background-color: #eef6fb !important;
}

.mta-appeal-status-success > td:first-child { box-shadow: inset 3px 0 #3f9b59; }
.mta-appeal-status-danger  > td:first-child { box-shadow: inset 3px 0 #cf5148; }
.mta-appeal-status-warning > td:first-child { box-shadow: inset 3px 0 #d6a72f; }

.mta-appeal-title {
	display: block;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
	text-decoration: none !important;
}

.mta-appeal-title:hover {
	color: #245b88;
	text-decoration: underline !important;
}

.mta-appeal-title + small {
	color: #6f7f8c;
	display: block;
	line-height: 1.25;
	margin-top: 4px;
}

.mta-appeal-open {
	align-items: center;
	color: #2f6f9f !important;
	display: inline-flex;
	font-size: 11px;
	font-weight: 700;
	gap: 4px;
	margin-top: 7px;
	text-decoration: none !important;
}

.mta-appeal-open:hover {
	color: #1e527b !important;
	text-decoration: underline !important;
}

.mta-appeal-open .glyphicon {
	font-size: 9px;
}

.mta-user {
	align-items: center;
	display: inline-flex;
	gap: 4px;
}

.mta-user .small_us_av {
	height: 28px;
	width: 28px;
}

.mta-muted {
	color: #7c8894;
}

/* ── Форма подачи и страница заявки ──────────────────────────── */
/* Оформление берётся у .bs-callout шаблона; здесь только отступы и переносы. */
.mta-search-item {
	margin-bottom: 10px;
}
.mta-search-item:last-child {
	margin-bottom: 0;
}
.mta-search-item h4,
.mta-search-item p,
.mta-selected-card p {
	overflow-wrap: anywhere;
}
.mta-search-item p,
.mta-selected-card p {
	margin-bottom: 3px;
}

.mta-selected-card:empty {
	display: none;
}

/* Контейнер нужен main.js как крючок для .has-error. */
.mta-evidence-upload.has-error label {
	color: #a94442;
}

/* Превью загрузки: шаблон стилизует только #imgs, loadImages() собирает #imgs-mta. */
#imgs-mta .thumbnail {
	float: left;
	margin-bottom: 0;
	margin-right: 10px;
	max-width: 100px;
}
#imgs-mta:before,
#imgs-mta:after {
	content: " ";
	display: table;
}
#imgs-mta:after {
	clear: both;
}

.mta-appeal-page .with_code {
	overflow-wrap: anywhere;
}

/* Основное решение должно читаться сразу, остальные действия остаются рядом. */
.mta-appeal-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin-top: 9px;
}

.mta-appeal-actions .btn {
	margin: 0;
}

.mta-appeal-actions .mta-resolve-primary {
	font-weight: 600;
	min-width: 128px;
}

/* ── Комментарии ─────────────────────────────────────────────── */
/* Сами сообщения используют штатную разметку .chat_message шаблона flat. */
#mta-comment-text {
	min-height: 96px;
	resize: vertical;
}

#mta-comments .chat_message .with_code {
	min-height: 29px;
}

/* ── Админка ─────────────────────────────────────────────────── */
.mta-admin-section {
	margin-bottom: 20px;
}
.mta-admin-toggle {
	display: block;
	font-weight: normal;
}
.mta-admin-server {
	font-weight: normal;
	margin-right: 15px;
}

/* Счётчик новых заявок в профиле. */
#profile_box .mta-pending-line .glyphicon {
	margin-right: 4px;
}

/* ── Мобильные ───────────────────────────────────────────────── */
/* Строки превращаются в карточки; подписи берутся из data-label через ::before —
   тот же приём, что и в Banlist Plus, поэтому дублирующая разметка не нужна. */
@media (max-width: 991px) {
	.mta-toolbar {
		border-radius: 6px;
		margin-bottom: 10px;
		padding: 10px;
	}

	.mta-status-filters {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mta-status-filter {
		justify-content: space-between;
		min-width: 0;
	}

	.mta-filter-row {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
	}

	.mta-filter-group,
	.mta-server-filter,
	.mta-toolbar-action {
		margin-left: 0;
		max-width: none;
		width: 100%;
	}

	.mta-add-button {
		width: 100%;
	}

	.mta-appeals-table {
		table-layout: auto;
	}

	.mta-appeals-table > thead {
		display: none;
	}

	.mta-appeals-table > tbody > .mta-appeal-row {
		background: #fff;
		border: 1px solid #cedae3;
		border-left: 4px solid #47749f;
		border-radius: 7px;
		box-shadow: 0 2px 5px rgba(34, 46, 58, .09);
		display: block;
		margin: 9px 6px;
		overflow: hidden;
		padding: 3px 11px;
	}

	.mta-appeals-table > tbody > .mta-appeal-status-success { border-left-color: #3f9b59; }
	.mta-appeals-table > tbody > .mta-appeal-status-danger  { border-left-color: #cf5148; }
	.mta-appeals-table > tbody > .mta-appeal-status-warning { border-left-color: #d6a72f; }

	.mta-appeals-table > tbody > .mta-appeal-row > td {
		align-items: start;
		background: transparent !important;
		border: 0 !important;
		border-bottom: 1px solid #edf0f2 !important;
		box-shadow: none !important;
		display: grid;
		gap: 10px;
		grid-template-columns: 92px minmax(0, 1fr);
		min-height: 35px;
		padding: 8px 0 !important;
		text-align: left !important;
		width: auto !important;
	}

	.mta-appeals-table > tbody > .mta-appeal-row > td:last-child {
		border-bottom: 0 !important;
	}

	.mta-appeals-table > tbody > .mta-appeal-row > td::before {
		color: #7a858f;
		content: attr(data-label);
		font-size: 10px;
		font-weight: 700;
		letter-spacing: .02em;
		text-transform: uppercase;
	}

	.mta-appeals-table > tbody > .mta-appeal-row > td[data-label="Заявка"] {
		display: block;
	}

	.mta-appeals-table > tbody > .mta-appeal-row > td[data-label="Заявка"]::before {
		display: block;
		margin-bottom: 4px;
	}

	.mta-appeal-open {
		background: #e8f2f8;
		border-radius: 4px;
		display: flex;
		justify-content: center;
		margin-top: 8px;
		padding: 7px 9px;
		width: 100%;
	}

	.mta-status {
		justify-self: start;
		max-width: 100%;
		min-width: 124px;
	}

	.mta-empty-row td {
		display: block;
		padding: 15px !important;
	}
}

@media (max-width: 360px) {
	.mta-status-filters {
		grid-template-columns: minmax(0, 1fr);
	}
}
