/* Offerti — felület */
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #15191e;
  --ink-2: #4b525a;
  --ink-3: #7c838b;
  --line: #e1e6ee;
  --line-2: #cdd5e0;
  --brand: #1670e8;
  --brand-ink: #0f56b8;
  --brand-soft: #e9f2ff;
  --dark: #07111f;
  --ok: #1f7a4d;
  --ok-soft: #e8f5ee;
  --warn: #9a6200;
  --warn-soft: #fff5dc;
  --bad: #b3261e;
  --bad-soft: #fdecea;
  --info: #2457a6;
  --info-soft: #eaf1fc;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,32,.05), 0 4px 16px rgba(16,24,32,.05);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--ink-3); }
.num, .tbl th.num, .tbl td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }

/* ---- App váz ---- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--dark); color: #d9dde2; padding: 18px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.25rem; padding: 4px 8px 18px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 7px; background: #fff; }
.brand .wm em { font-style: normal; color: var(--brand); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #c9ced4; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(22,112,232,.22); color: #fff; }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 4px; }
.sidebar-foot { margin-top: auto; font-size: .82rem; color: #9aa1a8; padding: 8px; }
.sidebar-foot strong { color: #fff; display: block; }
.plan-pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,.1); color: #fff; margin-top: 4px; }
.plan-pill.active { background: var(--brand); }
.main { padding: 26px 32px 60px; max-width: 1240px; width: 100%; min-width: 0; }
.topbar { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--ink-3); margin-top: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions > select, .actions > input { width: auto; }
.actions > input[type=search] { flex: 1 1 200px; }

/* ---- Elemek ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .label { color: var(--ink-3); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 1.55rem; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: .82rem; color: var(--ink-3); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; white-space: nowrap; line-height: 1.3; }
.btn:hover { background: var(--surface-2); text-decoration: none; border-color: #c4bcb2; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn-dark { background: var(--dark); border-color: var(--dark); color: #fff; }
.btn-dark:hover { background: #26303a; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-danger { color: var(--bad); border-color: #e8c3bf; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 5px 10px; font-size: .84rem; }
.btn-lg { padding: 12px 20px; font-size: 1rem; }
.btn svg { width: 16px; height: 16px; }
.icon-btn { border: 0; background: transparent; padding: 6px; border-radius: 6px; cursor: pointer; color: var(--ink-3); line-height: 0; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }

label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 4px; color: var(--ink-2); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; font: inherit; color: var(--ink); min-height: 38px;
}
textarea { min-height: 80px; resize: vertical; }
input[type=file] { font: inherit; font-size: .9rem; }
.field { margin-bottom: 12px; }
.field .help { font-size: .8rem; color: var(--ink-3); margin-top: 3px; font-weight: 400; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; color: var(--ink); }
.check input { margin-top: 4px; accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row-3 { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fcfbf9; }
.tbl .row-link { color: var(--ink); font-weight: 600; }
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.tbl tfoot td { font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--line-2); }

.badge { display: inline-block; font-size: .76rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.badge-draft { background: #eeeae5; color: #5d5650; }
.badge-sent { background: var(--info-soft); color: var(--info); }
.badge-accepted { background: var(--ok-soft); color: var(--ok); }
.badge-declined { background: var(--bad-soft); color: var(--bad); }
.badge-brand { background: var(--brand-soft); color: var(--brand-ink); }

.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-weight: 500; border: 1px solid; }
.flash-success { background: var(--ok-soft); border-color: #bfe2cf; color: #155c39; }
.flash-error { background: var(--bad-soft); border-color: #f2c4bf; color: #8c1d16; }
.flash-info { background: var(--info-soft); border-color: #c9daf5; color: #1b437f; }
.callout { padding: 12px 14px; border-radius: 8px; background: var(--brand-soft); border: 1px solid #c5dbfb; color: #0b3d82; margin-bottom: 14px; }
.callout-info { background: var(--info-soft); border-color: #c9daf5; color: #1b437f; }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-3); }
.empty strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 4px; }

.progress { height: 8px; background: #eeeae5; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.checklist .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; }
.checklist .done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist .done a { color: var(--ink-3); text-decoration: line-through; }
.checklist svg { width: 12px; height: 12px; }

.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 150px; padding-top: 8px; }
.bars .bar { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-align: center; font-size: .72rem; color: var(--ink-3); gap: 4px; }
.bars .stack { display: flex; flex-direction: column; justify-content: flex-end; border-radius: 4px 4px 0 0; overflow: hidden; min-height: 2px; background: #eeeae5; }
.bars .exp { background: #9aa1a8; }
.bars .prof { background: var(--brand); }
.legend { display: flex; gap: 14px; font-size: .82rem; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ---- Ajánlatszerkesztő ---- */
.editor-bar { position: sticky; top: 0; z-index: 20; background: rgba(243,245,248,.94); backdrop-filter: blur(6px); padding: 10px 0; margin: -10px 0 12px; display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.editor-bar .title-input { font-size: 1.15rem; font-weight: 700; border: 1px solid transparent; background: transparent; padding: 6px 8px; min-width: 260px; max-width: 520px; }
.editor-bar .title-input:hover, .editor-bar .title-input:focus { border-color: var(--line-2); background: #fff; }
.items-table td { padding: 6px 6px; }
.items-table { min-width: 940px; }
.items-table td:first-child { min-width: 220px; }
.items-table input, .items-table select { min-height: 34px; padding: 5px 7px; font-size: .9rem; }
.items-table .c-qty { width: 92px; }
.items-table .c-unit { width: 78px; }
.items-table .c-price { width: 120px; }
.items-table .c-markup { width: 76px; }
.items-table .c-vat { width: 118px; }
.items-table .c-sum { width: 120px; }
.items-table .c-act { width: 74px; white-space: nowrap; text-align: right; }
.items-table .type-tag { font-size: .7rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.items-table .free-tag { color: var(--ok); font-weight: 700; }
.totals { margin-left: auto; width: 340px; max-width: 100%; }
.totals .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.totals .grand { border: 0; background: var(--dark); color: #fff; padding: 10px 12px; border-radius: 8px; margin-top: 8px; font-weight: 700; font-size: 1.1rem; }
.totals .note { font-size: .8rem; color: var(--ink-3); padding-top: 6px; }
.picker { position: relative; }
.picker-results { position: absolute; z-index: 30; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 10px 30px rgba(16,24,32,.12); max-height: 320px; overflow: auto; margin-top: 4px; display: none; }
.picker-results.open { display: block; }
.picker-results button { display: flex; width: 100%; justify-content: space-between; gap: 10px; text-align: left; padding: 8px 12px; border: 0; background: #fff; font: inherit; cursor: pointer; border-bottom: 1px solid #f1ede8; }
.picker-results button:hover, .picker-results button.hl { background: var(--brand-soft); }
.picker-results .meta { color: var(--ink-3); font-size: .82rem; white-space: nowrap; }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.add-row .picker { flex: 1 1 320px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--ink-2); padding: 4px 0; }
.share-box { display: flex; gap: 8px; }
.share-box input { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.timeline li { padding: 5px 0 5px 18px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.timeline li.on::before { background: var(--brand); }

/* ---- Auth / publikus ---- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { color: var(--ink); justify-content: center; padding-bottom: 8px; font-size: 1.5rem; }
.auth-card .card { padding: 26px; }
.site-nav { display: flex; justify-content: space-between; align-items: center; max-width: 1120px; margin: 0 auto; padding: 18px 20px; }
.site-nav .brand { color: var(--ink); padding: 0; }
.hero { max-width: 1120px; margin: 0 auto; padding: 40px 20px 30px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 2.6rem; line-height: 1.12; letter-spacing: -.03em; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 540px; }
.hero-shot { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px rgba(16,24,32,.1); padding: 18px; font-size: .86rem; }
.section { max-width: 1120px; margin: 0 auto; padding: 36px 20px; }
.section h2 { font-size: 1.6rem; letter-spacing: -.02em; }
.feature { padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.feature .ico { width: 38px; height: 38px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 10px; }
.feature .ico svg { width: 20px; height: 20px; }
.price-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.price-card.featured { border: 2px solid var(--brand); box-shadow: 0 16px 40px rgba(22,112,232,.12); }
.price-card .price { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.price-card ul { padding-left: 0; list-style: none; }
.price-card li { padding: 4px 0 4px 24px; position: relative; }
.price-card li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.site-foot { border-top: 1px solid var(--line); margin-top: 30px; padding: 24px 20px; text-align: center; color: var(--ink-3); font-size: .88rem; }
.site-foot a { color: var(--ink-2); margin: 0 8px; }
.legal { max-width: 860px; margin: 0 auto; padding: 10px 20px 40px; }
.legal h2 { margin-top: 1.8em; font-size: 1.15rem; }
.legal h3 { margin-top: 1.2em; }
.legal li { margin-bottom: .35em; }
.legal .placeholder { background: var(--warn-soft); color: var(--warn); padding: 0 4px; border-radius: 4px; font-weight: 600; }
.public-offer { max-width: 920px; margin: 0 auto; padding: 24px 16px 60px; }
.po-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.po-head img { max-height: 64px; max-width: 180px; }
.po-title { font-size: 1.7rem; font-weight: 800; color: var(--brand); letter-spacing: -.01em; }
.decision { border: 2px solid var(--brand); }
.accepted-box { border: 2px solid var(--ok); background: var(--ok-soft); }
.declined-box { border: 2px solid var(--line-2); background: var(--surface-2); }

/* ---- Mobil ---- */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .2s; z-index: 50; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--dark); color: #fff; position: sticky; top: 0; z-index: 40; }
  .topbar .brand { padding: 0; font-size: 1.1rem; }
  .topbar button { background: transparent; border: 0; color: #fff; padding: 6px; line-height: 0; cursor: pointer; }
  .topbar button svg { width: 26px; height: 26px; }
  .topbar .brand img { width: 28px; height: 28px; }
  .main { padding: 18px 16px 50px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; padding-top: 20px; }
  .hero h1 { font-size: 2rem; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .editor-bar .title-input { min-width: 0; width: 100%; }
  .hide-sm { display: none; }
  /* tételsorok kártyaként */
  .items-table thead { display: none; }
  .items-table, .items-table tbody, .items-table tr, .items-table td { display: block; width: 100%; min-width: 0 !important; }
  .items-table tr { border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 10px; position: relative; }
  .items-table td { border: 0; padding: 4px 0; }
  .items-table td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; color: var(--ink-3); font-weight: 700; text-transform: uppercase; }
  .items-table .c-qty, .items-table .c-unit, .items-table .c-price, .items-table .c-markup, .items-table .c-vat, .items-table .c-sum { display: inline-block; width: 48%; vertical-align: top; }
  .items-table .c-act { position: absolute; top: 6px; right: 6px; width: auto; }
  .totals { width: 100%; }
}
@media print {
  .sidebar, .topbar, .editor-bar, .no-print { display: none !important; }
  .app { display: block; }
}

/* ---- Center kiegészítések ---- */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); margin-right: 6px; vertical-align: 1px; }
.dot.ok { background: #22a35a; box-shadow: 0 0 0 3px rgba(34,163,90,.15); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(179,38,30,.15); }
.product-card .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.product-card .head h2 { margin: 0; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini-stats div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.mini-stats b { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: .78rem; color: var(--ink-3); }
/* Áttekintés: csomagonkénti előfizetések, bevétel, lemondás */
.section-label { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin: 4px 0 6px; }
.plan-tiles { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.plan-tiles-4 { grid-template-columns: repeat(4, 1fr); }
.plan-tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.plan-tile.paid b { color: var(--ok); }
.plan-tile b { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.plan-tile span { display: block; font-weight: 600; font-size: .88rem; }
.plan-tile small { color: var(--ink-3); font-size: .76rem; }
.money-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.money-row .big { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .plan-tiles-4 { grid-template-columns: repeat(2, 1fr); } }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; font-size: .93rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips a { padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--ink-2); font-size: .86rem; background: #fff; }
.chips a.on { background: var(--dark); color: #fff; border-color: var(--dark); }
.chips a:hover { text-decoration: none; border-color: var(--brand); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.brand img { background: transparent !important; }

/* baráti fiókok */
.link-box { border-color: #bfe2cf; background: var(--ok-soft); }
.link-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.link-row input { flex: 1 1 auto; font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }
.check-row { display: flex; gap: 18px; flex-wrap: wrap; padding: 6px 0; }
.check-row label { display: flex; gap: 6px; align-items: center; font-weight: 500; margin: 0; }
.state-on { color: var(--ok); font-weight: 700; }
.state-off { color: var(--bad); font-weight: 700; }
.friend-row { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--line); }
.friend-row:last-child { border-bottom: 0; }
.friend-info { min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.friend-meta { flex-basis: 100%; font-size: .84rem; }
