:root {
  /* ---- MadWeb paletta ---- */
  --accent: #d64820;        /* MadWeb narancs, fő kiemelő */
  --accent-2: #b23815;      /* sötétebb hover */
  --accent-light: #ef7a4f;  /* világosabb narancs */
  --accent-soft: #fbeae2;   /* halvány háttér */
  --teal: #86cfc6;          /* logó türkiz (másodlagos akcent) */
  --teal-2: #6bbdb3;
  --sidebar: #2d2d2d;       /* MadWeb fekete oldalsáv */
  --sidebar-ink: #cfcfcf;   /* oldalsáv szöveg */
  --sidebar-ink-2: #9a9a9a; /* oldalsáv halvány */
  --sidebar-active: #3c3c3c;

  --bg: #f4f5f8;
  --surface: #ffffff;
  --ink: #1b1c2e;
  --ink-2: #6a6e86;
  --line: #e6e8ef;
  --line-2: #eef0f5;
  --brand: var(--accent);
  --brand-2: var(--accent-2);
  --brand-soft: var(--accent-soft);
  --blue: #3a5bd9;
  --green: #10935d;
  --red: #d72c4d;
  --amber: #916a00;
  --amber-bg: #fff5ea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.05);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 640; }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 246px; flex-shrink: 0; background: var(--sidebar);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 16px 14px; }
.brand-logo { max-height: 40px; max-width: 170px; background: #fff; padding: 7px 11px; border-radius: 10px; display: block; }
.brand-fb { align-items: center; gap: 11px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--teal), var(--accent));
  color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 17px;
  box-shadow: 0 4px 12px rgba(214,72,32,.35);
}
.brand-name { font-weight: 700; font-size: 16px; color: #fff; letter-spacing: -.01em; }

.side-nav { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; flex: 1; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--sidebar-ink); font-weight: 550; text-decoration: none; font-size: 14px;
}
.side-nav a:hover { background: var(--sidebar-active); color: #fff; text-decoration: none; }
.side-nav a:hover .ic { stroke: #fff; }
.side-nav a.active { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(214,72,32,.32); }
.side-nav a.active .ic { stroke: #fff; }
.ic { width: 19px; height: 19px; fill: none; stroke: var(--sidebar-ink-2); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.side-foot { border-top: 1px solid rgba(255,255,255,.08); padding: 14px 12px; }
.side-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--teal), var(--accent)); color: #fff; display: grid; place-items: center; font-weight: 700; }
.su-meta { display: flex; flex-direction: column; line-height: 1.2; }
.su-name { font-weight: 600; font-size: 13px; color: #fff; }
.su-role { color: var(--sidebar-ink-2); font-size: 12px; }
.logout-btn { width: 100%; background: transparent; border: 1px solid rgba(255,255,255,.16); border-radius: 9px; padding: 8px; cursor: pointer; color: var(--sidebar-ink); font-size: 13px; }
.logout-btn:hover { background: var(--sidebar-active); color: #fff; }

.main { flex: 1; min-width: 0; padding: 26px 30px 48px; max-width: 1120px; }

/* ---------- Auth (login) ---------- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-wrap { width: 100%; max-width: 360px; }
.login-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.greeting { font-size: 24px; font-weight: 680; letter-spacing: -.02em; }
.subtle { color: var(--ink-2); font-size: 13px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

/* KPI tiles */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.tile .t-label { color: var(--ink-2); font-size: 12.5px; font-weight: 560; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.value-item .vi-label { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.t-label .info, .vi-label .info { margin-left: 0; }
.tile .t-value { font-size: 25px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; }
.tile .t-sub { color: var(--ink-2); font-size: 12px; margin-top: 3px; }
.tile.accent { background: linear-gradient(135deg, var(--accent-light), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 10px 26px rgba(214,72,32,.22); }
.tile.accent .t-label, .tile.accent .t-sub { color: rgba(255,255,255,.88); }
.tile:not(.accent):hover { border-color: var(--accent); }

.value-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 10px; }
.value-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfb; }
.value-item .vi-label { color: var(--ink-2); font-size: 12px; }
.value-item .vi-num { font-size: 19px; font-weight: 680; margin-top: 2px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 14px; cursor: pointer; font-size: 13.5px; color: var(--ink); font-weight: 560; }
.btn:hover { background: var(--line-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.small { padding: 6px 11px; font-size: 12.5px; }
.btn.danger { color: var(--red); border-color: #f1b0a5; }
.btn.danger:hover { background: #fdecea; }
.inline { display: inline; }

/* ---------- Tables ---------- */
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
table.data th { color: var(--ink-2); font-weight: 580; font-size: 12.5px; }
table.data tr:last-child td { border-bottom: none; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini th, .mini td { padding: 7px 8px; border-bottom: 1px solid var(--line-2); text-align: left; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Forms ---------- */
.form label { display: block; margin-bottom: 15px; font-size: 13.5px; font-weight: 550; }
.form input, .form select {
  display: block; width: 100%; margin-top: 6px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 9px; font-size: 14px; background: #fff; font-weight: 450;
}
.form textarea {
  display: block; width: 100%; margin-top: 6px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 9px; font-size: 14px; background: #fff;
  font-family: inherit; font-weight: 450; line-height: 1.55; resize: vertical;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.form small { color: var(--ink-2); font-size: 12px; display: block; margin-top: 5px; font-weight: 400; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.form-card { max-width: 580px; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { margin-bottom: 0; }
hr { border: none; border-top: 1px solid var(--line-2); margin: 18px 0; }

/* ---------- Alerts / badges ---------- */
.alert { padding: 11px 14px; border-radius: 10px; font-size: 13.5px; margin: 0 0 16px; }
.alert.error { background: #fdecea; color: var(--red); }
.alert.warn { background: var(--amber-bg); color: var(--amber); }
/* A .alert.info feluliria a kis kor alaku ".info" jelvenyt (kulonben ossszemegy). */
.alert.info { background: #eaf1fb; color: var(--blue); display: block; width: auto; height: auto; place-items: initial; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; background: #eef0f2; color: var(--ink-2); font-weight: 560; }
.pill.ok { background: #e3f3ec; color: var(--green); }
.pill.err { background: #fdecea; color: var(--red); }
.muted { color: var(--ink-2); }
.small { font-size: 12px; }

/* ---------- Settings hub ---------- */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap: 14px; }
.hub-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); color: var(--ink); }
.hub-card:hover { border-color: var(--brand); text-decoration: none; }
.hub-card h3 { margin: 0 0 4px; font-size: 15px; }
.hub-card p { margin: 0; color: var(--ink-2); font-size: 13px; }

/* ---------- Store switcher ---------- */
.store-switch select { padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 13.5px; font-weight: 550; }

/* ---------- Top-stock / top-ordered list ---------- */
.stock-item { padding: 8px 10px; border-radius: 8px; }
.paged .paged-item:nth-child(even) { background: #f7f8fa; }
.paged .paged-item:hover { background: var(--accent-soft); }
.stock-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; }
.stock-name { font-weight: 440; color: var(--ink); }
.stock-units { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 550; }
.variant-list { margin: 8px 0 2px; padding-left: 16px; display: none; }
.variant-list.open, .stock-item.open .variant-list { display: block; }
.variant-list .vrow { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); padding: 3px 0; }
.caret { display: inline-block; color: var(--ink-2); font-size: 10px; transition: transform .15s; }
.stock-item.open .caret { transform: rotate(90deg); }

/* ---------- Profit waterfall ---------- */
.profit-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 760px){ .profit-grid { grid-template-columns: 1fr; } }
table.waterfall { width: 100%; border-collapse: collapse; }
table.waterfall td { padding: 8px 8px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
table.waterfall td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.waterfall tr.minus td { color: var(--ink-2); }
table.waterfall tr.sub td { font-weight: 640; border-top: 1px solid var(--line); }
table.waterfall tr.result td { font-weight: 720; font-size: 15px; border-top: 2px solid var(--ink); }
table.waterfall tr.result.pos td.num { color: var(--green); }
table.waterfall tr.result.neg td.num { color: var(--red); }
.kpis { display: flex; flex-direction: column; gap: 10px; }
.kpi { display: flex; flex-direction: column; background: #fafbfb; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.k-label { font-size: 12px; color: var(--ink-2); }
.k-val { font-size: 20px; font-weight: 700; }
.k-note { font-size: 11px; color: var(--ink-2); }
.big-value { font-size: 24px; font-weight: 720; }
.neg-text { color: var(--red); }

/* period + misc */
.period-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.period-links { display: flex; gap: 8px; flex-wrap: wrap; }
.period-custom { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.period-custom label { margin: 0; font-size: 12px; color: var(--ink-2); }
.period-custom input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; }
.close-box { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.close-box summary { cursor: pointer; font-size: 13.5px; color: var(--blue); }
.loc-list { display: flex; flex-direction: column; gap: 9px; margin: 10px 0; }
.chk { font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px; }
.chk input { width: auto; margin: 0; }
.access-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

/* Tab bar (Penzugyek: Eredmeny / Koltsegek) */
.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab { padding: 9px 14px; font-size: 14px; font-weight: 560; color: var(--ink-2); border-bottom: 2px solid transparent; text-decoration: none; margin-bottom: -1px; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Segmented control (30/90/120/360) */
.seg { display: inline-flex; background: var(--line-2); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-btn { border: none; background: transparent; padding: 5px 10px; border-radius: 7px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); font-weight: 560; text-decoration: none; display: inline-block; }
.seg-btn:hover { color: var(--ink); text-decoration: none; }
.seg-btn.active { background: #fff; color: var(--accent); box-shadow: var(--shadow); }

/* Lapozo */
.pager { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pg-btn { min-width: 30px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--ink-2); font-weight: 580; }
.pg-btn:hover { border-color: var(--accent); }
.pg-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Frissites gomb tolteskor */
.btn.is-loading { opacity: .7; pointer-events: none; }

/* Ertelmezesi utmutato */
.guide summary { cursor: pointer; font-size: 15px; }
.guide-body { margin-top: 12px; }
.guide-body p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.55; }
.guide-body b { color: var(--ink); }

.btn.primary { box-shadow: 0 4px 12px rgba(214,72,32,.24); }
.greeting { color: var(--ink); }

/* Info tooltip (magyarazatok hoverre) */
.info {
  display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%;
  background: rgba(0,0,0,.12); color: var(--ink-2); font-size: 10px; font-weight: 700; font-style: normal;
  cursor: help; position: relative; margin-left: 5px; vertical-align: middle; line-height: 1;
}
.tile.accent .info { background: rgba(255,255,255,.25); color: #fff; }
.info .tip {
  display: none; position: absolute; bottom: 150%; left: 50%; transform: translateX(-50%);
  width: 240px; max-width: 60vw; background: #2d2d2d; color: #fff; padding: 10px 12px;
  border-radius: 10px; font-size: 12px; font-weight: 450; line-height: 1.45; z-index: 30;
  box-shadow: 0 10px 28px rgba(0,0,0,.28); text-align: left; letter-spacing: normal;
}
.info .tip b { color: var(--accent-light); }
.info .tip::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: #2d2d2d; }
.info:hover .tip, .info:focus .tip { display: block; }
.info:last-child .tip, .num .info .tip { left: auto; right: 0; transform: none; }
.info:last-child .tip::after, .num .info .tip::after { left: auto; right: 6px; transform: none; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.two-col { grid-template-columns: 1fr 1fr; }
@media (max-width: 820px){ .two-col { grid-template-columns: 1fr; } }

/* ---------- Mobil (fejlec-sav a bal oldalsav helyett) ---------- */
/* Hamburger gomb: csak mobilon latszik. */
.nav-toggle { display: none; margin-left: auto; background: transparent; border: 0; color: #fff; padding: 6px; cursor: pointer; border-radius: 8px; }
.nav-toggle:hover { background: rgba(255,255,255,.1); }

@media (max-width: 820px){
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 50;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 0; overflow: visible;
  }
  .brand { display: flex; align-items: center; padding: 10px 14px; margin: 0; }
  .brand-logo { max-height: 32px; padding: 5px 8px; }
  .nav-toggle { display: inline-flex; align-items: center; }
  /* Alapbol osszecsukva; a hamburger nyitja. */
  .store-picker, .side-nav, .side-foot { display: none; }
  .sidebar.open .store-picker { display: block; padding: 8px 14px; }
  .sidebar.open .side-nav { display: flex; flex-direction: column; padding: 6px 10px 10px; gap: 4px; }
  .sidebar.open .side-nav a { padding: 12px 12px; white-space: nowrap; }
  .sidebar.open .side-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid rgba(255,255,255,.08); padding: 12px 14px; }
  .sidebar.open .side-user { display: flex; }
  .logout-btn { width: auto; padding: 8px 14px; border-color: rgba(255,255,255,.18); }
  .main { padding: 16px 14px 40px; max-width: 100%; }
  .greeting { font-size: 21px; }
  .profit-grid { grid-template-columns: 1fr; }
  .table-scroll > table { min-width: 560px; }
  .page-head { align-items: flex-start; }
  .info .tip { max-width: 78vw; }
}
@media (max-width: 480px){
  .side-nav a span { font-size: 13px; }
  .kpi-grid, .value-row, .cards, .hub-grid { grid-template-columns: 1fr; }
  .tile .t-value { font-size: 22px; }
}

/* --- Konyveloi import: lenyithato koltseg-csoportok + bontas --- */
/* Lepesrol lepesre lista (pl. Google Ads beallitas) */
ol.steps { margin: 6px 0 0; padding-left: 22px; }
ol.steps li { margin: 8px 0; line-height: 1.5; font-size: 14px; }
ol.steps code { background: #f3f4f6; border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; font-size: 12.5px; word-break: break-all; }

/* Szallitasi mod -> onkoltseg lista a bolt beallitasnal */
.ship-map { max-height: 320px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 12px; background: #fbfbfa; margin-top: 4px; }
.ship-map .ship-row { display: flex; align-items: center; gap: 10px; margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.ship-map .ship-row:last-child { border-bottom: none; }
.ship-map .ship-row > span { flex: 1; font-size: 13px; }
.ship-map .ship-row input { width: 120px; }

/* Nagy, informativ hibasav a lap tetejen */
.err-banner { background: #fdecea; border: 1px solid #f1b0a5; border-left: 5px solid var(--red); border-radius: 12px; padding: 16px 18px; margin: 0 0 18px; }
.err-banner .eb-title { color: var(--red); font-weight: 640; font-size: 15px; margin-bottom: 6px; }
.err-banner .eb-msg { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--ink); background: #fff; border: 1px solid #f1c8c0; border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; word-break: break-word; }
.err-banner .eb-hint { color: var(--ink-2); font-size: 12px; margin-top: 8px; }

/* Kis (negyed) csempek – kimutatasokhoz, egymas melle rendezve */
.mini-tiles { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 6px; }
.mini-tile { flex: 0 1 240px; min-width: 200px; max-width: 300px; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; }
.mini-tile .mt-label { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 4px; }
.mini-tile .mt-value { font-size: 22px; font-weight: 640; font-variant-numeric: tabular-nums; margin-top: 2px; }
.mini-tile .mt-sub { font-size: 11px; color: var(--ink-2); margin-top: 2px; }

/* Bank import: cash-eredmeny osszegzo */
.bank-summary { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin: 14px 0 4px; }
.bank-summary .bs-cell { flex: 1 1 120px; min-width: 110px; border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; background: #fbfbfa; display: flex; flex-direction: column; gap: 4px; }
.bank-summary .bs-cell.result { background: #fff; border-color: var(--line); border-width: 2px; }
.bank-summary .bs-l { font-size: 12px; color: var(--ink-2); }
.bank-summary .bs-v { font-size: 20px; font-weight: 640; font-variant-numeric: tabular-nums; }
.bank-summary .bs-op { align-self: center; font-size: 20px; color: var(--ink-2); font-weight: 600; }
@media (max-width: 640px) { .bank-summary .bs-op { display: none; } }

.cost-group { border: 1px solid var(--line-2); border-radius: 10px; margin: 8px 0; background: #fff; }
.cost-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; font-weight: 560; }
.cost-group > summary::-webkit-details-marker { display: none; }
.cost-group > summary::before { content: '▸'; color: var(--ink-2); margin-right: 8px; transition: transform .15s; }
.cost-group[open] > summary::before { transform: rotate(90deg); }
.cost-group .cg-name { flex: 1; }
.cost-group .cg-total { color: var(--accent); font-variant-numeric: tabular-nums; }
.cost-group table.mini { width: 100%; margin: 0; }
.cost-group table.mini td { padding: 7px 14px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.cost-group table.mini td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cost-group .override { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 12.5px; color: var(--ink-2); }
.cost-group .override input { max-width: 180px; }

.detail-row { display: none; background: var(--bg-1, #fafafa); }
.detail-row.open { display: table-row; }
.bd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; padding: 12px 6px; }
.bd-col .bd-h { font-weight: 580; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .02em; }
.bd-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--line-2); font-size: 13px; }
.bd-row .num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.data tr.row-empty td { color: var(--ink-2); opacity: .6; }
.pill.muted { background: #eef0f2; color: var(--ink-2); }

/* --- Sidebar vallalkozas-valto --- */
.store-picker { padding: 10px 14px 4px; }
.store-picker .sp-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: rgba(255,255,255,.5); margin-bottom: 5px; }
.store-picker select { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: #fff; font-size: 13.5px; }
.store-picker select option { color: #1a1a1a; }
.store-picker.single strong { color: #fff; font-size: 14px; }

/* --- Felhasznalok: jelszo + credential doboz --- */
.alert.ok { background: #e3f3ec; color: var(--green); }
.cred-box .cred-row { display: flex; gap: 22px; flex-wrap: wrap; margin: 8px 0; align-items: center; }
.cred-box code { background: #fff; border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 8px; font-size: 14px; }
.pw-wrap { display: flex; gap: 6px; align-items: center; }
.pw-wrap input { flex: 1; }

/* --- Penzugyek: "Igy olvasd" ertelmezo doboz + KPI szinek --- */
.diagnosis { background: var(--bg-1,#fafafa); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; margin: 6px 0 16px; }
.diag-head { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); font-weight: 600; margin-bottom: 8px; }
.diag-line { display: flex; gap: 9px; align-items: flex-start; margin: 5px 0; font-size: 13.5px; line-height: 1.45; }
.diag-line .dot { flex: none; width: 8px; height: 8px; border-radius: 999px; margin-top: 6px; background: var(--ink-2); }
.diag-line.pos .dot { background: var(--green); }
.diag-line.warn .dot { background: var(--amber); }
.diag-line.neg .dot { background: var(--red); }
.diag-line.muted { color: var(--ink-2); }
.diag-line.muted .dot { background: #c7ccd1; }
.kpi .k-val.pos { color: var(--green); }
.kpi .k-val.warn { color: var(--amber); }
.kpi .k-val.neg { color: var(--red); }

/* --- Havi mukodesi koltseg panel --- */
.mo-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 18px; align-items: center; margin: 6px 0 4px; }
.mo-main { background: var(--bg-1,#fafafa); border: 1px solid var(--line-2); border-radius: 10px; padding: 16px; text-align: center; }
.mo-main .mo-label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.mo-main .mo-val { display: block; font-size: 26px; font-weight: 650; color: var(--accent); font-variant-numeric: tabular-nums; }
.mo-main .mo-note { display: block; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.mo-side .mo-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.mo-side .mo-row .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mo-side .mo-row.total { font-weight: 600; border-bottom: none; }
.be-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-2); font-size: 14px; }
.be-line .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--green); flex: none; align-self: center; }
@media (max-width: 640px){ .mo-grid { grid-template-columns: 1fr; } }

/* --- Lista kereso mezo (Legnagyobb erteku / Legtobbet rendelt) --- */
.list-search { width: 100%; padding: 9px 12px; margin: 4px 0 10px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 13.5px; background: #fff; }
.list-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(214,72,32,.12); }
.list-empty { margin: 8px 2px; }

/* --- Konverziokovetes: webhook bekotesi doboz --- */
.mono-box { background: var(--bg-1,#fafafa); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; margin: 8px 0; }
.mono-box > div { margin: 5px 0; word-break: break-all; }
.mono-box code { background: #fff; border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 7px; font-size: 12.5px; }

/* --- Konverzios vezerlopult diagram: fix magassag, hogy ne nojon tul --- */
.chart-box { position: relative; height: 280px; width: 100%; }
.chart-box > canvas { position: absolute; inset: 0; }
@media (max-width: 640px){ .chart-box { height: 220px; } }

/* --- Lead lista: kompakt muvelet oszlop --- */
td.lead-act { min-width: 210px; }
td.lead-act .lead-act-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
td.lead-act .mini-sel { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; background: #fff; max-width: 150px; }
td.lead-act .win-form { display: flex; gap: 5px; align-items: center; }
td.lead-act .win-form input { width: 88px; padding: 6px 8px; margin: 0; }

/* --- Lead lista: reszponziv kartyak (tablazat helyett) --- */
.lead-list { display: flex; flex-direction: column; gap: 10px; }
.lead-card { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; flex-wrap: wrap; }
.lead-card .lc-main { flex: 1 1 260px; min-width: 0; }
.lc-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lc-name { font-weight: 640; font-size: 15px; }
.lc-contact { display: flex; gap: 14px; flex-wrap: wrap; margin: 5px 0 7px; font-size: 13.5px; }
.lc-contact a { color: var(--ink); }
.lc-tags { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.lc-tags .tag { font-size: 12px; color: var(--ink-2); background: #eef0f2; border-radius: 999px; padding: 2px 9px; }
.lc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: 0 0 auto; }
.lc-value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lc-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.lc-actions .mini-sel { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; background: #fff; }
.lc-actions .win-form { display: flex; gap: 5px; align-items: center; }
.lc-actions .win-form input { width: 92px; padding: 7px 9px; margin: 0; }
@media (max-width: 560px){
  .lead-card { flex-direction: column; }
  .lc-side { align-items: stretch; width: 100%; }
  .lc-actions { justify-content: flex-start; }
}

/* --- Lead kartya: rendezett ertek+gomb par (szegmentalt vezerlo) --- */
.lc-actions { align-items: stretch; }
.lc-actions .mini-sel { height: 36px; }
.lc-actions .win-form { gap: 0; align-items: stretch; }
.lc-actions .win-form input {
  width: 92px; height: 36px; margin: 0; padding: 0 10px; font-size: 13px;
  border: 1px solid var(--line); border-right: none; border-radius: 8px 0 0 8px;
  background: #fff; outline: none;
}
.lc-actions .win-form input:focus { border-color: var(--accent); }
.lc-actions .win-form .btn { height: 36px; border-radius: 0 8px 8px 0; }
.lc-closed { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
@media (max-width: 560px){ .lc-closed { align-items: flex-start; text-align: left; } }

/* --- Marketing: a meggyozes negy hitenek ive --- */
/* A lenyeg, hogy RANEZESRE latszodjon hol vekony az anyag, ne tablazatbol kelljen
   kiolvasni. Ezert a sav magassaga aranyos a tartalmak szamaval, es a vekony
   szakasz kulon szint kap. */
.arc { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-items: end; margin: 14px 0 0; }
.arc-col { text-align: center; padding: 8px 6px 10px; border-radius: 10px; background: #fafafa; border: 1px solid #eee; }
.arc-bar-wrap { height: 96px; display: flex; align-items: flex-end; justify-content: center; }
.arc-bar { width: 46px; border-radius: 6px 6px 0 0; background: var(--green, #2e9e5b); transition: height .2s; }
.arc-col.is-thin .arc-bar { background: #e8a33d; }
.arc-col.is-empty .arc-bar { background: #d9d9d9; }
.arc-col.is-thin { border-color: #f0d6a8; background: #fffaf1; }
.arc-col.is-empty { border-color: #e6e6e6; }
.arc-n { margin-top: 8px; font-size: 12px; color: #888; }
.arc-title { font-weight: 600; font-size: 13px; line-height: 1.25; margin-top: 2px; }
.arc-count { font-size: 12px; color: #666; margin-top: 4px; }
.arc-status { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 6px; }
.arc-status .pill { font-size: 11px; padding: 1px 6px; }
.stage-box { border: 1px solid #eee; border-radius: 10px; padding: 10px 12px; background: #fff; }
.stage-box > summary { cursor: pointer; }
@media (max-width: 700px) { .arc { grid-template-columns: repeat(2, 1fr); } }

/* --- Marketing alapok: olvashato megjelenites, a szerkesztes masodik lepes --- */
.basis-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.basis { border: 1px solid #eee; border-radius: 10px; padding: 12px 14px; background: #fcfcfc; }
.basis-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.basis-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #888; }
.basis.is-locked { background: #f6f7f8; border-color: #e3e5e8; }
.basis.is-locked .basis-text { color: #333; }
.group-row td { background: #fafafa; font-size: 12px; color: #555; }
.basis-text { white-space: pre-wrap; line-height: 1.5; font-size: 14px; }
.basis-text.empty { color: #999; font-style: italic; }
.basis-edit { margin-top: 10px; }
.basis-edit > summary { cursor: pointer; font-size: 12px; color: #666; }
@media (max-width: 900px) { .basis-grid { grid-template-columns: 1fr; } }
.row-edit > summary { cursor: pointer; font-size: 12px; color: #666; }
.row-edit .inline-form { flex-wrap: wrap; }

/* A tablazatban levo allapot-valaszto es a jelolomezo: a .form input/select szabaly
   csak .form-on belul hat, ezert ezek nyers bongeszo-kontrollkent jelentek meg. */
.data select, table.mini select {
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px;
  font-family: inherit; font-size: 13px; background: #fff;
}
.inline-form .chk { display: flex; align-items: center; gap: 6px; font-weight: 450; white-space: nowrap; }
.inline-form .chk input { width: auto; margin: 0; }

/* Ertekesitesi resz: a vazlat es a kerdessor egymas mellett. */
.sales-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.qlist { margin: 0; padding-left: 20px; }
.qlist li { margin-bottom: 8px; }
.qtext { line-height: 1.45; }
.qacts { display: flex; gap: 6px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.qacts .btn[disabled] { opacity: .35; cursor: default; }
@media (max-width: 900px) { .sales-grid { grid-template-columns: 1fr; } }

/* Az Alapok harom blokkja EGYMAS ALA, teljes szelessegben: harom hasabban a
   leghosszabb szoveg tulnyult (a hasabok egyforma magasak), es egy bekezdes szuk
   hasabban amugy is nehezen olvashato. Balra a cimke es a lezaras, jobbra a szoveg. */
.basis-list { display: flex; flex-direction: column; gap: 12px; }
.basis-list .basis { display: grid; grid-template-columns: 190px 1fr; gap: 16px; align-items: start; }
.basis-side { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.basis-main { min-width: 0; }
.basis-main .basis-text { max-width: 78ch; }
.basis-main textarea { max-width: 78ch; }
@media (max-width: 800px) { .basis-list .basis { grid-template-columns: 1fr; } }
/* A tablazat sorai kulonbozo magasak (a legordulo miatt), ezert a jobb szelso
   "Szerkesztes" elcsuszott a sorok kozott. */
.data td { vertical-align: middle; }

/* A sikeres muvelet visszajelzese: halk, jobbra igazitott sor, ami magatol elhalvanyul.
   A teljes szelessegu kek sav a lap tetejen minden mentes utan tolakodo volt, es
   ugyanakkora sulyt adott a "Mentve"-nek, mint egy figyelmeztetesnek. Ha a bongeszo nem
   animal (reduced motion), akkor is csak egy diszkret sor marad, nem egy sav. */
.flash-note { margin: 0 0 12px; text-align: right; font-size: 12.5px; color: var(--green); }
.flash-note::before { content: '✓ '; }
@media (prefers-reduced-motion: no-preference) {
  .flash-note { animation: flashAway 6s ease forwards; }
}
@keyframes flashAway { 0%, 55% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

/* Kampanyok: melyik van nyitva, melyik lezart, es melyiket nezzuk eppen. */
.camp-list { display: flex; flex-direction: column; gap: 14px; }
.camp-group { display: flex; flex-direction: column; gap: 6px; }
.camp-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-decoration: none; color: inherit; }
.camp-item:hover { border-color: var(--accent); }
.camp-item.is-current { border-color: var(--accent); background: var(--accent-soft); }
.camp-item .ci-name { font-weight: 600; }
.camp-item .ci-meta { color: var(--ink-2); font-size: 12.5px; margin-left: auto; }
.camp-item.is-current .pill { margin-left: 0; }

/* A kivalasztott kampany: a NEVE a cim, alatta minden hozza tartozik. */
.camp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.camp-eyebrow { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #888; }
.camp-title { font-size: 24px; margin: 2px 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.camp-meta { margin: 0; color: var(--ink-2); font-size: 13px; }
.camp-edit { margin-top: 12px; }
.camp-edit > summary { cursor: pointer; font-size: 12.5px; color: #666; }
.camp-body { margin-top: 18px; padding-left: 16px; border-left: 3px solid var(--accent-soft); }
.inline-form label.wide { flex: 1 1 100%; }
.inline-form label.wide textarea { width: 100%; max-width: 78ch; }
/* A tartalom szerkesztoje sajat, teljes szelessegu sorban nyilik a tetel ALATT.
   Zart allapotban a "Szerkesztes" a fenti sorhoz tapad, hogy ne tunjon kulon tetelnek. */
.edit-row > td { border-top: 0; padding: 0 8px 6px; }
.edit-row .row-edit > summary { font-size: 11.5px; color: #8a9099; }
.edit-row .row-edit[open] { padding-bottom: 10px; }
.edit-row .row-edit[open] > summary { color: #666; margin-bottom: 2px; }

/* Szimulacio */
.sim-table input { width: 130px; text-align: right; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.sim-table td, .sim-table th { vertical-align: middle; }
.sim-strong td { font-weight: 650; border-top: 2px solid var(--line); }
.sim-target { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2, #eee); }
