:root {
  --bg: #f3f6f7;
  --panel: #ffffff;
  --panel-soft: #f6f8f9;
  --line: #d5dde0;
  --line-strong: #aebdc2;
  --text: #101820;
  --muted: #607078;
  --muted-2: #8b9aa1;
  --green: #0f766e;
  --green-dark: #0b3f3b;
  --green-2: #e2f2ef;
  --gold: #d99a24;
  --steel: #223847;
  --ink: #0b1419;
  --copper: #c8752b;
  --amber: #b77900;
  --amber-2: #fff2d6;
  --red: #b4232e;
  --blue: #075fb8;
  --shadow: 0 18px 52px rgba(19, 34, 42, 0.13);
  --shadow-soft: 0 1px 2px rgba(12, 18, 15, 0.06), 0 16px 38px rgba(23, 39, 47, 0.08);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% -18%, rgba(15, 118, 110, 0.18), transparent 34%),
    linear-gradient(180deg, #f6f8f9 0, #edf2f3 360px, #ffffff 880px);
  color: var(--text);
  font-size: 15px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell.public-shell {
  grid-template-columns: minmax(0, 1fr);
}

.sidebar {
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(0, 107, 70, 0.06), rgba(255, 255, 255, 0) 170px),
    #fbfcfb;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 72px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  font-size: 22px;
  font-weight: 850;
  letter-spacing: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  font-size: 19px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 10px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 9px 16px rgba(0, 67, 49, 0.18));
}

.brand-logo svg {
  width: 42px;
  height: 42px;
  display: block;
}

.nav {
  padding: 16px 10px;
  display: grid;
  gap: 4px;
}

