:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --ink: #17201d;
  --muted: #60706b;
  --line: #d7dfdc;
  --panel: #ffffff;
  --panel-soft: #f8faf9;
  --accent: #0f766e;
  --accent-dark: #0b4f49;
  --accent-soft: #e8f3f1;
  --good: #147c50;
  --low: #b56d05;
  --empty: #b73342;
  --unknown: #697670;
  --blue: #245f9f;
  --shadow: 0 18px 42px rgba(36, 49, 45, .08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button,
.file-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  min-height: 40px;
}

button:hover,
.file-button:hover {
  background: var(--accent-dark);
}

.app-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(18px, 4vw, 48px);
  background: #12201c;
  color: white;
}

.eyebrow {
  margin: 0 0 4px;
  color: #9ed3c9;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 20px;
}

.status-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.status-panel span {
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 6px;
  padding: 7px 10px;
  color: #dfe9e6;
}

main {
  display: grid;
  gap: 12px;
  padding: 18px clamp(14px, 4vw, 38px) 28px;
}

.toolbar,
.supplier-tabs,
.panel,
.inventory-section,
.data-panel,
footer {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.supplier-tabs {
  display: flex;
  gap: 6px;
}

.supplier-tab {
  min-width: 72px;
  border-color: var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-weight: 800;
}

.supplier-tab:hover,
.supplier-tab.active {
  border-color: var(--accent);
  background: #e8f3ef;
  color: var(--accent-dark);
}

.settings-button {
  margin-left: auto;
  border-color: var(--line);
  background: white;
  color: var(--muted);
  font-weight: 800;
}

.settings-button:hover {
  background: #f4f6f5;
  color: var(--ink);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 14px;
}

.toolbar button:nth-child(n+2) {
  background: white;
  color: var(--accent-dark);
}

.file-button input {
  display: none;
}

.panel,
.inventory-section,
.data-panel,
footer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}

.panel-heading,
.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-heading p,
.section-heading p,
footer p {
  margin-bottom: 0;
  color: var(--muted);
}

textarea {
  display: block;
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.watch-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(110px, .7fr) minmax(90px, .55fr) minmax(160px, 1fr) auto;
  gap: 10px;
}

.product-form {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto;
  gap: 10px;
}

.hidden {
  display: none !important;
}

.live-status {
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: #f8faf9;
  color: var(--muted);
  white-space: nowrap;
}

.live-status.ok {
  border-color: rgba(22,133,82,.35);
  background: #eaf7f0;
  color: var(--good);
}

.live-status.error {
  border-color: rgba(186,47,55,.25);
  background: #fff0f0;
  color: var(--empty);
}

input[type="text"],
input[type="search"],
select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  background: white;
}

.lookup-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(120px, .6fr) minmax(180px, .8fr);
  gap: 12px;
  align-items: end;
}

.lookup-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.lookup-result {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8faf9;
}

.lookup-result strong {
  display: block;
  font-size: 34px;
  line-height: 1;
}

.lookup-result span {
  color: var(--muted);
}

.watchlist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.watch-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px 7px 10px;
  background: #f8faf9;
}

.watch-chip button {
  min-height: 0;
  padding: 3px 7px;
  border-color: #c7d0cb;
  background: white;
  color: var(--muted);
}

.section-heading {
  align-items: center;
}

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

.section-tools input {
  min-width: min(260px, 34vw);
}

.snapshot-warning {
  display: none;
  margin: 0 0 14px;
  border: 1px solid #e0c777;
  border-radius: 8px;
  padding: 12px;
  background: #fff7df;
  color: #6d5200;
}

.snapshot-warning.visible {
  display: block;
}

.dashboard {
  display: grid;
  gap: 12px;
}

.model-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.model-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  background: #edf2ef;
}

.model-head strong {
  font-size: 20px;
}

.model-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.skatesus-head {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: end;
}

