:root {
	--bg: #f4f4f5;
	--card-bg: #ffffff;
	--text-main: #09090b;
	--text-muted: #71717a;
	--border: #e4e4e7;
	--primary: #18181b;
	--primary-hover: #27272a;
	--ring: rgba(24, 24, 27, 0.2);
	--error-bg: #fef2f2;
	--error-text: #ef4444;
	--error-border: #fca5a5;
	--success-bg: #f0fdf4;
	--success-text: #166534;
	--success-border: #bbf7d0;
}

* {
	box-sizing: border-box;
}

body {
	font-family:
		ui-sans-serif,
		system-ui,
		-apple-system,
		BlinkMacSystemFont,
		'Segoe UI',
		Roboto,
		'Helvetica Neue',
		Arial,
		sans-serif;
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 100vh;
	margin: 0;
	background: var(--bg);
	color: var(--text-main);
	-webkit-font-smoothing: antialiased;
}

.wrapper {
	width: 100%;
	max-width: 540px;
	padding: 1.5rem;
}

.card {
	background: var(--card-bg);
	padding: 2.5rem 2rem;
	border-radius: 12px;
	border: 1px solid var(--border);
	box-shadow:
		0 4px 6px -1px rgba(0, 0, 0, 0.05),
		0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

h1 {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 600;
	text-align: center;
	letter-spacing: -0.025em;
}

.subtitle {
	text-align: center;
	color: var(--text-muted);
	font-size: 0.925rem;
	margin-bottom: 2rem;
	line-height: 1.5;
}

.error {
	background: var(--error-bg);
	color: var(--error-text);
	padding: 0.75rem 1rem;
	border-radius: 6px;
	border: 1px solid var(--error-border);
	margin-bottom: 1.5rem;
	font-size: 0.875rem;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.error::before {
	content: '!';
	display: inline-flex;
	justify-content: center;
	align-items: center;
	width: 1.25rem;
	height: 1.25rem;
	background: var(--error-text);
	color: white;
	border-radius: 50%;
	font-weight: bold;
	font-size: 0.75rem;
}

.form-group {
	margin-bottom: 1.25rem;
}

label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 500;
	font-size: 0.875rem;
}

input {
	width: 100%;
	padding: 0.625rem 0.75rem;
	border: 1px solid var(--border);
	border-radius: 6px;
	font-size: 0.95rem;
	transition: all 0.15s ease;
	outline: none;
	color: var(--text-main);
}

input:focus {
	border-color: var(--primary);
	box-shadow: 0 0 0 3px var(--ring);
}

button {
	width: 100%;
	padding: 0.75rem;
	background: var(--primary);
	color: #fff;
	border: 1px solid var(--primary);
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.95rem;
	font-weight: 500;
	transition: all 0.15s ease;
	margin-top: 0.5rem;
}

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

.footer-text {
	text-align: center;
	margin-top: 1.5rem;
	font-size: 0.875rem;
	color: var(--text-muted);
}

a {
	color: var(--text-main);
	font-weight: 500;
	text-decoration: none;
	transition: color 0.15s ease;
}

a:hover {
	text-decoration: underline;
}

/* Generic Buttons */
.btn-group {
	display: flex;
	gap: 1rem;
	margin-top: 2rem;
}

.btn {
	flex: 1;
	text-align: center;
	padding: 0.5rem 0.75rem;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 500;
	font-size: 0.875rem;
	transition: all 0.15s ease;
	cursor: pointer;
	display: inline-block;
}

.btn-primary {
	background: var(--primary);
	color: #fff;
	border: 1px solid var(--primary);
}

.btn-primary:hover {
	background: var(--primary-hover);
	text-decoration: none;
}

.btn-secondary {
	background: #fff;
	color: var(--text-main);
	border: 1px solid var(--border);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
	background: var(--bg);
	text-decoration: none;
}

.btn-danger {
	background: transparent;
	color: var(--error-text);
	border: 1px solid var(--error-border);
}

.btn-danger:hover {
	background: var(--error-bg);
	text-decoration: none;
}

.lead {
	text-align: center;
	line-height: 1.6;
	color: var(--text-muted);
	font-size: 0.95rem;
	margin-bottom: 1rem;
}

/* Table & Session Specifics */
.table-container {
	width: 100%;
	overflow-x: auto;
	margin-top: 1rem;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
}

th,
td {
	padding: 0.875rem 0.5rem;
	text-align: left;
	border-bottom: 1px solid var(--border);
}

th {
	color: var(--text-muted);
	font-weight: 500;
}

/* Dropdown Menus */
.top-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.75rem;
	margin-bottom: 1.5rem;
}

.dropdown {
	position: relative;
	display: inline-block;
}

/* Invisible bridge to keep hover active between button and dropdown */
.dropdown::after {
	content: '';
	position: absolute;
	bottom: -0.25rem;
	left: 0;
	right: 0;
	height: 0.25rem;
	background: transparent;
}

.dropdown-content {
	display: none;
	position: absolute;
	right: 0;
	top: calc(100% + 0.25rem); /* Adjusted to sit just below the bridge */
	background-color: var(--card-bg);
	min-width: 220px;
	box-shadow:
		0 10px 15px -3px rgba(0, 0, 0, 0.1),
		0 4px 6px -2px rgba(0, 0, 0, 0.05);
	border: 1px solid var(--border);
	border-radius: 6px;
	z-index: 10;
	overflow: hidden;
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
	display: block;
}

.dropdown-item {
	display: block;
	width: 100%;
	text-align: left;
	padding: 0.75rem 1rem;
	font-size: 0.875rem;
	color: var(--text-main);
	background: none;
	border: none;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s ease;
	margin: 0;
}

.dropdown-item:hover {
	background-color: var(--bg);
	text-decoration: none;
}

.dropdown-divider {
	height: 1px;
	background-color: var(--border);
	margin: 0;
}

.text-danger {
	color: var(--error-text);
}

/* Info Banner for SSO */
.info-banner {
	background-color: var(--success-bg);
	border: 1px solid var(--success-border);
	border-radius: 8px;
	padding: 1.25rem;
	margin-top: 0.5rem;
}

.info-banner h3 {
	margin: 0 0 0.5rem 0;
	color: var(--success-text);
	font-size: 1rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.info-banner p {
	margin: 0 0 1.25rem 0;
	color: var(--success-text);
	font-size: 0.875rem;
	line-height: 1.5;
}

.app-links {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.app-links li a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.875rem 1rem;
	background: var(--card-bg);
	border: 1px solid var(--success-border);
	border-radius: 6px;
	color: var(--success-text);
	font-weight: 500;
	transition: all 0.15s ease;
}

.app-links li a:hover {
	background: var(--success-bg);
	opacity: 0.85;
	text-decoration: none;
}
