@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

:root {
	color-scheme: dark;
	font-family: "Montserrat", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
	background: #0c1118;
	color: #e7edf6;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	background:
		radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.12), transparent 34%),
		linear-gradient(180deg, #111824 0%, #0c1118 230px, #090d13 100%);
	font-size: 13px;
}

.topbar {
	display: flex;
	justify-content: space-between;
	align-items: end;
	gap: 18px;
	padding: 20px 28px 12px;
}

.eyebrow {
	margin: 0 0 5px;
	color: #7f8da3;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0;
}

h1 {
	margin: 0;
	font-size: 26px;
	font-weight: 850;
	line-height: 1.08;
}

.summary {
	display: grid;
	justify-items: end;
	color: #8796ab;
	font-size: 12px;
}

.summary strong {
	color: #f8fafc;
	font-size: 24px;
	line-height: 1;
}

.top-actions {
	display: flex;
	align-items: center;
	gap: 14px;
}

.top-actions form {
	margin: 0;
}

.filters {
	position: sticky;
	top: 0;
	z-index: 5;
	display: grid;
	grid-template-columns: repeat(6, minmax(130px, 1fr));
	gap: 10px;
	margin: 0 28px 20px;
	padding: 14px;
	background: rgba(13, 18, 27, 0.88);
	border: 1px solid rgba(148, 163, 184, 0.14);
	border-radius: 10px;
	box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
	backdrop-filter: blur(14px);
}

label {
	display: grid;
	gap: 6px;
	color: #94a3b8;
	font-size: 11px;
	font-weight: 750;
}

.wide {
	grid-column: span 2;
}

input,
select,
button {
	width: 100%;
	min-height: 38px;
	border: 1px solid #263244;
	border-radius: 8px;
	background: #101722;
	color: #e7edf6;
	padding: 8px 11px;
	font: inherit;
	font-weight: 650;
}

input::placeholder {
	color: #56657a;
}

select {
	cursor: pointer;
}

input:focus,
select:focus {
	outline: 2px solid rgba(96, 165, 250, 0.16);
	border-color: #60a5fa;
}

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	border: 1px solid #3b82f6;
	border-radius: 8px;
	padding: 8px 12px;
	font-weight: 800;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.button:hover,
.icon-button:hover {
	transform: translateY(-1px);
}

.primary {
	background: #2f6fed;
	color: #fff;
}

.secondary {
	background: #101722;
	color: #d8e2ef;
	border-color: #2a3649;
}

.danger {
	background: #b91c1c;
	color: #fff;
	border-color: #ef4444;
}

.filter-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	align-self: end;
}

main {
	padding: 0 28px 34px;
}

.toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
	color: #8ea0b7;
}

.toolbar > div:first-child {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.toolbar strong {
	color: #f8fafc;
}

.login-state {
	border: 1px solid rgba(148, 163, 184, 0.14);
	border-radius: 999px;
	background: rgba(16, 23, 34, 0.72);
	color: #cbd5e1;
	padding: 8px 12px;
	font-size: 12px;
	font-weight: 800;
}

.toolbar-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.toolbar-actions form {
	margin: 0;
}

.notice {
	margin-bottom: 12px;
	padding: 10px 12px;
	border: 1px solid rgba(34, 197, 94, 0.3);
	border-radius: 8px;
	background: rgba(20, 83, 45, 0.32);
	color: #bbf7d0;
	font-weight: 750;
}

.notice.error {
	border-color: rgba(248, 113, 113, 0.34);
	background: rgba(127, 29, 29, 0.32);
	color: #fecaca;
}

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
	gap: 18px;
}

.card {
	position: relative;
	overflow: hidden;
	background: #0f1621;
	border: 1px solid rgba(148, 163, 184, 0.14);
	border-radius: 10px;
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
	transition: border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.card:hover {
	border-color: rgba(125, 211, 252, 0.28);
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
	transform: translateY(-1px);
}

.preview {
	display: grid;
	place-items: center;
	height: 300px;
	padding: 16px;
	background:
		linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%),
		linear-gradient(-45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.025) 75%),
		linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.025) 75%),
		#0b1018;
	background-position: 0 0, 0 12px, 12px -12px, -12px 0;
	background-size: 24px 24px;
}

.preview img {
	max-width: 100%;
	max-height: 282px;
	object-fit: contain;
	filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.42));
}

.card-overlay {
	position: absolute;
	inset: 10px 10px auto;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 8px;
	pointer-events: none;
}

.hash-badge {
	max-width: calc(100% - 142px);
	overflow: hidden;
	border: 1px solid rgba(148, 163, 184, 0.16);
	border-radius: 999px;
	background: rgba(5, 10, 18, 0.72);
	color: #dbeafe;
	padding: 6px 9px;
	font-family: "Montserrat", Consolas, monospace;
	font-size: 10px;
	font-weight: 800;
	text-overflow: ellipsis;
	white-space: nowrap;
	backdrop-filter: blur(10px);
}

