:root {
  --ink: #161616;
  --muted: #74746d;
  --paper: #f6f6f0;
  --white: #fff;
  --acid: #eaff3f;
  --line: #deded5;
  --danger: #ff5c42;
  --soft-danger: #fff0ec;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 8px; text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 700; }
h1, h2 { font-family: "Space Grotesk", sans-serif; margin: 0; line-height: .95; letter-spacing: -.05em; }
h1 { font-size: clamp(42px, 5vw, 68px); }
h2 { font-size: 34px; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--ink); }
.login-card { width: min(100%, 520px); padding: 44px; background: var(--acid); border-radius: 4px 48px 4px 4px; }
.brand-mark { float: right; font-family: "Space Grotesk"; font-weight: 700; font-size: 25px; }
.login-card h1 { font-size: clamp(54px, 9vw, 86px); }
.login-copy { max-width: 340px; margin: 24px 0 28px; line-height: 1.5; }
.login-form { display: grid; gap: 14px; }
.login-form label { display: grid; gap: 7px; font-size: 12px; font-weight: 700; }
.login-form input { width: 100%; padding: 13px; border: 1px solid var(--ink); background: #f8ffb8; outline: none; }
.login-form input:focus { background: white; box-shadow: 3px 3px 0 var(--ink); }
.login-button { border: 1px solid var(--ink); background: var(--ink); color: white; padding: 14px; font-weight: 700; margin-top: 4px; }
.login-button:disabled { opacity: .55; cursor: wait; }
.login-error { margin: 0; padding: 10px; color: #8f1c0c; background: #ffd8cf; font-size: 12px; }
.user-chip > span, .avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--acid); }
.prototype-note { margin: 24px 0 0; font-size: 12px; opacity: .6; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 240px; padding: 28px 22px; color: white; background: var(--ink); display: flex; flex-direction: column; z-index: 5; }
.logo { color: white; text-decoration: none; font-family: "Space Grotesk"; font-size: 25px; font-weight: 700; line-height: .8; letter-spacing: -.06em; }
.logo span { color: var(--acid); font-size: 12px; vertical-align: top; margin-left: 3px; }
nav { margin-top: 70px; display: grid; gap: 8px; }
.nav-item { border: 0; padding: 13px 14px; border-radius: 8px; background: transparent; color: #9b9b94; text-align: left; font-weight: 600; }
.nav-item span { margin-right: 10px; }
.nav-item:hover, .nav-item.active { color: var(--ink); background: var(--acid); }
.sidebar-bottom { margin-top: auto; }
.sync-state { color: #9b9b94; font-size: 12px; margin: 0 10px 18px; }
.sync-state i { display: inline-block; width: 7px; height: 7px; background: #6ddf83; border-radius: 50%; margin-right: 8px; }
.user-chip { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px; color: white; border: 1px solid #393933; background: #222; text-align: left; border-radius: 8px; }
.user-chip div { display: grid; }
.user-chip small { color: #85857e; }

main { margin-left: 240px; padding: 48px clamp(22px, 5vw, 72px) 80px; }
.mobile-header { display: none; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 25px; margin-bottom: 34px; }
.subtitle { margin: 14px 0 0; color: var(--muted); }
.primary-button { border: 1px solid var(--ink); background: var(--ink); color: white; padding: 13px 18px; font-weight: 700; box-shadow: 4px 4px 0 var(--acid); }
.primary-button:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--acid); }
.primary-button span { color: var(--acid); }
.full-width { width: 100%; margin-top: 8px; }

.stats-grid { display: grid; grid-template-columns: 1.25fr repeat(3, 1fr); gap: 12px; margin-bottom: 28px; }
.stat-card { background: var(--white); border: 1px solid var(--line); padding: 20px; min-height: 150px; display: flex; flex-direction: column; }
.stat-card p { color: var(--muted); margin: 0; font-size: 13px; }
.stat-card strong { font-family: "Space Grotesk"; font-size: 46px; margin-top: auto; letter-spacing: -.05em; }
.stat-card small { color: var(--muted); }
.hero-stat { background: var(--acid); border-color: var(--ink); }
.hero-stat p, .hero-stat small { color: var(--ink); }
.warning strong { color: var(--danger); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.search-box { width: min(100%, 420px); display: flex; align-items: center; gap: 10px; background: white; border: 1px solid var(--line); padding: 11px 13px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; }
.size-filters { display: flex; gap: 5px; }
.size-filter { border: 1px solid var(--line); background: white; padding: 9px 12px; }
.size-filter.active { color: white; background: var(--ink); border-color: var(--ink); }

.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.product-card { position: relative; background: white; border: 1px solid var(--line); overflow: hidden; }
.product-color { height: 10px; background: var(--swatch); }
.product-body { padding: 18px; }
.product-title-row { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.product-card h3 { margin: 0; font-family: "Space Grotesk"; font-size: 21px; letter-spacing: -.03em; }
.total-pill { font-size: 12px; padding: 4px 7px; background: var(--paper); white-space: nowrap; }
.total-pill.pending { color: #8a5a00; background: #fff4d6; }
.color-tabs { display: flex; gap: 5px; margin: 16px 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.color-tab { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid var(--line); background: var(--white); color: var(--muted); font-size: 12px; }
.color-tab i { width: 10px; height: 10px; border-radius: 50%; background: var(--tab-swatch); border: 1px solid #0002; }
.color-tab:hover { border-color: var(--ink); color: var(--ink); }
.color-tab.active { border-color: var(--ink); background: var(--ink); color: var(--white); }
.color-tab.active i { border-color: #fff8; }
.size-stock { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.size-cell { padding: 12px 4px; text-align: center; border-right: 1px solid var(--line); }
.size-cell:last-child { border: 0; }
.size-cell small { display: block; color: var(--muted); font-weight: 700; font-size: 10px; }
.size-cell strong { font-size: 18px; }
.size-cell.low { background: var(--soft-danger); color: var(--danger); }
.size-cell.pending { background: #fff4d6; color: #8a5a00; }
.size-cell.filtered-out { opacity: .18; }
.sku { color: #a0a097; font-size: 10px; letter-spacing: .08em; }

.table-card { background: white; border: 1px solid var(--line); }
.movement-row { display: grid; grid-template-columns: 130px 1fr 110px 140px; gap: 20px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.movement-row:last-child { border: 0; }
.movement-row small { display: block; color: var(--muted); }
.movement-amount { font-size: 18px; font-weight: 700; }
.movement-amount.in { color: #168842; }
.movement-amount.out { color: var(--danger); }
.empty-state { padding: 50px; text-align: center; color: var(--muted); }
.connection-badge { padding: 8px 12px; border-radius: 999px; background: #e4e4dc; color: var(--muted); font-size: 12px; font-weight: 700; }
.connection-badge.online { background: #dff8e5; color: #147136; }
.integration-card { display: flex; justify-content: space-between; gap: 30px; align-items: center; padding: 26px; margin-bottom: 34px; color: white; background: var(--ink); border-left: 8px solid var(--acid); }
.integration-card h2 { font-size: clamp(23px, 3vw, 36px); }
.integration-points { display: grid; gap: 8px; color: #d4d4ce; font-size: 13px; }
.integration-points span::first-letter { color: var(--acid); }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 14px; }
.section-heading h2 { font-size: 26px; }
.section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.secondary-button { padding: 9px 13px; border: 1px solid var(--line); background: white; font-weight: 700; }
.event-row { display: grid; grid-template-columns: 170px 1fr 170px; gap: 20px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.event-row:last-child { border: 0; }
.event-row small { display: block; color: var(--muted); }
.status-label { justify-self: end; padding: 5px 8px; background: #dff8e5; color: #147136; font-size: 11px; font-weight: 700; }
.status-label.warning { color: #8a5a00; background: #fff4d6; }

dialog { width: min(92vw, 540px); padding: 0; border: 0; border-radius: 2px; box-shadow: 0 25px 80px #0005; }
dialog::backdrop { background: #111b; backdrop-filter: blur(3px); }
dialog form { padding: 30px; }
.dialog-heading { display: flex; justify-content: space-between; margin-bottom: 26px; }
.icon-button { border: 0; background: transparent; font-size: 30px; align-self: start; }
dialog label { display: grid; gap: 8px; margin-bottom: 17px; font-size: 13px; font-weight: 700; }
dialog input, dialog select { width: 100%; padding: 12px; border: 1px solid var(--line); background: white; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stock-preview { background: var(--paper); padding: 13px; margin: -3px 0 17px; font-size: 13px; }
.toast { position: fixed; right: 25px; bottom: 25px; padding: 13px 18px; background: var(--ink); color: white; transform: translateY(100px); opacity: 0; transition: .25s; z-index: 20; }
.toast.show { transform: none; opacity: 1; }

@media (max-width: 1050px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .product-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .sidebar { display: none; }
  main { margin: 0; padding: 20px 16px 70px; }
  .mobile-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 45px; }
  .logo.dark { color: var(--ink); font-size: 25px; }
  .page-heading { align-items: start; flex-direction: column; }
  .page-heading .primary-button { width: 100%; }
  .stats-grid, .product-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .size-filters { overflow-x: auto; }
  .movement-row { grid-template-columns: 1fr auto; gap: 8px; }
  .movement-row > :nth-child(3) { grid-row: 1; grid-column: 2; }
  .movement-row > :nth-child(4) { grid-column: 1 / -1; }
  .login-card { padding: 28px; }
  .integration-card, .section-heading { align-items: stretch; flex-direction: column; }
  .event-row { grid-template-columns: 1fr; gap: 8px; }
  .status-label { justify-self: start; }
}
