:root {
  --bg: #f4f5f7;
  --card: #fff;
  --ink: #1a1a1a;
  --muted: #5c6570;
  --line: #d8dde3;
  --accent: #1f6feb;
  --accent-ink: #fff;
  --page-max: 1180px;
  --page-pad: 16px;
  --page-pad-desktop: 24px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-size: 16px; line-height: 1.4; }
a { color: var(--accent); }
.app {
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  padding: 16px var(--page-pad) 40px;
  box-sizing: border-box;
}
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
h1 { font-size: 20px; line-height: 1.25; margin: 0 0 12px; font-weight: 700; }
h2 { font-size: 16px; line-height: 1.3; margin: 0 0 8px; font-weight: 700; }
form.panel { max-width: 36rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0 0 12px; }
form.panel, .panel form { display: grid; gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 650; }
input {
  width: 100%;
  min-height: 44px;
  font-size: 16px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
button {
  width: auto;
  max-width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  padding: 0 14px;
}
button.quiet { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.flash { background: #e8f0fe; border-radius: 10px; padding: 12px; }
.hint { color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th.num, td.num { text-align: right; }
.staff-banner { margin: 0 0 12px; padding: 8px 12px; background: #e8f0fe; border-radius: 10px; font-size: .9rem; font-weight: 650; }
.cost, .sku { font-variant-numeric: tabular-nums; font-weight: 650; }
.sku { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 650; }
.muted { color: var(--muted); font-weight: 400; }
.send-this {
  margin: 12px 0 0;
  padding: 12px;
  background: #f7f9fc;
  border: 1px dashed #c5d0dc;
  border-radius: 10px;
}
.send-this h3 { margin: 0 0 8px; font-size: 1rem; }
.send-this pre {
  margin: 0 0 8px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9rem;
}
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.row-actions label { flex: 1 1 12rem; }
.row-actions button { width: auto; flex: 0 0 auto; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.form-actions button { width: auto; }
details.fold, details.prod-fold { margin: 0 0 12px; }
details.fold {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
}
details.fold > summary,
details.prod-fold > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
}
details.fold > summary::-webkit-details-marker,
details.prod-fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { margin: 0; }
.fold-toggle {
  flex: 0 0 40px;
  width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  user-select: none;
}
.fold-toggle::before { content: "+"; }
details[open] > summary .fold-toggle::before { content: "\2212"; }
.fold-body { padding: 0 14px 14px; }
details.prod-fold {
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 0 0 8px;
}
details.prod-fold > summary { font-weight: 650; }
details.prod-fold .fold-body { padding: 0 10px 8px; }
@media (min-width: 601px) {
  .app { padding-left: var(--page-pad-desktop); padding-right: var(--page-pad-desktop); }
}
@media (max-width: 600px) {
  .bar { align-items: stretch; }
  button, a { min-height: 44px; }
  .table-wrap { overflow-x: visible; }
  .table-wrap table, .table-wrap table tbody, .table-wrap table tr {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .table-wrap table thead { display: none; }
  .table-wrap table tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    margin: 0 0 8px;
    padding: 8px 10px;
    background: var(--card);
  }
  .table-wrap td, .table-wrap th {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    border: 0;
    padding: 4px 0;
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .table-wrap td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 650;
    color: var(--muted);
    text-align: left;
    flex: 0 0 auto;
    max-width: 46%;
  }
}
