﻿/* Táblázatok, csíkozás, lapozó, mobil (no-more-tables) nézet. */

@media only screen and (max-width: 800px) {
	/* Force table to not be like tables anymore */
	.no-more-tables table,
	.no-more-tables thead,
	.no-more-tables tbody,
	.no-more-tables th,
	.no-more-tables td,
	.no-more-tables tr {
		display: block;
	}

		/* Hide table headers (but not display: none;, for accessibility) */
		.no-more-tables thead tr {
			position: absolute;
			top: -9999px;
			left: -9999px;
		}

	.no-more-tables tr {
		border: 1px solid var(--gray-250);
	}

	.no-more-tables td {
		/* Behave  like a "row" */
		display: flex;
		flex-direction: row;
		align-items: flex-start;
		justify-content: space-between;
		white-space: normal;
		border: none;
		border-bottom: 1px solid var(--gray-250);
		min-height: 22px;
		padding: 4px 6px;
		text-align: right;
	}

		.no-more-tables td:before {
			/* Now like a table header */
			display: inline-block;
			flex: 0 0 35%;
			padding-right: 10px;
			text-align: left;
			font-weight: bold;
			content: attr(data-title);
			word-break: break-word;
		}
}

/* table */
.table-border {
	border-spacing: 0;
	border-collapse: separate;
	border: 2px solid var(--primary) !important;
	border-radius: 0.25rem !important;
}

	.table-border thead th {
		background-color: var(--primary) !important;
		color: white !important;
		border: 1px solid var(--primary) !important;
	}

	.table-border td, .table-border th {
		border: 1px solid var(--primary) !important;
		color: var(--font-color) !important;
		font-weight: 600 !important;
	}

	.table-border thead th a,
	.table-border thead th a:active,
	.table-border thead th a:focus {
		color: var(--secondary) !important;
		text-decoration: none !important;
	}

/* table pagination */
.pagination {
	margin-top: 12px !important;
}

	.pagination > .active > a
	.pagination > li > a:hover {
		color: var(--secondary) !important;
		background-color: var(--primary) !important;
	}

	.pagination > li > a,
	.pagination > li > span {
		padding: 4px 8px !important;
	}

	.pagination > li > a {
		background-color: var(--secondary) !important;
		color: var(--font-color) !important;
		margin: 10px 0px !important;
	}

.cell-right {
	text-align: right;
	padding-right: 16px;
}

.table-condensed {
	--bs-table-cell-padding-y: 0.25rem;
	--bs-table-cell-padding-x: 0.5rem;
}

table tr td {
	padding: 0px 3px 0px 3px !important;
	vertical-align: middle !important;
}

table.class_selector td {
	padding: 0px 3px 0px 3px !important;
}

.table_link {
	display: inline-block;
	width: 100%;
	min-height: 16px;
}

.rowColor1 td {
	background-color: white;
}

.rowColor2 td {
	background-color: var(--gray-100);
}

.alterColor {
	background-color: var(--gray-100);
}

.table-2rows-striped {
	background: white;
}

	.table-2rows-striped tbody tr:nth-child(4n+1), .table-2rows-striped tbody tr:nth-child(4n+2) {
		background: var(--gray-200);
	}

.table-3rows-striped {
	background: white;
}

	.table-3rows-striped tbody tr:nth-child(6n+1), .table-3rows-striped tbody tr:nth-child(6n+2), .table-3rows-striped tbody tr:nth-child(6n+3) {
		background: var(--gray-200);
	}

.select-striped li:nth-child(2n) {
	background: var(--gray-200);
}

.pagination {
	margin-top: 12px !important;
}

	.pagination > li > a {
		background-color: white;
		color: var(--primary);
		margin: 10px 0px !important;
	}

		.pagination > li > a:focus,
		.pagination > li > a:hover,
		.pagination > li > span:focus,
		.pagination > li > span:hover {
			color: black;
			background-color: var(--gray-250);
			border-color: var(--gray-400);
		}

	.pagination > li > a, .pagination > li > span {
		padding: 4px 8px !important;
	}

	.pagination > .active > a {
		color: var(--primary);
		background-color: white !Important;
		border: solid 2px var(--primary) !Important;
	}

		.pagination > .active > a:hover {
			background-color: white !Important;
			border: solid 2px var(--primary);
		}

.no-more-tables table > thead > tr > th {
	border-bottom: 2px solid var(--primary);
}

.table-borderless > tbody > tr > td,
.table-borderless > tbody > tr > th,
.table-borderless > tfoot > tr > td,
.table-borderless > tfoot > tr > th,
.table-borderless > thead > tr > td,
.table-borderless > thead > tr > th {
	border: none !important;
}

/* ---------- Kicsúszás elleni védelem és saját görgetési terület ----------
   A body-n overflow-x: hidden van, ezért ami a képernyőn túllóg, az levágódna és elérhetetlen lenne. */

/* Biztonsági háló: ha egy nézetből kimaradt a .table-responsive, a táblázatot közvetlenül tartalmazó
   kártyatörzs (vagy no-more-tables blokk) maga görgethető vízszintesen */
.content-area :is(.card-body, .no-more-tables):has(> table:not(.w-100)) {
	overflow-x: auto;
}

/* Asztali nézetben a lista saját görgetési területet kap: legfeljebb képernyőnyi magas, a fejléc rögzített,
   és a vízszintes görgetősáv mindig a látható részen van (nem a több száz soros lista legalján).
   Modális ablakokra nem vonatkozik (azok a .content-area-n kívül vannak); 800 px alatt a kártyanézet marad. */
@media (min-width: 801px) {
	.content-area .card .table-responsive {
		max-height: calc(100vh - 140px);
		overflow: auto;
	}

		.content-area .card .table-responsive > .table > thead > tr > th {
			position: sticky;
			top: 0;
			z-index: 2;
			background-color: var(--white);
		}

		.content-area .card .table-responsive > .table > thead.table-light > tr > th {
			background-color: #f8f9fa;
		}
}

/* Soron belüli „⋯” menü a ritkábban használt műveletekhez */
.row-menu {
	display: inline-block;
	vertical-align: middle;
}

.row-menu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	margin: 2px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--primary);
	cursor: pointer;
}

	.row-menu-toggle:hover,
	.row-menu-toggle[aria-expanded="true"] {
		background-color: rgba(0,87,100,.1);
	}

.row-menu .dropdown-menu {
	--bs-dropdown-link-active-bg: var(--primary);
	font-size: .9rem;
	z-index: 1040; /* a menüsor (1000) fölött, a modális ablak takarása (1050) alatt */
}

	.row-menu .dropdown-item {
		display: flex;
		align-items: center;
		gap: .6rem;
		font-weight: 500;
		color: var(--gray-900);
	}

		.row-menu .dropdown-item > .fa-solid {
			color: var(--primary);
		}
