* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: hsl(50 20% 98%);
  --fg: hsl(140 20% 15%);
  --card: #fff;
  --primary: hsl(142 70% 35%);
  --primary-light: hsl(142 65% 45%);
  --primary-dark: hsl(142 75% 25%);
  --muted: hsl(50 20% 92%);
  --muted-fg: hsl(140 10% 45%);
  --border: hsl(140 15% 88%);
  --destructive: hsl(0 70% 50%);
  --warning: hsl(45 100% 50%);
  --info: hsl(200 70% 50%);
  --radius: 12px;
  --shadow-sm: 0 2px 8px hsla(140, 70%, 35%, 0.08);
  --shadow-md: 0 4px 16px hsla(140, 70%, 35%, 0.12);
  --shadow-lg: 0 8px 32px hsla(140, 70%, 35%, 0.18);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  background: var(--bg); color: var(--fg);
  font-size: 15px; -webkit-font-smoothing: antialiased;
}
svg.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 252px; flex: none; background: hsl(0 0% 98%);
  border-right: 1px solid hsl(140 15% 90%);
  display: flex; flex-direction: column; padding: 18px 14px 14px;
  gap: 2px; overflow: hidden;
}
.logo { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; }
.logo-mark {
  width: 42px; height: 42px; border-radius: 12px; color: #fff;
  background: linear-gradient(135deg, hsl(142 70% 38%), hsl(142 65% 48%));
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.logo-mark svg { width: 22px; height: 22px; }
.logo b { color: var(--primary); font-size: 17px; letter-spacing: .2px; display: block; }
.logo span { color: var(--muted-fg); font-size: 12.5px; }
.nav-section { color: var(--muted-fg); font-size: 12px; font-weight: 600; padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px;
  border-radius: 9px; color: hsl(140 20% 20%); font-size: 14px; text-decoration: none;
}
.nav-item svg.ic { width: 17px; height: 17px; color: hsl(140 12% 35%); }
.nav-item.active { background: hsl(142 60% 95%); color: var(--primary-dark); font-weight: 600; }
.nav-item.active svg.ic { color: var(--primary); }
.nav-new {
  margin-left: auto; background: var(--primary); color: #fff; font-size: 9.5px;
  font-weight: 700; padding: 2px 7px; border-radius: 99px; letter-spacing: .5px;
}
.nav-bottom { margin-top: auto; border-top: 1px solid hsl(140 15% 90%); padding-top: 10px; }

.main { flex: 1; padding: 34px 44px 44px; min-width: 0; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.page-icon {
  width: 52px; height: 52px; border-radius: 14px; background: hsl(142 55% 93%);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
}
.page-icon svg { width: 26px; height: 26px; }
.page-head h1 { font-size: 27px; font-weight: 700; letter-spacing: -.3px; }
.page-head .sub { color: var(--muted-fg); font-size: 14.5px; margin-top: 2px; }
.page-head .spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer;
  font: inherit; font-weight: 600; border-radius: 11px; padding: 11px 20px; font-size: 14.5px;
}
.btn svg.ic { width: 17px; height: 17px; }
.btn-primary {
  background: linear-gradient(135deg, hsl(142 70% 33%), hsl(142 65% 42%));
  color: #fff; box-shadow: var(--shadow-sm);
}
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--fg); }
.btn-danger { background: #fff; border: 1.5px solid var(--destructive); color: var(--destructive); }
.btn-ghost { background: transparent; color: var(--muted-fg); }
.btn:disabled { opacity: .45; }

/* ---------- Tabs / pills ---------- */
.pills { display: flex; gap: 9px; margin-bottom: 20px; flex-wrap: wrap; }
.pill {
  padding: 8px 17px; border-radius: 99px; background: hsl(50 15% 93%);
  color: hsl(140 15% 30%); font-size: 14px; font-weight: 500; border: none; font-family: inherit;
}
.pill.active { background: var(--primary); color: #fff; font-weight: 600; box-shadow: var(--shadow-sm); }
.pill .count { opacity: .75; font-weight: 400; margin-left: 4px; }

.seg { display: inline-flex; background: hsl(50 15% 93%); border-radius: 12px; padding: 4px; gap: 2px; margin-bottom: 24px; }
.seg button {
  border: none; font: inherit; font-size: 14.5px; font-weight: 500; color: hsl(140 15% 32%);
  padding: 9px 22px; border-radius: 9px; background: transparent; display: flex; gap: 8px; align-items: center;
}
.seg button.active { background: #fff; color: var(--primary-dark); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ---------- Cards ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.stat {
  background: var(--card); border-radius: 14px; padding: 18px 20px; display: flex;
  align-items: center; gap: 14px; box-shadow: var(--shadow-sm); border: 1px solid hsl(140 15% 93%);
}
.stat-ic { width: 42px; height: 42px; border-radius: 99px; display: flex; align-items: center; justify-content: center; }
.stat-ic.green { background: hsl(142 55% 92%); color: var(--primary); }
.stat-ic.amber { background: hsl(45 90% 92%); color: hsl(38 85% 45%); }
.stat-ic.red { background: hsl(0 75% 94%); color: var(--destructive); }
.stat-ic.blue { background: hsl(210 85% 94%); color: hsl(215 75% 50%); }
.stat .lbl { color: var(--muted-fg); font-size: 13.5px; }
.stat .num { font-size: 24px; font-weight: 700; margin-top: 1px; }

.card {
  background: var(--card); border-radius: 14px; border: 1px solid hsl(140 15% 93%);
  box-shadow: var(--shadow-sm);
}

/* ---------- Search ---------- */
.search-row { display: flex; gap: 12px; margin-bottom: 20px; }
.search {
  flex: 1; display: flex; align-items: center; gap: 12px; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; color: var(--fg); font-size: 15px;
}
.search svg { color: var(--muted-fg); }
.search .ph { color: var(--muted-fg); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600; }
.badge svg.ic { width: 12px; height: 12px; }
.badge.blue { background: hsl(215 90% 93%); color: hsl(220 70% 45%); }
.badge.green { background: hsl(142 55% 91%); color: hsl(142 70% 28%); }
.badge.amber { background: hsl(43 95% 90%); color: hsl(35 85% 35%); }
.badge.red { background: hsl(0 80% 94%); color: hsl(0 65% 45%); }
.badge.purple { background: hsl(265 80% 94%); color: hsl(265 55% 48%); }
.badge.gray { background: hsl(50 12% 92%); color: hsl(140 8% 40%); }

/* ---------- List rows ---------- */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 16px; padding: 15px 20px;
  border-bottom: 1px solid hsl(140 15% 94%);
}
.row:last-child { border-bottom: none; }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 650; font-size: 15.5px; }
.row .meta { color: var(--muted-fg); font-size: 13.5px; margin-top: 2px; }
.check { width: 20px; height: 20px; border-radius: 6px; border: 1.6px solid hsl(140 12% 75%); flex: none; background: #fff; }
.check.on { background: var(--primary); border-color: var(--primary); position: relative; }
.check.on::after { content: ""; position: absolute; inset: 4px 5px 6px; border: solid #fff; border-width: 0 0 2.2px 2.2px; transform: rotate(-45deg); }

/* ---------- Fields (detail/form) ---------- */
.field { background: hsl(50 15% 96.5%); border: 1px solid hsl(140 12% 92%); border-radius: 11px; padding: 13px 16px; }
.field .flabel { font-size: 11px; font-weight: 700; letter-spacing: .8px; color: var(--muted-fg); text-transform: uppercase; margin-bottom: 5px; display: flex; align-items: center; gap: 6px; }
.field .fvalue { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field .fvalue .chev { color: var(--muted-fg); }
.field.warn { border: 1.5px solid hsl(43 90% 60%); background: hsl(46 95% 95%); }
.field.autofill { position: relative; }
.tag-val { background: hsl(142 55% 90%); color: hsl(142 70% 26%); font-weight: 700; font-size: 13px; padding: 3px 11px; border-radius: 99px; }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 2px dashed hsl(142 40% 70%); border-radius: 16px; background: hsl(142 50% 97%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 56px 20px; text-align: center;
}
.dropzone svg { width: 44px; height: 44px; color: var(--primary); stroke-width: 1.6; }
.dropzone b { font-size: 17px; }
.dropzone span { color: var(--muted-fg); font-size: 14px; }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: hsla(140 30% 10% / .45); display: flex; align-items: center; justify-content: center; padding: 30px; }
.modal { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; overflow: hidden; }

/* ---------- Public pages ---------- */
.public-body { min-height: 100vh; background: linear-gradient(160deg, hsl(142 45% 96%) 0%, hsl(50 20% 98%) 45%); display: flex; flex-direction: column; align-items: center; }
.public-nav { width: 100%; background: #fff; border-bottom: 1px solid hsl(140 15% 92%); display: flex; align-items: center; justify-content: center; padding: 15px 0; }
.public-card { background: #fff; border-radius: 20px; box-shadow: var(--shadow-md); border: 1px solid hsl(140 15% 93%); width: 100%; }
.input {
  width: 100%; border: 1px solid var(--border); border-radius: 11px; background: #fff;
  padding: 12px 15px; font: inherit; font-size: 15px; color: var(--fg);
}
.input.filled { background: hsl(142 55% 97%); border-color: hsl(142 45% 80%); font-weight: 600; }
.ilabel { font-size: 13px; font-weight: 650; color: hsl(140 15% 30%); margin-bottom: 6px; display: flex; align-items: center; gap: 7px; }
.auto-hint { font-size: 11px; font-weight: 700; color: var(--primary); background: hsl(142 55% 92%); border-radius: 99px; padding: 2px 8px; letter-spacing: .3px; }
.step-num { width: 26px; height: 26px; border-radius: 99px; background: var(--primary); color: #fff; font-size: 13.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
