/* Moderation Page Revamp */
.page-moderation {
	background: var(--color-background);
	margin: 0;
	height: calc(100vh - 4rem);
	overflow: hidden;
	display: flex !important;
	flex-direction: column;
}
.page-moderation.dark {
	background: var(--color-background);
}
main.page-moderation {
	grid-template-columns: unset !important;
}
.page-moderation > .mod-page {
	max-width: 1720px;
	width: 100%;
	margin: 0 auto;
}
.mod-page {
	padding: 1.6rem 2.2rem 2.2rem;
	font-size: 15px;
	display: flex;
	flex-direction: column;
	gap: 1.4rem;
	height: 100%;
	box-sizing: border-box;
}
.dark .mod-page {
	color: var(--color-on-background);
}

/* Panel container for table */
.mod-panel {
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.78));
	border: 1px solid rgba(0, 0, 0, 0.08);
	backdrop-filter: blur(6px);
	border-radius: 18px;
	padding: 1.15rem 1.25rem 1.45rem;
	box-shadow: 0 8px 26px -6px rgba(0, 0, 0, 0.35);
	display: flex;
	flex-direction: column;
	gap: 1rem;
	flex: 1;
	min-height: 0;
}
.dark .mod-panel {
	background: linear-gradient(180deg, rgba(34, 36, 42, 0.92), rgba(28, 30, 36, 0.9));
	border-color: rgba(255, 255, 255, 0.08);
	box-shadow: 0 8px 28px -6px rgba(0, 0, 0, 0.6);
}

.mod-bar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: .85rem 1rem;
}
.mod-title {
	margin: 0;
	font-size: 1.4rem;
	letter-spacing: .5px;
	font-weight: 700;
}
.mod-bar__actions {
	display: flex;
	gap: .55rem;
	align-items: center;
	flex-wrap: wrap;
}

.mod-filter {
	padding: .55rem .7rem;
	min-width: 14.5rem;
	border: 1px solid var(--input-border, #c9ccd1);
	border-radius: 9px;
	background: #fff;
	font-size: .7rem;
	font-weight: 600;
	letter-spacing: .07em;
	text-transform: uppercase;
}
.dark .mod-filter {
	background: #272b33;
	border-color: #3a4048;
	color: #f2f4f6;
}

.mod-btn {
	background: #2f64ff;
	color: #fff;
	border: none;
	padding: .6rem 1rem;
	border-radius: 9px;
	cursor: pointer;
	font-size: .72rem;
	letter-spacing: .08em;
	font-weight: 700;
	box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.4);
	display: inline-flex;
	align-items: center;
	gap: .35rem;
}
.mod-btn:hover {
	background: #184fff;
}
.mod-btn:active {
	transform: translateY(1px);
}
.mod-btn.danger {
	background: #b23a32;
}
.mod-btn.danger:hover {
	background: #922f29;
}

.mod-hint {
	opacity: .7;
	font-size: .72rem;
	padding: 0 .1rem;
}
.mod-loading,
.mod-error {
	font-size: .78rem;
	padding: .6rem 0;
	font-weight: 600;
}

.mod-table-wrap {
	flex: 1;
	min-width: 100%;
	overflow: auto;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.55);
	backdrop-filter: blur(4px);
	min-height: 0;
}
.dark .mod-table-wrap {
	background: rgba(32, 34, 39, 0.55);
	border-color: rgba(255, 255, 255, 0.07);
}

/* Custom scrollbars for moderation tables (WebKit) */
.mod-table-wrap::-webkit-scrollbar,
.records-panel::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}
.mod-table-wrap::-webkit-scrollbar-track,
.records-panel::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.04);
	border-radius: 999px;
}
.mod-table-wrap::-webkit-scrollbar-thumb,
.records-panel::-webkit-scrollbar-thumb {
	background: rgba(47, 100, 255, 0.8);
	border-radius: 999px;
}
.dark .mod-table-wrap::-webkit-scrollbar-thumb,
.dark .records-panel::-webkit-scrollbar-thumb {
	background: rgba(109, 157, 255, 0.9);
}

/* Firefox scrollbars for moderation tables */
.mod-table-wrap,
.records-panel {
	scrollbar-width: thin;
	scrollbar-color: rgba(47, 100, 255, 0.8) rgba(0, 0, 0, 0.04);
}
.dark .mod-table-wrap,
.dark .records-panel {
	scrollbar-color: rgba(109, 157, 255, 0.9) rgba(255, 255, 255, 0.04);
}

