:root {
  --orange: #f5a623;
  --orange-deep: #e8910f;
  --green: #4caf50;
  --green-deep: #3d8b40;
  --bg: #f6f4ef;
  --card: #ffffff;
  --text: #2a2a2a;
  --muted: #7a7a7a;
  --line: #ebe6dc;
  --shadow: 0 10px 30px rgba(60, 40, 10, 0.06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at 0% 0%, rgba(245, 166, 35, 0.12), transparent 50%),
    radial-gradient(ellipse at 100% 0%, rgba(76, 175, 80, 0.1), transparent 45%),
    var(--bg);
  min-height: 100vh;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.ok-line { color: #2e7d32 !important; }
.warn-line { color: #c62828 !important; }
.tpl-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 10px 0 14px;
}
.batch-mode {
  display: flex;
  gap: 16px;
  margin: 10px 0;
}
.batch-box {
  margin: 8px 0 12px;
  padding: 12px;
  background: #f7f8f5;
  border-radius: 8px;
}
.batch-box .cover-actions {
  flex-wrap: wrap;
  margin-top: 8px;
}
.batch-preview {
  background: #1f2a1f;
  color: #d7e8d0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
}
.retail-label-toolbar {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 8px 0 12px;
}
.retail-label-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
}
.retail-label-toolbar input[type="number"] {
  width: 72px !important;
  max-width: 72px !important;
  margin: 0 !important;
}
.retail-label-wrap {
  margin: 0 0 8px;
  max-height: 360px;
  overflow: auto;
}
#retailLabelTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
#retailLabelTable th,
#retailLabelTable td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line, #e4e8e0);
  text-align: left;
  vertical-align: middle;
}
#retailLabelTable th {
  position: sticky;
  top: 0;
  background: #f7f8f5;
  z-index: 1;
  font-weight: 600;
}
#retailLabelTable .retail-pick {
  width: 18px !important;
  max-width: 18px !important;
  min-width: 18px;
  margin: 0 !important;
  accent-color: var(--orange);
  cursor: pointer;
}
#tab-hardware #retailLabelTable .retail-copies,
#retailLabelTable .retail-copies {
  width: 80px !important;
  max-width: 80px !important;
  margin: 0 !important;
}
#retailLabelTable tr.selected {
  background: #fff8f0;
}
#retailLabelTable .code-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}
#tab-hardware .panel + .panel { margin-top: 14px; }
#tab-hardware input[type="text"],
#tab-hardware input:not([type]),
#tab-hardware input[type="number"],
#tab-hardware select,
#tab-hardware textarea {
  width: 100%;
  max-width: 520px;
  margin: 4px 0 10px;
}
.error { color: #d32f2f; min-height: 1.2em; }

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
}
.btn:hover { border-color: var(--orange); }
.btn.primary {
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  border: none;
  color: #fff;
  font-weight: 600;
}
.btn.danger {
  background: #fff;
  border-color: #e11d48;
  color: #e11d48;
}
.btn.danger:hover {
  background: #fff1f2;
  border-color: #be123c;
}
.btn.green {
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  border: none;
  color: #fff;
}
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.sm { padding: 4px 10px; font-size: 12px; }

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(400px, 100%);
  background: var(--card);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.login-card .logo { width: 120px; align-self: center; }
.login-card h1 { text-align: center; margin: 8px 0 0; font-size: 22px; }
.login-card .muted { text-align: center; margin-bottom: 12px; }
.login-card label { font-size: 13px; color: var(--muted); margin-top: 6px; }
.login-card input, .content input, .content select, .content textarea, dialog input, dialog textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
}
#loginBtn { margin-top: 12px; width: 100%; padding: 12px; }

