:root {
  --red: #d8471f;
  --red-bright: #f36a24;
  --deep-red: #9d3b14;
  --pepper: #66351e;
  --charcoal: #2a1b13;
  --broth: #c86d18;
  --gold: #f6b642;
  --amber: #f28a24;
  --warm-bg: #fff7eb;
  --panel: #fffdf8;
  --ink: #241c19;
  --muted: #746257;
  --line: #efd8bd;
  --green: #16803c;
  --orange: #d97706;
  --blue: #2563eb;
  --rose: #be123c;
  --shadow: 0 16px 42px rgba(133, 72, 19, 0.12);
  --asset-heat: url("./assets/malatang-heat.png");
  --asset-orange-broth: url("./assets/ours-orange-broth-bg.png");
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(255, 247, 235, 0.96), rgba(255, 252, 246, 0.98) 38%, #fff8ef),
    var(--warm-bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  min-height: 38px;
  padding: 0 13px;
  cursor: pointer;
  white-space: nowrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  color: var(--ink);
  padding: 0 10px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
select:focus {
  outline: 0;
  border-color: rgba(242, 138, 36, 0.58);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(242, 138, 36, 0.15);
}

dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(42, 23, 21, 0.42);
}

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

th,
td {
  border-bottom: 1px solid #f1ded5;
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: #744018;
  font-weight: 700;
  background: #fff2dd;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: #fff8f1;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(42, 27, 19, 0.96), rgba(116, 55, 18, 0.92)),
    var(--asset-heat) center / cover;
  color: #fff;
  padding: 24px 18px;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(246, 182, 66, 0.17) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(255, 235, 193, 0.08), transparent 45%);
  background-size: 42px 100%, auto;
  pointer-events: none;
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 30px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background:
    linear-gradient(145deg, #fff1a8 0%, var(--gold) 28%, var(--amber) 62%, var(--deep-red) 100%);
  color: #fff8df;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(198, 109, 24, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

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

.brand span {
  color: #ffe4b7;
  font-size: 13px;
  margin-top: 3px;
}

nav {
  display: grid;
  gap: 8px;
}

nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  color: #fff2df;
  background: transparent;
  text-align: left;
  border: 1px solid transparent;
}

nav button span {
  display: grid;
  place-items: center;
  width: 20px;
}

nav button.active,
nav button:hover {
  background: linear-gradient(90deg, rgba(242, 138, 36, 0.34), rgba(246, 182, 66, 0.16));
  border-color: rgba(246, 182, 66, 0.5);
  box-shadow: inset 3px 0 0 var(--gold);
}

.sidebar-plate {
  position: absolute;
  right: -26px;
  bottom: 24px;
  width: 128px;
  height: 128px;
  border: 1px solid rgba(255, 218, 136, 0.26);
  border-radius: 50%;
  background:
    radial-gradient(circle at 64% 58%, rgba(242, 138, 36, 0.72), transparent 28%),
    radial-gradient(circle at 42% 38%, rgba(246, 182, 66, 0.55), transparent 18%),
    radial-gradient(circle, rgba(255, 245, 220, 0.09), rgba(255, 255, 255, 0.03) 58%, transparent 62%);
  opacity: 0.9;
}

.sidebar-plate span {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: rgba(255, 218, 164, 0.72);
}

.sidebar-plate span:nth-child(1) {
  width: 44px;
  height: 8px;
  left: 26px;
  top: 46px;
  transform: rotate(-28deg);
}

.sidebar-plate span:nth-child(2) {
  width: 52px;
  height: 9px;
  left: 38px;
  top: 64px;
  transform: rotate(18deg);
}

.sidebar-plate span:nth-child(3) {
  width: 35px;
  height: 7px;
  left: 55px;
  top: 82px;
  transform: rotate(-12deg);
}

.sidebar-plate span:nth-child(4) {
  width: 10px;
  height: 10px;
  left: 31px;
  top: 76px;
  background: var(--amber);
}

main {
  min-width: 0;
  padding: 24px 28px 30px;
}

.topbar,
.panel-heading,
.panel-tools,
.top-actions,
.form-actions,
.filter-row,
.button-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  min-height: 156px;
  margin-bottom: 18px;
  border: 1px solid rgba(246, 182, 66, 0.34);
  border-radius: 8px;
  padding: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 42%, rgba(246, 182, 66, 0.28), transparent 34%),
    linear-gradient(90deg, rgba(42, 27, 19, 0.88) 0%, rgba(127, 66, 18, 0.64) 45%, rgba(64, 36, 19, 0.18) 100%),
    var(--asset-orange-broth) center 58% / cover;
  box-shadow: 0 18px 44px rgba(133, 72, 19, 0.2);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, #ffe08a, var(--amber), transparent);
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.topbar-copy {
  display: grid;
  gap: 4px;
}

