:root {
  --brand: #e85d04;
  --accent: #f97316;
  --accent-dark: #c2410c;
  --accent-soft: #fed7aa;
  --secondary: #2b3138;
  --text: #1c2127;
  --muted: #5c6570;
  --line: #e4e0db;
  --bg: #f6f4f1;
  --bg-soft: #eeebe6;
  --surface: #ffffff;
  --header-bg: var(--secondary);
  --footer-bg: var(--secondary);
  --danger: #b42318;
  --ok: #067647;
  --warn: #b54708;
  --radius: 10px;
  --header-h: 118px;
  --shadow: 0 1px 2px rgba(28, 33, 39, 0.05), 0 10px 28px rgba(28, 33, 39, 0.06);
  --shadow-hover: 0 8px 24px rgba(28, 33, 39, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: 1.75rem;
}

.site-header {
  display: flex;
  flex-direction: column;
  background: var(--header-bg);
  color: #fff;
  box-shadow: 0 8px 24px rgba(28, 33, 39, 0.14);
}

.site-header a,
.site-header button.linkish,
.site-header .nav-drop-btn,
.site-header .account-menu-btn {
  color: #fff;
}

.site-header a:hover,
.site-header button.linkish:hover {
  color: color-mix(in srgb, #fff 82%, var(--accent));
}

.header-brand-bar,
.header-nav-row {
  width: 100%;
}

.header-brand-row,
.footer-inner,
.wrap {
  width: min(1280px, calc(100% - 2.5rem));
  margin: 0 auto;
}

.header-brand-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.85rem;
  min-height: 3.4rem;
  padding: 0.55rem 0;
}

.header-brand-row .shop-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.9;
  margin-right: auto;
  white-space: nowrap;
}

.header-nav-row {
  background: rgba(0, 0, 0, 0.18);
}

.header-nav-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  min-height: 2.85rem;
  padding: 0.2rem 0;
}

.brand-mark {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  color: #fff;
  font-weight: 700;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  height: 38px;
  max-width: 9rem;
  overflow: hidden;
  background: #fff;
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
}

.brand-logo {
  height: 30px;
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: left center;
}

.login-logo,
.company-logo-preview {
  max-height: 40px;
  max-width: min(220px, 46vw);
  width: auto;
  object-fit: contain;
  background: #fff;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
}

.login-logo {
  max-height: 64px;
  margin-bottom: 0.75rem;
}

.company-logo-preview {
  max-height: 72px;
}

.field-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.field-toggle label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 400;
}

.custom-field-edit {
  border: 1px solid var(--line);
  padding: 0.8rem 1rem 1rem;
  margin: 0;
  border-radius: var(--radius);
  background: var(--surface);
}

.company-theme {
  min-height: 100%;
  --header-bg: var(--brand);
  --footer-bg: var(--brand);
}

.helio-theme {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  --brand: #e85d04;
  --accent: #f97316;
  --accent-dark: #c2410c;
  --accent-soft: #fed7aa;
  --secondary: #2b3138;
  --header-bg: var(--secondary);
  --footer-bg: var(--secondary);
}

.helio-theme.login-shell,
.helio-theme:has(> .login-shell) {
  display: grid;
}

.helio-theme .page {
  flex: 1;
}

.brand-mark strong {
  font-size: 1.35rem;
  line-height: 1;
}

.nav-main {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.94rem;
  font-weight: 600;
  width: 100%;
}

.nav-main > a,
.nav-drop-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  border: 0;
  border-radius: 8px;
  white-space: nowrap;
  color: #fff;
  line-height: 1.2;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.nav-main > a:hover,
.nav-drop-btn:hover,
.nav-drop.is-current > .nav-drop-btn,
.nav-main > a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: none;
}

.helio-header .nav-main > a[aria-current="page"],
.helio-header .nav-drop.is-current > .nav-drop-btn {
  background: var(--brand);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #fff;
  color: var(--header-bg);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.helio-header .nav-badge {
  color: var(--secondary);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.86rem;
  flex-shrink: 0;
  margin-left: auto;
}

.account-menu {
  position: relative;
}

.account-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.16);
  color: #fff;
  font: inherit;
}

.account-menu-btn::after {
  content: "";
  width: 0.35em;
  height: 0.35em;
  flex-shrink: 0;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.85;
}

