@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/figtree-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/figtree-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --forest: #0b3d36;
  --forest-deep: #072924;
  --palm: #1f8a62;
  --palm-bright: #2aad78;
  --gold: #d4a017;
  --sand: #f3ebe0;
  --sand-deep: #e5d8c4;
  --ink: #14241f;
  --muted: #5a6b64;
  --line: rgba(11, 61, 54, 0.12);
  --surface: #fffcf7;
  --danger: #b3261e;
  --warn: #b86a0d;
  --ok: #1f8a62;
  --sidebar: #0b3d36;
  --sidebar-text: rgba(255, 252, 247, 0.78);
  --sidebar-active: #ffffff;
  --font: "Figtree", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --space: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: #f6f2ea;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--palm); text-decoration: none; }
button, input, select, textarea { font: inherit; }

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 0% 0%, rgba(45, 173, 120, 0.16), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 0%, rgba(212, 160, 23, 0.12), transparent 50%),
    linear-gradient(165deg, #f7f1e7 0%, #efe8db 100%);
}

/* ── Login ─────────────────────────────────────────────────────────────── */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: calc(var(--space) * 3);
}

.login-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: calc(var(--space) * 4);
  box-shadow: 0 12px 40px rgba(7, 41, 36, 0.08);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: calc(var(--space) * 3);
}

.login-brand img { width: 36px; height: 36px; }
.login-brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.login-brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.field { margin-bottom: calc(var(--space) * 2); }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.field input:focus {
  outline: 2px solid rgba(31, 138, 98, 0.35);
  border-color: var(--palm);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 4px;
  background: var(--forest);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms var(--ease);
}
.btn:hover { background: var(--forest-deep); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: rgba(11, 61, 54, 0.04); }

.error-banner {
  margin-bottom: calc(var(--space) * 2);
  padding: 10px 12px;
  border-radius: 4px;
  background: rgba(179, 38, 30, 0.08);
  color: var(--danger);
  font-size: 13px;
}

/* ── Shell ─────────────────────────────────────────────────────────────── */

.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  grid-template-rows: 52px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.topbar-brand img { width: 26px; height: 26px; }

.command-search {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  cursor: text;
  font-size: 13px;
}
.command-search kbd {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #f6f2ea;
  color: var(--muted);
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}
.avatar-chip:hover { border-color: var(--line); background: #fff; }
.avatar-chip .dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}
.avatar-meta { text-align: left; line-height: 1.2; }
.avatar-meta strong { display: block; font-size: 12px; }
.avatar-meta span { font-size: 11px; color: var(--muted); }

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 12px 10px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
}

.nav-section {
  margin-top: 14px;
}
.nav-section:first-child { margin-top: 4px; }
.nav-section-label {
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 252, 247, 0.42);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 4px;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-link.active {
  background: rgba(42, 173, 120, 0.28);
  color: var(--sidebar-active);
  font-weight: 600;
}

.main {
  padding: 20px 24px 40px;
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.page-head h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.page-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 14px;
}
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .value {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.kpi .delta { margin-top: 2px; font-size: 12px; color: var(--palm); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.panel h2 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}

.attention-list { list-style: none; margin: 0; padding: 0; }
.attention-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.attention-list li:first-child { border-top: 0; }
.dot-pri {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-pri.high { background: var(--danger); }
.dot-pri.med { background: #c47a12; }
.dot-pri.low { background: var(--gold); }

.table-wrap { overflow: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th,
table.data td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}
table.data tr:hover td { background: rgba(11, 61, 54, 0.03); }

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(11, 61, 54, 0.08);
  color: var(--forest);
}
.badge.ok { background: rgba(31, 138, 98, 0.12); color: var(--ok); }
.badge.warn { background: rgba(196, 122, 18, 0.14); color: #8a5508; }
.badge.danger { background: rgba(179, 38, 30, 0.1); color: var(--danger); }

.empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* ── Command palette ───────────────────────────────────────────────────── */

.palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 41, 36, 0.42);
  z-index: 100;
  display: grid;
  place-items: start center;
  padding-top: 12vh;
  animation: fadeIn 120ms var(--ease);
}
.palette {
  width: min(560px, calc(100vw - 24px));
  background: #fff;
  border-radius: 6px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 64px rgba(7, 41, 36, 0.22);
  overflow: hidden;
}
.palette input {
  width: 100%;
  height: 48px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  font-size: 15px;
  outline: none;
}
.palette-results {
  max-height: 360px;
  overflow: auto;
  padding: 8px;
}
.palette-group {
  margin-bottom: 8px;
}
.palette-group h3 {
  margin: 0;
  padding: 6px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.palette-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
}
.palette-item:hover,
.palette-item.active { background: rgba(31, 138, 98, 0.1); }
.palette-item strong { font-size: 13px; }
.palette-item span { font-size: 12px; color: var(--muted); }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.work-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px;
  background: #fff;
}
.work-card .n {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.work-card .t { color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 2px; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.coming-soon {
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 252, 247, 0.6);
}

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}
.filters-bar input,
.filters-bar select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  min-width: 140px;
}
.filters-bar .chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.sort-btn.active-sort {
  border-color: var(--palm);
  color: var(--forest);
  font-weight: 700;
}
.click-row { cursor: pointer; }
.listing-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 3px;
  background: #eee;
  flex-shrink: 0;
}
.thumb.placeholder {
  border: 1px solid var(--line);
}
.danger-text { color: var(--danger); font-weight: 700; }