.top-actions,
.form-actions,
.button-row {
  flex-wrap: wrap;
}

.panel-tools {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.segmented-control {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #edcda5;
  border-radius: 8px;
  background: #fffaf4;
}

.segmented-control button {
  min-height: 34px;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}

.segmented-control button.active {
  background: linear-gradient(135deg, var(--gold), var(--amber) 58%, var(--deep-red));
  color: #fff;
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

.role-staff .supplier-column,
.role-staff .manager-only {
  display: none !important;
}

.top-actions {
  justify-content: flex-end;
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--deep-red);
  font-weight: 700;
}

.topbar .eyebrow {
  color: #ffe19a;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
}

.topbar h1 {
  max-width: 560px;
  font-size: clamp(30px, 3.6vw, 44px);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.32);
}

h2 {
  font-size: 18px;
}

h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.primary {
  background: linear-gradient(135deg, var(--gold), var(--amber) 48%, var(--deep-red));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(242, 138, 36, 0.24);
}

.ghost {
  background: #fff3df;
  color: var(--deep-red);
  font-weight: 700;
  border: 1px solid rgba(242, 138, 36, 0.14);
}

.api-badge,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  background: #fff0d2;
  color: var(--pepper);
  font-size: 13px;
  font-weight: 700;
}

.api-badge.ok,
.pill.ok {
  background: #eaf8ef;
  color: #116936;
}

.api-badge.bad,
.pill.bad {
  background: #ffe4de;
  color: var(--deep-red);
}

.action-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 8px;
  padding: 0 10px;
  background: #f6efe8;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid rgba(255, 221, 182, 0.3);
  border-radius: 8px;
  background: rgba(255, 248, 241, 0.92);
  padding: 6px 8px 6px 12px;
  color: var(--ink);
  backdrop-filter: blur(8px);
}

.user-menu strong,
.user-menu span {
  display: block;
}

.user-menu span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.steam-lines {
  display: flex;
  gap: 12px;
  height: 34px;
  align-items: end;
  margin-top: 8px;
}

.steam-lines span {
  display: block;
  width: 26px;
  height: 30px;
  border-left: 2px solid rgba(255, 214, 133, 0.62);
  border-radius: 50%;
  transform: rotate(16deg);
  opacity: 0.72;
}

.steam-lines span:nth-child(2) {
  height: 22px;
  transform: rotate(-12deg);
  opacity: 0.5;
}

.steam-lines span:nth-child(3) {
  height: 27px;
  transform: rotate(8deg);
  opacity: 0.58;
}

.message {
  margin-bottom: 18px;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff0d2;
  color: #7a4a00;
  border: 1px solid #f5d391;
}

.message.error {
  background: #ffe6dc;
  color: var(--pepper);
  border-color: #f1c7c0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid rgba(239, 216, 189, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  position: relative;
  overflow: hidden;
  min-height: 110px;
  padding: 18px;
  display: grid;
  align-content: space-between;
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.97), rgba(255, 248, 235, 0.96));
}

.metric::after {
  position: absolute;
  right: 16px;
  bottom: -12px;
  font-size: 54px;
  line-height: 1;
  color: rgba(200, 109, 24, 0.1);
  font-weight: 900;
}

