*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: #1a1a1a;
	background-color: #f5f5f5;
	min-height: 100vh;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 60px 20px;
}

a {
	color: #1a1a1a;
	text-decoration: none;
}

/* Card (used for guest/login/register pages) */

.card {
	width: 100%;
	max-width: 400px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
}

.card-header {
	padding: 20px 24px;
	border-bottom: 1px solid #e0e0e0;
}

.card-header h1 {
	font-size: 16px;
	font-weight: 600;
	color: #1a1a1a;
}

.card-header p {
	font-size: 13px;
	color: #666;
	margin-top: 2px;
}

.card-body {
	padding: 24px;
}

.card-footer {
	padding: 16px 24px;
	border-top: 1px solid #e0e0e0;
	text-align: center;
}

.card-footer a {
	font-size: 13px;
	color: #666;
	transition: color 0.15s;
}

.card-footer a:hover {
	color: #1a1a1a;
}

.back-link {
	display: inline-block;
	font-size: 13px;
	color: #666;
	margin-bottom: 16px;
	transition: color 0.15s;
}

.back-link:hover {
	color: #1a1a1a;
}

/* Sidebar layout */

.layout {
	display: flex;
	width: 100%;
	max-width: 1060px;
	min-height: 480px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
}

.sidebar {
	width: 220px;
	flex-shrink: 0;
	border-right: 1px solid #e0e0e0;
	background: #fafafa;
	display: flex;
	flex-direction: column;
}

.sidebar-header {
	padding: 20px;
	border-bottom: 1px solid #e0e0e0;
}

.sidebar-title {
	font-size: 14px;
	font-weight: 600;
}

.sidebar-user {
	font-size: 12px;
	color: #666;
	margin-top: 2px;
}

.sidebar-nav {
	flex: 1;
	padding: 8px 0;
	overflow-y: auto;
}

.nav-group {
	padding: 8px 0;
}

.nav-group-title {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #999;
	padding: 4px 20px 4px;
}

.nav-item {
	display: block;
	padding: 6px 20px;
	font-size: 13px;
	color: #444;
	text-decoration: none;
	transition: background-color 0.1s;
}

.nav-item:hover {
	background-color: #f0f0f0;
}

.nav-item-active {
	background-color: #eaeaea;
	color: #1a1a1a;
	font-weight: 500;
}

.sidebar-footer {
	border-top: 1px solid #e0e0e0;
	padding: 8px 0;
}

.nav-item-logout {
	color: #999;
}

.nav-item-logout:hover {
	color: #c53030;
}

/* Main content area */

.content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.content-header {
	padding: 24px 40px;
	border-bottom: 1px solid #e0e0e0;
}

.content-header h1 {
	font-size: 18px;
	font-weight: 600;
}

.content-header p {
	font-size: 13px;
	color: #666;
	margin-top: 2px;
}

.content-body {
	padding: 24px 40px;
	flex: 1;
}

/* Forms */

.content-form {
	max-width: 340px;
}

.form-group {
	margin-bottom: 16px;
}

.form-group label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: #444;
	margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
	width: 100%;
	height: 40px;
	padding: 0 12px;
	font-size: 14px;
	font-family: inherit;
	color: #1a1a1a;
	background: #fff;
	border: 1px solid #d0d0d0;
	border-radius: 6px;
	outline: none;
	transition: border-color 0.15s;
}

.form-group input:focus {
	border-color: #1a1a1a;
}

.form-error {
	font-size: 13px;
	color: #c53030;
	margin-top: 4px;
}

.input-invalid {
	border-color: #c53030 !important;
}

.form-error-live:empty {
	display: none;
}

.btn {
	display: block;
	width: 100%;
	height: 40px;
	padding: 0 16px;
	font-size: 14px;
	font-family: inherit;
	font-weight: 500;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	text-align: center;
	line-height: 40px;
	transition: background-color 0.15s;
}

.btn-primary {
	background-color: #1a1a1a;
	color: #fff;
}

.btn-primary:hover {
	background-color: #333;
}

.btn-secondary {
	background-color: #f0f0f0;
	color: #1a1a1a;
	border: 1px solid #d0d0d0;
}

.btn-secondary:hover {
	background-color: #e5e5e5;
}

/* Info list (account overview) */

.info-list {
	max-width: 400px;
}

.info-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
	border-bottom: none;
}

.info-item dt {
	font-size: 13px;
	color: #666;
}

.info-item dd {
	font-size: 14px;
	font-weight: 500;
}

/* Tables */

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

th {
	text-align: left;
	font-weight: 500;
	color: #666;
	padding: 10px 12px;
	border-bottom: 2px solid #e0e0e0;
}

td {
	padding: 10px 12px;
	border-bottom: 1px solid #f0f0f0;
	color: #1a1a1a;
}

tr:last-child td {
	border-bottom: none;
}

tr:hover td {
	background-color: #fafafa;
}

.badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 10px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.badge-yes {
	background-color: #e6f4ea;
	color: #1e7e34;
}

.badge-no {
	background-color: #f0f0f0;
	color: #888;
}

.btn-toggle {
	display: inline-block;
	font-family: inherit;
	font-size: 12px;
	font-weight: 500;
	padding: 4px 12px;
	border-radius: 4px;
	border: 1px solid #d0d0d0;
	background-color: #f5f5f5;
	color: #666;
	cursor: pointer;
	transition: all 0.15s;
}

.btn-toggle:hover {
	border-color: #999;
	background-color: #eee;
}

.btn-toggle-on {
	background-color: #e6f4ea;
	color: #1e7e34;
	border-color: #b7dfbf;
}

.btn-toggle-on:hover {
	background-color: #d4edda;
	border-color: #8fcea0;
}

/* Content sections */

.content-section {
	margin-bottom: 24px;
}

.content-section h2 {
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 16px;
}

/* Inline button variant */

.btn-inline {
	width: auto;
	display: inline-block;
	padding: 0 20px;
}

/* Checkbox + select form controls */

.checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #444;
	cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: #1a1a1a;
}

select {
	height: 36px;
	padding: 0 10px;
	font-size: 13px;
	font-family: inherit;
	color: #1a1a1a;
	background: #fff;
	border: 1px solid #d0d0d0;
	border-radius: 6px;
	outline: none;
}

select:focus {
	border-color: #1a1a1a;
}

.select-full {
	width: 100%;
	margin: 0;
}

/* Invite code display */

.invite-link-cell {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.invite-code {
	font-family: "SF Mono", Monaco, Menlo, Consolas, monospace;
	font-size: 12px;
	color: #444;
	background: #f5f5f5;
	padding: 3px 6px;
	border-radius: 4px;
	user-select: all;
	white-space: nowrap;
}

.btn-copy {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 1px solid #d0d0d0;
	border-radius: 4px;
	background: #fff;
	color: #666;
	cursor: pointer;
	flex-shrink: 0;
	transition: all 0.15s;
}

.btn-copy:hover {
	border-color: #999;
	color: #1a1a1a;
	background: #f5f5f5;
}

.table-scroll {
	overflow-x: auto;
}

.badge-claimed {
	background-color: #e8eaf6;
	color: #3949ab;
}

/* Modal (native dialog) */

.modal {
	border: none;
	border-radius: 8px;
	padding: 0;
	width: 380px;
	max-width: calc(100vw - 40px);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
	margin: auto;
}

.modal::backdrop {
	background: rgba(0, 0, 0, 0.3);
}

.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
	font-size: 16px;
	font-weight: 600;
}

.modal-close {
	background: none;
	border: none;
	font-size: 22px;
	color: #999;
	cursor: pointer;
	padding: 0;
	line-height: 1;
}

.modal-close:hover {
	color: #1a1a1a;
}

.modal-body {
	padding: 24px;
}

.modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 20px;
}

/* Toast notification */

.toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	background: #1a1a1a;
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	padding: 10px 20px;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	z-index: 1000;
	animation: toast-in 0.2s ease;
}

@keyframes toast-in {
	from { opacity: 0; transform: translateX(-50%) translateY(8px); }
	to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Upload form */

.upload-form .upload-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 20px;
	max-width: 480px;
}

.upload-form .upload-fields .form-group:last-child {
	grid-column: 1 / -1;
}

.file-input {
	font-family: inherit;
	font-size: 13px;
	color: #444;
}

/* Version tag */

.version-tag {
	font-family: "SF Mono", Monaco, Menlo, Consolas, monospace;
	font-size: 12px;
	color: #444;
	background: #f5f5f5;
	padding: 2px 6px;
	border-radius: 4px;
}

/* Small button variant */

.btn-small {
	display: inline-block;
	width: auto;
	height: 32px;
	line-height: 32px;
	padding: 0 14px;
	font-size: 13px;
}

.text-muted {
	color: #999;
	font-weight: 400;
}

/* Placeholder */

.placeholder-text {
	color: #999;
	font-size: 13px;
}

/* Audit log */

.audit-filter {
	margin-bottom: 16px;
}

.badge-event {
	background-color: #e8eaf6;
	color: #3949ab;
	white-space: nowrap;
}

.ip-code {
	font-family: "SF Mono", Monaco, Menlo, Consolas, monospace;
	font-size: 12px;
	color: #444;
}

.detail-cell {
	font-size: 12px;
	color: #666;
	max-width: 300px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.nowrap {
	white-space: nowrap;
}

.pagination {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: 20px;
	font-size: 13px;
}

.pagination-link {
	color: #1a1a1a;
	font-weight: 500;
	text-decoration: none;
}

.pagination-link:hover {
	text-decoration: underline;
}

.pagination-info {
	color: #666;
}

.setting-desc {
	font-size: 0.85em;
	color: #666;
	margin-top: 2px;
}
