/* Kovász demo: "C · Hajnali műszak". Colours, fonts and sizes follow docs/SPEC-KOVASZ.md. */
:root {
  --bg: #14161a;
  --card: #1e2127;
  --line: #353b45;
  --text: #f3f4f6;
  --dim: #b4bcc8;
  --accent: #fbbf24;
  --on-accent: #1a1300;
  --ok: #4ade80;
  --ok-bg: #14301f;
  --warn: #fbbf24;
  --warn-bg: #3a2f12;
  --err: #fca5a5;
  --err-bg: #3b1d1d;
  --radius: 14px;
  --btn-h: 56px;
  --gap: 10px;
  --topbar-h: 72px;
  color-scheme: dark;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--font-body); overflow-x: hidden; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.15; margin: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(30px, 6vw, 34px); }
h2 { font-size: 22px; font-weight: 600; }
p { margin: 0; overflow-wrap: anywhere; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.dim { color: var(--dim); }
.boot { padding: 32px 16px; color: var(--dim); }

/* Buttons: at least 56 px high */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--btn-h); padding: 10px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--text); font: 600 17px/1.25 var(--font-body); text-align: center; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--dim); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.05); }
.btn-outline-warn { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }

/* Cards, banners */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stack { display: grid; gap: var(--gap); }
.banner { border-radius: var(--radius); padding: 14px 16px; border: 1px solid; font-weight: 500; }
.banner.warn { background: var(--warn-bg); border-color: var(--warn); }
.banner.ok { background: var(--ok-bg); border-color: var(--ok); }
.banner.err { background: var(--err-bg); border-color: var(--err); color: var(--err); }
/* Dismissible, clickable notice on the start page */
.banner.notice { display: flex; align-items: stretch; gap: 8px; padding: 0; }
.notice-link { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 14px 8px 14px 16px; min-height: 56px; color: inherit; text-decoration: none; border-radius: var(--radius); }
.notice-link:hover, .notice-link:focus-visible { background: rgba(245, 165, 36, 0.12); }
.notice-link .dim { font-weight: 400; font-size: 0.9em; }
.notice-close { flex: none; align-self: flex-start; width: 56px; min-height: 56px; padding: 0; font-size: 28px; line-height: 1; background: transparent; border: 0; color: inherit; }
.badge { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; font-size: 13px; font-weight: 600; color: var(--dim); white-space: nowrap; }

/* Login */
.login { max-width: 560px; margin: 0 auto; padding: 28px 16px 40px; display: grid; gap: 18px; }
.login .brand-big { font: 700 40px/1 var(--font-head); color: var(--accent); }
.people-group { display: grid; gap: var(--gap); }
.people-group h2 { color: var(--dim); font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; font-family: var(--font-body); font-weight: 600; }
.person { display: grid; gap: 2px; text-align: left; width: 100%; min-height: var(--btn-h); padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; cursor: pointer; }
.person:hover { border-color: var(--accent); }
.person:disabled { opacity: 0.6; cursor: wait; }
.person .name { font: 600 19px/1.25 var(--font-body); }
.person .title { color: var(--dim); font-size: 15px; }

/* App shell */
.shell { min-height: 100vh; display: grid; grid-template-rows: var(--topbar-h) 1fr; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar .brand { font: 700 24px/1 var(--font-head); color: var(--accent); text-decoration: none; }
.topbar .spacer { flex: 1; }
.topbar .who { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.nav { display: none; position: fixed; z-index: 15; top: var(--topbar-h); left: 0; right: 0; bottom: 0; overflow-y: auto; background: var(--bg); padding: 12px; }
.nav-open .nav { display: block; }
.nav-list { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.nav-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--btn-h); padding: 10px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--text); font: 600 17px/1.25 var(--font-body); text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.nav-item[aria-current="page"] .badge { color: var(--on-accent); border-color: var(--on-accent); }
.nav-user { display: grid; gap: 10px; }
main { padding: 16px 12px 40px; min-width: 0; }
main:focus { outline: none; }
.page { max-width: 1100px; margin: 0 auto; display: grid; gap: 14px; }
.page-head { display: grid; gap: 4px; }

/* Start page tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--gap); }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; }
a.tile-link { color: inherit; text-decoration: none; min-height: 44px; }
a.tile-link:hover, a.tile-link:focus-visible { border-color: var(--accent, #F5A524); }
.tile .num { font: 700 26px/1.1 var(--font-head); }
.tile .label { color: var(--dim); font-size: 15px; }
.role-sutomester .tile .num { font-size: 44px; }

/* Log */
.orders-list { display: grid; gap: var(--gap); }
.log { display: grid; gap: var(--gap); margin: 0; padding: 0; list-style: none; }
.log li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: grid; gap: 2px; }
.log .when { color: var(--dim); font-size: 14px; }