.skatesus-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.skatesus-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.skatesus-controls label {
  display: grid;
  gap: 4px;
  min-width: 120px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.skatesus-controls select {
  min-height: 34px;
  padding: 6px 9px;
}

.remove-product {
  min-height: 34px;
  border-color: var(--line);
  background: white;
  color: var(--muted);
  padding: 6px 10px;
}

.remove-product:hover {
  background: #f4f6f5;
  color: var(--ink);
}

.size-grid {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.cell {
  flex: 0 0 88px;
  min-height: 74px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 9px 10px;
  background: white;
}

.cell:last-child {
  border-right: 0;
}

.cell .size {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.cell .count {
  display: block;
  margin-top: 3px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.cell .detail {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.cell.good {
  border-top-color: rgba(22,133,82,.28);
  background: #eaf7f0;
  color: var(--good);
}

.cell.low {
  border-top-color: rgba(187,122,5,.25);
  background: #fff5df;
  color: var(--low);
}

.cell.empty {
  border-top-color: rgba(186,47,55,.25);
  background: #fff0f0;
  color: var(--empty);
}

.cell.unknown {
  background: #f4f5f4;
  color: var(--unknown);
}

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

summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.data-panel > summary {
  font-size: 18px;
}

.data-heading {
  margin-top: 12px;
}

.settings-dialog {
  width: min(520px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
}

.settings-dialog::backdrop {
  background: rgba(17, 25, 22, .28);
}

.settings-dialog form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-head h2 {
  margin-bottom: 0;
}

.settings-head button {
  border-color: var(--line);
  background: white;
  color: var(--muted);
}

.settings-dialog label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.settings-note {
  margin: 0;
  color: var(--muted);
}

code {
  display: block;
  margin-top: 10px;
  padding: 12px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
  color: var(--ink);
}

@media (max-width: 720px) {
  .app-header,
  .panel-heading,
  .section-heading {
    display: grid;
  }

  .section-tools {
    display: grid;
  }

  .section-tools input {
    min-width: 0;
    width: 100%;
  }

  .watch-form {
    grid-template-columns: 1fr;
  }

  .product-form {
    grid-template-columns: 1fr;
  }

  .live-status {
    justify-self: start;
  }

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

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

  .skatesus-head {
    display: grid;
    align-items: start;
  }

  .skatesus-controls {
    justify-content: start;
  }
}

/* Polished dashboard pass */
body {
  background:
    linear-gradient(180deg, #eef4f3 0, var(--bg) 240px),
    var(--bg);
}

main {
  gap: 14px;
  padding-top: 20px;
}

.supplier-tabs {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 8px 28px rgba(36, 49, 45, .06);
}

.supplier-tab,
.settings-button {
  min-height: 38px;
  border-radius: 6px;
  border-color: transparent;
  padding: 8px 16px;
}

.supplier-tab {
  min-width: 64px;
  background: transparent;
}

.supplier-tab:hover,
.supplier-tab.active {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .28);
}

.settings-button {
  border-color: var(--line);
  background: white;
}

.inventory-section,
.data-panel,
.settings-dialog {
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.inventory-section {
  padding: clamp(16px, 2.4vw, 24px);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(280px, 390px);
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.section-heading p {
  margin-top: 5px;
  font-size: 15px;
}

.live-status {
  font-size: 13px;
  font-weight: 800;
}

.product-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

button,
.file-button {
  border-radius: 6px;
  font-weight: 800;
}

input[type="text"],
input[type="search"],
select,
textarea {
  border-radius: 6px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

input[type="text"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  border-color: rgba(36, 95, 159, .62);
  box-shadow: 0 0 0 3px rgba(36, 95, 159, .14);
}

.dashboard {
  gap: 14px;
}

.model-row {
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 26px rgba(36, 49, 45, .06);
}

.model-head {
  min-height: 62px;
  padding: 13px 14px;
  background: linear-gradient(180deg, #f4f8f6, #edf3f1);
}

.model-head strong {
  font-size: 18px;
  letter-spacing: 0;
}

.model-head span {
  width: fit-content;
  border: 1px solid rgba(20, 124, 80, .24);
  border-radius: 999px;
  padding: 3px 8px;
  background: #edf8f2;
  color: var(--good);
  font-size: 12px;
  font-weight: 800;
}

.remove-product {
  border-color: transparent;
  background: rgba(255, 255, 255, .78);
}

.size-grid {
  background: #f3f5f4;
}

.cell {
  flex-basis: 82px;
  min-height: 76px;
  border-top: 0;
  border-color: var(--line);
  padding: 10px 11px;
}

.cell .size {
  color: #586762;
  font-weight: 800;
}

.cell .count {
  margin-top: 5px;
  font-size: 23px;
}

.cell.good {
  background: #eef9f2;
}

.cell.low {
  background: #fff7e8;
}

.cell.empty {
  background: #fff1f3;
}

.cell.unknown {
  background: #f5f6f6;
}

.skatesus-controls {
  gap: 8px;
}

.skatesus-controls label {
  min-width: 116px;
}

.skatesus-controls select {
  background-color: white;
  font-weight: 800;
}

.data-panel {
  padding: 14px 16px;
}

.data-panel > summary {
  font-size: 16px;
}

@media (max-width: 820px) {
  main {
    padding: 12px 10px 22px;
  }

  .supplier-tabs {
    width: calc(100% - 20px);
    margin-inline: 10px;
  }

  .section-heading {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .product-form {
    grid-column: 1 / -1;
    width: 100%;
  }

  .inventory-section,
  .data-panel {
    width: calc(100% - 20px);
    padding: 14px;
  }

  h1 {
    font-size: 30px;
  }

  .model-head {
    display: grid;
    gap: 12px;
    align-items: start;
  }

  .skatesus-head {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .skatesus-title-row {
    width: 100%;
  }

  .skatesus-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .skatesus-controls label {
    min-width: 0;
  }

  .cell {
    flex-basis: 72px;
    min-height: 70px;
    padding: 9px;
  }

  .cell .count {
    font-size: 19px;
  }
}

@media (max-width: 430px) {
  .supplier-tab {
    min-width: 54px;
    padding-inline: 12px;
  }

  .settings-button {
    padding-inline: 12px;
  }

  .section-heading {
    grid-template-columns: 1fr auto;
  }

  .skatesus-controls {
    grid-template-columns: 1fr 1fr;
  }
}

/* Stay Sharp premium dark dashboard */
:root {
  color-scheme: dark;
  --bg: #0b1114;
  --ink: #edf7f8;
  --muted: #8ea2a7;
  --line: rgba(158, 190, 195, .16);
  --panel: #111a1f;
  --panel-soft: #172329;
  --accent: #5eb8ff;
  --accent-dark: #2678c8;
  --accent-soft: rgba(94, 184, 255, .15);
  --good: #4ade80;
  --low: #f59e0b;
  --empty: #fb4b5f;
  --unknown: #87969a;
  --blue: #8bd8ff;
  --shadow: 0 24px 60px rgba(0, 0, 0, .34);
}

body {
  background:
    radial-gradient(circle at 18% -8%, rgba(94, 184, 255, .18), transparent 34vw),
    radial-gradient(circle at 88% 6%, rgba(72, 125, 255, .14), transparent 30vw),
    linear-gradient(180deg, #101925 0, var(--bg) 320px);
  color: var(--ink);
}

main {
  gap: 16px;
  padding-top: 22px;
}

.supplier-tabs,
.inventory-section,
.data-panel,
.model-row,
.settings-dialog {
  border: 1px solid var(--line);
  background: rgba(17, 26, 31, .88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.supplier-tabs {
  border-radius: 16px;
  padding: 6px;
}

.supplier-tab,
.settings-button {
  min-height: 42px;
  border-radius: 12px;
  color: var(--muted);
  letter-spacing: .02em;
}

.supplier-tab {
  background: transparent;
}

.supplier-tab:hover,
.supplier-tab.active {
  border-color: rgba(94, 184, 255, .48);
  background: linear-gradient(180deg, rgba(94, 184, 255, .2), rgba(94, 184, 255, .09));
  color: #e1f3ff;
}

.settings-button {
  border-color: var(--line);
  background: rgba(255, 255, 255, .04);
  color: #d2e3e6;
}

.settings-button:hover,
.remove-product:hover,
.toolbar button:nth-child(n+2):hover {
  border-color: rgba(139, 216, 255, .36);
  background: rgba(139, 216, 255, .1);
  color: var(--ink);
}

.inventory-section,
.data-panel {
  border-radius: 18px;
}

.section-heading p,
.panel-heading p,
footer p,
.model-head span,
.settings-note,
details {
  color: var(--muted);
}

h1 {
  color: #f6fdff;
}

.live-status {
  border-color: var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
}

.live-status.ok {
  border-color: rgba(94, 184, 255, .38);
  background: rgba(94, 184, 255, .12);
  color: #b9e5ff;
}

.live-status.error {
  border-color: rgba(251, 75, 95, .34);
  background: rgba(251, 75, 95, .12);
  color: #ff9aa6;
}

button,
.file-button {
  border-color: rgba(94, 184, 255, .72);
  background: linear-gradient(180deg, #6ec1ff, #2678c8);
  color: #04101f;
  box-shadow: 0 10px 22px rgba(38, 120, 200, .22);
}

button:hover,
.file-button:hover {
  background: linear-gradient(180deg, #88d0ff, #2d86dc);
}

input[type="text"],
input[type="search"],
select,
textarea {
  border-color: var(--line);
  background: #0d1519;
  color: var(--ink);
}

select {
  color-scheme: dark;
}

input[type="text"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  border-color: rgba(139, 216, 255, .72);
  box-shadow: 0 0 0 3px rgba(139, 216, 255, .15);
}

.model-row {
  border-radius: 16px;
  overflow: hidden;
}

.model-head {
  min-height: 56px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .025));
}

.model-head strong {
  color: #f7feff;
  font-size: 17px;
}

.model-head span {
  border-color: rgba(183, 151, 255, .42);
  background: linear-gradient(180deg, rgba(183, 151, 255, .2), rgba(123, 92, 214, .14));
  color: #dbcfff;
  box-shadow: 0 0 0 1px rgba(183, 151, 255, .08), 0 8px 22px rgba(123, 92, 214, .12);
}

.skatesus-controls label {
  color: #a9c0c5;
}

.skatesus-controls select {
  background: #0c1519;
  color: #edf7f8;
}

.remove-product,
.toolbar button:nth-child(n+2),
.settings-head button {
  border-color: var(--line);
  background: rgba(255, 255, 255, .045);
  color: #b8c9cd;
  box-shadow: none;
}

.size-grid {
  background: #0b1216;
  overflow-x: auto;
  scrollbar-color: rgba(139, 216, 255, .34) rgba(255, 255, 255, .04);
  scrollbar-width: thin;
}

.size-grid::-webkit-scrollbar {
  height: 9px;
}

.size-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .04);
}

.size-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(139, 216, 255, .34);
}

.cell {
  flex: 0 0 78px;
  min-height: 68px;
  border-color: rgba(158, 190, 195, .12);
  background: #0e171b;
}

.cell .size {
  color: #a7b8bd;
}

.cell .count {
  font-size: 20px;
}

.cell.good {
  border-top: 2px solid rgba(74, 222, 128, .55);
  background: linear-gradient(180deg, rgba(74, 222, 128, .16), rgba(74, 222, 128, .055));
  color: #86efac;
}

.cell.low {
  border-top: 2px solid rgba(245, 158, 11, .64);
  background: linear-gradient(180deg, rgba(245, 158, 11, .18), rgba(245, 158, 11, .06));
  color: #fbbf24;
}

.cell.empty {
  border-top: 2px solid rgba(251, 75, 95, .62);
  background: linear-gradient(180deg, rgba(251, 75, 95, .16), rgba(251, 75, 95, .055));
  color: #ff7b8a;
}

.cell.unknown {
  background: rgba(255, 255, 255, .035);
  color: var(--unknown);
}

.data-panel > summary,
summary {
  color: #e8f4f6;
}

.settings-dialog::backdrop {
  background: rgba(0, 0, 0, .58);
}

.settings-dialog form {
  background: var(--panel);
}

.settings-dialog label {
  color: #a9c0c5;
}

code {
  border-color: var(--line);
  background: #0d1519;
  color: #d7eef2;
}

@media (max-width: 820px) {
  .cell {
    flex-basis: 70px;
    min-height: 66px;
  }

  .model-head {
    min-height: 0;
  }
}
