/* Enso — one stylesheet, phone first, prints a clean A4 invoice. */
:root {
  --ink: #1b2430; --muted: #5d6b7a; --line: #dfe4ea; --bg: #f5f7fa; --card: #fff;
  --brand: #1b2440; --brand-2: #3b5a9a; --seal: #e4572e; --accent: #e8f0f8;
  --good: #1f7a4d; --bad: #b42318; --warn: #a15c00; --warn-bg: #fff6e5;
  --r: 10px; --nav-h: 62px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; color: var(--ink); background: var(--bg); }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 4px 0 6px; }
a { color: var(--brand-2); }
.boot { padding: 40px; text-align: center; color: var(--muted); }

/* shell */
.shell { min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 30; background: var(--brand); color: #fff; padding: 8px 12px; height: 56px;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 2px 10px rgba(15, 23, 34, .15); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; min-width: 0; flex: 1; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 17px; }
.logo { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 8px; background: #fff; color: var(--brand); font-weight: 800; }
.brand.big { font-size: 20px; color: var(--brand); margin-bottom: 4px; }
.brand.big .logo { background: var(--brand); color: #fff; }
.burger { flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .12); cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; }
.burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: #fff; transition: transform .25s, opacity .2s; }
.menu-open .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-open .burger span:nth-child(2) { opacity: 0; }
.menu-open .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.btn.top-new { flex: none; background: #fff; color: var(--brand); min-height: 36px; padding: 6px 12px; }
.nav { position: fixed; top: 56px; bottom: 0; left: 0; z-index: 25; width: 250px; max-width: 82vw; display: flex; flex-direction: column;
  overflow-y: auto; background: #fff; border-right: 1px solid var(--line); padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  transform: translateX(-102%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); box-shadow: 4px 0 24px rgba(15, 23, 34, .12); }
.menu-open .nav { transform: none; }
.scrim { position: fixed; inset: 56px 0 0 0; z-index: 24; background: rgba(15, 23, 34, .35); opacity: 0; pointer-events: none; transition: opacity .25s; }
.menu-open .scrim { opacity: 1; pointer-events: auto; }
.nav a { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-size: 15px; padding: 12px 20px;
  border-left: 3px solid transparent; }
.nav a .ico { font-size: 19px; width: 24px; text-align: center; }
.nav a:hover { background: #f4f7fb; }
.nav a.on { color: var(--brand); font-weight: 700; background: var(--accent); border-left-color: var(--brand); }
.main { padding: 16px 16px 40px; max-width: 1100px; margin: 0 auto; }
@media (min-width: 1000px) {
  .top { position: fixed; left: 0; right: 0; }
  .burger, .scrim { display: none; }
  .nav { transform: none; box-shadow: none; width: 220px; }
  .main { margin-left: 220px; padding: 76px 28px 40px; max-width: none; }
}
@media (max-width: 420px) { .btn.top-new { padding: 6px 9px; font-size: 13.5px; } }

/* page head */
.page-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sub { color: var(--muted); margin: 2px 0 8px; }
.section { margin-top: 22px; }

/* cards, grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 14px; }
.card.inset { background: #fafbfc; padding: 12px; margin: 10px 0; }
.card.hello ol { margin: 0; padding-left: 20px; }
.card.hello li { margin: 4px 0; }
.card.hello li.done { color: var(--muted); text-decoration: line-through; }
.grid2, .grid3 { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: 1fr 1fr 1fr; } }
.row-inline { display: flex; gap: 8px; align-items: center; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* forms */
.field { display: block; margin-bottom: 10px; }
.field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.field-hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.field-hint.ok { color: var(--good); } .field-hint.bad { color: var(--bad); }
.input { width: 100%; font: inherit; padding: 9px 10px; border: 1px solid #c9d1da; border-radius: 8px; background: #fff; color: var(--ink); min-height: 40px; }
.input:focus { outline: 2px solid var(--brand-2); outline-offset: 0; border-color: var(--brand-2); }
textarea.input { resize: vertical; }
.check { display: flex; gap: 8px; align-items: center; margin: 6px 0 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters .input { width: auto; flex: 1 1 180px; }
.period { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.period .input { width: auto; }

/* buttons */
.btn { font: inherit; font-weight: 600; border-radius: 8px; padding: 9px 14px; border: 1px solid transparent; cursor: pointer;
  background: var(--accent); color: var(--brand); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.ghost { background: #fff; border-color: #c9d1da; color: var(--ink); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger-ghost { background: #fff; border-color: #f0c6c2; color: var(--bad); }
.btn.link { background: none; border: 0; color: var(--brand-2); padding: 6px 0; min-height: 0; font-weight: 500; }
.btn.small { padding: 6px 10px; min-height: 32px; font-size: 13.5px; }
.btn.big { padding: 12px 22px; font-size: 16px; }
.btn.icon { background: none; border: 0; font-size: 20px; color: var(--muted); padding: 4px 8px; min-height: 0; }
.btn[disabled] { opacity: .55; cursor: default; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; }
.btn.tab { background: #fff; border-color: var(--line); color: var(--muted); white-space: nowrap; }
.btn.tab.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.save-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin: 6px 0 20px; }

/* tables */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { font-size: 12.5px; color: var(--muted); background: #fafbfc; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: #f7f9fc; }
.r { text-align: right !important; white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 24px !important; }
.pos { color: var(--good); font-weight: 600; } .neg { color: var(--bad); font-weight: 600; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--accent); color: var(--brand); margin-left: 6px; }
.badge.bad { background: #fde8e6; color: var(--bad); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.warn-box { background: var(--warn-bg); border: 1px solid #f2d9a8; color: #5b3a00; border-radius: var(--r); padding: 10px 14px; margin-bottom: 12px; }
.warn-text { grid-column: 1 / -1; color: var(--warn); font-size: 12.5px; }
.warn-text:empty { display: none; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.stat.click { cursor: pointer; } .stat.click:hover { border-color: var(--brand-2); }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 21px; font-weight: 750; margin: 2px 0; }
.stat-sub { font-size: 12px; color: var(--muted); }
.stat.good .stat-value { color: var(--good); } .stat.bad .stat-value { color: var(--bad); } .stat.warn .stat-value { color: var(--warn); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

/* bill lines */
.lines { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.line { display: grid; gap: 0 8px; grid-template-columns: 1fr 1fr 1fr; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.line .c-item { grid-column: 1 / -1; }
.line .c-item .input + .input { margin-top: 6px; }
.line .c-amt { grid-column: 1 / 3; align-self: center; }
.line .c-amt .amt { font-size: 16px; }
.line .c-del { text-align: right; align-self: center; }
.line .unit { font-weight: 400; }
@media (min-width: 900px) {
  .line { grid-template-columns: 3fr 1fr 1fr 1.1fr .9fr 1.2fr auto; align-items: end; }
  .line.with-disc { grid-template-columns: 3fr 1fr 1fr 1.1fr .7fr .9fr 1.2fr auto; }
  .line .c-item { grid-column: auto; }
  .line .c-amt { grid-column: auto; text-align: right; padding-bottom: 18px; }
  .line .c-del { padding-bottom: 14px; }
}
.bom-row { display: grid; grid-template-columns: 2fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.bom-row .field-hint { grid-column: 1 / -1; margin-top: -4px; }
.totals { margin-left: auto; max-width: 380px; }
.tot-row { display: flex; justify-content: space-between; padding: 4px 0; }
.tot-row.grand { font-size: 18px; font-weight: 800; border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 8px; }
.words { font-style: italic; color: var(--muted); margin: 6px 0; }

/* reports */
.statement { max-width: 560px; }
.st-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.st-row.strong { font-weight: 700; } .st-row.indent span:first-child { padding-left: 14px; color: var(--muted); white-space: pre; }
.st-row.head { font-weight: 700; border-bottom: 0; padding-top: 12px; }
.st-row.total { font-weight: 700; border-top: 1px solid var(--ink); }
.st-row.grand { font-size: 18px; font-weight: 800; border-top: 2px solid var(--ink); border-bottom: 0; margin-top: 4px; }
.st-row.grand.good span:last-child { color: var(--good); } .st-row.grand.bad span:last-child { color: var(--bad); }
.st-row.muted { color: var(--muted); font-size: 13.5px; }
.dl-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }

/* modal, toast */
.overlay { position: fixed; inset: 0; background: rgba(15, 23, 34, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-height: 92vh; display: flex; flex-direction: column; border-radius: 14px 14px 0 0; }
@media (min-width: 700px) { .overlay { align-items: center; } .modal { width: 520px; border-radius: 14px; } .modal.wide { width: 760px; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 14px 16px; overflow-y: auto; }
.modal-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; transition: .2s; max-width: 92vw; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.bad { background: var(--bad); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px; width: 100%; max-width: 400px; }
.login-card.wide { max-width: 560px; }
.login-card h1 { margin: 14px 0 12px; }
.login-card .btn.big { width: 100%; justify-content: center; margin-top: 6px; }
.login-links { display: flex; justify-content: space-between; flex-wrap: wrap; margin-top: 8px; }

/* the invoice */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.invoice { position: relative; background: #fff; border: 1px solid var(--line); padding: 22px; max-width: 900px; margin: 0 auto; font-size: 13px; color: #000; }
.invoice .label { color: #555; font-size: 11.5px; text-transform: uppercase; letter-spacing: .02em; }
.inv-top { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid #000; padding-bottom: 10px; }
.seller-name { font-size: 20px; font-weight: 800; }
.inv-title { text-align: right; } .inv-title .big { font-size: 18px; font-weight: 800; letter-spacing: .04em; } .muted { color: #555; }
.inv-meta { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid #000; }
.inv-meta .strong { font-weight: 700; font-size: 14px; }
.invno { text-align: right; } .invno > div { margin-bottom: 2px; }
table.inv-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
table.inv-table th, table.inv-table td { border: 1px solid #999; padding: 5px 6px; text-align: left; }
table.inv-table th { background: #f0f0f0; font-size: 11.5px; }
table.inv-table.small { font-size: 12px; }
.inv-bottom { display: flex; gap: 20px; justify-content: space-between; }
.inv-left { flex: 1 1 55%; } .inv-right { flex: 0 0 300px; }
.bank, .terms, .note { margin-top: 8px; font-size: 12px; }
.sign { margin-top: 30px; text-align: right; } .sign-line { margin-top: 44px; border-top: 1px solid #000; display: inline-block; padding-top: 4px; }
.stamp { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); font-size: 64px; font-weight: 900;
  color: rgba(180, 35, 24, .25); border: 6px solid rgba(180, 35, 24, .25); padding: 4px 18px; pointer-events: none; }
@media (max-width: 640px) {
  .invoice { padding: 12px; font-size: 12px; }
  .inv-top, .inv-meta, .inv-bottom { flex-direction: column; }
  .inv-title, .invno { text-align: left; } .inv-right { flex: none; }
  table.inv-table { display: block; overflow-x: auto; }
}

/* licence */
.licence-banner { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 16px; margin-bottom: 14px;
  border-radius: var(--r); background: linear-gradient(120deg, var(--accent), #fff); border: 1px solid #c8d8ea; }
.licence-banner > div { display: flex; flex-direction: column; }
.licence-banner span { color: var(--muted); font-size: 13.5px; }
.licence-banner.soon { background: linear-gradient(120deg, var(--warn-bg), #fff); border-color: #f2d9a8; }
.lock-card { max-width: 460px; margin: 30px auto; text-align: center; padding: 28px 22px; }
.lock-card .btn.big { width: 100%; justify-content: center; margin: 6px 0; }
.lock-ico { font-size: 44px; animation: wiggle 1.6s ease-in-out .4s 2; }
.price-tag { margin: 16px 0; } .price-tag b { display: block; font-size: 34px; color: var(--brand); }
.price-tag span { color: var(--muted); font-size: 13.5px; }
.buy-price { margin-bottom: 6px; } .price-now { font-size: 26px; color: var(--brand); }
.buy-go .btn { width: 100%; justify-content: center; }
.small { font-size: 12.5px; }

/* motion — quick and quiet, never in the way of typing */
.btn, .nav a, .stat, .card, table.data td, .input { transition: background-color .18s, color .18s, border-color .18s, box-shadow .18s, transform .12s; }
.btn:active:not([disabled]) { transform: scale(.97); }
.btn.primary:hover:not([disabled]) { box-shadow: 0 4px 14px rgba(27, 36, 64, .25); }
.stat.click:hover, tr.click:hover td { box-shadow: 0 2px 10px rgba(27, 36, 48, .06); }
.stat.click:hover { transform: translateY(-2px); }
.input:focus { box-shadow: 0 0 0 4px rgba(44, 90, 143, .15); }
.main.enter > * { animation: rise .32s cubic-bezier(.2, .7, .2, 1) both; }
.main.enter > *:nth-child(2) { animation-delay: .04s; } .main.enter > *:nth-child(3) { animation-delay: .08s; }
.main.enter > *:nth-child(4) { animation-delay: .12s; } .main.enter > *:nth-child(n+5) { animation-delay: .16s; }
.main.enter .stats > .stat { animation: rise .35s cubic-bezier(.2, .7, .2, 1) both; }
.main.enter .stats > .stat:nth-child(2) { animation-delay: .05s; } .main.enter .stats > .stat:nth-child(3) { animation-delay: .1s; }
.main.enter .stats > .stat:nth-child(4) { animation-delay: .15s; } .main.enter .stats > .stat:nth-child(n+5) { animation-delay: .2s; }
.login-card { animation: pop .45s cubic-bezier(.2, .8, .2, 1) both; }
.login .logo, .top .logo { animation: spin-in .6s cubic-bezier(.2, .8, .2, 1) both; }
.overlay { animation: fade .18s ease-out both; }
.modal { animation: sheet .26s cubic-bezier(.2, .8, .2, 1) both; }
@media (min-width: 700px) { .modal { animation-name: pop; } }
.toast { transition: opacity .22s, transform .28s cubic-bezier(.2, .8, .2, 1); }
.nav a.on .ico { animation: bounce .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin-in { from { transform: rotate(-90deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bounce { 0% { transform: scale(.8); } 60% { transform: scale(1.15); } 100% { transform: none; } }
@keyframes wiggle { 0%, 100% { transform: none; } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* printing: A4 invoice, or a roll receipt (body.print-80 / print-58) */
.receipt { display: none; }
.print-menu h3 { margin: 0 0 2px; }
@media print {
  /* a roll: nothing on the page but the receipt, starting at the top,
     in a size where 48 (3-inch) or 32 (2-inch) characters fit a line */
  body.print-80 .main > :not(.r80), body.print-58 .main > :not(.r58) { display: none !important; }
  body.print-80, body.print-58, body.print-80 .shell, body.print-58 .shell { min-height: 0 !important; }
  body.print-80 .receipt.r80, body.print-58 .receipt.r58 { display: block; margin: 0; padding: 0; font: 9.3px/1.3 "Courier New", monospace; color: #000; white-space: pre; animation: none !important; }
  body.print-58 .receipt.r58 { font-size: 9.6px; }
  body.print-80 .receipt.rqr.r80, body.print-58 .receipt.rqr.r58 { font-family: inherit; white-space: normal; }
  .receipt.rqr .upi-qr { border: 0; padding: 0; margin: 6px 0 0; }
}
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .top, .nav, .scrim, .no-print, .toast, .overlay, .licence-banner { display: none !important; }
  .main.enter > * { animation: none !important; }
  .main { margin: 0 !important; padding: 0 !important; max-width: none; }
  .invoice { border: 0; padding: 0; max-width: none; font-size: 11.5px; }
  .inv-top, .inv-meta, .inv-bottom { flex-direction: row !important; }
  .inv-title, .invno { text-align: right !important; } .inv-right { flex: 0 0 280px !important; }
  table.inv-table { display: table !important; }
  table.inv-table tr { break-inside: avoid; }
}

/* party picker, bill extras, payment status */
.picker { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 15; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 34, .14); margin-top: 4px; max-height: 280px; overflow-y: auto; animation: rise .16s ease-out both; }
.suggest:empty { display: none; }
.suggest button { display: block; width: 100%; text-align: left; font: inherit; background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 10px 12px; cursor: pointer; color: var(--ink); }
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover, .suggest button:focus { background: var(--accent); outline: none; }
.suggest small { display: block; color: var(--muted); font-size: 12.5px; }
.party-card { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r);
  background: var(--accent); border: 1px solid #c8d8ea; margin-bottom: 10px; animation: pop .25s ease-out both; }
.party-card .pc-name { font-weight: 700; font-size: 16px; }
.party-card .pc-line { color: var(--muted); font-size: 13.5px; }
.party-card .pc-due { font-weight: 700; color: var(--bad); font-size: 13.5px; margin-top: 4px; }
.party-card .pc-due.ok { color: var(--good); }
details.more { margin-top: 6px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--brand-2); padding: 6px 0; }
.pay-state { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.pay-state.paid { background: #e3f4ea; color: var(--good); }
.pay-state.part { background: var(--warn-bg); color: var(--warn); }
.pay-state.unpaid { background: #fde8e6; color: var(--bad); }
.inv-transport { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 0; border-bottom: 1px solid #000; font-size: 12px; }
.inv-transport b { font-weight: 700; }
.inv-paid { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #999; }
.inv-paid .due { font-weight: 800; }

@media print {
  body.print-80 { width: 80mm; } body.print-58 { width: 58mm; }
}

/* Enso: quick actions, product & order cards, chips */
.qa { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 700px) { .qa { grid-template-columns: repeat(6, 1fr); } }
.qa-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 14px; border: 1px solid var(--line);
  background: #fff; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--ink); cursor: pointer; transition: transform .15s, box-shadow .2s, border-color .2s; }
.qa-tile:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(27, 36, 64, .12); border-color: var(--brand-2); }
.qa-ico { width: 42px; height: 42px; display: grid; place-items: center; font-size: 22px; border-radius: 12px; background: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 8px; }
.chip { font: inherit; font-size: 13.5px; font-weight: 600; padding: 6px 12px; border-radius: 99px; border: 1px solid #c9d1da; background: #fff; color: var(--ink); cursor: pointer; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.small { padding: 2px 9px; font-size: 12px; cursor: default; }
.chip.late { background: var(--bad); border-color: var(--bad); color: #fff; }
.recipe-row { display: grid; grid-template-columns: 2fr 1.2fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.recipe-row .r { font-weight: 600; }
.order-row { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; align-items: end; }
@media (max-width: 560px) { .recipe-row { grid-template-columns: 1fr 1fr auto; } .recipe-row .r { grid-column: 1 / 3; } .order-row { grid-template-columns: 1fr 1fr; } }
.cost-box { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: #f7f9fc; border: 1px solid var(--line); }
.cost-box .tot-row.good span:last-child { color: var(--good); font-weight: 700; } .cost-box .tot-row.bad span:last-child { color: var(--bad); font-weight: 700; }
.pgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 8px;
  transition: transform .15s, box-shadow .2s; animation: rise .3s ease-out both; }
.pcard:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(27, 36, 48, .08); }
.pcard.order { cursor: default; } .pcard.urgent { border-color: #f0c6c2; box-shadow: inset 4px 0 0 var(--bad); }
.pc-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; } .pc-head b { font-size: 16px; }
.pc-mats, .pc-line { color: var(--muted); font-size: 13px; }
.pc-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pc-nums small { display: block; color: var(--muted); font-size: 11.5px; } .pc-nums b { font-size: 14px; }
.pc-short { font-size: 13px; color: var(--bad); font-weight: 600; background: #fde8e6; border-radius: 8px; padding: 6px 10px; }
.card.need { border-color: #f0c6c2; background: #fff8f7; }

/* Enso logo */
.logo-img { width: 34px; height: 34px; border-radius: 9px; flex: none; animation: spin-in .6s cubic-bezier(.2, .8, .2, 1) both; }
.brand.big .logo-img { width: 48px; height: 48px; border-radius: 12px; }
.brand.big > span { display: flex; flex-direction: column; line-height: 1.15; }
.brand-tag { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.qa-ico { background: #f1f3f8; }
.btn.top-new { color: var(--brand); }

/* logo + UPI QR on documents */
.inv-logo { height: 110px; max-width: 280px; object-fit: contain; object-position: left center; margin-right: 18px; }
@media (max-width: 640px) { .inv-logo { height: 80px; max-width: 220px; } }
@media print { .inv-logo { height: 28mm; max-width: 75mm; } }
.inv-top { align-items: flex-start; }
.upi-qr { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 8px; border: 1px dashed #999; border-radius: 8px; width: fit-content; font-size: 12px; }
.upi-qr img { width: 96px; height: 96px; image-rendering: pixelated; }
.logo-preview { width: 72px; height: 72px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 4px; }

.adv-row { background: #e3f4ea; border-radius: 10px; padding: 8px 12px; margin: 6px 0 10px; }
