[hidden] { display: none !important; }
:root {
  --bg: #f6f7f9; --card: #fff; --ink: #16181d; --muted: #6b7280; --line: #e5e7eb;
  --brand: #1f6f4a; --brand-ink: #fff; --brand-soft: #e8f3ee;
  --ok: #15803d; --ok-soft: #e7f6ec; --warn: #a16207; --warn-soft: #fdf6e3;
  --bad: #b91c1c; --bad-soft: #fdecec; --info: #3730a3; --info-soft: #eef2ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
button { font: inherit; cursor: pointer; }
a { color: var(--brand); }

.top { display: flex; align-items: center; gap: 20px; padding: 10px 24px; background: var(--card);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px;
  background: none; border: 0; padding: 0; color: var(--ink); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); display: inline-block; }
.tabs { display: flex; gap: 4px; }
.tabs button { background: none; border: 0; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.tabs button.on { background: var(--brand-soft); color: var(--brand); }
.who { margin-left: auto; color: var(--muted); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.sep { color: var(--line); }

main { max-width: 900px; margin: 0 auto; padding: 24px 16px 120px; }
#v-list { max-width: none; }
.view { display: none; }
.view.on { display: block; }
h1 { font-size: 24px; margin: 4px 0 8px; }
h2 { font-size: 17px; margin: 0 0 14px; }
.muted { color: var(--muted); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin: 16px 0; }

label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; color: #374151; margin-bottom: 12px; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 11px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
input[type=checkbox] { width: auto; }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; }

.row { display: flex; gap: 10px; align-items: flex-end; }
.row.between { justify-content: space-between; align-items: center; }
.row .grow { flex: 1; }
.row .btn { margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 140px 140px 1fr; gap: 0 14px; }
.span2 { grid-column: span 2; }

.btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 16px; font-weight: 600;
  text-decoration: none; color: var(--ink); display: inline-block; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.big { padding: 14px 28px; font-size: 17px; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
.actions { text-align: right; }

.found { background: var(--info-soft); border-radius: 10px; padding: 10px 12px; margin: 0 0 14px; font-size: 14px; }
.pick { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; margin: 6px 0 0; }
.pick:hover { border-color: var(--brand); }

.search { position: relative; margin-bottom: 12px; }
.results { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08); z-index: 4; max-height: 340px; overflow: auto; }
.results button { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: none;
  border: 0; border-bottom: 1px solid var(--line); padding: 9px 12px; }
.results button:hover { background: var(--brand-soft); }
.results span { color: var(--muted); white-space: nowrap; }
.pad { padding: 10px 12px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.num { text-align: right; white-space: nowrap; }
.items input.qty { width: 64px; text-align: right; padding: 5px 7px; }
.x { background: none; border: 0; font-size: 20px; color: var(--muted); line-height: 1; }
.x:hover { color: var(--bad); }
.disc { margin-top: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; width: fit-content; }
.seg button { border: 0; background: #fff; padding: 8px 16px; font-weight: 600; }
.seg button.on { background: var(--brand); color: #fff; }
.totals { display: flex; justify-content: flex-end; gap: 22px; color: var(--muted); flex-wrap: wrap; }
.totals b { color: var(--ink); }
.totals .big { font-size: 18px; color: var(--ink); }

.field { margin-bottom: 14px; }
.lab { font-weight: 600; font-size: 13px; color: #374151; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chips button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 15px; font-weight: 600; }
.chips button:hover { border-color: var(--brand); }
.chips button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.tagprev { background: var(--bg); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin: 4px 0 0; color: var(--muted); }
.tagprev span { color: var(--ink); font-weight: 600; }

.err, .errtxt { color: var(--bad); }
p.err { background: var(--bad-soft); padding: 10px 14px; border-radius: 10px; }
p.ok { background: var(--ok-soft); color: var(--ok); padding: 10px 14px; border-radius: 10px; }
.done h2 { color: var(--ok); }

.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.list td.tags { font-size: 12px; color: var(--muted); max-width: 220px; }
.chip { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; background: var(--bg);
  text-decoration: none; color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }

.login-body { display: grid; place-items: center; min-height: 100vh; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 32px; width: 340px;
  display: flex; flex-direction: column; gap: 14px; }
.login-card .btn { padding: 12px; }

@media (max-width: 680px) {
  .top { padding: 10px 16px; gap: 10px; }
  .who { margin-left: 0; width: 100%; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .panel { padding: 16px; }
  .totals { justify-content: flex-start; }
}