.metric.danger::after {
  content: "辣";
}

.metric.transit::after {
  content: "途";
}

.metric.warning::after {
  content: "采";
}

.metric.neutral::after {
  content: "¥";
}

.metric span {
  color: var(--muted);
  font-size: 14px;
}

.metric strong,
.report-number {
  font-size: 28px;
  font-weight: 800;
  position: relative;
  z-index: 1;
}

.metric.danger {
  border-top: 4px solid var(--amber);
}

.metric.transit {
  border-top: 4px solid var(--blue);
}

.metric.warning {
  border-top: 4px solid var(--gold);
}

.metric.neutral {
  border-top: 4px solid var(--green);
}

.content-grid,
.split-grid {
  display: grid;
  gap: 18px;
}

.content-grid {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.split-grid {
  grid-template-columns: minmax(420px, 1.45fr) minmax(300px, 0.9fr);
}

.panel {
  min-width: 0;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 249, 239, 0.96));
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel-heading {
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-heading h2,
.panel > h2 {
  position: relative;
  padding-left: 12px;
}

.panel-heading h2::before,
.panel > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe08a, var(--amber));
}

.section-gap {
  margin-top: 22px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  border: 1px solid rgba(239, 216, 189, 0.7);
  border-radius: 8px;
  background: rgba(255, 249, 239, 0.78);
  padding: 12px;
}

.form-grid button {
  grid-column: 1 / -1;
}

.purchase-overview {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.purchase-alert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.purchase-alert-card {
  border: 1px solid #efd8b8;
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: #fffaf2;
  padding: 12px;
}

.purchase-alert-card header,
.purchase-alert-card footer,
.purchase-alert-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.purchase-alert-card header small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.purchase-alert-stats {
  margin: 12px 0;
  border-top: 1px solid #f0dcc4;
  border-bottom: 1px solid #f0dcc4;
  padding: 9px 0;
  color: var(--muted);
  font-size: 13px;
}

.purchase-alert-stats strong {
  color: var(--ink);
}

.purchase-alert-card footer {
  justify-content: flex-end;
}

.manual-purchase-builder {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border: 1px solid rgba(239, 216, 189, 0.7);
  border-radius: 8px;
  background: rgba(255, 249, 239, 0.78);
  padding: 12px;
}

.manual-purchase-header,
.manual-purchase-composer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.manual-purchase-composer {
  grid-template-columns: minmax(180px, 1.4fr) minmax(110px, 0.7fr) minmax(130px, 0.8fr) auto;
}

.manual-purchase-lines {
  display: grid;
  gap: 8px;
}

.manual-purchase-line,
.manual-purchase-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.manual-purchase-line {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdfa;
  padding: 10px 12px;
}

.manual-purchase-line small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.manual-purchase-actions {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.manual-purchase-actions small {
  color: var(--muted);
}

.manual-purchase-status {
  display: grid;
  gap: 4px;
}

.form-feedback {
  color: var(--green) !important;
  font-weight: 700;
}

.form-feedback.error {
  color: var(--red) !important;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  padding: 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.toggle-field input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.integration-grid section {
  min-width: 0;
}

.integration-grid h3 {
  color: var(--deep-red);
}

.integration-table {
  margin-top: 18px;
  border: 1px solid var(--line);
}

.integration-table table {
  min-width: 980px;
}

.mapping-threshold-input {
  max-width: 110px;
}

.compact-actions {
  gap: 6px;
  flex-wrap: nowrap;
}

.compact-actions button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 13px;
}

.danger-button {
  color: var(--red);
}

.integration-log-heading {
  margin-top: 18px;
}

.sync-error {
  display: block;
  margin-top: 5px;
  color: var(--red);
  line-height: 1.4;
}

.list {
  display: grid;
  gap: 10px;
}

.list.compact {
  margin-top: 12px;
  gap: 8px;
}

.empty {
  border: 1px dashed #edcda5;
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: #fff8f1;
}

.list-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #efd8b8;
  border-radius: 8px;
  padding: 12px;
  background: #fffdf9;
}

.list-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold), var(--amber));
}