.main-view { display: flex; min-height: 100vh; }
.sider {
  width: 220px;
  background: #1f2a1f;
  color: #e8f5e9;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 6px 16px; }
.brand img { width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: 12px; }
.brand strong { display: block; font-size: 16px; }
.brand span { font-size: 10px; letter-spacing: 1px; opacity: 0.7; }
.sider nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav {
  text-align: left;
  background: transparent;
  border: none;
  color: #c8e6c9;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}
a.nav.link {
  display: block;
  text-decoration: none;
  color: #ffe082;
}
.nav.active, .nav:hover { background: rgba(76, 175, 80, 0.25); color: #fff; }
.logout { margin-top: auto; color: #a5d6a7 !important; }

.content { flex: 1; padding: 24px 28px; overflow: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.topbar h2 { margin: 0; font-size: 22px; }
.top-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.switch { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { accent-color: var(--orange); width: auto; }
.switch.locked {
  cursor: default;
  color: var(--text);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff4e5;
  border: 1px solid #f0c98a;
}
.batch-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  background: #faf8f3;
  border-radius: 12px;
}
.order-card .pick {
  display: flex;
  align-items: center;
  padding-right: 8px;
}
.order-card .pick input { width: 18px; height: 18px; accent-color: var(--orange); }
.batch-codes { color: #e8910f; font-size: 12px; margin-top: 4px; }

.phone-video-tip {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #e8f5e9;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}
.phone-video-tip strong { color: #2e7d32; display: block; margin-bottom: 4px; }

.toast {
  position: fixed; top: 24px; right: 24px; z-index: 99;
  background: #1f2a1f; color: #fff; padding: 14px 18px; border-radius: 12px;
  box-shadow: var(--shadow); font-weight: 600;
}
.order-card.new { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(245,166,35,.25); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 28px; font-weight: 700; margin-top: 6px; color: var(--orange-deep); }

.panel {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.pickup-head { margin: 18px 0 8px; }

.order-list { display: flex; flex-direction: column; gap: 10px; }
.order-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  align-items: center;
}
.pickup {
  font-size: 28px;
  font-weight: 800;
  color: var(--green-deep);
  min-width: 72px;
}
.toolbar { margin-bottom: 12px; display: flex; gap: 10px; }
.table-wrap { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); overflow: auto; padding: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #faf8f3; color: var(--muted); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #eee;
}
.tag.paid, .tag.making { background: #fff3e0; color: #ef6c00; }
.tag.ready { background: #e8f5e9; color: #2e7d32; }
.tag.done { background: #eceff1; color: #546e7a; }
.tag.pending_pay { background: #fff8e1; color: #f9a825; }

.verify-panel { max-width: 480px; display: flex; flex-direction: column; gap: 10px; }
#verifyResult { background: #faf8f3; padding: 12px; border-radius: 10px; min-height: 80px; white-space: pre-wrap; }

.prose ol { line-height: 1.8; }
.prose code { background: #f0ebe3; padding: 2px 6px; border-radius: 4px; }

dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  width: min(640px, 94vw);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0,0,0,.35); }
#productForm { padding: 20px; display: flex; flex-direction: column; gap: 8px; max-height: 86vh; overflow: auto; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.cover-editor {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.cover-preview {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
  background: #f0ebe3;
  border: 1px solid #e8e2d8;
  flex-shrink: 0;
}
.cover-fields { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cover-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cover-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 8px;
  background: #faf8f3;
  border-radius: 12px;
}
.cover-gallery button {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}
.cover-gallery button.on { border-color: var(--orange, #f5a623); }
.cover-gallery img { width: 100%; height: 72px; object-fit: cover; display: block; }
.product-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  background: #f0ebe3;
  vertical-align: middle;
  margin-right: 10px;
  flex-shrink: 0;
}
.hardware-entry { margin: 14px 0 0; }

.mobile-only { display: none !important; }
.bottom-nav { display: none; }

.order-card .order-main { flex: 1; min-width: 0; }
.order-card .order-title { font-size: 15px; font-weight: 600; line-height: 1.35; }
.order-card .order-contact {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text);
}
.order-ingredients {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
  color: #1b5e20;
  font-weight: 600;
}
.order-ingredients .ing-prod {
  color: var(--text);
  font-weight: 500;
}
.list-card .order-ingredients {
  margin: 4px 0;
}
.phone-link {
  color: var(--orange-deep, #c45f0a);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.phone-link:hover { text-decoration: underline; }
.order-card .actions .btn { min-height: 36px; }

.list-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin: 0 0 10px;
  background: #fff;
}
.list-card:last-child { margin-bottom: 0; }
.list-card .row-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.list-card .code {
  font-size: 26px;
  font-weight: 800;
  color: var(--green-deep);
  line-height: 1;
}
.list-card .meta { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.list-card .actions { margin-top: 10px; }
.product-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.product-toolbar-row {
  margin-bottom: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.product-toolbar-row .muted {
  font-size: 12px;
  line-height: 1.4;
}
.product-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
  cursor: grab;
  touch-action: none;
  transition: box-shadow .15s, border-color .15s, opacity .15s;
}
.product-card.selected {
  border-color: #f5a623;
  background: #fffaf0;
}
.product-side {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
  cursor: pointer;
  user-select: none;
}
.product-check {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: #f5a623;
}
.product-card:active { cursor: grabbing; }
.product-card.dragging {
  opacity: 0.55;
  border-color: #f5a623;
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
}
.product-card.drag-over {
  border-color: #2e7d32;
  border-style: dashed;
}
.product-card .drag-handle {
  width: 18px;
  color: #bbb;
  font-size: 14px;
  line-height: 1;
  text-align: center;
  user-select: none;
}
.product-card .product-thumb {
  margin-right: 0;
}
.product-card .info { flex: 1; min-width: 0; }
.product-card .actions { margin-top: 8px; }
.product-order-dirty {
  color: #e65100 !important;
  font-weight: 600;
}

.product-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.product-cat-tabs .cat-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: #444;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}
.product-cat-tabs .cat-tab.on {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
  font-weight: 700;
}

.specs-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.specs-editor .spec-row {
  display: grid;
  grid-template-columns: 1fr 1fr 88px 56px;
  gap: 8px;
  align-items: center;
}
.specs-editor .spec-row input {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}
.specs-editor .spec-del {
  border: 1px solid #e0d8ce;
  background: #fff;
  color: #c62828;
  border-radius: 8px;
  height: 36px;
  cursor: pointer;
  font-size: 13px;
}
.specs-editor .spec-del:hover {
  background: #ffebee;
}
#productDialog select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
}

@media (max-width: 900px) {
  .mobile-only { display: inline-flex !important; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat .value { font-size: 24px; }

  .main-view {
    flex-direction: column;
    min-height: 100dvh;
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  .sider {
    display: none;
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    background: #1f2a1f;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
    gap: 2px;
  }
  .bottom-nav .nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 2px;
    min-height: 52px;
    border-radius: 10px;
    font-size: 11px;
    color: #a5d6a7;
    background: transparent;
    border: none;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .bottom-nav .nav .ico {
    font-size: 13px;
    font-weight: 700;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.06);
  }
  .bottom-nav .nav.active,
  .bottom-nav .nav:hover {
    background: rgba(76, 175, 80, 0.22);
    color: #fff;
  }
  .bottom-nav .nav.active .ico {
    background: rgba(76, 175, 80, 0.45);
    color: #fff;
  }
  .bottom-nav a.nav.link { color: #ffe082; }
  .bottom-nav a.nav.link .ico { color: #ffe082; }

  .content {
    padding: 14px 14px 20px;
    width: 100%;
  }
  .topbar {
    margin-bottom: 12px;
    align-items: flex-start;
  }
  .topbar h2 { font-size: 20px; }
  .top-actions {
    width: 100%;
    gap: 10px 12px;
  }
  .top-actions .switch span { font-size: 12px; }
  .top-actions .btn { min-height: 40px; padding: 8px 12px; }

  .batch-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .batch-bar .btn {
    width: 100%;
    min-height: 44px;
    font-size: 15px;
  }
  .batch-bar .switch { min-height: 40px; }

  .order-card {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 14px;
    gap: 10px;
  }
  .order-card .pick {
    padding-right: 0;
    padding-top: 6px;
  }
  .order-card .pick input {
    width: 22px;
    height: 22px;
  }
  .order-card .pickup {
    font-size: 32px;
    min-width: 0;
    flex: 1;
  }
  .order-card .order-main {
    flex: 1 1 100%;
    order: 3;
  }
  .order-card .actions {
    flex: 1 1 100%;
    order: 4;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .order-card .actions .btn {
    width: 100%;
    min-height: 44px;
    font-size: 14px;
    padding: 10px 8px;
  }

  .table-wrap {
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }
  .table-wrap > table { display: none; }
  .retail-label-wrap {
    background: var(--card, #fff);
    box-shadow: var(--shadow);
    overflow: auto;
    padding: 8px;
  }
  .retail-label-wrap > table { display: table; }

  .list-card .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .list-card .actions .btn {
    width: 100%;
    min-height: 44px;
    font-size: 14px;
  }

  .product-card .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .product-card .actions .btn {
    min-height: 40px;
  }

  .verify-panel { max-width: none; }
  .verify-panel input,
  .verify-panel .btn {
    min-height: 48px;
    font-size: 16px;
  }

  .toast {
    left: 12px;
    right: 12px;
    top: calc(12px + env(safe-area-inset-top, 0px));
    text-align: center;
  }

  dialog {
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    border-radius: 16px 16px 0 0;
    max-height: 92dvh;
  }
  #productForm {
    max-height: 88dvh;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .cover-editor { flex-direction: column; }
  .dialog-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-top: 10px;
  }
  .dialog-actions .btn {
    flex: 1;
    min-height: 44px;
  }

  .login-card { padding: 28px 20px; }
  .login-card input,
  #loginBtn { min-height: 48px; font-size: 16px; }
}

.delivery-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.delivery-row {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 1.4fr;
  gap: 10px;
  padding: 12px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--line);
}
.delivery-row label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.delivery-row input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}
.delivery-row input:disabled {
  background: #f0eee9;
  color: var(--muted);
}

@media (max-width: 720px) {
  .delivery-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .bottom-nav .nav span:not(.ico) { font-size: 10px; }
}

.report-days {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.report-day {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.report-day-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
}
.report-day-head:hover { background: #faf8f4; }
.report-day-head .date { font-weight: 600; min-width: 110px; }
.report-day-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}
.report-day-body.hidden { display: none; }
.report-sub {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 720px) {
  .report-sub { grid-template-columns: 1fr; }
}
.report-sub h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.report-sub table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.report-sub th,
.report-sub td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.report-sub th { color: var(--muted); font-weight: 500; }

.purchase-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin-top: 10px;
}
.purchase-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}
.purchase-form label.full { grid-column: 1 / -1; }
.purchase-form input,
.purchase-form textarea {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
}
.invoice-preview img {
  max-width: min(360px, 100%);
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-top: 6px;
}
.invoice-preview a { color: var(--orange-deep); }
@media (max-width: 720px) {
  .purchase-form { grid-template-columns: 1fr; }
}

#userDialog {
  width: min(720px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
}
#userDialog::backdrop { background: rgba(20, 16, 10, 0.35); }
.user-form h3 { margin: 0 0 10px; }

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.pager .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.reserve-cat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reserve-cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.reserve-cat-row .reserve-cat-name {
  flex: 1;
  color: var(--text);
  font-size: 14px;
}
