:root {
	--bg: #0f1117;
	--surface: #1a1d27;
	--surface-hover: #222633;
	--border: #2a2e3d;
	--text: #e4e6ed;
	--text-muted: #8b8fa3;
	--accent: #5b7fff;
	--accent-hover: #4a6bef;
	--red: #ff6b6b;
	--green: #51cf66;
	--blue: #748ffc;
	--radius: 12px;
	--shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

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

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
	background: var(--bg);
	color: var(--text);
	line-height: 1.6;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* Topbar */
.topbar {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(15, 17, 23, 0.85);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--border);
}

.topbar-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0.75rem 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.brand {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	color: var(--text);
	text-decoration: none;
	font-weight: 700;
	font-size: 1.25rem;
}

.brand svg {
	color: var(--accent);
}

.nav {
	display: flex;
	gap: 1.5rem;
}

.nav a {
	color: var(--text-muted);
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 500;
	transition: color 0.2s;
}

.nav a:hover,
.nav a.active {
	color: var(--text);
}

/* Hero */
.hero {
	max-width: 1200px;
	margin: 0 auto;
	padding: 3rem 1.5rem 2rem;
}

.hero h1 {
	font-size: 2rem;
	font-weight: 700;
	margin-bottom: 0.25rem;
}

.subtitle {
	color: var(--text-muted);
	font-size: 1rem;
	margin-bottom: 1.5rem;
}

.search-wrap {
	position: relative;
	max-width: 480px;
}

.search-icon {
	position: absolute;
	left: 1rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--text-muted);
	pointer-events: none;
}

.search-wrap input {
	width: 100%;
	padding: 0.85rem 1rem 0.85rem 2.8rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	color: var(--text);
	font-size: 0.95rem;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.search-wrap input:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(91, 127, 255, 0.15);
}

.search-wrap input::placeholder {
	color: var(--text-muted);
}

/* Content */
.content {
	flex: 1;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1.5rem 3rem;
}

/* Card grid */
.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 1.25rem;
}

/* Document card */
.doc-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.25rem;
	display: flex;
	gap: 1rem;
	transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.doc-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow);
	border-color: var(--accent);
}

.doc-icon {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.doc-icon.pdf {
	background: rgba(255, 107, 107, 0.12);
	color: var(--red);
}

.doc-icon.img {
	background: rgba(81, 207, 102, 0.12);
	color: var(--green);
}

.doc-icon.other {
	background: rgba(116, 143, 252, 0.12);
	color: var(--blue);
}

.doc-body {
	flex: 1;
	min-width: 0;
}

.doc-title {
	font-size: 1rem;
	font-weight: 600;
	margin-bottom: 0.25rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.doc-desc {
	font-size: 0.85rem;
	color: var(--text-muted);
	margin-bottom: 0.6rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.doc-meta {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-size: 0.78rem;
	color: var(--text-muted);
	margin-bottom: 0.75rem;
}

.badge {
	padding: 0.15rem 0.5rem;
	border-radius: 4px;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.03em;
}

.badge-pdf {
	background: rgba(255, 107, 107, 0.15);
	color: var(--red);
}

.badge-img {
	background: rgba(81, 207, 102, 0.15);
	color: var(--green);
}

.badge-xml {
	background: rgba(116, 143, 252, 0.15);
	color: var(--blue);
}

.meta-date {
	white-space: nowrap;
}

.meta-size {
	white-space: nowrap;
}

/* Download button */
.btn-download {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.5rem 1rem;
	background: var(--accent);
	color: #fff;
	border-radius: 8px;
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.2s;
}

.btn-download:hover {
	background: var(--accent-hover);
}

/* Empty state */
.empty-state {
	text-align: center;
	padding: 4rem 1rem;
	color: var(--text-muted);
}

.empty-state svg {
	margin-bottom: 1rem;
	opacity: 0.5;
}

.empty-state p {
	font-size: 1.1rem;
}

/* Footer */
.footer {
	border-top: 1px solid var(--border);
	padding: 1.5rem;
	text-align: center;
	color: var(--text-muted);
	font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 640px) {
	.nav {
		display: none;
	}

	.hero {
		padding: 2rem 1rem 1.5rem;
	}

	.hero h1 {
		font-size: 1.5rem;
	}

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