.list-card header,
.list-card footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.list-card header strong {
  display: block;
}

.list-card small,
.muted {
  color: var(--muted);
}

.list-card footer {
  margin-top: 10px;
  flex-wrap: wrap;
}

.line-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.suggestion-edit-card {
  gap: 12px;
}

.suggestion-edit-lines {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.suggestion-edit-line {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 0.7fr) minmax(120px, 0.7fr);
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 249, 239, 0.76);
}

.suggestion-edit-item {
  display: grid;
  gap: 4px;
  align-self: center;
}

.suggestion-edit-line label,
.suggestion-arrival-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.suggestion-edit-line input,
.suggestion-arrival-field input {
  width: 100%;
}

.suggestion-arrival-field {
  max-width: 240px;
}

.status-low {
  color: var(--red);
  font-weight: 700;
}

.inventory-row-low {
  background: #fff5e8;
}

.inventory-row-low td:first-child {
  box-shadow: inset 4px 0 0 var(--amber);
}

.stock-warning-note {
  color: var(--deep-red);
  font-weight: 700;
}

.status-normal {
  color: var(--green);
  font-weight: 700;
}

.filter-row {
  margin-bottom: 18px;
  flex-wrap: wrap;
  border: 1px solid rgba(239, 216, 189, 0.78);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
  padding: 12px;
}

.filter-row input {
  max-width: 180px;
}

.stock-panel {
  padding: 20px;
}

.stock-panel .panel-heading {
  align-items: flex-start;
  border-bottom: 1px solid #efd8bd;
  padding-bottom: 14px;
}

.stock-panel .panel-heading small {
  display: block;
  margin-top: 5px;
  line-height: 1.5;
}

.stock-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  border: 1px solid #efd6ad;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 241, 213, 0.94), rgba(255, 250, 242, 0.95));
  padding: 12px;
  margin-bottom: 14px;
}

.stock-search {
  display: grid;
  grid-template-columns: 54px minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
}

.stock-search span {
  color: var(--deep-red);
  font-size: 13px;
  font-weight: 800;
}

.stock-selects {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.stock-selects select {
  min-width: 150px;
}

.stock-table-wrap {
  border: 1px solid #efd6ad;
  border-radius: 8px;
  background: #fff;
}

.stock-table {
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
}

.stock-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px;
  background: #fff0d7;
  color: #754313;
}

.stock-table td {
  padding: 12px;
  vertical-align: middle;
}

.stock-table tbody tr:last-child td {
  border-bottom: 0;
}

.stock-item-name {
  display: grid;
  gap: 4px;
}

.stock-item-name small {
  color: var(--muted);
  font-weight: 500;
}

.category-chip,
.threshold-chip,
.stock-count-value {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 8px;
  padding: 0 9px;
}

.category-chip {
  background: #f6ead8;
  color: #6b4a31;
  font-size: 13px;
  font-weight: 700;
}

.threshold-chip {
  background: #ffedbd;
  color: #7a4a00;
  font-weight: 800;
}

.stock-count-value {
  color: var(--ink);
  font-weight: 800;
}

.stock-row-low {
  background: #fff4e6;
}

.stock-row-low td:first-child {
  box-shadow: inset 4px 0 0 var(--amber);
}

.stock-row-low .stock-count-value {
  color: var(--deep-red);
}

.stock-row-low .threshold-chip {
  background: #ffdfad;
  color: var(--deep-red);
}

.qty-input {
  max-width: 150px;
  font-weight: 800;
}

.location-select {
  min-width: 132px;
}

.note-input {
  min-width: 190px;
}

.row-action {
  min-width: 88px;
}

.empty-row td {
  background: #fff8f1;
  color: var(--muted);
  padding: 26px;
  text-align: center;
}

.pagination-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #efd8bd;
}