.mod-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	font-size: 1.08rem;
	line-height: 1.5;
}
.mod-table thead th {
	position: sticky;
	top: 0;
	background: rgba(240, 242, 245, 0.9);
	backdrop-filter: blur(4px);
}
.dark .mod-table thead th {
	background: rgba(41, 44, 50, 0.9);
}
.mod-table th,
.mod-table td {
	padding: .7rem .85rem;
	text-align: left;
	border-bottom: 1px solid rgba(0, 0, 0, 0.07);
	vertical-align: middle;
}
.dark .mod-table th,
.dark .mod-table td {
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.mod-table th {
	font-size: .9rem;
	text-transform: uppercase;
	letter-spacing: .11em;
	font-weight: 700;
	opacity: .9;
}
/* Better readability */
.mod-table {
	font-family: 'Lexend Deca', system-ui, sans-serif;
	font-size: 1.08rem;
}
.mod-table th {
	font-size: .9rem;
}
.mod-table td {
	font-weight: 500;
	font-size: 1.05rem;
}
.mod-table tbody tr:nth-child(even) {
	background: rgba(0, 0, 0, 0.025);
}
.dark .mod-table tbody tr:nth-child(even) {
	background: rgba(255, 255, 255, 0.04);
}
.mod-table tbody tr:hover {
	background: rgba(47, 100, 255, 0.08);
}
.dark .mod-table tbody tr:hover {
	background: rgba(77, 140, 255, 0.12);
}
.mod-table .col-id {
	width: 48px;
	font-variant-numeric: tabular-nums;
	text-align: right;
}
.mod-table .col-percent,
.mod-table .col-hz {
	text-align: right;
	font-variant-numeric: tabular-nums;
}
.mod-table .col-mobile {
	text-align: center;
}
.mod-table .col-actions {
	white-space: nowrap;
}
.mod-table .col-level,
.mod-table .col-user,
.mod-table .col-discord {
	max-width: 240px;
	overflow-wrap: break-word;
}
.mod-table .col-user--long {
	font-size: 0.85rem;
}
.mod-table a {
	font-weight: 600;
}

/* Status badge */
.status-badge {
	display: inline-block;
	padding: .34rem .65rem .36rem;
	border-radius: 8px;
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.status-pending .status-badge {
	background: #2f64ff;
	color: #fff;
}
.status-approved .status-badge {
	background: #1f8f4d;
	color: #fff;
}
.status-rejected .status-badge {
	background: #c25a16;
	color: #fff;
}
.status-consideration .status-badge {
	background: #8d6ad9;
	color: #fff;
}

.row-btn {
	border: none;
	cursor: pointer;
	padding: .5rem .8rem;
	font-size: .78rem;
	border-radius: 7px;
	font-weight: 700;
	letter-spacing: .07em;
	box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.32);
}
.row-btn.approve {
	background: #1f8f4d;
	color: #fff;
}
.row-btn.approve:hover {
	background: #197a41;
}
.row-btn.reject {
	background: #c25a16;
	color: #fff;
}
.row-btn.reject:hover {
	background: #a24d14;
}
.row-btn.delete {
	background: #b23a32;
	color: #fff;
}
.row-btn.delete:hover {
	background: #922f29;
}
.row-btn.consider {
	background: #8d6ad9;
	color: #fff;
}
.row-btn.consider:hover {
	background: #7a55cc;
}
.row-btn:disabled {
	opacity: .5;
	cursor: default;
	box-shadow: none;
}
/* Make action buttons visually match taller rows */
.mod-table td.actions {
	display: flex;
	align-items: center;
	gap: .4rem;
	padding-top: 1.30rem;
	padding-bottom: 1.30rem;
}
.mod-table a {
	color: #2f64ff;
	text-decoration: none;
	font-weight: 600;
}
.mod-table a:hover {
	text-decoration: underline;
}
.empty {
	text-align: center;
	font-style: italic;
	opacity: .62;
	padding: .75rem 0;
}

/* Records panel additions */
.orphan-records {
	margin-top: 1rem;
	display: flex;
	flex-direction: column;
	gap: .75rem;
}
.records-header {
	display: flex;
	flex-wrap: wrap;
	gap: .6rem;
	align-items: center;
}
.records-header .record-filter {
	padding: .55rem .7rem;
	border: 1px solid var(--input-border, #c9ccd1);
	border-radius: 9px;
	font-size: .72rem;
	font-weight: 600;
	letter-spacing: .05em;
}
.dark .records-header .record-filter {
	background: #272b33;
	color: #f2f4f6;
	border-color: #3a4048;
}
.records-count {
	font-size: .68rem;
	font-weight: 700;
	opacity: .7;
}
.records-panel {
	max-height: 320px;
	overflow: auto;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.5);
	backdrop-filter: blur(4px);
}
.dark .records-panel {
	background: rgba(32, 34, 39, 0.5);
	border-color: rgba(255, 255, 255, 0.07);
}
.mod-table.small {
	font-size: 1.06rem;
	line-height: 1.48;
	table-layout: fixed;
}
.mod-table.small th {
	font-size: .82rem;
	padding: .62rem .8rem;
	letter-spacing: .08em;
}
.mod-table.small td {
	font-size: .98rem;
	padding: .64rem .8rem;
}
.mod-table.small .row-btn.xs {
	padding: .54rem .9rem;
	font-size: .76rem;
	letter-spacing: .065em;
}
.mod-table.small thead th {
	position: sticky;
	top: 0;
	z-index: 2;
}
.mod-table.small tbody tr:nth-child(even) {
	background: rgba(0, 0, 0, 0.035);
}
.dark .mod-table.small tbody tr:nth-child(even) {
	background: rgba(255, 255, 255, 0.06);
}
.mod-table.small tbody tr:hover {
	background: rgba(47, 100, 255, 0.12);
}
.dark .mod-table.small tbody tr:hover {
	background: rgba(77, 140, 255, 0.18);
}
.mod-table.small .rec-col-level {
	width: 22%;
}
.mod-table.small .rec-col-user {
	width: 16%;
}
.mod-table.small .rec-col-percent {
	width: 9%;
	text-align: right;
	font-variant-numeric: tabular-nums;
}
.mod-table.small .rec-col-hz {
	width: 7%;
	text-align: right;
	font-variant-numeric: tabular-nums;
}
.mod-table.small .rec-col-mobile {
	width: 9%;
	text-align: center;
}
.mod-table.small .rec-col-origin {
	width: 10%;
	text-align: center;
}
.mod-table.small .rec-col-actions {
	width: 9%;
	text-align: center;
}
.mod-table.small .rec-col-level,
.mod-table.small .rec-col-user {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.origin-badge {
	display: inline-block;
	padding: .32rem .6rem .36rem;
	border-radius: 6px;
	font-size: .63rem;
	letter-spacing: .09em;
	font-weight: 700;
	line-height: 1;
	background: #f1f3f7;
	color: #1e2c45;
	border: 1px solid #d4dae2;
}
.dark .origin-badge {
	background: #2f3a46;
	color: #dce6f4;
	border-color: #485566;
}
.origin-json {
	background: #e9f8ff;
	border-color: #c2e7f7;
	color: #074b61;
}
.dark .origin-json {
	background: #224956;
	border-color: #2e5d6c;
	color: #bfe9f7;
}
.origin-submission {
	background: #e9fced;
	border-color: #bfe7cc;
	color: #125a2f;
}
.dark .origin-submission {
	background: #1f4a2d;
	border-color: #2a5f3c;
	color: #b9f3cd;
}
.origin-other {
	background: #efefef;
	border-color: #d5d5d5;
	color: #444;
}
.dark .origin-other {
	background: #444;
	border-color: #555;
	color: #efefef;
}
.mod-table.small .row-btn.xs {
	line-height: 1;
}
.mod-table.small .rec-col-id {
	width: 56px;
	font-variant-numeric: tabular-nums;
}
.mod-table.small .rec-col-percent,
.mod-table.small .rec-col-hz {
	text-align: right;
	font-variant-numeric: tabular-nums;
}
.mod-table.small .rec-col-mobile {
	text-align: center;
	width: 48px;
}
.mod-table.small .rec-col-actions {
	white-space: nowrap;
}
.mod-table.small tbody tr:nth-child(even) {
	background: rgba(0, 0, 0, 0.03);
}
.dark .mod-table.small tbody tr:nth-child(even) {
	background: rgba(255, 255, 255, 0.05);
}
.mod-table.small tbody tr:hover {
	background: rgba(47, 100, 255, 0.1);
}
.dark .mod-table.small tbody tr:hover {
	background: rgba(77, 140, 255, 0.14);
}

/* Advanced info modal refresh */
.adv-modal {
	position: fixed;
	inset: 0;
	z-index: 4000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 4.5rem 1.2rem 2.5rem;
	backdrop-filter: blur(3px);
}
.adv-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 14, 20, 0.72);
	backdrop-filter: blur(2px);
}
.dark .adv-backdrop {
	background: rgba(0, 0, 0, 0.78);
}
.adv-panel {
	position: relative;
	width: min(980px, 100%);
	background: rgba(255, 255, 255, 0.96);
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 22px;
	padding: 1.9rem 2rem 2.2rem;
	box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.38), 0 4px 16px -4px rgba(0, 0, 0, 0.22);
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	font-family: 'Lexend Deca', system-ui, sans-serif;
}
.dark .adv-panel {
	background: rgba(36, 38, 44, 0.96);
	border-color: rgba(255, 255, 255, 0.07);
	box-shadow: 0 16px 40px -14px rgba(0, 0, 0, 0.78), 0 4px 16px -6px rgba(0, 0, 0, 0.55);
}
.adv-title {
	margin: 0;
	font-size: 1.7rem;
	line-height: 1.18;
	letter-spacing: .4px;
	font-weight: 800;
	color: #1e2e55;
	padding: .2rem 0 .25rem;
}
.dark .adv-title {
	color: #e6edfa;
}
.adv-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 1.05rem 1.4rem;
	font-size: 1.05rem;
}
.adv-item {
	line-height: 1.42;
	position: relative;
	padding: .55rem .85rem .65rem;
	background: rgba(255, 255, 255, 0.55);
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 14px;
	box-shadow: 0 3px 8px -3px rgba(0, 0, 0, 0.18);
}
.dark .adv-item {
	background: rgba(44, 48, 56, 0.55);
	border-color: rgba(255, 255, 255, 0.07);
}
.adv-item strong {
	display: block;
	font-size: .64rem;
	letter-spacing: .12em;
	text-transform: uppercase;
	font-weight: 800;
	opacity: .7;
	margin-bottom: .28rem;
}
.adv-item a {
	font-weight: 600;
	color: #2f64ff;
	text-decoration: none;
	word-break: break-all;
}
.adv-item a:hover {
	text-decoration: underline;
}
.dark .adv-item a {
	color: #7da3ff;
}
.adv-actions {
	display: flex;
	justify-content: flex-end;
	margin-top: .4rem;
}
.adv-panel .row-btn.delete {
	font-size: .86rem;
	padding: .7rem 1.25rem;
	border-radius: 11px;
}
.adv-meta-wide {
	grid-column: 1 / -1;
}
.adv-item.muted {
	opacity: .55;
}
.adv-panel::-webkit-scrollbar {
	width: 12px;
}
.adv-panel::-webkit-scrollbar-track {
	background: transparent;
}
.adv-panel::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.22);
	border-radius: 30px;
	border: 3px solid transparent;
	background-clip: content-box;
}
.dark .adv-panel::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.22);
}