.account-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 16rem;
  padding: 0.4rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.site-header .account-menu-panel a,
.site-header .account-menu-panel button.linkish {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  color: var(--text);
}

.site-header .account-menu-panel a:hover,
.site-header .account-menu-panel button.linkish:hover,
.site-header .account-menu-panel button.demo-jump:hover:not(:disabled) {
  background: var(--bg-soft);
  color: var(--text);
}

.account-menu-kicker {
  margin: 0.15rem 0.6rem 0.1rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-header .account-menu-panel button.demo-jump,
.demo-jump-list button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.6rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.site-header .account-menu-panel button.demo-jump small,
.demo-jump-list button small {
  color: var(--muted);
  font-size: 0.75rem;
}

.site-header .account-menu-panel button.demo-jump:disabled,
.demo-jump-list button:disabled {
  cursor: default;
  opacity: 0.55;
}

.demo-jump-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.45rem;
}

.demo-jump-list button {
  border: 1px solid var(--line);
  background: var(--surface);
}

.demo-jump-list button:hover:not(:disabled) {
  border-color: var(--brand);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.list-filter {
  flex: 1 1 16rem;
  max-width: 24rem;
}

.list-filter input[type="search"] {
  width: 100%;
}

.filter-scope [data-search][hidden],
.filter-empty[hidden] {
  display: none !important;
}

.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.page-toolbar h1,
.page-toolbar h2 {
  margin: 0;
}

button.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.helio-header {
  background: var(--secondary);
  border-top: 3px solid var(--brand);
}

.helio-header .brand-mark::before {
  content: "";
  width: 11px;
  height: 11px;
  background: var(--brand);
  border-radius: 3px;
  flex-shrink: 0;
}

.helio-header .shop-label {
  color: var(--brand);
}

.page {
  min-height: calc(100vh - 220px);
  padding: 2rem 0 3.5rem;
}

.hero {
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--brand) 78%, #111) 0%,
    var(--brand) 58%,
    color-mix(in srgb, var(--brand) 70%, var(--accent)) 100%
  );
  color: #fff;
  padding: 2.8rem 0 2.5rem;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.hero p {
  margin: 0;
  max-width: 36rem;
  opacity: 0.92;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.25rem;
}

.product-card,
.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.product-card,
a.panel {
  overflow: hidden;
  color: var(--text);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

a.product-card:hover,
a.panel:hover {
  color: var(--text);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.product-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-soft);
}

.product-card .body,
.panel {
  padding: 1rem 1.1rem 1.15rem;
}

.product-card h2,
.product-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.price {
  color: var(--brand);
  font-weight: 600;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--brand);
  margin: 0;
  line-height: 1.15;
}

.btn,
button.btn,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius);
  padding: 0.4rem 1rem;
  line-height: 2rem;
  font: 600 0.9rem/2rem inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn:hover,
button.btn:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
  transform: translateY(-1px);
}

.btn:disabled,
button.btn:disabled,
.btn:disabled:hover,
button.btn:disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn-ghost {
  background: var(--surface);
  color: var(--brand);
}

.btn-ghost:hover {
  color: var(--accent-dark);
  background: var(--surface);
}

.qr-card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.qr-card img {
  width: 220px;
  height: 220px;
  margin: 0.6rem 0;
}

.qr-url {
  word-break: break-all;
  font-size: 0.8rem;
}

.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #fff4f2;
  color: var(--danger);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

input:not([type]),
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
select,
textarea {
  width: 100%;
  max-width: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:not([type]):focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}

textarea {
  min-height: 6rem;
}

.approver-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border: 1px solid var(--line);
  padding: 0.7rem 0.85rem;
  max-height: 11rem;
  overflow: auto;
  background: var(--bg-soft);
  border-radius: var(--radius);
}