/* Dialog and toast */
dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, 0.65); }
dialog .actions { display: grid; gap: var(--gap); margin-top: 16px; }
.toast { position: fixed; z-index: 40; left: 12px; right: 12px; bottom: 16px; margin: 0 auto; max-width: 520px; padding: 14px 16px; border-radius: var(--radius); background: var(--ok-bg); border: 1px solid var(--ok); font-weight: 500; }
.toast.err { background: var(--err-bg); border-color: var(--err); color: var(--err); }

/* Forms */
.field { display: grid; gap: 6px; }
.field > label, .field > .label { font-weight: 600; font-size: 17px; }
input, select, textarea { width: 100%; min-height: var(--btn-h); padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 500 17px/1.3 var(--font-body); }
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.row2 { display: grid; gap: var(--gap); }
.prod { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.prod:first-of-type { border-top: 0; }
.prod .pname { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.stepper { display: flex; gap: 8px; }
.stepper .btn { flex: 0 0 var(--btn-h); padding: 0; font-size: 26px; }
.stepper input { flex: 1; min-width: 0; text-align: center; font: 700 26px/1.1 var(--font-head); }
.total { font: 600 19px/1.3 var(--font-head); }

.check { display: flex; align-items: center; gap: 12px; min-height: var(--btn-h); padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); font-weight: 600; cursor: pointer; }
.check input { width: 28px; height: 28px; min-height: 0; flex: 0 0 28px; accent-color: var(--accent); }
.recipe-row { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.recipe-row .amount { display: flex; gap: 8px; align-items: center; }
.recipe-row .amount input { flex: 1; min-width: 0; }
.recipe-row .unit { color: var(--dim); white-space: nowrap; }
.num3 { display: grid; gap: var(--gap); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--dim); font-size: 15px; }
.group-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-top: 6px; }
.pill.dim { border-color: var(--line); color: var(--dim); }

/* Fixed main button at the bottom on phones */
.has-bottom-bar { padding-bottom: 110px; }
.bottom-bar { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; display: grid; gap: 8px; padding: 10px 12px; background: var(--bg); border-top: 1px solid var(--line); }
.bottom-bar.two { grid-template-columns: 1fr 2fr; }

/* Orders */
.daynav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.daynav .date-field { grid-column: 1 / -1; grid-row: 1; }
.order { display: grid; gap: 10px; }
.order-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px; }
.order-head h2 { font-size: 20px; }
.pill { display: inline-block; padding: 2px 12px; border-radius: 999px; border: 1px solid; font-size: 14px; font-weight: 600; }
.pill.warn { background: var(--warn-bg); border-color: var(--warn); }
.pill.ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.items { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.items li { display: flex; justify-content: space-between; gap: 12px; }
.items .qty { font-weight: 700; white-space: nowrap; }
.actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }

/* Summary */
.strong { font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.print-only { display: none; }
.sum-table { display: none; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.sum { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--card); }
table.sum th, table.sum td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; overflow-wrap: break-word; }
table.sum thead th { font-size: 13px; line-height: 1.25; color: var(--dim); font-weight: 600; background: var(--bg); }
table.sum .num { text-align: right; font-variant-numeric: tabular-nums; }
table.sum .shop-col { width: 17%; font-weight: 600; }
table.sum .total-col { width: 88px; }
table.sum tr.group th { background: var(--bg); color: var(--accent); font-family: var(--font-head); font-size: 17px; }
table.sum tfoot th, table.sum tfoot td { border-top: 2px solid var(--line); border-bottom: 0; }

/* Baking list (tablet): big type, big buttons */
.small { font-size: 14px; }
.btn-xl { min-height: 64px; font-size: 22px; }
.bake { display: grid; gap: 12px; }
.bake.is-done { border-color: var(--ok); }
.bake-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.bake-head h2 { font-size: 24px; }
.bake-qty { font-family: var(--font-head); font-weight: 700; font-size: 44px; line-height: 1; white-space: nowrap; }
.done-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-weight: 600; }
.shops summary { display: flex; align-items: center; min-height: var(--btn-h); cursor: pointer; font-weight: 600; }
.shops .items li { padding: 6px 0; border-top: 1px solid var(--line); }
.bake-list { display: grid; gap: var(--gap); }
.time-card { display: grid; gap: 6px; }
.time-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.time-big { font-family: var(--font-head); font-weight: 700; font-size: 44px; line-height: 1; color: var(--accent); }
.items.big { font-size: 20px; gap: 8px; }
.items.big li { padding: 8px 0; border-top: 1px solid var(--line); }

