:root { --accent: #1f5fa8; --bg: #f4f6f9; --line: #dde2ea; --text: #1c2430; --muted: #6b7686; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 24px; background: #fff; border-bottom: 3px solid var(--accent); }
.logo svg { height: 46px; width: auto; display: block; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }
button { font: inherit; cursor: pointer; border-radius: 8px; padding: 9px 16px; border: 1px solid var(--accent); }
button.primary { background: var(--accent); color: #fff; font-weight: 600; }
button.ghost { background: #fff; color: var(--accent); }
button.del { border: none; background: none; color: #b33; font-size: 18px; padding: 4px 8px; }
.wrap { max-width: 1100px; margin: 20px auto; padding: 0 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 16px; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
input[readonly] { background: #f7f8fa; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.company-info { font-size: 13px; color: var(--muted); line-height: 1.6; }
.company-info b { color: var(--text); }
.hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
table.items { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
table.items th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px; border-bottom: 1px solid var(--line); }
table.items td { padding: 4px; border-bottom: 1px solid #eef1f5; }
table.items td input, table.items td select { width: 100%; }
table.items td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding-right: 8px; }
table.items .c-name { width: 36%; } table.items .c-qty { width: 9%; } table.items .c-price { width: 14%; } table.items .c-vat { width: 9%; }
.sums { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-top: 14px; flex-wrap: wrap; }
#vatTable { border-collapse: collapse; font-variant-numeric: tabular-nums; margin-left: auto; order: 2; }
#vatTable td, #vatTable th { padding: 4px 12px; text-align: right; font-size: 13px; border-bottom: 1px solid #eef1f5; }
#vatTable tr.total td { font-weight: 700; font-size: 15px; border-top: 2px solid var(--accent); }
.words { font-size: 13px; color: var(--muted); max-width: 480px; }
.words b { color: var(--text); }
.foot { max-width: 1100px; margin: 0 auto 30px; padding: 0 16px; font-size: 12px; color: var(--muted); text-align: center; }
@media (max-width: 760px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; padding: 10px 14px; }
  .top-actions { width: 100%; flex-wrap: nowrap; }
  .top-actions button { flex: 1; padding: 8px 4px; font-size: 13px; }
  table.items, table.items tbody { display: block; }
  table.items thead { display: none; }
  table.items tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.items td { display: block; width: auto !important; border: none; padding: 0; }
  table.items td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
  table.items td.num { text-align: left; padding: 0; }
  table.items td.c-name { grid-column: 1 / -1; } table.items td.idx { display: none; }
  table.items td.c-del { text-align: right; align-self: end; }
  #vatTable { width: 100%; } #vatTable td, #vatTable th { padding: 4px 4px; font-size: 12px; white-space: nowrap; }
}
