:root {
  --ink-950: #0b1220;
  --ink-900: #13233f;
  --ink-700: #344054;
  --ink-500: #667085;
  --surface: #f4f6f8;
  --card: #ffffff;
  --line: #dde3ea;
  --line-soft: #ebeff3;
  --brand: #2e68ff;
  --brand-soft: #eaf0ff;
  --success: #158a60;
  --success-soft: #ddf5ea;
  --warning: #c77700;
  --warning-soft: #fff0cc;
  --danger: #c43d4b;
  --cyan: #16a6b6;
  --shadow: 0 12px 34px rgba(16, 24, 40, 0.07);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink-950);
  background: var(--surface);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--surface);
}

button,
input {
  font: inherit;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  color: white;
  background: var(--ink-950);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: block;
  border-radius: 12px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand small {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 11px;
}

.nav {
  margin-top: 42px;
  display: grid;
  gap: 7px;
}

.nav-item {
  height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 10px;
  color: #aeb9c9;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: 150ms ease;
}

.nav-item:hover {
  color: white;
  background: rgba(255, 255, 255, 0.07);
}

.nav-item.active {
  color: white;
  background: rgba(46, 104, 255, 0.22);
  box-shadow: inset 3px 0 0 var(--brand);
}

.nav-icon {
  width: 22px;
  text-align: center;
  font-size: 20px;
  font-weight: 400;
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.status-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #42d394;
  box-shadow: 0 0 0 4px rgba(66, 211, 148, 0.12);
}

.sidebar-note strong,
.sidebar-note span {
  display: block;
}

.sidebar-note strong {
  font-size: 12px;
}

.sidebar-note span {
  margin-top: 5px;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.4;
}

.main {
  min-width: 0;
}

.topbar {
  height: 72px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
}

.topbar > div:first-child strong,
.topbar > div:first-child span {
  display: block;
}

.topbar > div:first-child strong {
  margin-top: 4px;
  font-size: 14px;
}

.eyebrow {
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 750;
}

.user strong,
.user small {
  display: block;
}

.user strong {
  font-size: 12px;
}

.user small {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 10px;
}

.content {
  max-width: 1480px;
  margin: 0 auto;
  padding: 38px 36px 64px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.page-heading h1 {
  max-width: 820px;
  margin: 8px 0 10px;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.page-heading p {
  max-width: 780px;
  margin: 0;
  color: var(--ink-500);
  font-size: 14px;
  line-height: 1.55;
}

.environment-badge {
  padding: 8px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: var(--ink-700);
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.workspace-grid {
  margin-top: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.upload-card,
.matrix-card,
.catalog-search,
.results {
  padding: 22px;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.card-heading > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-heading h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.card-heading.compact h2 {
  font-size: 15px;
}

.step,
.file-type,
.sync-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.step {
  color: var(--brand);
  background: var(--brand-soft);
}

.file-type {
  color: var(--success);
  background: var(--success-soft);
}

.sync-badge {
  color: var(--success);
  background: var(--success-soft);
}

.dropzone {
  min-height: 268px;
  margin-top: 20px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed #b8c4d2;
  border-radius: 14px;
  background: #fafbfc;
  cursor: pointer;
  transition: 160ms ease;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--brand);
  background: #f6f8ff;
}

.upload-icon {
  width: 50px;
  height: 50px;
  margin-bottom: 16px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 26px;
}

.dropzone strong {
  font-size: 15px;
}

.dropzone > span:not(.upload-icon):not(.button) {
  margin-top: 7px;
  color: var(--ink-500);
  font-size: 12px;
}

.button {
  min-height: 38px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 9px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.dropzone .button {
  margin-top: 18px;
}

.button.secondary {
  color: var(--ink-950);
  border-color: var(--line);
  background: white;
}

.button.primary {
  color: white;
  background: var(--brand);
}

.button.disabled {
  opacity: 0.46;
  pointer-events: none;
}

.upload-footer {
  margin-top: 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.upload-footer strong,
.upload-footer span {
  display: block;
}

.upload-footer strong {
  font-size: 11px;
}

.upload-footer span {
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 10px;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--brand);
  background: transparent;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.matrix-name {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.matrix-logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--ink-900);
  font-size: 13px;
  font-weight: 800;
}

.matrix-name .matrix-logo {
  display: grid;
  color: white;
}

.matrix-name strong,
.matrix-name span {
  display: block;
}

.matrix-name strong {
  font-size: 14px;
}

.matrix-name span {
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 10px;
}

.metric-grid {
  margin-top: 21px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line-soft);
  border-left: 1px solid var(--line-soft);
}

.metric {
  padding: 16px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.metric span,
.metric strong {
  display: block;
}

.metric span {
  color: var(--ink-500);
  font-size: 10px;
}

.metric strong {
  margin-top: 7px;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

.category-list {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: var(--ink-700);
  font-size: 10px;
}

.category-row span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-row strong {
  color: var(--ink-950);
  font-variant-numeric: tabular-nums;
}

.process-strip {
  margin-top: 18px;
  padding: 17px 20px;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.process-strip > div {
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 10px;
}

.process-strip > div > span {
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 10px;
  font-weight: 800;
}

.process-strip strong {
  font-size: 11px;
}

.process-strip small {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 9px;
}

.process-strip i {
  color: #aeb8c5;
  font-style: normal;
}

.catalog-search,
.results {
  margin-top: 18px;
}

.search-field {
  height: 48px;
  margin-top: 18px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfc;
}

.search-field span {
  color: var(--ink-500);
  font-size: 21px;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink-950);
  background: transparent;
  font-size: 13px;
}

.search-results {
  margin-top: 12px;
}

.search-results > p {
  margin: 0;
  color: var(--ink-500);
  font-size: 11px;
}

.catalog-item {
  padding: 12px 0;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 180px 100px;
  gap: 14px;
  align-items: center;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
}

.catalog-item code {
  color: var(--brand);
  font-family: inherit;
  font-weight: 750;
}

.catalog-item strong {
  line-height: 1.4;
}

.catalog-item span {
  color: var(--ink-500);
}

.results {
  padding: 0;
  overflow: hidden;
}

.results-header {
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.results-header h2 {
  margin: 7px 0 6px;
  font-size: 18px;
}

.results-header p {
  margin: 0;
  color: var(--ink-500);
  font-size: 11px;
}

.result-kpis {
  padding: 16px 22px;
  display: flex;
  gap: 36px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}

.result-kpis div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.result-kpis span {
  color: var(--ink-500);
  font-size: 10px;
}

.result-kpis strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.result-kpis .success strong {
  color: var(--success);
}

.result-kpis .warning strong {
  color: var(--warning);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink-500);
  background: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  min-width: 130px;
  line-height: 1.45;
}

td:first-child,
td:nth-child(2) {
  min-width: 290px;
}

.item-code {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
  font-size: 9px;
  font-weight: 750;
}

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

.confidence {
  display: flex;
  align-items: center;
  gap: 8px;
}

.confidence-track {
  width: 62px;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf2;
}

.confidence-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--success);
}

.chip {
  min-height: 26px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.chip.confirmed {
  color: var(--success);
  background: var(--success-soft);
}

.chip.review {
  color: var(--warning);
  background: var(--warning-soft);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: 400px;
  padding: 14px 16px;
  border-radius: 11px;
  color: white;
  background: var(--ink-950);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.2);
  font-size: 12px;
  line-height: 1.45;
}

.toast.error {
  background: #922f3c;
}

.hidden {
  display: none !important;
}

.login-page {
  min-height: 100vh;
  margin: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  color: var(--ink-950);
  background:
    radial-gradient(circle at 20% 10%, rgba(46, 104, 255, 0.13), transparent 32%),
    var(--surface);
}

.login-card {
  width: min(100%, 420px);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 24px 70px rgba(11, 18, 32, 0.12);
}

.login-mark {
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  display: block;
  border-radius: 13px;
}

.login-card h1 {
  margin: 7px 0 10px;
  font-size: 27px;
  line-height: 1.15;
}

.login-card > p {
  margin: 0 0 24px;
  color: var(--ink-700);
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 600;
}

.login-form input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-950);
  background: white;
  font: inherit;
  font-size: 16px;
}

.login-form input:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(46, 104, 255, 0.12);
}

.login-form .button {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
  justify-content: center;
  border: 0;
  cursor: pointer;
}

.login-error {
  margin: -8px 0 18px !important;
  padding: 11px 12px;
  border-radius: 9px;
  color: var(--danger);
  background: rgba(196, 61, 75, 0.09);
  font-size: 13px;
}

.login-card > small {
  margin-top: 22px;
  display: block;
  color: #7a8597;
  text-align: center;
}

.logo-review-page {
  min-height: 100vh;
  margin: 0;
  padding: 48px 24px;
  color: var(--ink-950);
  background: var(--surface);
}

.logo-review {
  width: min(100%, 1080px);
  margin: 0 auto;
}

.logo-back {
  margin-bottom: 48px;
  display: inline-flex;
  color: var(--ink-700);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.logo-review h1 {
  margin: 8px 0 10px;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.04em;
}

.logo-review-lead {
  margin: 0;
  color: var(--ink-700);
}

.logo-options {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.logo-option {
  min-height: 390px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.logo-option.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(46, 104, 255, 0.1), var(--shadow);
}

.logo-option.selected .logo-number {
  color: var(--brand);
}

.logo-number {
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.logo-option img {
  width: 108px;
  height: 108px;
  margin: 42px auto 38px;
  display: block;
  border-radius: 29px;
  box-shadow: 0 18px 38px rgba(11, 18, 32, 0.16);
}

.logo-option h2 {
  margin: auto 0 8px;
  font-size: 19px;
}

.logo-option p {
  margin: 0;
  color: var(--ink-700);
  font-size: 13px;
  line-height: 1.55;
}

.logo-review-note {
  margin: 24px 0 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-700);
  background: var(--card);
  font-size: 13px;
}

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

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 16px 20px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .nav {
    margin: 0;
    display: flex;
  }

  .nav-item {
    padding: 0 10px;
  }

  .nav-icon,
  .sidebar-note {
    display: none;
  }

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

@media (max-width: 700px) {
  .logo-review-page {
    padding: 28px 16px 42px;
  }

  .logo-back {
    margin-bottom: 30px;
  }

  .logo-options {
    grid-template-columns: 1fr;
  }

  .logo-option {
    min-height: 330px;
  }

  .topbar {
    padding: 0 18px;
  }

  .content {
    padding: 28px 16px 48px;
  }

  .page-heading {
    display: block;
  }

  .environment-badge {
    margin-top: 16px;
    display: inline-flex;
  }

  .sidebar {
    gap: 16px;
    overflow-x: auto;
  }

  .brand small,
  .nav-item:not(.active) {
    display: none;
  }

  .process-strip {
    grid-template-columns: 1fr;
  }

  .process-strip i {
    display: none;
  }

  .upload-footer,
  .results-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-kpis {
    gap: 14px;
    flex-wrap: wrap;
  }

  .catalog-item {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}