.approver-list label {
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.size-price-grid {
  display: grid;
  gap: 0.55rem;
}

.size-price-row label {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  font-weight: 600;
}

.thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  vertical-align: middle;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.alert {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.alert-error {
  border-color: #f0b4ae;
  background: #fff6f5;
  color: var(--danger);
}

.alert-ok {
  border-color: #abefc6;
  background: #f6fef9;
  color: var(--ok);
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.badge-pending {
  color: var(--warn);
  border-color: #f9dbaf;
  background: #fffaeb;
}

.badge-approved {
  color: var(--ok);
  border-color: #abefc6;
  background: #f6fef9;
}

.stock-low {
  color: var(--danger);
  font-weight: 600;
}

.warehouse-models {
  display: grid;
  gap: 1rem;
}

.warehouse-model h2 {
  margin: 0;
  font-size: 1.15rem;
}

.warehouse-model > .btn {
  margin-top: 0.75rem;
}

.badge-rejected,
.badge-cancelled {
  color: var(--muted);
  background: var(--bg-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.site-footer {
  background: var(--footer-bg);
  color: #fff;
  padding: 2.2rem 0;
  font-size: 0.9rem;
}

.site-footer a {
  color: #fff;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.site-footer h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.8;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.budget-chip {
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
}

.legal {
  max-width: 44rem;
}

.legal h2 {
  margin-top: 1.4rem;
}

.legal-links {
  margin: 1.15rem 0 0;
  font-size: 0.85rem;
}

.site-footer li {
  margin: 0.2rem 0;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 420px at 12% -8%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 55%),
    linear-gradient(180deg, var(--secondary) 0 42%, var(--bg) 42%);
  padding: 2rem 1rem;
}

.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand);
  padding: 1.8rem 1.6rem 1.5rem;
  border-radius: 14px;
  box-shadow: var(--shadow-hover);
}

.demo-box {
  margin-top: 1.2rem;
  font-size: 0.85rem;
  background: var(--bg-soft);
  padding: 0.85rem;
  border-radius: var(--radius);
}

.demo-box code {
  font-size: 0.8rem;
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.period-form {
  align-items: end;
  gap: 0.85rem;
}

.period-form > div {
  min-width: 10rem;
}

.export-table {
  max-width: 36rem;
}

.export-table td:last-child {
  white-space: nowrap;
}

@media print {
  .site-header,
  .site-footer,
  .no-print {
    display: none !important;
  }

  .page.wrap {
    padding: 0;
  }

  .panel {
    break-inside: avoid;
    box-shadow: none;
    border: none;
  }

  .qr-card {
    border: none;
    padding: 0;
    box-shadow: none;
  }

  .qr-card img {
    width: 280px;
    height: 280px;
  }
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.row-negative td {
  background: #fff6f5;
}

.budget-chip.is-negative {
  border-color: #f0b4ae;
  color: #fff;
  background: rgba(180, 35, 24, 0.35);
}

.header-sub {
  width: min(1280px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 0.7rem 0 0.85rem;
}

.shop-for {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  color: #fff;
}

.shop-for label {
  font-size: 0.82rem;
  font-weight: 600;
}

.shop-for select {
  min-width: min(100%, 18rem);
  background: #fff;
  color: var(--text);
}

.shop-for-note {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.85rem;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius);
  padding: 0.4rem 0.75rem;
  font: 600 0.9rem inherit;
}

.nav-drop {
  position: relative;
  flex: 0 0 auto;
}

.nav-drop-btn::after {
  content: "";
  width: 0.38em;
  height: 0.38em;
  margin-left: 0.1rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.8;
}

.nav-drop-panel {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 13rem;
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 0.55rem 0.7rem;
  z-index: 40;
}

.nav-drop-panel a {
  color: var(--text);
  font-size: 0.92rem;
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
}

.site-header .nav-drop-panel a {
  color: var(--text);
}

.nav-drop-panel a:hover,
.nav-drop-panel a[aria-current="page"] {
  background: var(--bg-soft);
  color: var(--text);
}

input,
select,
textarea,
button {
  font-size: 1rem;
}

@media (max-width: 1023px) {
  .article-layout,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .budget-chip {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .header-nav-inner {
    flex-wrap: wrap;
  }

  .nav-main {
    display: none;
    width: 100%;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.35rem 0 0.7rem;
  }

  .nav-main.is-open {
    display: flex;
  }

  .nav-main > a,
  .nav-drop-btn {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-drop-panel {
    position: static;
    padding: 0.15rem 0 0.35rem 0.7rem;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .site-header .nav-drop-panel a {
    color: #fff;
  }

  .hero h1 {
    font-size: 1.45rem;
  }

  .page {
    padding: 1.2rem 0 2.5rem;
  }

  .btn,
  button.btn {
    min-height: 2.6rem;
  }

  .login-shell {
    background: var(--bg);
  }
}