@media (max-width: 780px) {
	.adv-panel {
		padding: 1.5rem 1.05rem 1.85rem;
		border-radius: 20px;
	}
	.adv-grid {
		gap: .8rem .85rem;
	}
	.adv-title {
		font-size: 1.42rem;
	}
	.adv-item {
		padding: .52rem .65rem .6rem;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.adv-panel {
		animation: adv-fade-in .38s cubic-bezier(.32, .72, .27, .99);
	}
	@keyframes adv-fade-in {
		0% {
			transform: translateY(14px) scale(.96);
			opacity: 0;
		}
		100% {
			transform: translateY(0) scale(1);
			opacity: 1;
		}
	}
	.adv-backdrop {
		animation: adv-backdrop .4s ease;
	}
	@keyframes adv-backdrop {
		0% {
			opacity: 0;
		}
		100% {
			opacity: 1;
		}
	}
}

@media (min-width:1200px){
	.mod-page { padding:1.9rem 3rem 3rem; }
	.mod-table { font-size:1.1rem; }
}

@media (min-width:1500px){
	.mod-page { max-width:1800px; }
	.mod-table .col-level, .mod-table .col-user, .mod-table .col-discord { max-width:300px; }
}

/* Dense for narrow widths */
@media (max-width:860px){
	.mod-table th:nth-child(1), .mod-table td:nth-child(1) { display:none; }
	.mod-table th:nth-child(5), .mod-table td:nth-child(5) { display:none; }
	.mod-table th:nth-child(6), .mod-table td:nth-child(6) { display:none; }
	.mod-table { font-size:.78rem; }
	.mod-table td { font-size:.78rem; }
	.status-badge { font-size:.68rem; }
}

/* Credential modal tweaks */
.creds-form .submit-section__legend { color:#2f64ff; }
.dark .creds-form .submit-section__legend { color:#7da3ff; }
.creds-form .submit-field--span2 { grid-column:1 / -1; }