/* Delivery */
.map-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.map { height: 340px; background: #2a2f38; }
.map.picking { cursor: crosshair; outline: 3px solid var(--accent); outline-offset: -3px; }
.pin-wrap { background: none; border: 0; }
.pin { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid #14161a; font-family: var(--font-head); font-weight: 700; font-size: 16px; background: var(--accent); color: var(--on-accent); }
.pin.del { background: var(--ok); color: #06240f; }
.stop { display: grid; gap: 10px; }
.stop-head { display: flex; align-items: center; gap: 10px; }
.stop-head h3 { flex: 1; font-size: 20px; }
.note { padding-top: 8px; border-top: 1px solid var(--line); }
.reorder { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.reorder li { display: grid; grid-template-columns: 1fr 56px 56px; gap: 8px; align-items: center; }
.reorder li.idle .reorder-name { color: var(--dim); }
.reorder-name { font-weight: 600; overflow-wrap: anywhere; }
.btn-sq { padding: 0; font-size: 22px; }
.items .btn { min-height: 44px; }

/* Signature */
.sign-panel { border-color: var(--accent); }
.sig-pad { border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.sig-canvas { display: block; width: 100%; aspect-ratio: 2 / 1; max-height: 340px; touch-action: none; cursor: crosshair; }
.sig-svg { display: block; width: 100%; max-width: 420px; border: 1px solid var(--line); border-radius: 8px; }
.signed { padding-top: 6px; }
#print-root { display: none; }

/* Invoice preview */
.only-wide { display: none; }

/* Laptop and tablet landscape: menu is always visible on the left */
@media (min-width: 900px) {
  .shell { grid-template-columns: 280px 1fr; grid-template-rows: var(--topbar-h) 1fr; }
  .topbar { grid-column: 1 / -1; }
  .menu-btn { display: none; }
  .nav { display: block; position: sticky; top: var(--topbar-h); align-self: start; height: calc(100vh - var(--topbar-h)); overflow-y: auto; grid-row: 2; grid-column: 1; padding: 16px 12px; border-right: 1px solid var(--line); }
  main { grid-row: 2; grid-column: 2; padding: 24px 24px 48px; }
  dialog .actions { grid-template-columns: 1fr 1fr; }
  .row2 { grid-template-columns: 1fr 1fr; }
  .num3 { grid-template-columns: 1fr 1fr 1fr; }
  .recipe-row { grid-template-columns: 1fr 260px; align-items: center; }
  .prod { grid-template-columns: 1fr 260px; align-items: center; }
  .has-bottom-bar { padding-bottom: 0; }
  .bottom-bar { position: static; padding: 0; border: 0; grid-template-columns: auto; justify-content: start; }
  .bottom-bar.two { grid-template-columns: auto auto; }
  .daynav { grid-template-columns: auto auto 1fr; align-items: center; }
  .daynav .date-field { grid-column: auto; grid-row: auto; max-width: 260px; }
  .orders-list { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
  .actions-row { grid-template-columns: auto auto; justify-content: start; }
  .sum-table { display: block; overflow: visible; }
  .sum-cards { display: none; }
  /* the head row stays under the top bar and the totals stay at the bottom while the shops scroll */
  table.sum { border-collapse: separate; border-spacing: 0; }
  table.sum thead th { position: sticky; top: var(--topbar-h); z-index: 3; box-shadow: inset 0 -2px 0 var(--line); }
  table.sum tfoot th, table.sum tfoot td { position: sticky; bottom: 0; z-index: 3; background: var(--card); box-shadow: inset 0 2px 0 var(--line); border-top: 0; }
  .only-wide { display: block; }
  .only-narrow, .paper-lines.only-narrow { display: none; }
  .map { height: 440px; }
  .bake-list { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); align-items: start; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* Printing: white paper, only the page content, the table instead of the cards */
@media print {
  :root { color-scheme: light; --bg: #fff; --card: #fff; --line: #999; --text: #000; --dim: #333; --accent: #000; }
  body { background: #fff; color: #000; }
  .topbar, .nav, .no-print, .toast, .bottom-bar { display: none !important; }
  body.print-one #app { display: none !important; }
  body.print-one #print-root { display: block !important; padding: 0; }
  body.print-one .note { border: 0; }
  body.print-one #print-root { max-width: 180mm; }
  body.print-one .pill.ok { background: #fff; color: #000; border-color: #000; }
  body.print-one .only-wide { display: block !important; }
  body.print-one .only-narrow { display: none !important; }
  .sig-svg { border: 1px solid #999; max-width: 360px; }
  .shell, main { display: block !important; padding: 0 !important; }
  .print-only { display: block; }
  .sum-table { display: block !important; border: 0; }
  .sum-cards { display: none !important; }
  table.sum { font-size: 12px; }
  table.sum thead th, table.sum tr.group th { background: #eee; color: #000; position: static; }
  table.sum tfoot th, table.sum tfoot td { position: static; }
  @page { size: A4 landscape; margin: 12mm; }
}


/* ---- Orders: top action, tabs, filters, groups ---- */
.head-row { display: grid; gap: 12px; }
.head-row .btn { justify-self: stretch; }
.tabs { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 12px 0; }
.tab[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.filters { margin: 12px 0; }
.filters summary { min-height: var(--btn-h); display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.filter-grid { display: grid; gap: 12px; margin: 8px 0 12px; }
.field { display: grid; gap: 6px; }
.field > span { color: var(--dim); font-weight: 600; font-size: 15px; }
.orders-group { margin-top: 20px; }
.group-title { font-size: 20px; margin: 0 0 10px; padding-left: 12px; border-left: 4px solid var(--line); }
.group-title.warn { border-color: var(--warn); }
.group-title.ok { border-color: var(--ok); }
@media (min-width: 900px) {
  .head-row { grid-template-columns: 1fr auto; align-items: end; }
  .head-row .btn { justify-self: end; }
  .tabs { grid-template-columns: repeat(3, auto); justify-content: start; }
  .filter-grid { grid-template-columns: repeat(4, 1fr); }
}


/* ---- Baking list: toolbar, quantity editor, print table ---- */
.toolbar { display: grid; gap: 8px; margin: 12px 0; }
.qty-edit { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px 14px; }
.qty-edit summary { min-height: var(--btn-h); display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.qty-edit .stepper, .qty-edit .btn { margin-top: 10px; }
.qty-edit .btn { width: 100%; }
.qty-edit .stepper .btn { width: auto; margin-top: 0; }
.adjusted { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.print-table { width: 100%; border-collapse: collapse; margin: 6px 0 14px; font-size: 13px; }
.print-table th, .print-table td { border: 1px solid #666; padding: 5px 7px; text-align: left; vertical-align: top; }
.print-table .num { text-align: right; }
.print-table .tick { width: 14mm; text-align: center; }
@media (min-width: 900px) { .toolbar { grid-template-columns: auto auto; justify-content: start; } }

.pin.idle-dot { width: 14px; height: 14px; background: #6b7280; border-width: 2px; }
.btn-row { display: grid; gap: 8px; }
@media (min-width: 900px) { .btn-row { grid-template-columns: auto auto; justify-content: start; } }

/* ---- Delivery progress ---- */
.progress { display: grid; gap: 6px; }
.progress-text { font-size: 16px; }
.bar { height: 14px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.bar .fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; min-width: 0; }
.bar .fill.full { background: var(--ok); }
@media print { .progress { display: none; } }

/* Invoice "paper": the same look as the PDF, on the screen and when printed from the browser */
.paper { --p-brown: #3B2A1A; --p-amber: #F5A524; --p-amber-dark: #B45309; --p-cream: #FFF8E7; --p-cream2: #FDEFC8; --p-edge: #F3D9A0; --p-ink: #1F2937; --p-dim: #6B7280; --p-line: #D6C7A8;
  background: #fff; color: var(--p-ink); border-radius: var(--radius); overflow: hidden; font: 400 15px/1.4 var(--font-body); }
.paper, .paper * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.paper p, .paper h3 { margin: 0; }
.paper .dim { color: var(--p-dim); }
.paper-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 22px 20px; background: var(--p-brown); color: #fff; }
.paper-loaf { width: 56px; height: 38px; flex: none; }
.paper-brand { display: grid; gap: 2px; }
.paper-brand strong { font: 700 26px/1.1 var(--font-head); }
.paper-brand span { color: var(--p-amber); font-weight: 700; font-size: 13px; letter-spacing: 0.04em; }
.paper-ref { display: grid; gap: 2px; margin-left: auto; text-align: right; color: var(--p-cream2); font-size: 13px; }
.paper-ref strong { color: #fff; font: 700 18px/1.2 var(--font-head); }
.paper-stripe { height: 6px; background: var(--p-amber); }
.paper-body { display: grid; gap: 14px; padding: 18px 20px 8px; }
.paper-warn { padding: 8px 12px; border: 1px solid #B91C1C; border-radius: 8px; background: #FEE2E2; color: #991B1B; font-weight: 700; font-size: 12.5px; text-align: center; }
.paper-parties { display: grid; gap: 12px; }
.paper-box { display: grid; gap: 3px; align-content: start; padding: 12px; border: 1px solid var(--p-edge); border-radius: 8px; background: var(--p-cream); font-size: 14px; }
.paper-box h3 { color: var(--p-amber-dark); font: 700 11px/1.2 var(--font-body); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.paper-box .name { font: 700 17px/1.25 var(--font-body); }
.paper-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.paper-chip { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--p-edge); border-radius: 8px; }
.paper-chip span { color: var(--p-amber-dark); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.paper-chip strong { font-size: 15px; }
.paper table { width: 100%; border-collapse: collapse; }
.paper th, .paper td { padding: 7px 10px; text-align: left; vertical-align: top; }
.paper .num { text-align: right; white-space: nowrap; }
.paper-table thead th, .paper-vat thead th { font-size: 12.5px; }
.paper-table thead th { background: var(--p-brown); color: #fff; }
.paper-table thead th:first-child { border-radius: 6px 0 0 6px; }
.paper-table thead th:last-child { border-radius: 0 6px 6px 0; }
.paper-table tbody tr:nth-child(odd) { background: var(--p-cream); }
.paper-table .idx { color: var(--p-dim); width: 1%; }
.paper-lines { margin: 0; padding: 0; list-style: none; display: grid; }
.paper-lines li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 9px 8px; }
.paper-lines li:nth-child(odd) { background: var(--p-cream); }
.paper-lines li span { grid-column: 1; color: var(--p-dim); font-size: 13px; }
.paper-lines li b { grid-column: 2; grid-row: 1 / span 2; align-self: center; white-space: nowrap; }
.paper-sum { display: grid; gap: 14px; align-items: start; }
.paper-vat thead th { background: var(--p-cream2); color: var(--p-brown); border-top: 1px solid var(--p-edge); border-bottom: 1px solid var(--p-edge); }
.paper-vat tbody th, .paper-vat tbody td { border-bottom: 1px solid var(--p-line); }
.paper-total { display: grid; gap: 6px; padding: 16px; border-radius: 10px; background: var(--p-brown); color: #fff; }
.paper-total p { display: flex; justify-content: space-between; gap: 12px; color: var(--p-cream2); }
.paper-total p span:last-child { color: #fff; }
.paper-total .paper-pay { display: grid; gap: 2px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--p-amber); color: var(--p-amber); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.paper-gross { font: 700 30px/1.1 var(--font-head); color: #fff; text-align: right; text-transform: none; letter-spacing: 0; }
.paper-notes { display: grid; gap: 6px; color: var(--p-dim); font-size: 12px; }
.paper-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin: 10px 20px 0; padding: 12px 0 16px; border-top: 2px solid var(--p-amber); color: var(--p-dim); font-size: 12px; }
@media (min-width: 700px) {
  .paper-parties { grid-template-columns: 1fr 1fr; }
  .paper-chips { grid-template-columns: repeat(4, 1fr); }
  .paper-sum { grid-template-columns: 1.2fr 1fr; }
}
@page invoice { size: A4 portrait; margin: 10mm; }
@media print {
  body.print-one #print-root { max-width: none; }
  body.print-one .paper { page: invoice; }
  body.print-one .paper { border-radius: 0; font-size: 13px; }
  body.print-one .paper-parties { grid-template-columns: 1fr 1fr; }
  body.print-one .paper-chips { grid-template-columns: repeat(4, 1fr); }
  body.print-one .paper-sum { grid-template-columns: 1.2fr 1fr; }
  body.print-one .paper tr, body.print-one .paper-box, body.print-one .paper-total, body.print-one .paper-sum { break-inside: avoid; }
}
