:root {
  color-scheme: light;
  --page: #f3f6fc;
  --card: #fff;
  --ink: #142543;
  --muted: #566681;
  --line: #e3eaf5;
  --blue: #1755c7;
  --blue-soft: #e8f0ff;
  --blue-strong: #133f9e;
  --amber: #8b5000;
  --green: #14604d;
  --violet: #6045a9;
  --radius: 21px;
  --shadow: 0 10px 32px #234d8010;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--page); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid #5084ee;
  outline-offset: 3px;
}
svg { display: block; width: 20px; height: 20px; }
.workspace { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }

.rail {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  background: #fff;
  padding: 33px 18px 20px;
  border-right: 1px solid var(--line);
}
.brand { display: block; width: fit-content; max-width: calc(100% - 16px); margin: 0 8px 42px; }
.brand img, .mobile-brand img { display: block; max-width: 100%; height: auto; }
.brand img { width: 150px; }
.mobile-brand img { width: 116px; }
.mobile-brand { display: none; }
.rail-label { margin: 0 12px 12px; color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.nav { display: grid; gap: 6px; }
.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  padding: 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}
.nav-btn:hover { background: #f0f5ff; color: var(--blue); }
.nav-btn.active { background: var(--blue-soft); color: var(--blue-strong); }

.shell { width: 100%; max-width: 1450px; margin: 0 auto; padding: 24px clamp(20px, 3.5vw, 58px) 24px; }
.topline, .top-actions { display: flex; align-items: center; gap: 10px; }
.topline { justify-content: flex-end; margin-bottom: 25px; }
.mode {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}

.mode:hover:not(:disabled) { background: var(--blue-soft); }
.mode svg { width: 17px; height: 17px; }
.mode[aria-pressed=true] { color: var(--blue-strong); background: var(--blue-soft); }
.mode:disabled { opacity: 1; }


.hero { display: flex; justify-content: space-between; align-items: end; gap: 10px; margin-bottom: 17px; }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
h1 { margin: 7px 0 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.14; letter-spacing: -.045em; }
h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.hero p, .panel-head p, .dialog-head p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.sync { display: flex; align-items: center; gap: 7px; color: var(--green); font-size: 12px; white-space: nowrap; padding-bottom: 2px; }
.sync i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #3f9c75; box-shadow: 0 0 0 4px #dff2eb; }
.sync.off { color: #795814; }
.sync.off i { background: #c88a25; box-shadow: 0 0 0 4px #faedcf; }
.sync a { color: inherit; }

.search {
  display: flex;
  gap: 11px;
  align-items: center;
  width: 100%;
  padding: 0 13px;
  border: 1px solid #dbe5f5;
  border-radius: 14px;
  background: white;
  color: var(--blue);
  box-shadow: 0 4px 14px #234d8008;
}
#global-search { margin-bottom: 16px; }
.search:focus-within { outline: 2px solid #6c98ed; outline-offset: 2px; }
.search input { width: 100%; min-width: 0; padding: 13px 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search kbd { min-width: 24px; text-align: center; border: 1px solid var(--line); padding: 2px 5px; border-radius: 5px; color: var(--muted); }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-bottom: 17px; }
.metric {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 15px;
  text-align: left;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow .16s ease;
}
.metric:hover { box-shadow: 0 10px 28px #234d8026; }
.metric-stock { color: white; background: linear-gradient(130deg,#143e9f,#2163dc); border-color: #245bc8; }
.metric-stock::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 170px;
  height: 170px;
  right: -81px;
  bottom: -78px;
  border-radius: 50%;
  border: 1px solid #ffffff4a;
  box-shadow: 0 0 0 15px #ffffff11, 0 0 0 34px #ffffff13, 0 0 0 53px #ffffff0b;
}
.metric-top { display: flex; justify-content: space-between; align-items: start; color: var(--muted); }
.metric-icon, .shortcut-icon, .product-thumb {
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 11px;
  width: 38px;
  height: 38px;
  background: #e9f0fe;
  color: #2c60c0;
}
.metric-stock .metric-top { color: white; }
.metric-stock .metric-icon { background: #ffffff2b; color: white; }
.metric-incoming .metric-icon { background: #e4f4ef; color: var(--green); }
.metric-attention .metric-icon { background: #fff0d9; color: var(--amber); }
.metric-name { font-size: 13px; font-weight: 700; }
.metric strong { font: 750 clamp(24px, 3vw, 35px)/1 "SFMono-Regular", Consolas, monospace; letter-spacing: -.07em; }
.metric strong small { margin-left: 5px; font: 600 12px "PingFang SC", sans-serif; letter-spacing: 0; }
.metric-note { color: var(--muted); font-size: 11px; }
.metric-stock .metric-note { color: #e0ecff; }

.panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; padding: 18px 18px 14px; }
.panel-head select, .alert-setting select {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7faff;
  color: var(--ink);
  padding: 6px 8px;
  font-size: 12px;
}
.quick-panel { margin-bottom: 17px; }
.shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding: 0 18px 16px; }
.shortcuts button {
  display: flex; align-items: center; gap: 8px; padding: 9px;
  text-align: left; background: #f8faff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; font-size: 13px; font-weight: 700;
}
.shortcuts button:hover { background: var(--blue-soft); }
.shortcuts button:nth-child(2) .shortcut-icon { background: #fff0e8; color: #99502e; }
.shortcuts button:nth-child(3) .shortcut-icon { background: #efebff; color: var(--violet); }
.shortcuts small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; margin-top: 4px; }
.shortcuts b { margin-left: auto; color: var(--muted); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 15px; }
.chart { padding: 3px 18px 12px; }
.chart-empty {
  display: grid; place-content: center; justify-items: center; gap: 9px; min-height: 174px;
  text-align: center; border: 1px dashed #cddcf5; border-radius: 14px;
  background: repeating-linear-gradient(to bottom,#f9fbff 0,#f9fbff 31px,#edf2fb 31px,#edf2fb 32px);
}
.chart-empty svg { width: 30px; height: 30px; color: var(--blue); }
.chart-empty strong { font-size: 14px; }
.chart-empty small, .chart-note { color: var(--muted); font-size: 11px; }
.chart-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 11px; color: var(--muted); font-size: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 4px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; background: #3069d8; }
.chart-legend span + span i { background: #a7baff; }
.chart-plot { display: grid; grid-template-columns: repeat(var(--days), minmax(0,1fr)); gap: 2px; background: repeating-linear-gradient(to bottom,#fff 0,#fff 31px,#edf2fb 31px,#edf2fb 32px); }
.chart-day { min-width: 0; text-align: center; }
.chart-day small { display: block; overflow: visible; white-space: nowrap; color: var(--muted); font: 10px/1.6 "SFMono-Regular", Consolas, monospace; }
.chart-day:last-child small { text-align: right; direction: rtl; }
.chart-day:last-child small { unicode-bidi: plaintext; }
.bar-pair { height: 128px; display: flex; justify-content: center; gap: 2px; align-items: end; }
.bar-pair i { width: min(42%, 12px); height: var(--height); background: #3069d8; border-radius: 3px 3px 0 0; }
.bar-pair i + i { background: #a7baff; }
.chart-note { margin: 8px 0 0; }
.link-btn { border: 0; background: transparent; color: var(--blue); font-size: 12px; white-space: nowrap; padding: 3px 0; }
.link-btn:hover { text-decoration: underline; }
.alert-item {
  width: calc(100% - 34px); display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 8px; align-items: center;
  margin: 0 17px; padding: 7px 0; border: 0; border-bottom: 1px solid var(--line);
  text-align: left; background: white; color: var(--ink);
}
.alert-item:hover { background: #f8faff; }
.alert-item strong, .alert-item small { display: block; overflow-wrap: anywhere; }
.alert-item strong { font-size: 13px; }
.alert-item small { color: var(--muted); font-size: 11px; margin-top: 4px; }
.product-thumb { width: 36px; height: 36px; background: #edf2ff; color: #2d5db7; }
.product-thumb svg { width: 19px; height: 19px; }
.product-thumb img { display: block; width: 30px; height: 30px; object-fit: contain; }
.detail-photo { display: grid; place-items: center; margin: 0 0 14px; padding: 8px; background: #f5f8fe; border-radius: 11px; }
.detail-photo img { width: 132px; max-width: 100%; height: 132px; object-fit: contain; }
.badge, .muted-pill { display: inline-block; padding: 3px 6px; border-radius: 6px; white-space: nowrap; font-size: 10px; font-weight: 700; }
.badge.empty { background: #fce9ee; color: #9b284b; }
.badge.low { background: #fff1d5; color: #815000; }
.badge.healthy { background: #e7f5ed; color: #16604b; }
.muted-pill { color: var(--muted); background: #eef3fc; }
.alert-setting { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 12px 17px 14px; color: var(--muted); font-size: 11px; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 18px 13px; }
.chip { padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: #f8faff; color: var(--muted); font-size: 12px; }
.chip[aria-pressed=true] { background: var(--blue-soft); color: var(--blue-strong); border-color: #c9d9f7; font-weight: 700; }
.pick-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 18px 11px; padding: 7px 9px; background: var(--blue-soft); color: var(--blue-strong); font-size: 12px; border-radius: 8px; }
.pick-banner button { border: 0; color: inherit; background: none; text-decoration: underline; }
.table-head, .row {
  display: grid;
  grid-template-columns: minmax(140px,2fr) repeat(4,minmax(56px,1fr)) minmax(65px,.9fr);
  gap: 9px;
  align-items: center;
  padding: 0 18px;
}
.table-head { min-height: 36px; background: #eff4fc; color: var(--muted); font-size: 11px; font-weight: 700; }
.row { min-height: 69px; border-bottom: 1px solid var(--line); }
.row:last-child { border: 0; border-radius: 0 0 var(--radius) var(--radius); }
.row:hover { background: #fafcff; }
.product { display: flex; align-items: center; gap: 8px; min-width: 0; }
.product-name { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.product button { border: 0; padding: 0; color: var(--ink); background: transparent; text-align: left; font-size: 13px; font-weight: 750; }
.product button:hover { text-decoration: underline; text-underline-offset: 3px; }
.sku { display: block; margin-top: 3px; color: var(--ink); font-size: 16px; font-weight: 750; line-height: 1.2; }
.cell { display: grid; justify-items: start; gap: 3px; min-width: 0; }
.quantity { white-space: nowrap; font: bold 21px/1.15 "SFMono-Regular", Consolas, monospace; letter-spacing: -.06em; }
.quantity small { margin-left: 3px; font: 11px sans-serif; letter-spacing: 0; }
.mobile-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.stock { color: var(--blue-strong); }
.incoming { color: var(--green); }
.zero { color: #64748b; }
.text-link { padding: 0; border: 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.quick { display: flex; gap: 4px; }
.quick button { width: 28px; height: 26px; border: 1px solid #dae6fa; border-radius: 6px; background: #f0f5ff; color: var(--blue-strong); font-size: 16px; line-height: 1; padding: 0; }
.quick button:hover:not(:disabled) { background: #dfeaff; }
.row-end { display: grid; gap: 5px; justify-items: start; color: var(--muted); font-size: 11px; }
.batch-actions button, .action-row button { border: 1px solid #d9e5fb; border-radius: 8px; padding: 6px 9px; background: #edf4ff; color: var(--blue-strong); font-size: 12px; }
div.empty { padding: 31px 12px; text-align: center; color: var(--muted); font-size: 13px; }
.log-row { display: grid; grid-template-columns: 1.3fr 1fr 1.4fr; gap: 10px; padding: 13px 18px; border-top: 1px solid var(--line); align-items: center; }
.log-row strong { font-size: 13px; }
.log-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.log-row span { font-size: 12px; }

dialog { width: min(530px,calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 21px; color: var(--ink); background: white; box-shadow: 0 20px 60px #1425434a; }
dialog::backdrop { background: #14254378; }
.dialog-head { display: flex; justify-content: space-between; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin-top: 6px; }
.close { min-width: 38px; height: 38px; border: 0; border-radius: 9px; background: #eff4fc; color: var(--ink); font-size: 24px; line-height: 1; }
.detail-body, .form-body { padding: 16px 20px; }
.summary { display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; margin-bottom: 16px; }
.summary div { padding: 9px; background: #f2f6ff; border-radius: 9px; font-size: 12px; }
.summary b { display: block; margin-top: 5px; font: 700 19px "SFMono-Regular", Consolas, monospace; }
.detail-body h3 { margin: 16px 0 8px; font-size: 14px; }
.batch-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.batch-row strong { font-size: 13px; }
.batch-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.batch-actions, .action-row { display: flex; gap: 5px; flex-wrap: wrap; }
.action-row { margin-top: 13px; }
.form-body { display: grid; gap: 12px; }
.form-body label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; }
.form-body input, .form-body select { width: 100%; min-width: 0; padding: 10px; border: 1px solid #ccd9ef; border-radius: 8px; background: white; color: var(--ink); }
.hint, .error { margin: 0; font-size: 12px; }
.hint { color: var(--muted); }
.error { color: #a62c49; }
.form-actions { display: flex; justify-content: end; gap: 8px; padding-top: 4px; }
.primary, .secondary { padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; font-weight: 700; }
.primary { background: var(--blue); border-color: var(--blue); color: white; }
.secondary { background: #f3f7ff; color: var(--ink); }
#toast { position: fixed; bottom: 16px; right: 16px; z-index: 10; max-width: calc(100% - 32px); padding: 11px 14px; border-radius: 10px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 13px; }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: 170px minmax(0,1fr); }
  .shell { padding-right: 20px; padding-left: 20px; }
  .rail { padding-left: 12px; padding-right: 12px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
}

@media (max-width: 820px) {
  .workspace { display: block; }
  .rail { display: contents; }
  .brand, .rail-label { display: none; }
  .mobile-brand { display: flex; }
  .nav {
    position: fixed;
    z-index: 5;
    bottom: max(10px,env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: min(460px,calc(100% - 22px));
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0,1fr);
    gap: 4px;
    padding: 5px;
    background: #ffffffef;
    backdrop-filter: blur(15px);
    border: 1px solid #dae5f7;
    border-radius: 18px;
    box-shadow: 0 9px 30px #25437229;
  }
  .nav-btn { justify-content: center; padding: 9px 5px; font-size: 12px; }
  .nav-btn.active { background: var(--blue); color: white; }
  .shell { padding-bottom: 70px; }
  .topline { justify-content: space-between; margin-bottom: 20px; }
  #toast { bottom: calc(68px + env(safe-area-inset-bottom)); }
}

@media (max-width: 620px) {
  .shell { padding: 13px 12px 78px; }
  .topline { margin-bottom: 17px; }
  .top-actions { gap: 6px; }
  .mode { min-height: 38px; padding: 7px 8px; }

  .hero { align-items: start; gap: 8px; margin-bottom: 13px; }
  .hero p { font-size: 12px; }
  .sync { padding-top: 5px; max-width: 113px; white-space: normal; font-size: 11px; line-height: 1.4; }
  .search input { font-size: 16px; padding: 11px 0; }
  .search kbd { display: none; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 12px; }
  .metric-attention { grid-column: 1/-1; }
  .metric { padding: 11px; border-radius: 16px; gap: 5px; }
  .metric-icon, .shortcut-icon { width: 33px; height: 33px; }
  .metric strong { font-size: 26px; }
  .metric-note { font-size: 10px; }
  .dashboard-grid { grid-template-columns: minmax(0,1fr); gap: 11px; }
  .panel-head { padding: 13px 12px 10px; }
  .panel-head h2 { font-size: 16px; }
  .panel-head p { font-size: 12px; margin-top: 5px; }
  .quick-panel { margin-bottom: 11px; }
  .shortcuts { padding: 0 12px 12px; gap: 5px; }
  .shortcuts button { padding: 7px; display: grid; gap: 5px; font-size: 12px; }
  .shortcuts b { display: none; }
  .shortcuts small { font-size: 10px; }
  .chart { padding: 1px 12px 12px; }
  .filters { padding: 0 12px 11px; gap: 5px; }
  .chip { padding: 7px 8px; }
  .pick-banner { margin: 0 12px 10px; }
  .table-head { display: none; }
  #inventory { background: transparent; border: 0; box-shadow: none; }
  #products { display: grid; gap: 8px; }
  .row, .row:last-child { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; padding: 10px; background: white; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
  .product { grid-column: 1/-1; }
  .product button { font-size: 15px; }
  .cell { background: #f3f7ff; padding: 7px; border-radius: 8px; }
  .mobile-label { position: static; clip-path: none; width: auto; height: auto; overflow: visible; color: var(--muted); font-size: 10px; }
  .quantity { font-size: 19px; }
  .quick button { width: 30px; height: 32px; }
  .row-end { grid-column: 1/-1; display: flex; flex-wrap: wrap; gap: 5px 9px; align-items: center; }
  .nav-btn { flex-direction: column; gap: 3px; padding: 7px 3px; }
  .nav-btn svg { width: 17px; height: 17px; }
  .log-row { grid-template-columns: 1fr 1fr; padding: 9px 12px; }
  .log-row span:last-child { grid-column: 1/-1; }
  .form-body input, .form-body select { font-size: 16px; }
}
@media (max-width: 360px) {
  .quick button { width: 25px; }
  .quantity { font-size: 17px; }
  .metric-note { overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.signed-out .nav { display: none; }
.login-panel { margin: min(10vh, 85px) auto 0; max-width: 510px; padding: clamp(20px, 5vw, 42px); }
.login-panel h1 { font-size: clamp(26px, 4vw, 38px); margin-top: 17px; }
.login-panel p { margin: 10px 0 22px; color: var(--muted); font-size: 14px; }
.account-error { margin: 0 20px 16px; }
.form-body .remember-login { display: flex; align-items: center; gap: 8px; min-height: 30px; cursor: pointer; }
.form-body .remember-login input { width: 17px; height: 17px; margin: 0; padding: 0; accent-color: var(--blue); }
#account-name { margin: 0; font-size: 14px; }

.ordered, .reserved { color: var(--violet); }
.available { color: var(--green); }
.order-filters { display: flex; align-items: center; gap: 9px; padding: 0 18px 13px; }
.order-filters label:first-child { flex: 1; }
.order-filters select { padding: 8px; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; background: #f7faff; font-size: 12px; }
.order-group { border-top: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
.order-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 12px 18px; background: #f7faff; }
.order-group-head .order-actions { align-items: center; }
.order-group-head .primary { padding: 7px 10px; }
.order-delete { padding: 7px 10px; color: #a02a3d; background: #fff1f3; border: 1px solid #f1c6cd; border-radius: 8px; }
#delete-order-save { background: #a02a3d; border-color: #a02a3d; }
.order-row { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 12px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--line); }
.order-group small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 620px) {
  .order-filters { padding-inline: 12px; }
  .order-group-head { padding-inline: 12px; }
  .order-row { grid-template-columns: 1fr 1fr; padding: 12px; }
}

.order-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: end; }
#admin-dialog { width: min(650px,calc(100% - 24px)); }
#admin-create { justify-self: start; }
.admin-accounts { list-style: none; margin: 0; padding: 0; }
.admin-accounts li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 10px 0; overflow-wrap: anywhere; }
.admin-accounts small { display: block; color: var(--muted); margin-top: 3px; }
.admin-form, .admin-form fieldset { display: grid; gap: 12px; }
.admin-form { border-top: 1px solid var(--line); padding-top: 12px; }
.admin-form fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
.admin-form h3 { margin: 0; font-size: 15px; }
.admin-accounts .admin-delete { color: #a02a3d; background: #fff1f3; border-color: #f1c6cd; }
.admin-delete-confirm { background: #a02a3d; border-color: #a02a3d; }
#order-dialog { width: min(740px,calc(100% - 24px)); }
#order-fields { margin: 0; border: 0; min-inline-size: 0; }
.order-meta { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.order-picker { display: grid; gap: 7px; }
.form-body .order-available { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.form-body .order-available input { width: auto; }
#order-lines-title { margin: 0 0 4px; font-size: 14px; }
.order-products { padding: 0; margin: 0; list-style: none; }
#order-product-results:not(:empty) { max-height: 180px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.order-products li { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 7px 9px; font-size: 13px; }
.order-products li + li, #order-lines li { border-top: 1px solid var(--line); }
.order-products strong { overflow-wrap: anywhere; }
.order-products small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
#order-lines li { grid-template-columns: minmax(0,1fr) 94px auto; }
.order-products .secondary { padding: 7px 9px; white-space: nowrap; }
@media (max-width: 560px) {
  .order-meta { grid-template-columns: 1fr; }
  #order-lines li { grid-template-columns: minmax(0,1fr) 76px auto; }
  .order-products .secondary { min-height: 40px; }
}
.inventory-filters { display: flex; flex-wrap: wrap; align-items: start; gap: 0 10px; padding: 0 18px 13px; }
.inventory-filters .filters { padding: 0; }
.category-filter select { padding: 6px 9px; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; background: #f8faff; font-size: 12px; }
.product > div { min-width: 0; }
.product-name button { overflow-wrap: anywhere; }
@media (max-width: 620px) {
  .inventory-filters { padding-inline: 12px; row-gap: 6px; }
}