.stock-panel .form-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.stock-panel .form-actions .primary {
  min-width: 140px;
}

.stock-submit-bar {
  position: sticky;
  z-index: 8;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  border: 1px solid #e89024;
  border-radius: 8px;
  background: linear-gradient(100deg, #fff2d2, #ffd47c);
  padding: 12px 14px;
  box-shadow: 0 14px 30px rgba(134, 72, 21, 0.2);
}

.stock-submit-bar strong,
.stock-submit-bar small {
  display: block;
}

.stock-submit-bar small {
  margin-top: 3px;
  color: #76512d;
}

.stock-submit-bar .primary {
  min-width: 210px;
}

.order-next-step {
  margin-bottom: 12px;
  border: 1px solid #e89127;
  border-left: 5px solid var(--amber);
  border-radius: 7px;
  background: #fff1d2;
  padding: 11px 13px;
  color: #6e3a16;
  font-weight: 800;
}

.list-card.just-created {
  border-color: #df841e;
  background: #fff4dd;
  box-shadow: 0 0 0 3px rgba(242, 153, 42, 0.18);
}

.inactive-card {
  opacity: 0.68;
  background: #f7f4ef;
}

.bar-list {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(140px, 1fr) 70px;
  gap: 10px;
  align-items: center;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #f3e2cb;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), var(--gold));
}

.receive-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.receive-line {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 8px;
  align-items: center;
}

.modal {
  width: min(420px, calc(100vw - 28px));
  margin: auto;
}

.modal-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 24px 56px rgba(42, 23, 21, 0.22);
}

.field-label {
  display: grid;
  gap: 6px;
  color: #744018;
  font-size: 13px;
  font-weight: 700;
}

.field-label input,
.field-label select {
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}

.important-field {
  border-left: 3px solid var(--gold);
  padding-left: 10px;
}

.important-field input {
  background: #fff8ec;
  border-color: #f2c789;
}

#view-uber > .panel {
  width: 100%;
}

.stock-confirm-modal {
  width: min(860px, calc(100vw - 28px));
}

.stock-confirm-card {
  max-height: min(760px, calc(100vh - 40px));
  overflow: hidden;
}

.stock-confirm-card .table-wrap {
  max-height: 520px;
  overflow: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.icon-button {
  width: 38px;
  padding: 0;
  font-size: 20px;
}

.login-page {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(42, 27, 19, 0.88), rgba(126, 66, 21, 0.52), rgba(255, 247, 235, 0.78)),
    var(--asset-orange-broth) center / cover;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(300px, 420px);
  gap: 24px;
  width: min(1040px, 100%);
  padding: 0;
}

.login-hero,
.login-panel {
  border: 1px solid rgba(255, 215, 169, 0.28);
  border-radius: 8px;
  box-shadow: 0 24px 62px rgba(36, 17, 15, 0.34);
}

.login-hero {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  display: grid;
  align-content: center;
  padding: 36px;
  background:
    linear-gradient(145deg, rgba(42, 27, 19, 0.76), rgba(165, 83, 20, 0.5)),
    rgba(42, 27, 19, 0.58);
  color: #fff;
  backdrop-filter: blur(4px);
}

.login-hero::after {
  content: "";
  position: absolute;
  left: 36px;
  right: 36px;
  bottom: 28px;
  height: 3px;
  background: linear-gradient(90deg, #ffe08a, var(--amber), transparent);
}

.login-brand {
  margin-bottom: 28px;
}

.login-hero h1 {
  max-width: 420px;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.08;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.38);
}

.login-hero p {
  max-width: 430px;
  margin: 14px 0 0;
  color: #ffe7d6;
  line-height: 1.65;
}

.login-panel {
  align-self: center;
  padding: 24px;
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(10px);
}

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

.login-panel .button-row {
  margin-top: 14px;
}

.login-heat-badges {
  display: flex;
  gap: 10px;
  margin-top: 26px;
}

