:root {
	color-scheme: light;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	background: #f5f3ee;
	color: #16120f;
}

* { box-sizing: border-box; }
body { margin: 0; background: #f5f3ee; color: #16120f; }
a { color: inherit; }

.topbar {
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: 0;
	background: #16120f;
	color: white;
}

.topbar-main { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; padding: 18px 28px 14px; }
.topbar-main form { margin: 0; }
.topbar span { display: block; color: #cfc7bc; font-size: 13px; margin-top: 2px; }
.topnav { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; padding: 0 28px 18px; border-top: 1px solid rgb(255 255 255 / 10%); }
.topnav a { color: #f7efe4; text-decoration: none; font-weight: 900; padding: 11px 16px; border-radius: 12px; background: rgb(255 255 255 / 9%); margin-top: 12px; }
.topnav a:hover { background: rgb(247 215 116 / 22%); }
.page { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }

.hero {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 18px;
	padding: 28px;
	border-radius: 18px;
	background: linear-gradient(135deg, #fff 0%, #f7d774 100%);
	border: 1px solid #ead49a;
	box-shadow: 0 14px 30px rgb(22 18 15 / 8%);
}

.hero h1 { margin: 0 0 8px; font-size: clamp(30px, 5vw, 54px); letter-spacing: -0.04em; }
.hero p { margin: 0; max-width: 680px; color: #4e453a; line-height: 1.5; }
.eyebrow { margin: 0 0 8px; color: #8a5a00; text-transform: uppercase; font-size: 12px; font-weight: 800; letter-spacing: 0.12em; }

.metric-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 18px 0; }
.metric, .card {
	background: #fff;
	border: 1px solid #e5ded3;
	border-radius: 14px;
	box-shadow: 0 8px 22px rgb(22 18 15 / 5%);
}
.metric { padding: 16px; }
.metric span { display: block; color: #766b5f; font-size: 13px; margin-bottom: 6px; }
.metric strong { font-size: 26px; letter-spacing: -0.03em; }
.metric.warning { border-color: #f2c94c; background: #fff9dc; }

.grid-2 { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 18px; }
.product-layout { grid-template-columns: 0.85fr 1.35fr; align-items: start; }
.card { padding: 22px; }
.card h2 { margin: 0 0 14px; }
.card-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.card-header.stacked { flex-direction: column; }
.muted { color: #6f665c; line-height: 1.5; }
.pill { display: inline-flex; border-radius: 999px; padding: 3px 8px; background: #f3f4f6; color: #374151; font-size: 12px; font-weight: 800; }
.checklist { padding-left: 18px; color: #4e453a; line-height: 1.8; }

.section-title { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 18px; }
.section-title h1 { margin: 0 0 8px; font-size: clamp(30px, 4vw, 48px); letter-spacing: -0.04em; }
.section-title p { margin: 0; color: #6f665c; max-width: 760px; line-height: 1.5; }
.section-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.section-actions form { margin: 0; }
.page-notice { margin: -6px 0 18px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid #eee7dc; text-align: left; font-size: 14px; }
th { color: #766b5f; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.table-wrap { overflow-x: auto; }
tr.inactive { opacity: 0.62; }
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-actions form { margin: 0; }

button, .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 10px;
	padding: 11px 16px;
	background: #16120f;
	color: white;
	font-weight: 800;
	text-decoration: none;
	cursor: pointer;
}
.ghost { background: rgb(255 255 255 / 12%); border: 1px solid rgb(255 255 255 / 20%); }
.secondary { background: white; color: #16120f; border: 1px solid #d8cfc3; }
.small { padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); background: white; border: 1px solid #e5ded3; border-radius: 20px; padding: 30px; box-shadow: 0 18px 50px rgb(22 18 15 / 12%); }
.login-card h1 { margin: 0 0 8px; font-size: 34px; letter-spacing: -0.04em; }
.form-grid { display: grid; gap: 10px; margin-top: 22px; }
.form-grid.compact { margin-top: 0; gap: 12px; }
.inline-grid { display: grid; gap: 10px; }
.inline-grid.two { grid-template-columns: repeat(2, 1fr); }
.inline-grid.three { grid-template-columns: repeat(3, 1fr); }
.inline-grid.four { grid-template-columns: repeat(4, 1fr); }
.search-form { display: flex; gap: 8px; min-width: min(360px, 100%); }
label { font-weight: 800; font-size: 14px; }
input, select { width: 100%; border: 1px solid #d8cfc3; border-radius: 10px; padding: 12px; font: inherit; background: #fff; }
.checkbox-row { display: inline-flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.alert { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; border-radius: 10px; padding: 12px; margin-top: 16px; }
.notice { background: #ecfdf5; border: 1px solid #bbf7d0; color: #166534; border-radius: 10px; padding: 12px; }
.warning-box { background: #fff7d6; border: 1px solid #f2d46b; color: #7c4a00; border-radius: 10px; padding: 10px; margin-top: 12px; font-weight: 800; }

.products-title { align-items: center; }
.product-editor { padding: 0; margin-bottom: 18px; overflow: hidden; }
.product-editor > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; cursor: pointer; list-style: none; background: linear-gradient(135deg, #fff7d6 0%, #fff 72%); }
.product-editor > summary::-webkit-details-marker { display: none; }
.product-editor summary strong { display: block; font-size: 20px; letter-spacing: -0.03em; }
.product-editor summary small { display: block; margin-top: 4px; color: #6f665c; line-height: 1.4; }
.summary-action { flex: 0 0 auto; border-radius: 999px; padding: 7px 11px; background: #16120f; color: #fff; font-size: 12px; font-weight: 900; }
.product-form-card { padding: 0; overflow: hidden; border-top: 1px solid #eee2be; }
.product-form-card.editing-mode { border-color: #d69e00; box-shadow: 0 12px 32px rgb(138 90 0 / 14%); }
.form-heading { padding: 22px; background: linear-gradient(135deg, #fff7d6 0%, #fff 72%); border-bottom: 1px solid #eee2be; }
.form-heading h2 { margin: 0 0 8px; letter-spacing: -0.03em; }
.form-heading p, .form-section p { margin: 0; color: #6f665c; line-height: 1.5; }
.editing-banner { display: inline-flex; margin: 0 0 10px; border-radius: 999px; padding: 6px 10px; background: #16120f; color: #fff; font-size: 13px; font-weight: 900; }
.guided-form { margin: 0; gap: 0; }
.form-section { display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding: 20px 22px; border-bottom: 1px solid #eee7dc; }
.form-section h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -0.02em; }
.form-section label { display: block; margin: 14px 0 6px; }
.step-label { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: #16120f; color: white; font-weight: 900; font-size: 13px; }
.field-hint { margin-top: 8px !important; font-size: 13px; }
.sticky-actions { padding: 18px 22px; margin: 0; background: #fbfaf7; }
.sync-listing-form { display: grid; gap: 8px; padding: 0 22px 20px; margin: -4px 0 0; background: #fbfaf7; }

.product-list-card { min-width: 0; }
.product-catalog-card { padding: 22px; }
.product-list-header { align-items: center; }
.product-list-header h2 { margin-bottom: 0; }
.product-cards { display: grid; gap: 12px; }
.product-card { border: 1px solid #eee2d4; border-radius: 14px; padding: 16px; background: #fffdf9; }
.product-card.selected { border-color: #d69e00; background: #fff8dc; }
.product-card.inactive { opacity: 0.62; }
.product-card-main { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.product-card-main strong { display: inline-flex; margin-bottom: 6px; border-radius: 999px; padding: 4px 9px; background: #16120f; color: #fff; font-size: 12px; letter-spacing: 0.04em; }
.product-card h3 { margin: 0 0 4px; font-size: 18px; letter-spacing: -0.02em; }
.product-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.product-facts div { border-radius: 10px; background: #f6f1e8; padding: 10px; }
.product-facts span { display: block; color: #766b5f; font-size: 12px; font-weight: 800; margin-bottom: 4px; }
.product-facts strong { font-size: 14px; }
.product-dimensions { font-size: 14px; margin-bottom: 12px; }
.catalog-grid { gap: 14px; }
.catalog-product { display: grid; grid-template-columns: 142px 1fr; gap: 16px; padding: 14px; align-items: stretch; }
.product-cover { min-height: 142px; border-radius: 14px; overflow: hidden; background: #f6f1e8; border: 1px solid #eee2d4; display: grid; place-items: center; }
.product-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: #8a7d6e; font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.product-info { min-width: 0; display: grid; gap: 12px; }
.catalog-main { align-items: start; }
.product-code-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 7px; }
.product-code-row strong { display: inline-flex; border-radius: 999px; padding: 5px 10px; background: #16120f; color: #fff; font-size: 12px; letter-spacing: 0.04em; }
.product-subtitle { font-size: 13px; }
.pill.ok { background: #dcfce7; color: #166534; }
.pill.warning { background: #fef3c7; color: #92400e; }
.pill.danger { background: #fee2e2; color: #991b1b; }
.catalog-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.catalog-facts div { padding: 9px; }
.package-line { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.package-line.ready { background: #ecfdf5; color: #14532d; }
.package-line.missing { background: #fff7d6; color: #7c4a00; }
.listing-details { border-radius: 12px; background: #f9f4eb; border: 1px solid #eee2d4; }
.listing-details summary { cursor: pointer; padding: 10px 12px; font-weight: 900; color: #5f5449; }
.listing-links { display: grid; gap: 6px; margin: 0 0 12px; border-radius: 12px; background: #f9f4eb; padding: 10px; }
.listing-links > span { color: #766b5f; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.05em; }
.listing-link-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; border-top: 1px solid #eee2d4; padding-top: 6px; }
.listing-link-row:first-of-type { border-top: 0; padding-top: 0; }
.listing-link-row strong { font-size: 13px; }
.listing-link-row small { color: #6f665c; text-align: right; }
.empty-state { border: 1px dashed #d8cfc3; border-radius: 14px; padding: 24px; background: #fffdf9; }
.empty-state h3 { margin: 0 0 8px; }
.empty-state p { margin: 0; }

.import-card { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: end; margin-bottom: 18px; }
.import-card h2 { margin: 0 0 8px; }
.import-card .notice { grid-column: 1 / -1; }
.import-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.orders-card { display: grid; gap: 14px; }
.order-list { display: grid; gap: 14px; }
.order-card { border: 1px solid #eee2d4; border-radius: 14px; padding: 16px; background: #fffdf9; }
.order-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.order-head strong { font-size: 18px; letter-spacing: -0.02em; }
.order-facts { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.order-foot { margin-top: 12px; font-size: 14px; }
.payload-layout { grid-template-columns: 1fr 1fr; align-items: start; }
.payload-box { overflow: auto; max-height: 70vh; border-radius: 12px; background: #16120f; color: #f7efe4; padding: 16px; font-size: 13px; line-height: 1.45; }
.compact-payload { max-height: 360px; }
.payload-items-card { margin-top: 18px; }
.payload-items { display: grid; gap: 14px; }
.payload-items h3 { margin: 0 0 8px; }

@media (max-width: 900px) {
	.hero, .topbar { align-items: flex-start; flex-direction: column; }
	.metric-grid, .grid-2, .product-layout, .inline-grid.two, .inline-grid.three, .inline-grid.four, .product-facts, .import-card, .order-facts, .payload-layout { grid-template-columns: 1fr; }
	.card-header, .search-form { flex-direction: column; align-items: stretch; }
	.form-section { grid-template-columns: 1fr; }
	.catalog-product { grid-template-columns: 96px 1fr; gap: 12px; }
	.product-cover { min-height: 96px; }
	.catalog-facts { grid-template-columns: repeat(2, 1fr); }
	.catalog-main { flex-direction: column; }
	.import-form { align-items: stretch; flex-direction: column; }
	.topbar-main { align-items: stretch; flex-direction: column; }
	.topbar-main button { width: 100%; }
	.topnav { align-items: stretch; flex-direction: column; width: 100%; }
}

@media (max-width: 560px) {
	.catalog-product { grid-template-columns: 1fr; }
	.product-cover { min-height: 210px; }
	.product-editor > summary { align-items: flex-start; flex-direction: column; }
	.catalog-facts { grid-template-columns: 1fr; }
}