.inspect-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
  min-height: calc(100vh - 120px);
}
.inspect-preview,
.inspect-controls {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px;
}
.inspect-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.inspect-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.inspect-gallery img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 3px;
  background: #eee;
}
.empty-gallery {
  place-items: center;
  min-height: 120px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 4px;
  display: grid;
}
.inspect-preview h1 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.inspect-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}
.inspect-meta strong {
  color: var(--forest);
  font-size: 18px;
}
.inspect-body {
  white-space: pre-wrap;
  font-size: 14px;
  margin: 0 0 16px;
}
.inspect-dl .dl-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.inspect-dl dt { color: var(--muted); }
.inspect-dl dd { margin: 0; }
.inspect-controls h2 {
  margin: 18px 0 8px;
  font-size: 14px;
}
.inspect-controls h2:first-child { margin-top: 0; }
.mod-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.reason-box {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  resize: vertical;
  margin-bottom: 10px;
}
.btn-warn { background: #8a5508; color: #fff; }
.btn-warn:hover { background: #6e4306; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1c16; }
.risk-score {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}
.risk-score.high { color: var(--danger); }
.risk-score.medium { color: #8a5508; }
.risk-score.low { color: var(--ok); }
.risk-block ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
}
.seller-block { font-size: 13px; }
.report-list, .notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}
.report-list li, .note {
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.flash {
  padding: 8px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
  font-size: 13px;
}
.ok-flash { background: rgba(31, 138, 98, 0.12); color: var(--ok); }
.err-flash { background: rgba(179, 38, 30, 0.1); color: var(--danger); }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.detail-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.detail-value { margin-top: 2px; font-weight: 600; }
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.action-row input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.pager {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.linkish {
  color: var(--palm);
  cursor: pointer;
  font-weight: 600;
}
.package-card + .package-card { margin-top: 0; }
.package-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.package-head h2 { margin: 0; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.form-grid .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.form-grid .field input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font-weight: 500;
  color: var(--ink);
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}
.form-grid .field select,
.setting-row .field input,
.setting-row .field select,
.row-actions select,
td select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font-weight: 500;
  color: var(--ink);
  font: inherit;
}
.setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.setting-row:last-of-type { border-bottom: 0; }
.setting-meta strong { display: block; font-size: 14px; color: var(--ink); }
.setting-meta p { margin: 4px 0 0; font-size: 13px; }
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.data-table tr.clickable:hover { background: rgba(11, 61, 54, 0.04); cursor: pointer; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.chip {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  background: #fff;
}
.bar-list { display: flex; flex-direction: column; gap: 8px; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(100px, 160px) 1fr 48px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.bar-label { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track {
  height: 8px;
  background: rgba(11, 61, 54, 0.08);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--palm);
  border-radius: 99px;
}
.bar-count { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.support-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.4fr);
  gap: 14px;
  align-items: start;
}
.support-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  width: 100%;
  text-align: left;
  padding: 10px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}
.support-item .muted { grid-column: 1 / -1; font-size: 12px; }
.support-item.active {
  border-color: var(--palm);
  background: rgba(31, 138, 98, 0.06);
}
.support-messages {
  max-height: 420px;
  overflow: auto;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.support-msg {
  padding: 8px 10px;
  border-radius: 4px;
  max-width: 85%;
  background: rgba(11, 61, 54, 0.06);
}
.support-msg.staff {
  align-self: flex-end;
  background: rgba(31, 138, 98, 0.12);
}
.support-msg .muted { display: block; margin-top: 4px; font-size: 11px; }
.kyc-images {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
}
.kyc-thumb {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #eee;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: 52px auto minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
  }
  .sidebar {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px;
    min-height: 0;
  }
  .nav-section { display: flex; gap: 4px; margin: 0; }
  .nav-section-label { display: none; }
  .nav-link { white-space: nowrap; }
  .avatar-meta { display: none; }
  .inspect-shell { grid-template-columns: 1fr; }
  .support-layout { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr; }
  .setting-row { grid-template-columns: 1fr; }
}