.login-heat-badges span {
  display: block;
  width: 46px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--amber), var(--gold));
  box-shadow: 0 10px 24px rgba(242, 138, 36, 0.28);
}

.login-heat-badges span:nth-child(2) {
  width: 30px;
  background: #ffd16d;
}

.login-heat-badges span:nth-child(3) {
  width: 18px;
  background: #fff0c7;
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

  .sidebar-plate {
    display: none;
  }

  nav {
    grid-template-columns: repeat(4, 1fr);
  }

  nav button {
    justify-content: center;
  }

  main {
    padding: 18px;
  }

  .topbar {
    display: flex;
    min-height: 0;
    padding: 20px;
    gap: 16px;
  }

  .topbar h1 {
    font-size: 32px;
  }

  .steam-lines {
    height: 22px;
    margin-top: 4px;
  }

  .steam-lines span {
    height: 20px;
  }

  .topbar .user-menu {
    align-items: center;
    flex-direction: row;
    width: min(100%, 560px);
  }

  .topbar,
  .user-menu,
  .panel-tools,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .content-grid,
  .split-grid,
  .integration-grid,
  .form-grid,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .manual-purchase-composer {
    grid-template-columns: 1fr 1fr;
  }

  .login-hero {
    min-height: 260px;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }

  .stock-panel .panel-heading {
    align-items: stretch;
  }

  .stock-panel .panel-tools {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
  }

  .stock-panel .panel-tools .api-badge {
    flex: 1;
    justify-content: center;
  }

  .stock-panel .panel-tools .ghost {
    width: 40px;
    padding: 0;
  }

  .stock-toolbar {
    grid-template-columns: 1fr;
  }

  .stock-selects {
    justify-content: stretch;
  }

  .stock-selects select {
    min-width: 0;
  }

  .suggestion-edit-line {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 17px;
  }

  main {
    padding: 12px;
  }

  .topbar {
    padding: 16px;
    background-position: center right;
  }

  .topbar h1 {
    font-size: 28px;
  }

  .sidebar {
    padding: 12px;
  }

  .brand {
    margin-bottom: 14px;
  }

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

  nav button {
    min-height: 42px;
    justify-content: flex-start;
    white-space: normal;
  }

  .top-actions,
  .user-menu,
  .button-row,
  .form-actions,
  .filter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .manual-purchase-header,
  .manual-purchase-composer {
    grid-template-columns: 1fr;
  }

  .manual-purchase-actions,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .manual-purchase-actions > *,
  .modal-actions > * {
    width: 100%;
  }

  .topbar .top-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: stretch;
    width: 100%;
  }

  .topbar .top-actions > * {
    width: auto;
  }

  .topbar .top-actions > .api-badge {
    grid-column: 1;
    grid-row: 1;
    justify-content: center;
  }

  .topbar #refreshButton {
    grid-column: 2;
    grid-row: 1;
  }

  .topbar .top-actions > .user-menu {
    display: grid;
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: 1fr 1fr;
  }

  .topbar .user-menu > div {
    grid-column: 1 / -1;
  }

  .topbar .user-menu {
    align-items: stretch;
  }

  .top-actions > *,
  .button-row > *,
  .form-actions > *,
  .filter-row > * {
    width: 100%;
    max-width: none;
  }

  .metric,
  .panel {
    padding: 14px;
  }

  .metric {
    min-height: 88px;
  }

  .metric strong,
  .report-number {
    font-size: 24px;
  }

  .list-card header,
  .list-card footer,
  .receive-line {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .list-card footer button,
  .receive-form button {
    width: 100%;
  }

  .stock-search {
    grid-template-columns: 1fr;
  }

  .stock-selects,
  .pagination-row {
    align-items: stretch;
    flex-direction: column;
  }

  .stock-table {
    min-width: 780px;
  }

  .stock-panel .form-actions .primary {
    width: 100%;
  }

  .stock-submit-bar {
    align-items: stretch;
    bottom: 8px;
    flex-direction: column;
  }

  .stock-submit-bar .primary {
    width: 100%;
  }
}
