:root {
	--ink: #191b1f;
	--muted: #666f7c;
	--line: #d7dce3;
	--surface: #ffffff;
	--page: #f5f6f8;
	--brand: #e4262f;
	--brand-dark: #111111;
	--brand-soft: #fff1f2;
	--accent: #198754;
	--danger: #b42318;
	--warning: #b54708;
	--shadow: 0 16px 34px rgba(20, 24, 31, .08);
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background:
		linear-gradient(180deg, rgba(255,255,255,.82), rgba(245,246,248,.96) 220px),
		var(--page);
	color: var(--ink);
	font-family: Arial, Helvetica, sans-serif;
	font-size: 15px;
	line-height: 1.45;
}

a { color: inherit; }

.app-header {
	background: #111;
	color: #fff;
	padding: 14px 24px;
	position: sticky;
	top: 0;
	z-index: 10;
	box-shadow: 0 12px 28px rgba(0, 0, 0, .16);
}

.app-header__inner {
	align-items: center;
	display: flex;
	gap: 16px;
	justify-content: space-between;
	margin: 0 auto;
	max-width: 1180px;
}

.brand-lockup {
	align-items: center;
	display: flex;
	gap: 14px;
	min-width: 240px;
}

.brand-logo {
	background: #fff;
	border: 2px solid rgba(255,255,255,.75);
	border-radius: 10px;
	height: 58px;
	object-fit: cover;
	width: 58px;
}

.brand { color: #fff; font-size: 20px; font-weight: 800; letter-spacing: .2px; }
.header-meta { color: #d8dde5; font-size: 13px; }
.header-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.shell {
	display: grid;
	gap: 20px;
	grid-template-columns: minmax(0, 1fr) 380px;
	margin: 0 auto;
	max-width: 1180px;
	padding: 26px 24px;
}

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

.panel {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 8px;
	box-shadow: var(--shadow);
}

.panel__head {
	align-items: center;
	background: linear-gradient(180deg, #fff, #fafbfc);
	border-bottom: 1px solid var(--line);
	border-radius: 8px 8px 0 0;
	display: flex;
	gap: 14px;
	justify-content: space-between;
	padding: 18px 20px;
}

.panel__title {
	font-size: 21px;
	font-weight: 800;
	margin: 0;
}

.panel__body { padding: 20px; }

.grid {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }

label {
	color: #344054;
	font-size: 13px;
	font-weight: 700;
}

input,
select,
textarea {
	background: #fff;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	color: var(--ink);
	font: inherit;
	min-height: 42px;
	padding: 10px 12px;
	width: 100%;
}

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

input:focus,
select:focus,
textarea:focus {
	border-color: var(--brand);
	box-shadow: 0 0 0 3px rgba(228, 38, 47, .14);
	outline: none;
}

.btn,
.icon-btn {
	align-items: center;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
	display: inline-flex;
	font-weight: 700;
	gap: 8px;
	justify-content: center;
	min-height: 42px;
	padding: 10px 14px;
	text-decoration: none;
}

.btn { background: var(--brand); color: #fff; }
.btn:hover { filter: brightness(.96); }
.btn--secondary { background: #f1f3f6; color: #24272d; border: 1px solid #d9dee7; }
.btn--success { background: var(--accent); color: #fff; }
.btn--danger { background: #fee2e2; color: #991b1b; }
.btn--ghost { background: transparent; color: var(--brand-dark); }

.icon-btn {
	background: #fee2e2;
	color: #991b1b;
	font-size: 20px;
	padding: 0;
}

.form-actions {
	align-items: center;
	border-top: 1px solid var(--line);
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: flex-end;
	margin-top: 20px;
	padding-top: 18px;
}

.help,
.meta { color: var(--muted); font-size: 12px; }

.alert {
	border-radius: 8px;
	margin-bottom: 16px;
	padding: 12px 14px;
}

.alert--success { background: #dcfce7; color: #166534; }
.alert--error { background: #ffedd5; color: #9a3412; }
.errors { color: var(--danger); margin-bottom: 14px; }

.list { display: grid; gap: 12px; }

.item-card {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 8px;
	display: grid;
	gap: 9px;
	padding: 14px;
}

.item-card:hover {
	border-color: #c8ced8;
	box-shadow: 0 10px 20px rgba(20, 24, 31, .05);
}

.item-card__head {
	align-items: flex-start;
	display: flex;
	gap: 12px;
	justify-content: space-between;
}

.item-card strong { display: block; font-size: 15px; }
.item-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.status {
	background: var(--brand-soft);
	border-radius: 999px;
	color: #af1f27;
	display: inline-block;
	font-size: 12px;
	font-weight: 700;
	padding: 4px 9px;
}

.status--active { background: #dcfce7; color: #166534; }
.status--inactive { background: #f2f4f7; color: #475467; }
.status--warning { background: #fef3c7; color: #92400e; }

.products,
.route-orders { display: grid; gap: 10px; }

.product-row {
	display: grid;
	gap: 10px;
	grid-template-columns: minmax(0, 1fr) 120px 42px;
}

.checkline {
	align-items: center;
	display: flex;
	gap: 10px;
	min-height: 42px;
}

.checkline input {
	height: 18px;
	min-height: 18px;
	width: 18px;
}

.map-preview {
	background: #f1f3f6;
	border: 1px solid var(--line);
	border-radius: 8px;
	min-height: 260px;
	overflow: hidden;
}

.map-preview iframe {
	border: 0;
	display: block;
	height: 260px;
	width: 100%;
}

.map-empty {
	align-items: center;
	color: var(--muted);
	display: flex;
	height: 260px;
	justify-content: center;
	padding: 20px;
	text-align: center;
}

.route-grid {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.route-orders {
	list-style: none;
	margin: 0;
	padding: 0;
}

.route-order-item { cursor: grab; }
.route-order-item.dragging { opacity: .55; }
.drag-handle {
	align-items: center;
	background: #eef2f7;
	border-radius: 8px;
	color: var(--brand-dark);
	cursor: grab;
	display: inline-flex;
	font-size: 18px;
	height: 32px;
	justify-content: center;
	width: 32px;
}

.table-like { display: grid; gap: 10px; }

@media (max-width: 900px) {
	.shell,
	.route-grid { grid-template-columns: 1fr; }
	.shell { padding: 16px; }
}

@media (max-width: 640px) {
	.app-header__inner,
	.form-actions,
	.item-card__head { align-items: stretch; flex-direction: column; }
	.brand-lockup { min-width: 0; }
	.brand-logo { height: 52px; width: 52px; }
	.grid,
	.grid--three,
	.product-row { grid-template-columns: 1fr; }
	.icon-btn { width: 100%; }
}
