:root {
  color-scheme: dark;
  --bg: #101216;
  --surface: #181b21;
  --surface-up: #20242c;
  --line: #30353e;
  --text: #f4f5f7;
  --muted: #a6adbb;
  --lime: #d8fa64;
  --amber: #f6ca82;
  --mono: "IBM Plex Mono", monospace;
  font: 14px Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, p { margin: 0; }
button, select, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
input, select, textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  min-width: 0;
  color: var(--text);
}
textarea { resize: vertical; }
label { display: grid; gap: 7px; color: var(--muted); font-weight: 500; }
.primary, .secondary {
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
  white-space: nowrap;
}
.primary { color: #15190d; background: var(--lime); border-color: var(--lime); }
.primary:hover { background: #e7ff96; }
.secondary { color: var(--text); background: var(--surface-up); }
.secondary:hover { background: #2b313b; }
.text-button { background: transparent; border: 0; color: var(--muted); padding: 5px; }
.text-button:hover { color: var(--lime); }
.muted { color: var(--muted); }
.workspace { min-height: 100vh; display: grid; grid-template-columns: 226px minmax(0, 1fr); }
.sidebar { background: #15181e; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 24px 15px; gap: 42px; }
.brand { display: flex; align-items: center; gap: 6px; color: #fff; font-size: 17px; font-weight: 800; letter-spacing: -.04em; }
.brand > span:last-child { color: var(--muted); }
.brand .brand-mark { display: grid; place-items: center; width: 35px; height: 35px; margin-right: 5px; border-radius: 9px; background: var(--lime); color: #141b0e; font: 800 italic 21px Inter, sans-serif; }
.sidebar nav { display: grid; gap: 6px; }
.nav { display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); padding: 12px; font-weight: 600; }
.nav span { font: 20px/16px var(--mono); }
.nav:hover { background: var(--surface-up); }
.nav.active { color: var(--lime); background: #242d20; border-color: #35412a; }
.account { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 6px 0; display: flex; gap: 8px; justify-content: space-between; align-items: center; overflow-wrap: anywhere; }
.top { height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid var(--line); color: var(--muted); font-weight: 600; }
.demo-badge { font: 12px var(--mono); color: var(--amber); border: 1px solid #66533a; padding: 5px 8px; border-radius: 5px; }
.main-content { padding: 38px 34px 44px; max-width: 1540px; margin: auto; }
.heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
h1 { font-size: clamp(31px, 4.5vw, 46px); font-weight: 800; letter-spacing: -.055em; line-height: 1.05; }
.heading p, .table-heading p { color: var(--muted); margin-top: 9px; }
.actions, .filters { display: flex; gap: 9px; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 23px; }
.metric { color: var(--text); display: grid; text-align: left; gap: 15px; padding: 19px 21px; }
.metric > span { color: var(--muted); font-weight: 600; }
.metric strong { font: 600 33px/1 var(--mono); font-variant-numeric: tabular-nums; }
.metric.warning strong { color: var(--amber); }
.metric.warning:hover, .metric.warning[aria-pressed="true"] { border-color: var(--amber); }
.table-heading { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 22px 21px 15px; }
h2 { font-size: 21px; letter-spacing: -.035em; }
.table-heading p { font-size: 13px; margin-top: 5px; }
.filters { padding: 0 21px 16px; }
.filters input { width: min(100%, 278px); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 14px 15px; vertical-align: middle; border-top: 1px solid var(--line); }
th { background: #1d2027; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
td:first-child, th:first-child { padding-left: 21px; }
td:last-child, th:last-child { padding-right: 21px; }
td { line-height: 1.45; }
tr:hover td { background: #1d2027; }
.product-name { min-width: 145px; font-weight: 650; }
.quantity { font: 500 13px var(--mono); white-space: nowrap; }
.stock-bar { display: block; width: 100%; min-width: 72px; max-width: 122px; height: 5px; margin-top: 8px; border: 0; border-radius: 8px; overflow: hidden; appearance: none; background: #2c323a; }
.stock-bar::-webkit-progress-bar { background: #2c323a; }
.stock-bar::-webkit-progress-value { background: #a6cc58; }
.stock-bar::-moz-progress-bar { background: #a6cc58; }
.stock-bar.low::-webkit-progress-value { background: var(--amber); }
.stock-bar.low::-moz-progress-bar { background: var(--amber); }
.badge { display: inline-block; white-space: nowrap; border-radius: 6px; padding: 4px 8px; font-size: 12px; color: #c9eaa3; background: #283523; }
.badge.low { color: var(--amber); background: #3d3021; }
.badge.neutral { color: var(--muted); background: var(--surface-up); }
.detail { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }
.table-footer { padding: 0 21px; }
.table-footer button { margin: 16px 0; }
.positive { color: #c9eaa3; }
.negative { color: #ffad9f; }
.empty { text-align: center; color: var(--muted); padding: 26px; }
.notice, .error { padding: 10px 12px; border-radius: 8px; color: #e7f6d0; background: #263321; }
.notice { margin-bottom: 15px; }
.notice.error, .error { background: #49272a; color: #ffcbc7; }
.login-view { min-height: 100vh; display: grid; align-items: center; justify-content: center; padding: 18px; }
.login-card { display: grid; gap: 17px; width: min(410px, calc(100vw - 36px)); padding: 30px; }
.login-card h1 { font-size: 32px; }
dialog { border: 1px solid var(--line); border-radius: 15px; color: var(--text); background: var(--surface); width: min(680px, calc(100% - 24px)); padding: 23px; }
dialog::backdrop { background: #08090bc9; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.dialog-head button { font-size: 23px; line-height: 1; }
#dialog-fields, #operation-lines { display: grid; gap: 13px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.operation-line { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.operation-line label { flex: 1 1 94px; }
.operation-line label:first-child { flex-basis: 180px; }
.operation-line button { font-size: 21px; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 17px; }
#dialog-error { margin-top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: 176px minmax(0, 1fr); }
  .main-content, .top { padding-inline: 20px; }
}
@media (max-width: 650px) {
  .workspace { display: block; }
  .sidebar { gap: 12px; padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .account { padding-top: 8px; }
  .top { height: 40px; }
  .main-content { padding: 22px 14px; }
  .metric { padding: 12px 9px; gap: 10px; }
  .metric > span { font-size: 11px; }
  .metric strong { font-size: 25px; }
  .metrics { gap: 6px; }
}
