:root {
	--main-bg-color: #222;
	--form-back-color: #222;
	--form-fore-color: #fff;
	--input-back-color: #222;
	--input-fore-color: #fff;
	--border-color-primary: silver;
	--fore-color: #fff;
	--fore-color-secondary: #aaa;
	--button-back-color: #eee;
	--button-fore-color: #222;
	--button-primary-back-color: #1976d2;
	--button-primary-fore-color: #f8f8f8;
	--button-primary-hover-back-color: #1565c0;
	--warning-color: #ff0000;
	--highlight-color: #48abe0;
}

* {
	box-sizing: border-box;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
	background-color: var(--main-bg-color);
	color: var(--fore-color);
	margin: 0;
	padding: 0;
}

.hidden {
	display: none !important;
}

/* Admin Header / Navigation */
.topMenu {
	position: sticky;
	top: 0;
	z-index: 100;
}

.admin-header {
	display: flex;
	align-items: center;
	padding: 0 1.5rem;
	height: 56px;
	background: #111;
	border-bottom: 1px solid #333;
	gap: 2rem;
}

.admin-logo {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--highlight-color);
	white-space: nowrap;
}

.admin-nav {
	display: flex;
	gap: 0.25rem;
	flex: 1;
}

.nav-link {
	color: var(--fore-color-secondary);
	text-decoration: none;
	padding: 0.5rem 0.75rem;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.9rem;
	transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
	background: #333;
	color: var(--fore-color);
}

.admin-user {
	display: flex;
	align-items: center;
	gap: 1rem;
	font-size: 0.9rem;
	color: var(--fore-color-secondary);
}

.logout-link {
	color: var(--warning-color);
}

/* Admin Content Area */
.admin-content {
	max-width: 1200px;
	margin: 0 auto;
	padding: 1.5rem;
}

.adminPanel {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: calc(100vh - 56px);
}

.adminLoginPane {
	width: 400px;
	padding: 2rem;
	border: 1px solid #333;
	border-radius: 8px;
	background: #1a1a1a;
}

.adminLoginPane h2 {
	text-align: center;
	margin-bottom: 1.5rem;
}

/* Toolbar */
.admin-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1rem;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.admin-toolbar h2 {
	margin: 0;
}

.toolbar-actions {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	flex-wrap: wrap;
}

.search-input {
	padding: 0.4rem 0.75rem;
	border: 1px solid #555;
	border-radius: 4px;
	background: var(--input-back-color);
	color: var(--fore-color);
	min-width: 200px;
}

.table-info {
	color: var(--fore-color-secondary);
	font-size: 0.85rem;
	margin-bottom: 0.5rem;
}

/* Stats Grid */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 1rem;
	margin-bottom: 2rem;
}

.stat-card {
	background: #1a1a1a;
	border: 1px solid #333;
	border-radius: 8px;
	padding: 1.25rem;
	text-align: center;
}

.stat-number {
	font-size: 2rem;
	font-weight: 700;
	color: var(--highlight-color);
}

.stat-label {
	font-size: 0.85rem;
	color: var(--fore-color-secondary);
	margin-top: 0.25rem;
}

/* Quick Actions */
.quick-actions {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 2rem;
}

/* Data Tables */
.admin-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1rem;
}

.admin-table th,
.admin-table td {
	padding: 0.6rem 0.75rem;
	text-align: left;
	border-bottom: 1px solid #333;
}

.admin-table th {
	background: #1a1a1a;
	color: var(--fore-color-secondary);
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-weight: 600;
}

.admin-table tbody tr:hover {
	background: #2a2a2a;
}

.admin-table tbody tr.clickable-row {
	cursor: pointer;
}

.admin-table a {
	color: var(--highlight-color);
	text-decoration: none;
	cursor: pointer;
}

.admin-table a:hover {
	text-decoration: underline;
}

/* Badges */
.badge {
	display: inline-block;
	padding: 0.15rem 0.5rem;
	border-radius: 12px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
}

