:root {
  --bg: #f4f1e8;
  --ink: #1c332c;
  --muted: #66746b;
  --line: #e4e1d6;
  --card: #fbfaf6;
  --side: #1e3a32;
  --side-ink: #f4f1e8;
  --green: #1f6b45;
  --green-2: #3d8f62;
  --green-3: #8fbf9b;
  --green-4: #d5e4d4;
  --shadow: 0 10px 30px rgba(24, 47, 37, 0.06);
  --sans: "DM Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app { display: flex; min-height: 100%; }

.side {
  width: 232px;
  flex: none;
  background: var(--side);
  color: var(--side-ink);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 18px;
}
.brand svg { width: 28px; height: 28px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #e7efe8;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
}
.nav button svg { width: 18px; height: 18px; opacity: 0.9; }
.nav button.active { background: #f4f1e8; color: var(--side); }
.side-foot { margin-top: auto; padding: 12px; font-size: 13px; }
.side-foot span { display: block; opacity: 0.65; font-size: 12px; }

.main { flex: 1; min-width: 0; padding: 28px 32px 48px; }
.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.kicker { margin: 0; color: var(--muted); font-size: 13px; }
h1 { margin: 4px 0 0; font-size: 32px; letter-spacing: -0.04em; font-weight: 650; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  color: var(--muted);
  box-shadow: var(--shadow);
}
.view { display: none; }
.view.active { display: block; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 0.9fr; gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 18px 14px;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0; font-size: 16px; font-weight: 650; }
.card .sub { margin: 2px 0 14px; color: var(--muted); font-size: 12px; }
.metric { font-size: 34px; font-weight: 650; letter-spacing: -0.04em; }
.up { color: var(--green); font-size: 13px; font-weight: 600; }

.donut-row { display: flex; align-items: center; gap: 18px; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  margin-right: 8px;
}
.legend b { float: right; margin-left: 18px; font-weight: 550; }

.table-card { margin-top: 16px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 550; padding: 10px 8px; }
td { padding: 12px 8px; border-top: 1px solid var(--line); }
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e7f3ea;
  color: #1d5c38;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}
.status.packed { background: #eef6e6; }
.status.shipped { background: #e5f0ea; }
.status.transit { background: #e7f0e4; }
.dot { width: 7px; height: 7px; border-radius: 99px; background: var(--green-2); }

.toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.toolbar input, .toolbar select {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.toolbar input { flex: 1; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.stat strong { display: block; font-size: 28px; letter-spacing: -0.04em; }
.stat span { color: var(--muted); font-size: 13px; }

.track { display: grid; grid-template-columns: 280px 1fr 280px; gap: 16px; }
.steps { display: grid; gap: 18px; margin: 8px 0 0; }
.step { display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.step .mark {
  width: 28px; height: 28px; border-radius: 99px;
  background: var(--side); color: white;
  display: grid; place-items: center; font-size: 13px;
}
.step small { color: var(--muted); }
.map {
  height: 220px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 30% 40%, #d7e6cf 0 8px, transparent 9px),
    radial-gradient(circle at 55% 58%, #d7e6cf 0 8px, transparent 9px),
    radial-gradient(circle at 74% 72%, #d7e6cf 0 8px, transparent 9px),
    linear-gradient(#edf3ea, #f7f6f1);
  border: 1px solid var(--line);
  position: relative;
}
.map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.label {
  border: 1px dashed #cfcab8;
  border-radius: 12px;
  padding: 16px;
  background: #f7f4ea;
}
.bars { display: grid; gap: 8px; margin: 16px 0; }
.bars i { display: block; height: 8px; border-radius: 99px; background: #d9d3c4; }
.bars i:nth-child(1) { width: 70%; }
.bars i:nth-child(2) { width: 92%; }
.bars i:nth-child(3) { width: 48%; }
.barcode { font-family: ui-monospace, monospace; letter-spacing: 0.18em; font-size: 18px; }

.row-btn {
  border: 0;
  background: transparent;
  padding: 0;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.empty { color: var(--muted); padding: 20px 8px; }

.side-foot { border: 0; background: transparent; color: inherit; text-align: left; border-radius: 12px; }
.side-foot:hover { background: rgba(255,255,255,.08); }
.login {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card { width: min(420px, 100%); }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.form input, .form select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
}
.primary {
  border: 0;
  background: var(--side);
  color: var(--side-ink);
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 650;
}
.ghost {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 10px 14px;
}
.note { color: var(--muted); font-size: 13px; }
dialog {
  width: min(440px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: var(--card);
  color: var(--ink);
}
dialog::backdrop { background: rgba(28, 51, 44, 0.35); }
.bone {
  display: inline-block;
  height: 14px;
  border-radius: 8px;
  vertical-align: middle;
  background: linear-gradient(90deg, #ece8dc 25%, #f7f5ee 37%, #ece8dc 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease infinite;
}
.bone.w24 { width: 64px; }
.bone.w40 { width: 42%; }
.bone.w60 { width: 68%; }
.bone.pill { width: 92px; height: 28px; border-radius: 999px; }
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bone { animation: none; }
}
.error { color: #8a3b32; font-size: 13px; min-height: 1.2em; }
.ok { color: var(--green); font-size: 13px; min-height: 1.2em; }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; }
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.avatar {
  width: 56px; height: 56px; border-radius: 18px;
  background: var(--side); color: var(--side-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 18px;
}
@media (max-width: 980px) {
  .app { display: block; }
  .side { width: auto; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { display: none; }
  .grid-2, .track, .stats, .split { grid-template-columns: 1fr; }
  .main { padding: 20px 16px 40px; }
}
body.locked .app { display: none; }
body:not(.locked) .login { display: none; }
