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

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	background: #eef2f7;
	color: #1f2937;
}

.hidden { display: none !important; }

.login-wrap {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 20px;
}

.login-card {
	width: min(420px, 100%);
	background: #fff;
	border-radius: 14px;
	padding: 28px;
	box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.login-card h2 {
	margin-bottom: 16px;
	color: #3b52d9;
}

.field { margin-bottom: 14px; }

label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 13px;
	color: #334155;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="tel"],
textarea,
select {
	width: 100%;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
	background: #fff;
}

textarea { min-height: 90px; resize: vertical; }

.btn {
	border: none;
	border-radius: 8px;
	padding: 10px 14px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.btn.primary { background: #3b52d9; color: white; }
.btn.primary:hover { background: #2f44c4; }
.btn.ghost { background: #e2e8f0; color: #1f2937; }
.btn.ghost:hover { background: #cbd5e1; }
.btn.danger { background: #dc2626; color: white; }
.btn.danger:hover { background: #b91c1c; }

.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
	background: linear-gradient(120deg, #3b52d9 0%, #6c48c5 100%);
	color: white;
	padding: 16px 18px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.topbar h1 { font-size: 20px; margin-bottom: 4px; }
.topbar p { opacity: 0.9; font-size: 13px; }

.alert {
	margin: 12px 18px 0;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 13px;
}

.alert.success { background: #dcfce7; color: #166534; }
.alert.error { background: #fee2e2; color: #991b1b; }

.workspace {
	display: grid;
	grid-template-columns: 420px 1fr;
	gap: 14px;
	padding: 14px;
	min-height: calc(100vh - 84px);
}

.sidebar {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.sidebar-head {
	padding: 12px;
	border-bottom: 1px solid #e2e8f0;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.section-nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	padding: 12px;
	border-bottom: 1px solid #e2e8f0;
}

.section-btn {
	border: 1px solid #cbd5e1;
	background: #f8fafc;
	color: #1f2937;
	border-radius: 8px;
	padding: 8px 10px;
	text-align: left;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.section-btn.active {
	background: #3b52d9;
	color: white;
	border-color: #3b52d9;
}

.panels {
	padding: 12px;
	overflow: auto;
	min-height: 0;
}

.panel { display: none; }
.panel.active { display: block; }

.panel h3 {
	margin-bottom: 10px;
	font-size: 16px;
	color: #0f172a;
}

.panel-note {
	font-size: 12px;
	color: #64748b;
	margin-bottom: 12px;
}

.stack { display: grid; gap: 10px; }

.list {
	display: grid;
	gap: 10px;
	margin-top: 10px;
}

.item {
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}

.item img { width: 100%; height: 150px; object-fit: cover; display: block; }
.item-body { padding: 10px; }
.item-title { font-weight: 700; margin-bottom: 4px; }
.item-sub { font-size: 12px; color: #475569; margin-bottom: 8px; }

.preview-wrap {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.preview-toolbar {
	border-bottom: 1px solid #e2e8f0;
	padding: 10px 12px;
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.preview-toolbar .hint {
	font-size: 12px;
	color: #64748b;
	margin-left: auto;
}

iframe {
	width: 100%;
	height: 100%;
	border: none;
	background: white;
}

.preview-frame { flex: 1; min-height: 0; }

@media (max-width: 1100px) {
	.workspace { grid-template-columns: 1fr; }
	.sidebar { max-height: 55vh; }
	.preview-wrap { min-height: 45vh; }
}
