@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap");

:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-strong: #f7fafb;
  --text: #111827;
  --muted: #5f6b7a;
  --muted-weak: #8a94a3;
  --line: #d9e2e7;
  --line-strong: #b9c8d0;
  --target: #19d3c5;
  --target-dark: #0f9f97;
  --green: #047857;
  --amber: #b7791f;
  --red: #667085;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --radius: 0px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(17, 24, 39, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 39, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  color: var(--text);
  font-family: var(--font);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image: linear-gradient(180deg, rgba(25, 211, 197, 0.12), transparent 280px);
}

h1,
h2,
p {
  margin: 0;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(460px, auto);
  align-items: end;
  gap: 24px;
  padding: 30px 32px 26px;
  background: #ffffff;
  border-bottom: 1px solid var(--line-strong);
}

.brand-block {
  display: grid;
  gap: 8px;
}

h1 {
  max-width: 880px;
  color: var(--text);
  font-size: 56px;
  font-weight: 900;
  line-height: 0.96;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar p {
  color: var(--muted);
  font-family: var(--font);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  justify-items: end;
  justify-content: flex-end;
}

.language-toggle {
  justify-self: start;
  min-height: 34px;
  border: 1px solid var(--target);
  border-radius: var(--radius);
  background: transparent;
  color: var(--target);
  padding: 0 12px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.language-toggle:hover {
  background: var(--target);
  color: #082f2d;
}

.sync-status {
  display: grid;
  grid-template-columns: minmax(160px, auto) minmax(170px, auto);
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  max-width: 560px;
}

.sync-card {
  display: grid;
  gap: 7px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.sync-card span {
  color: var(--muted);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sync-card strong {
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.sync-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0;
}

main {
  padding: 20px 32px 36px;
}

.login-page {
  min-height: 100vh;
}

.login-page::before {
  background-image: linear-gradient(180deg, rgba(25, 211, 197, 0.18), transparent 360px);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 560px);
  padding: 30px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--target);
}

.login-kicker {
  margin-bottom: 12px;
  color: var(--target-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-card h1 {
  margin-bottom: 14px;
  font-size: 48px;
}

.login-copy {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.login-form label {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.login-form input {
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  padding: 0 12px;
  font-family: var(--font);
  font-size: 16px;
}

.login-form button {
  min-height: 46px;
  border: 1px solid var(--target);
  border-radius: var(--radius);
  background: var(--target);
  color: #082f2d;
  padding: 0 14px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.login-form button:hover {
  background: #35e2d5;
  border-color: #35e2d5;
}

.login-error {
  margin-top: 18px;
  padding: 10px 12px;
  color: #344054;
  background: rgba(25, 211, 197, 0.14);
  border-left: 3px solid var(--target);
  font-size: 13px;
  font-weight: 800;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.kpi {
  position: relative;
  min-height: 112px;
  padding: 16px 14px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.kpi::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--target);
  content: "";
}

.kpi span {
  display: block;
  color: var(--muted);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: uppercase;
}

.kpi strong {
  display: block;
  margin-top: 18px;
  color: var(--text);
  font-family: var(--font);
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  overflow-wrap: anywhere;
}

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

.chart-panel {
  min-height: 330px;
}

.chart-panel.wide {
  min-height: 330px;
}

.chart-panel.coverage-panel {
  grid-column: span 1;
}

.chart-panel.sku-panel {
  grid-column: span 3;
}

.chart-panel.map-panel {
  grid-column: span 2;
  min-height: 520px;
}

.chart-panel.change-panel {
  grid-column: span 2;
  min-height: 520px;
}

.chart {
  width: 100%;
  height: 270px;
  padding: 8px;
}

.sku-panel .chart {
  height: auto;
  min-height: 420px;
  padding: 16px 18px 18px;
}

.sku-ranking {
  display: grid;
  gap: 8px;
}

.sku-rank-row {
  display: grid;
  grid-template-columns: minmax(240px, 36%) minmax(180px, 1fr) 64px;
  align-items: center;
  gap: 12px;
  min-height: 22px;
}

.sku-rank-row.not-collected .sku-product-link,
.sku-rank-row.not-collected .sku-rate {
  color: var(--muted-weak);
}

.sku-rank-row.not-collected .sku-bar-track {
  background: #eef3f5;
}

.sku-product-link {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.sku-product-link:hover {
  color: var(--target);
  text-decoration-color: var(--target);
}

.sku-bar-track {
  position: relative;
  height: 12px;
  overflow: hidden;
  background: #e8f1f3;
  border-radius: var(--radius);
}

.sku-bar-fill {
  display: block;
  height: 100%;
  min-width: 0;
  background: var(--target);
  border-radius: var(--radius);
}

.sku-rate {
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.map-panel .chart {
  height: 450px;
}

.change-panel .chart {
  height: 450px;
}

select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  padding: 0 10px;
  font-family: var(--font);
  font-size: 12px;
}

.drilldown,
.change-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f7fafb;
}

.drilldown label,
.change-filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.selection-summary {
  padding: 12px 16px;
  color: var(--muted);
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.4;
  border-bottom: 1px solid var(--line);
}

.export-link {
  color: var(--target);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: underline;
  text-decoration-color: var(--target);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-transform: uppercase;
}

.product-link {
  color: var(--text);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.product-link:hover {
  color: var(--target);
  text-decoration-color: var(--target);
}

.detail-box {
  border-bottom: 1px solid var(--line);
}

.detail-box summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  min-height: 54px;
  margin: 12px 16px;
  padding: 11px 12px;
  border: 1px solid var(--target);
  border-radius: var(--radius);
  background: rgba(25, 211, 197, 0.12);
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  transition: background 160ms ease, border-color 160ms ease;
}

.detail-box summary:hover {
  background: rgba(25, 211, 197, 0.2);
}

.detail-box summary::marker,
.detail-box summary::-webkit-details-marker {
  display: none;
  content: "";
}

.detail-summary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 94px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: var(--radius);
  background: var(--target);
  color: #082f2d;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.detail-summary-action::after {
  content: "v";
  margin-left: 8px;
  font-size: 10px;
}

.detail-box[open] .detail-summary-action {
  font-size: 0;
}

.detail-box[open] .detail-summary-action::before {
  content: attr(data-open-label);
  font-size: 11px;
}

.detail-box[open] .detail-summary-action::after {
  content: "^";
  font-size: 10px;
}

.recent-changes-details {
  display: block;
}

.recent-changes-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  min-height: 64px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #f7fafb;
  list-style: none;
  transition: background 160ms ease;
}

.recent-changes-summary:hover {
  background: rgba(25, 211, 197, 0.12);
}

.recent-changes-summary::marker,
.recent-changes-summary::-webkit-details-marker {
  display: none;
  content: "";
}

.recent-changes-heading {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.recent-changes-summary-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.recent-changes-details[open] .detail-summary-action {
  font-size: 0;
}

.recent-changes-details[open] .detail-summary-action::before {
  content: attr(data-open-label);
  font-size: 11px;
}

.recent-changes-details[open] .detail-summary-action::after {
  content: "^";
  font-size: 10px;
}

.change-window-note {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.panel {
  margin-top: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #f7fafb;
}

.panel-title h2 {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.panel-title span {
  color: var(--muted);
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

th,
td {
  padding: 12px;
  border-bottom: 1px solid #e7edf0;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.35;
}

th {
  color: var(--muted);
  background: #f3f7f8;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  color: #1f2937;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover {
  background: rgba(25, 211, 197, 0.08);
}

td.product {
  max-width: 360px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  background: transparent;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.status.available {
  color: var(--green);
}

.status.limited {
  color: var(--amber);
}

.status.unavailable {
  color: var(--red);
}

.empty {
  padding: 28px 16px;
  color: var(--muted);
}

.source-note {
  margin-top: 12px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--target);
  border-radius: var(--radius);
}

.source-note h2 {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.source-note h3 {
  margin: 16px 0 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.source-note h3:first-of-type {
  margin-top: 0;
}

.source-note ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.source-note strong {
  color: var(--text);
}

select:focus,
input:focus,
button:focus {
  outline: 2px solid var(--target);
  outline-offset: 2px;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .topbar-actions {
    width: 100%;
  }

  .sync-status {
    justify-content: start;
  }

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

@media (max-width: 860px) {
  .topbar {
    padding: 20px 16px;
  }

  h1 {
    font-size: 34px;
    line-height: 1;
  }

  .sync-status {
    grid-template-columns: 1fr;
    justify-content: flex-start;
    width: 100%;
    max-width: none;
  }

  .sync-card {
    width: 100%;
    min-width: 0;
  }

  .sync-card strong {
    white-space: normal;
  }

  main {
    padding: 14px;
  }

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

  .kpi {
    min-height: 104px;
  }

  .kpi strong {
    font-size: 26px;
  }

  .chart-grid,
  .drilldown,
  .change-filters {
    grid-template-columns: 1fr;
  }

  .chart-panel.coverage-panel,
  .chart-panel.sku-panel,
  .chart-panel.map-panel,
  .chart-panel.change-panel {
    grid-column: span 1;
  }

  .sku-panel .chart {
    min-height: 0;
    padding: 12px;
  }

  .sku-rank-row {
    grid-template-columns: minmax(0, 1fr) 80px 56px;
  }

  .chart-panel.map-panel {
    min-height: 390px;
  }

  .map-panel .chart {
    height: 320px;
  }

  .chart-panel.change-panel {
    min-height: 360px;
  }

  .change-panel .chart {
    height: 290px;
  }
}

@media (max-width: 520px) {
  .kpis {
    grid-template-columns: 1fr;
  }

  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .sku-rank-row {
    grid-template-columns: minmax(0, 1fr) 52px;
  }

  .sku-bar-track {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
    transition-duration: 0.001ms !important;
  }
}
