/* Kelt számlázó — saját, függőség nélküli stíluslap */
:root {
  --bg: #f5f6f8; --panel: #ffffff; --ink: #1f2933; --muted: #6b7280; --line: #e3e6ea; --line2: #d1d5db;
  --accent: #0f766e; --accent-ink: #ffffff; --accent-soft: #e6f4f2;
  --ok: #15803d; --ok-soft: #e8f6ed; --warn: #b45309; --warn-soft: #fdf3e2; --bad: #b91c1c; --bad-soft: #fdecec;
  --radius: 8px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --side: 232px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* elrendezés */
.layout { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: #12312e; color: #d7ecea; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: baseline; gap: 8px; padding: 2px 10px 18px; }
.brand b { font-size: 22px; letter-spacing: .02em; color: #fff; }
.brand span { font-size: 11px; color: #8fb9b4; }
.side nav a { display: flex; justify-content: space-between; align-items: center; color: #d7ecea; padding: 8px 10px;
  border-radius: 6px; margin-bottom: 2px; }
.side nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.side nav a.on { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
.side .sep { height: 1px; background: rgba(255,255,255,.1); margin: 12px 4px; }
.side .cta { display: block; text-align: center; background: #2dd4bf; color: #06201d; font-weight: 650;
  padding: 9px 10px; border-radius: 6px; margin: 0 4px 14px; }
.side .cta:hover { text-decoration: none; filter: brightness(1.05); }
.badge { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 999px; font-size: 11px;
  font-weight: 650; text-align: center; }
.badge.bad { background: var(--bad); color: #fff; }
.main { min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 28px;
  background: var(--panel); border-bottom: 1px solid var(--line); gap: 12px; }
.top .who { display: flex; align-items: center; gap: 14px; }
.content { padding: 24px 28px 48px; max-width: 1280px; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px;
  flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* panelek */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 18px; }
.panel.tight { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 16px 18px; }
.stat .v { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }

/* gombok */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line2); background: var(--panel);
  color: var(--ink); padding: 7px 13px; border-radius: 6px; font: inherit; font-weight: 550; cursor: pointer;
  white-space: nowrap; }
.btn:hover { background: #f3f4f6; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: #f1c4c4; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 4px 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }

/* táblázatok */
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 9px 12px;
  border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click:hover td { background: #f8fafb; cursor: pointer; }
table.t tfoot td { font-weight: 650; background: #fafbfc; }

/* címkék */
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #eef0f3; color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }

/* űrlapok */
.inp { width: 100%; padding: 7px 10px; border: 1px solid var(--line2); border-radius: 6px; font: inherit;
  background: #fff; color: var(--ink); }
.inp:focus { outline: 2px solid #99d5cd; border-color: var(--accent); }
textarea.inp { resize: vertical; }
select.inp { padding: 6px 8px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 3px; }
.field .err, .errlist { color: var(--bad); font-size: 12px; margin-top: 3px; }
.field.check { display: flex; gap: 8px; align-items: center; }
.field.check label { margin: 0; color: var(--ink); font-weight: 500; font-size: 14px; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
.formgrid .wide { grid-column: 1 / -1; }
ul.errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: var(--bad); font-size: 12px; }
ul.radio, div#id_mode { display: flex; gap: 18px; }
#id_mode > div label, ul.radio label { color: var(--ink); font-weight: 500; font-size: 14px; }

/* üzenetek */
.msgs { margin-bottom: 16px; }
.msg { padding: 10px 14px; border-radius: 6px; margin-bottom: 8px; border: 1px solid transparent; }
.msg.success { background: var(--ok-soft); border-color: #bfe5cc; color: #14532d; }
.msg.error { background: var(--bad-soft); border-color: #f3c2c2; color: #7f1d1d; }
.msg.warning { background: var(--warn-soft); border-color: #f2d7a6; color: #78350f; }
.msg.info { background: var(--accent-soft); border-color: #b5e0da; color: #134e4a; }
.banner { padding: 8px 28px; background: #fff7e6; border-bottom: 1px solid #f2d7a6; color: #78350f; font-size: 13px; }

/* számlaszerkesztő */
.lines td { padding: 6px 6px; }
.lines .inp { padding: 6px 7px; }
.lines .c-desc { min-width: 240px; }
.lines .c-qty { width: 80px; }
.lines .c-unit { width: 80px; }
.lines .c-price { width: 120px; }
.lines .c-vat { width: 150px; }
.lines .c-sum { width: 120px; }
.lines .c-del { width: 40px; text-align: center; }
.lines tr.deleted { display: none; }
.lines .sub { margin-top: 4px; }
.totals { display: grid; grid-template-columns: auto auto; gap: 4px 24px; justify-content: end; margin-top: 12px; }
.totals .big { font-size: 20px; font-weight: 700; color: var(--accent); }
.stickybar { position: sticky; bottom: 0; background: rgba(245,246,248,.96); border-top: 1px solid var(--line);
  padding: 12px 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 8px; }

/* adatlap */
dl.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
.party b { font-size: 15px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.timeline li:last-child { border-bottom: 0; }

/* szűrősáv */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters .inp { width: auto; }
.pager { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* belépés */
.login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #12312e, #0f766e); }
.login .card { background: #fff; border-radius: 12px; padding: 32px; width: 360px; box-shadow: 0 20px 40px rgba(0,0,0,.25); }
.login .card h1 { margin-bottom: 18px; }

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .content, .top { padding-left: 16px; padding-right: 16px; }
  .lines { display: block; overflow-x: auto; }
}
@media print {
  .side, .top, .actions, .stickybar { display: none !important; }
  .layout { display: block; }
}
.w100 { width: 100%; justify-content: center; }
.narrow { max-width: 560px; }
.login .brand { padding: 0 0 8px; }
.login .brand b { color: #12312e; font-size: 28px; }
.mt { margin-top: 14px; }
.right { text-align: right; }
.hidden { display: none; }
.panel-h { padding: 14px 18px 4px; }
.panel-h h2 { margin: 0 0 6px; }

/* vevőblokk, tagolt űrlapok */
fieldset.sect { border: 1px solid var(--line, #e5e7eb); border-radius: 8px; padding: 10px 14px 4px; margin: 0 0 14px; }
fieldset.sect legend { font-weight: 600; padding: 0 6px; }
.hits { position: absolute; z-index: 20; background: #fff; border: 1px solid #d1d5db; border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,.08); max-height: 260px; overflow: auto; min-width: 280px; }
.hits button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; cursor: pointer; }
.hits button:hover, .hits button:focus { background: var(--accent-soft, #e6f4f2); }
#buyer-panel .field { position: relative; }
button.link { border: 0; background: none; color: var(--accent, #0f766e); padding: 0 2px; cursor: pointer; font: inherit; }
.quick { margin-top: 3px; }
.desc-row { display: flex; gap: 6px; }
.desc-row input[name$="-code"] { max-width: 110px; }
details > summary { cursor: pointer; color: var(--accent, #0f766e); }
[hidden] { display: none !important; }
.hits .nohit { padding: 7px 10px; }