.badge-active {
	background: #1b5e20;
	color: #a5d6a7;
}

.badge-disabled {
	background: #b71c1c;
	color: #ef9a9a;
}

.badge-locked {
	background: #e65100;
	color: #ffcc02;
}

.badge-expired {
	background: #424242;
	color: #bdbdbd;
}

/* Pagination */
.pagination {
	display: flex;
	gap: 0.25rem;
	margin-top: 1rem;
	justify-content: center;
}

.pagination button {
	min-width: 36px;
}

/* Detail Sections */
.detail-section {
	margin-bottom: 1.5rem;
	padding: 1rem;
	border: 1px solid #333;
	border-radius: 8px;
	background: #1a1a1a;
}

.detail-section h3 {
	margin-top: 0;
	margin-bottom: 0.75rem;
	font-size: 1rem;
	color: var(--fore-color-secondary);
	border-bottom: 1px solid #333;
	padding-bottom: 0.5rem;
}

/* Forms */
.form-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.75rem;
}

.form-row {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.form-row.full-width {
	grid-column: 1 / -1;
}

.form-row.inline {
	flex-direction: row;
	align-items: center;
	gap: 0.5rem;
}

.form-row label {
	font-size: 0.85rem;
	color: var(--fore-color-secondary);
}

.form-row input,
.form-row textarea,
.form-row select {
	padding: 0.4rem 0.6rem;
	border: 1px solid #555;
	border-radius: 4px;
	background: var(--input-back-color);
	color: var(--fore-color);
	font-size: 0.9rem;
}

.form-row textarea {
	min-height: 80px;
	resize: vertical;
}

/* Checkboxes */
.checkbox-label {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	cursor: pointer;
	font-size: 0.9rem;
}

.checkbox-group,
.role-checkboxes,
.service-checkboxes {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.radio-group {
	display: flex;
	gap: 1rem;
}

/* Buttons */
button, .button {
	padding: 0.4rem 1rem;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.9rem;
	background: var(--button-back-color);
	color: var(--button-fore-color);
	transition: opacity 0.15s;
}

button:hover {
	opacity: 0.85;
}

button.primary {
	background: var(--button-primary-back-color);
	color: var(--button-primary-fore-color);
}

button.primary:hover {
	background: var(--button-primary-hover-back-color);
}

button.danger {
	background: #c62828;
	color: #fff;
}

button.danger:hover {
	background: #b71c1c;
}

button.small {
	padding: 0.2rem 0.5rem;
	font-size: 0.8rem;
}

button:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

button.secondary {
	background: #555;
	color: #fff;
}

/* Credentials Display */
.credential-display {
	font-size: 0.9rem;
}

.credential-display code {
	background: #333;
	padding: 0.2rem 0.4rem;
	border-radius: 3px;
	font-size: 0.85rem;
}

.credential-actions {
	margin-top: 0.75rem;
	display: flex;
	gap: 0.5rem;
}

/* Action Buttons */
.action-buttons {
	display: flex;
	gap: 0.5rem;
}

/* Error Message */
.error-message {
	color: var(--warning-color);
}

.detail-message {
	margin-top: 0.5rem;
	color: var(--highlight-color);
}

/* Message Modal */
div[name="adminMessage"] {
	display: none;
}

div[name="adminMessage"].show {
	display: block;
}

.message-modal {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: #333;
	padding: 2rem;
	border-radius: 8px;
	z-index: 1000;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
	.admin-header {
		flex-wrap: wrap;
		height: auto;
		padding: 0.5rem 1rem;
	}

	.admin-nav {
		order: 3;
		width: 100%;
		overflow-x: auto;
	}

	.form-grid {
		grid-template-columns: 1fr;
	}

	.stats-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.admin-table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}

	.toolbar-actions {
		width: 100%;
	}
}

/* Login form row overrides */
.pane .row {
	margin-bottom: 0.75rem;
}

.pane .right-align {
	text-align: right;
}