.card-actions {
	display: flex;
	gap: 7px;
	pointer-events: auto;
}

.icon-button {
	display: inline-grid;
	place-items: center;
	width: 32px;
	min-height: 32px;
	border: 1px solid rgba(148, 163, 184, 0.18);
	border-radius: 999px;
	background: rgba(5, 10, 18, 0.74);
	color: #e2e8f0;
	padding: 0;
	font-size: 12px;
	font-weight: 900;
	backdrop-filter: blur(10px);
	cursor: pointer;
	transition: transform 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.settings-button {
	width: 44px;
	font-size: 10px;
	text-transform: uppercase;
}

.icon-button.is-active {
	border-color: #60a5fa;
	color: #93c5fd;
}

.image-dialog {
	width: min(620px, calc(100vw - 28px));
	max-height: calc(100vh - 40px);
	overflow: auto;
	border: 1px solid rgba(148, 163, 184, 0.2);
	border-radius: 12px;
	background: #0f1621;
	color: #e7edf6;
	padding: 14px;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
}

.image-dialog::backdrop {
	background: rgba(2, 6, 23, 0.76);
	backdrop-filter: blur(4px);
}

.zoom-dialog {
	width: min(980px, calc(100vw - 28px));
}

.login-dialog {
	width: min(380px, calc(100vw - 28px));
}

.dialog-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
}

.dialog-head strong {
	overflow-wrap: anywhere;
}

.dialog-close,
.info-list button {
	width: auto;
	min-height: 32px;
	border-radius: 7px;
	padding: 6px 10px;
	background: #172233;
	color: #d8e2ef;
	border-color: #2a3649;
	font-size: 12px;
	font-weight: 800;
	cursor: pointer;
}

.zoom-image {
	display: block;
	width: 100%;
	max-height: calc(100vh - 140px);
	object-fit: contain;
	border-radius: 10px;
	background:
		linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%),
		linear-gradient(-45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.025) 75%),
		linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.025) 75%),
		#0b1018;
	background-position: 0 0, 0 12px, 12px -12px, -12px 0;
	background-size: 24px 24px;
	padding: 18px;
}

.info-list {
	display: grid;
	gap: 8px;
}

.info-list div {
	display: grid;
	grid-template-columns: 92px minmax(0, 1fr) 68px;
	gap: 8px;
	align-items: center;
	border: 1px solid rgba(148, 163, 184, 0.12);
	border-radius: 8px;
	background: #101722;
	padding: 8px;
}

.info-list span {
	color: #94a3b8;
	font-size: 11px;
	font-weight: 800;
}

.info-list code {
	overflow: hidden;
	color: #e7edf6;
	font-family: "Montserrat", Consolas, monospace;
	font-size: 12px;
	font-weight: 700;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.chips span {
	border-radius: 999px;
	padding: 5px 8px;
	background: #172233;
	color: #b6c5d8;
	font-size: 11px;
	font-weight: 750;
}

.update,
.delete-form,
.login-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.update button,
.delete-form button,
.login-form label,
.login-form button {
	grid-column: 1 / -1;
}

.delete-form {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin-top: 24px;
	color: #95a5bb;
}

.empty {
	grid-column: 1 / -1;
	padding: 36px;
	border: 1px dashed #334155;
	border-radius: 10px;
	background: #0f1621;
	text-align: center;
	color: #95a5bb;
	font-weight: 800;
}

@media (min-width: 1500px) {
	.grid {
		grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
	}
}

@media (max-width: 1180px) {
	.filters {
		grid-template-columns: repeat(3, minmax(150px, 1fr));
	}
}

@media (max-width: 720px) {
	body {
		font-size: 12px;
	}

	.topbar,
	main {
		padding-left: 14px;
		padding-right: 14px;
	}

	.topbar,
	.toolbar {
		align-items: stretch;
		flex-direction: column;
	}

	.toolbar-actions {
		align-items: stretch;
		flex-direction: column;
	}

	.summary {
		justify-items: start;
	}

	.top-actions {
		align-items: stretch;
		justify-content: space-between;
	}

	.filters {
		position: static;
		grid-template-columns: 1fr;
		margin: 0 14px 16px;
	}

	.wide {
		grid-column: auto;
	}

	.filter-actions {
		grid-template-columns: 1fr;
	}

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

	.preview {
		height: 330px;
	}

	.preview img {
		max-height: 310px;
	}

	.info-list div {
		grid-template-columns: 1fr;
	}

	.hash-badge {
		max-width: calc(100% - 134px);
	}
}