.nav button {
  border: 0;
  background: transparent;
  color: #33413c;
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 8px;
  text-align: left;
  font-weight: 650;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.nav button:hover {
  background: #f1f7f4;
  color: var(--green);
  transform: translateX(2px);
}

.nav button.active {
  background: linear-gradient(90deg, rgba(0, 107, 70, 0.12), rgba(0, 107, 70, 0.05));
  color: var(--green);
  box-shadow: inset 3px 0 0 var(--green);
}

.nav svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.nav .count {
  margin-left: auto;
  background: var(--green);
  color: white;
  min-width: 24px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.side-footer {
  margin-top: auto;
  padding: 16px 20px 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: grid;
  gap: 10px;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 72px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 4;
}

.topbar.public-topbar {
  grid-template-columns: auto minmax(320px, 1fr) auto;
  padding: 0 34px;
}

.top-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 23px;
  font-weight: 850;
  white-space: nowrap;
  color: #111a16;
}

.searchbar {
  display: grid;
  grid-template-columns: 180px minmax(160px, 1fr) 116px;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  max-width: 980px;
  background: white;
  box-shadow: 0 12px 34px rgba(22, 35, 43, 0.08);
}

.searchbar select,
.searchbar input {
  border: 0;
  border-right: 1px solid var(--line);
  padding: 0 14px;
  min-width: 0;
  background: white;
  color: var(--text);
}

.searchbar button,
.primary {
  border: 0;
  background: linear-gradient(180deg, #164f5f, #0f2f3b);
  color: white;
  font-weight: 700;
  border-radius: 0;
}

.searchbar button:hover,
.primary:hover {
  background: linear-gradient(180deg, #1c6172, #123846);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #33413c;
  white-space: nowrap;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #25322e;
  box-shadow: 0 1px 2px rgba(12, 18, 15, 0.04);
}

.content {
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.content.full-width {
  grid-template-columns: minmax(0, 1fr);
}

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

.panel-header {
  min-height: 54px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title {
  font-weight: 750;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #111a16;
}

.link {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 650;
}

.filters {
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) repeat(3, minmax(150px, 180px));
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.filters input,
.filters select,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 13px;
  background: white;
  color: var(--text);
}

.field textarea {
  padding-top: 10px;
  min-height: 86px;
  resize: vertical;
}

.catalog-tools {
  padding: 4px 20px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.marketplace-page {
  display: grid;
  gap: 22px;
}

.market-hero {
  min-height: 270px;
  border-radius: 14px;
  padding: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
  gap: 28px;
  align-items: end;
  color: white;
  background:
    linear-gradient(115deg, rgba(12, 26, 32, 0.96), rgba(19, 61, 72, 0.9) 56%, rgba(190, 114, 39, 0.58)),
    linear-gradient(135deg, #0b1419, #223847);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.market-hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -90px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  transform: rotate(28deg);
}

.market-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.market-hero h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(38px, 5vw, 66px);
  line-height: 0.98;
  letter-spacing: 0;
}

.market-hero p {
  margin: 18px 0 0;
  max-width: 660px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 18px;
  line-height: 1.55;
}

.market-hero-actions {
  margin-top: 26px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.market-hero-actions .ghost {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.28);
  color: white;
}

.market-hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.market-hero-stats div {
  min-height: 116px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  align-content: end;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.market-hero-stats strong {
  font-size: 31px;
  line-height: 1;
}

.market-hero-stats span {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
}

.promo-banner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 178px;
  border-radius: 18px;
  padding: 26px 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: center;
  gap: 28px;
  border: 1px solid rgba(12, 38, 32, 0.14);
  box-shadow: 0 18px 46px rgba(16, 28, 24, 0.1);
  color: #f7fbf9;
}

.promo-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 78% 28%, rgba(255, 255, 255, 0.18), transparent 32%),
    linear-gradient(125deg, #17352f, #0b1b18 58%, #07110f);
}

.promo-banner::after {
  content: "";
  position: absolute;
  inset: auto -70px -110px auto;
  width: 430px;
  height: 280px;
  z-index: -1;
  background: rgba(255, 255, 255, 0.08);
  transform: rotate(-13deg);
  border-radius: 38px;
}

.promo-amber::before {
  background:
    radial-gradient(circle at 78% 28%, rgba(245, 179, 61, 0.27), transparent 34%),
    linear-gradient(125deg, #243035, #132428 54%, #4c3413);
}

.promo-green::before {
  background:
    radial-gradient(circle at 80% 30%, rgba(37, 181, 127, 0.28), transparent 34%),
    linear-gradient(125deg, #0c2c25, #0b1d1a 58%, #072f23);
}

.promo-copy {
  display: grid;
  gap: 12px;
  max-width: 720px;
}

.promo-copy h2 {
  margin: 0;
  font-size: clamp(25px, 3vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

.promo-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  line-height: 1.55;
  max-width: 660px;
}

.promo-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
}

.promo-actions .primary.solid {
  background: #f3b33d;
  border-color: #f3b33d;
  color: #12221c;
}

.promo-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.promo-dots button {
  width: 30px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 255, 255, 0.28);
}

.promo-dots button.active {
  background: #ffffff;
}

.promo-visual {
  position: relative;
  min-height: 150px;
}

.promo-stat {
  position: absolute;
  right: 18px;
  top: 8px;
  width: 142px;
  height: 112px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(12px);
  display: grid;
  place-content: center;
  text-align: center;
  gap: 6px;
}

.promo-stat strong {
  font-size: 34px;
  line-height: 1;
}

.promo-stat span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.promo-part,
.promo-line {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.promo-part-a {
  width: 150px;
  height: 46px;
  left: 8px;
  top: 42px;
  transform: rotate(-12deg);
  box-shadow: inset 0 0 0 13px rgba(255, 255, 255, 0.08);
}

.promo-part-b {
  width: 96px;
  height: 96px;
  right: 145px;
  bottom: 2px;
  border-radius: 28px;
  transform: rotate(16deg);
  box-shadow: inset 0 0 0 16px rgba(243, 179, 61, 0.18);
}

.promo-line.one {
  width: 220px;
  height: 3px;
  left: 32px;
  bottom: 32px;
}

.promo-line.two {
  width: 120px;
  height: 3px;
  right: 36px;
  bottom: 18px;
  background: rgba(243, 179, 61, 0.55);
}

.market-surface {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.market-surface-head {
  min-height: 72px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.market-surface-head .panel-title {
  margin-bottom: 5px;
}

.parts-grid {
  padding: 0 20px 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.part-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(13, 24, 30, 0.04);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.part-card:hover,
.part-card:focus {
  transform: translateY(-3px);
  border-color: rgba(34, 56, 71, 0.32);
  box-shadow: 0 18px 44px rgba(22, 38, 47, 0.13);
  outline: 0;
}

.part-card-media {
  position: relative;
  aspect-ratio: 1.55;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)),
    var(--part-bg);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.part-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f9fbfb;
  display: block;
  padding: 12px;
}

.part-card-media svg {
  width: 96px;
  height: 96px;
  color: var(--steel);
  opacity: 0.72;
}

.part-card-status {
  position: absolute;
  left: 12px;
  bottom: 12px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(11, 20, 25, 0.78);
  color: white;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
}

.part-card-body {
  min-height: 258px;
  padding: 17px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.part-card-top,
.part-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.part-card-top {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.part-card-top strong {
  color: var(--steel);
}

.part-card h3 {
  margin: 0;
  min-height: 50px;
  color: #0d1b22;
  font-size: 20px;
  line-height: 1.22;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.part-card-ref {
  border-left: 3px solid var(--copper);
  padding-left: 11px;
  display: grid;
  gap: 3px;
}

.part-card-ref span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.part-card-ref strong {
  color: #0c1720;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.part-card-ref em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.part-card-meta span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.part-card-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.part-card-footer strong {
  min-width: 0;
  color: var(--steel);
  font-size: 16px;
  line-height: 1.2;
}

.part-card-footer span {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  background: #edf4f5;
  color: var(--steel);
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.market-empty {
  margin: 0 20px 22px;
  min-height: 180px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  background: #f8fafb;
}

.market-category-picker {
  margin: 0 20px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  overflow: hidden;
}

.market-category-picker.compact {
  background: #f7fbf9;
}

.category-picker-top {
  min-height: 42px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.category-picker-top strong {
  font-size: 14px;
}

.root-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.root-tabs button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  min-height: 36px;
  padding: 0 13px;
  white-space: nowrap;
  font-weight: 700;
  color: #33413c;
}

.root-tabs button.active {
  background: var(--steel);
  border-color: var(--steel);
  color: white;
}

.category-search-row {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.category-search-row input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: white;
}

.category-choice-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  padding: 10px 12px 12px;
}

.category-choice-list button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  min-height: 62px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.category-choice-list button.selected {
  border-color: rgba(15, 118, 110, 0.42);
  background: #eef8f6;
}

.category-choice-list strong,
.category-choice-list em {
  display: block;
}

.category-choice-list strong {
  font-size: 13px;
  margin-bottom: 3px;
}

.category-choice-list em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-choice-list small {
  min-width: 28px;
  min-height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--green-2);
  color: var(--green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.category-picker-footer {
  min-height: 44px;
  border-top: 1px solid var(--line);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
}

.ghost {
  border: 1px solid var(--line);
  background: white;
  color: #26352f;
  border-radius: 8px;
  min-height: 36px;
  padding: 0 12px;
  font-weight: 650;
}

.ghost.small {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.ghost.danger {
  color: var(--red);
  border-color: #efc2c7;
}

.table-wrap {
  overflow: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 920px;
}

th {
  height: 42px;
  text-align: left;
  font-size: 12px;
  color: #52605b;
  font-weight: 750;
  background: #fbfcfb;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0 12px;
}

td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  vertical-align: middle;
}

tbody tr:hover {
  background: #fbfdfc;
}

.selected-row {
  background: #f1f8f5;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:focus {
  outline: 2px solid rgba(0, 107, 70, 0.35);
  outline-offset: -2px;
  background: #f4faf7;
}

.clickable-row:hover .part-name {
  text-decoration: underline;
}

.part-cell {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 210px;
}

.thumb {
  width: 72px;
  height: 52px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background:
    linear-gradient(140deg, rgba(255,255,255,0.76), rgba(255,255,255,0)),
    var(--part-bg);
  display: grid;
  place-items: center;
  color: #35423d;
  overflow: hidden;
}

.thumb svg {
  width: 42px;
  height: 42px;
  opacity: 0.78;
}

.thumb img,
.detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: white;
}

.part-name {
  color: var(--blue);
  font-weight: 750;
  margin-bottom: 4px;
}

.subline {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 7px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.badge.green {
  background: var(--green-2);
  color: var(--green);
}

.badge.amber {
  background: var(--amber-2);
  color: var(--amber);
}

.badge.red {
  background: #ffe8ea;
  color: var(--red);
}

.side-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.mini-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.mini-card h3 {
  margin: 0;
  min-height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.mini-body {
  padding: 14px;
}

.progress {
  height: 8px;
  background: #dfe5e2;
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 12px;
}

.progress span {
  display: block;
  height: 100%;
  width: var(--value);
  background: var(--green);
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 9px 0;
}

.status-line,
.lead-line,
.invoice-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid #edf0ef;
}

.status-line:last-child,
.lead-line:last-child,
.invoice-line:last-child {
  border-bottom: 0;
}

.lead-card {
  gap: 12px;
}

.lead-card.unread {
  border-color: rgba(13, 129, 92, 0.35);
  background: linear-gradient(90deg, rgba(13, 129, 92, 0.08), #fff 38%);
}

.lead-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.lead-card-head > div {
  display: grid;
  gap: 4px;
}

.lead-contact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.lead-contact-grid div {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.lead-contact-grid div:last-child {
  border-right: 0;
}

.lead-contact-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.lead-contact-grid strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 0 0 16px;
}

.tab {
  border: 1px solid var(--line);
  background: white;
  min-height: 36px;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 700;
  color: #33413c;
}

.tab.active {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.workspace {
  display: none;
}

.workspace.active {
  display: block;
}

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

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

.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 750;
  margin-bottom: 6px;
}

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

.check-row {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.wide {
  grid-column: 1 / -1;
}

.section-pad {
  padding: 16px;
}

.module-list {
  display: grid;
  gap: 10px;
}

.module-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
  background: #fbfcfb;
}

.module-row strong {
  font-size: 15px;
}

.module-row.import-state {
  border-color: rgba(0, 112, 74, 0.28);
  background: #f5fbf8;
}

.module-row.import-state.cleared {
  border-color: rgba(199, 54, 54, 0.26);
  background: #fff8f7;
}

.stats-intro {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 14px;
}

.stats-intro > div {
  display: grid;
  gap: 4px;
}

.stats-bars {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.stats-bar-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 58px;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.stats-bar-row strong {
  text-align: right;
}

.stats-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e8eef0;
  overflow: hidden;
}

.stats-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0b7890, #f0a43a);
}

.stats-top-list,
.stats-activity-list {
  display: grid;
  gap: 8px;
}

.stats-top-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.stats-top-item:hover {
  border-color: #0b7890;
  background: #f6fbfc;
}

.stats-top-item span,
.stats-activity-item span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.stats-top-item em,
.stats-activity-item em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-activity-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.empty-row {
  color: var(--muted);
  padding: 10px 0;
}

.import-drop {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 14px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.import-drop strong {
  display: block;
  font-size: 15px;
  margin-bottom: 5px;
}

.file-button {
  min-height: 38px;
  border-radius: 8px;
  background: var(--green);
  color: white;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}

.small-file-button {
  min-height: 34px;
  font-size: 13px;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-panel {
  align-content: start;
}

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

.category-mapping-list {
  display: grid;
  gap: 10px;
}

.category-source-filter {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.category-source-filter input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
}

.category-mapping-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(360px, 1.5fr) auto;
  gap: 12px;
  align-items: center;
}

.mapping-state {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.category-mapping-row strong,
.category-mapping-row span {
  display: block;
}

.category-mapping-control {
  position: relative;
  display: grid;
  gap: 8px;
  align-items: center;
}

.category-combo-trigger {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 0 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.category-combo-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.category-combo-trigger strong {
  color: var(--blue);
  font-size: 12px;
}

.category-combo-panel {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: white;
  box-shadow: var(--shadow);
  padding: 10px;
}

.category-combo-panel input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: white;
}

.category-combo-options {
  margin-top: 8px;
  max-height: 260px;
  overflow: auto;
  display: grid;
  gap: 4px;
}

.category-combo-options button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  min-height: 34px;
  padding: 7px 8px;
  text-align: left;
  color: var(--text);
  font-size: 13px;
}

.category-combo-options button:hover,
.category-combo-options button.selected {
  background: #eef6f7;
  color: var(--steel);
}

.mapping-suggestion {
  grid-column: 1 / -1;
  justify-self: start;
  padding: 0;
  min-height: auto;
  text-align: left;
}

.mapping-help pre {
  margin: 4px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
  padding: 12px;
  overflow: auto;
  color: #17313c;
  font: 13px/1.5 Consolas, "Courier New", monospace;
}

.invoice-edit-table input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  background: white;
}

.invoice-edit-table th:nth-child(2),
.invoice-edit-table th:nth-child(3),
.invoice-edit-table th:nth-child(4),
.invoice-edit-table td:nth-child(2),
.invoice-edit-table td:nth-child(3),
.invoice-edit-table td:nth-child(4) {
  width: 120px;
}

.actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.primary.solid {
  border-radius: 8px;
  min-height: 38px;
  padding: 0 14px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: white;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.metric strong {
  display: block;
  font-size: 26px;
  margin-top: 8px;
}

.inactive-listing {
  opacity: 0.66;
  background: #fafafa;
}

.publication-toggle {
  min-width: 92px;
}

.publication-toggle.inactive {
  color: var(--red);
  border-color: rgba(199, 54, 54, 0.32);
  background: #fff8f7;
}

.category-overview {
  margin-top: 12px;
  max-height: 330px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.category-overview-head,
.category-overview-row {
  display: grid;
  grid-template-columns: 110px minmax(260px, 1fr) 180px;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
}

.category-overview-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7faf8;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.category-overview-row {
  border-bottom: 1px solid #eef2ef;
  font-size: 13px;
}

.category-overview-row:last-child {
  border-bottom: 0;
}

.category-overview-row strong {
  font-size: 12px;
}

.category-overview-row em {
  color: var(--muted);
  font-style: normal;
}

.category-empty {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #17201c;
  color: white;
  padding: 13px 15px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transform: translateY(120px);
  opacity: 0;
  transition: 180ms ease;
  z-index: 10;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(23, 32, 28, 0.42);
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}

.detail-modal {
  width: min(980px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(12, 18, 15, 0.24);
}

.detail-header {
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-header h2 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.15;
}

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

.detail-media {
  display: grid;
  align-content: start;
  gap: 12px;
}

.carousel-stage {
  position: relative;
}

.detail-thumb {
  width: 100%;
  min-height: 245px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(140deg, rgba(255,255,255,0.76), rgba(255,255,255,0)),
    var(--part-bg);
  display: grid;
  place-items: center;
  color: #35423d;
}

.detail-thumb.image-button {
  padding: 0;
  cursor: zoom-in;
  overflow: hidden;
}

.detail-thumb svg {
  width: 150px;
  height: 150px;
  opacity: 0.82;
}

.detail-thumb img {
  width: 100%;
  height: 100%;
  min-height: 245px;
  object-fit: contain;
  display: block;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  width: 38px;
  height: 48px;
  transform: translateY(-50%);
  border: 1px solid rgba(216, 223, 220, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.carousel-nav.prev {
  left: 10px;
}

.carousel-nav.next {
  right: 10px;
}

.carousel-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(23, 32, 28, 0.72);
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.gallery-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.gallery-strip button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

.gallery-strip button.active {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(0, 107, 70, 0.18);
}

.gallery-strip img {
  width: 100%;
  aspect-ratio: 1.35;
  object-fit: contain;
  background: white;
  display: block;
}

.detail-body {
  display: grid;
  gap: 14px;
  align-content: start;
}

.detail-price {
  font-size: 30px;
  line-height: 1.1;
  font-weight: 820;
  color: var(--green);
}

.detail-action-panel {
  border: 1px solid rgba(0, 107, 70, 0.22);
  border-radius: 8px;
  background: #f4fbf7;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.detail-action-panel.success {
  background: #f2fbf6;
}

.detail-action-panel strong {
  font-size: 15px;
}

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

.seller-profile div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.seller-profile .wide {
  grid-column: 1 / -1;
}

.seller-profile span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.seller-profile strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.form-grid.compact {
  gap: 10px;
}

.image-lightbox {
  position: fixed;
  inset: 24px;
  z-index: 30;
  border-radius: 8px;
  background: rgba(10, 14, 12, 0.92);
  display: grid;
  place-items: center;
  padding: 44px 62px;
}

.image-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  background: white;
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: white;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  width: 46px;
  height: 62px;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  display: grid;
  place-items: center;
  font-size: 42px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-nav.prev {
  left: 16px;
}

.lightbox-nav.next {
  right: 16px;
}

.lightbox-count {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: white;
  font-size: 13px;
  font-weight: 800;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.spec-grid div {
  padding: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 70px;
}

.spec-grid div:nth-child(2n) {
  border-right: 0;
}

.spec-grid div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.spec-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 6px;
}

.spec-grid strong {
  font-size: 14px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .app-shell.public-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .brand span,
  .nav-label,
  .side-footer {
    display: none;
  }

  .brand {
    justify-content: center;
    padding: 0;
  }

  .nav button {
    justify-content: center;
    padding: 0;
  }

  .nav .count {
    position: absolute;
    margin-left: 24px;
    margin-top: -20px;
  }

  .content {
    grid-template-columns: 1fr;
  }

  .market-hero {
    grid-template-columns: 1fr;
  }

  .market-hero-stats {
    max-width: 720px;
  }

  .promo-banner {
    grid-template-columns: minmax(0, 1fr) 260px;
    padding: 24px;
  }

  .promo-visual {
    min-height: 130px;
  }

  .promo-stat {
    right: 4px;
  }
}

@media (max-width: 780px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
    border-right: 0;
  }

  .brand {
    justify-content: flex-start;
    padding: 0 16px;
  }

  .brand span,
  .nav-label {
    display: inline;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    height: auto;
    padding: 14px;
    grid-template-columns: 1fr;
    position: static;
  }

  .topbar.public-topbar {
    grid-template-columns: 1fr;
  }

  .top-brand {
    justify-content: center;
  }

  .searchbar {
    grid-template-columns: 1fr;
    height: auto;
  }

  .searchbar select,
  .searchbar input,
  .searchbar button {
    min-height: 42px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content {
    padding: 14px;
  }

  .market-hero {
    min-height: auto;
    padding: 24px;
    border-radius: 12px;
  }

  .market-hero h1 {
    font-size: 36px;
  }

  .market-hero p {
    font-size: 16px;
  }

  .market-hero-stats {
    grid-template-columns: 1fr;
  }

  .promo-banner {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px;
    border-radius: 12px;
  }

  .promo-copy h2 {
    font-size: 28px;
    line-height: 1.12;
  }

  .promo-copy p {
    font-size: 15px;
  }

  .promo-visual {
    display: none;
  }

  .promo-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .market-surface-head {
    min-height: auto;
    padding: 16px;
    align-items: flex-start;
  }

  .parts-grid {
    grid-template-columns: 1fr;
    padding: 0 14px 16px;
  }

  .filters,
  .form-grid,
  .mapping-field-grid,
  .lead-contact-grid,
  .category-mapping-control,
  .category-source-filter,
  .grid-2,
  .rights-grid,
  .metric-strip,
  .stats-intro,
  .stats-bar-row,
  .stats-activity-item,
  .import-drop,
  .category-mapping-row,
  .category-overview-head,
  .category-overview-row,
  .detail-grid,
  .spec-grid {
    grid-template-columns: 1fr;
  }

  .spec-grid div,
  .spec-grid div:nth-child(2n),
  .spec-grid div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .spec-grid div:last-child {
    border-bottom: 0;
  }
}
