/* ============================================================
   IRS Felhő — Design System CSS (v2)
   Tokenek + shell + komponensek. Később assets/css/felho.css.
   Világoskék brand. Soha nem admin zöld (#3d9a2e / #4BC737).
   ============================================================ */

:root {
  /* Oldal / felület — világoskék felhő paletta */
  --bg: #f4f8fc;
  --bg-soft: #e8f1f8;
  --surface: #ffffff;
  --surface-2: #f7fafc;
  --field-bg: #f7fbfe;
  --ink: #0c1a24;
  --text: var(--ink);
  --muted: #5a7184;
  --line: rgba(14, 116, 144, 0.14);
  --border: var(--line);

  /* Akcentus (világoskék) */
  --felho: #0ea5e9;
  --felho-deep: #0369a1;
  --felho-bright: #38bdf8;
  --felho-soft: #e0f2fe;
  --primary: var(--felho);
  --primary-hover: var(--felho-deep);
  --primary-soft: rgba(14, 165, 233, 0.12);
  --primary-grad: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 48%, #0369a1 100%);
  --on-primary: #ffffff;
  --info-text: #0369a1;
  --info-border: rgba(14, 165, 233, 0.28);

  /* Állapotok */
  --ok: #059669;
  --ok-soft: rgba(5, 150, 105, 0.12);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, 0.12);
  --err: #dc2626;
  --err-soft: rgba(220, 38, 38, 0.1);

  /* Oldalsáv — mindig sötét kékes (cloud app mélység) */
  --sidebar-bg: #0c1a24;
  --sidebar-bg-2: #0f2231;
  --sidebar-ink: #e8f4fb;
  --sidebar-muted: #7d97ab;
  --sidebar-line: rgba(125, 211, 252, 0.14);
  --sidebar-active: rgba(56, 189, 252, 0.16);
  --sidebar-active-ink: #7dd3fc;
  --sidebar-hover: rgba(125, 211, 252, 0.08);

  /* Topbar / shell */
  --topbar-bg: rgba(255, 255, 255, 0.82);
  --topbar-h: 56px;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 68px;

  /* Térköz (mobil / alap); asztalon tömörebb — lásd min-width 960px */
  --pad-x: 1.1rem;
  --pad-y: 1rem;
  --pad-page: 1.25rem;
  --pad-panel-y: 0.85rem;
  --pad-panel-x: 1.1rem;
  --pad-body-y: 1rem;
  --pad-body-x: 1.1rem;
  --pad-card: 1rem 1.1rem;
  --pad-cell-y: 0.62rem;
  --pad-cell-x: 0.7rem;
  --pad-btn-y: 0.55rem;
  --pad-btn-x: 1rem;
  --pad-field-y: 0.62rem;
  --pad-field-x: 0.8rem;
  --gap-stack: 0.85rem;
  --gap-grid: 1rem;
  --gap-stat: 0.85rem;
  --gap-toolbar: 0.55rem;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 8px 24px rgba(3, 105, 161, 0.08);
  --shadow-sm: 0 2px 8px rgba(3, 105, 161, 0.06);
  --shadow-lg: 0 18px 48px rgba(3, 105, 161, 0.14);
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Sora", "DM Sans", system-ui, sans-serif;
  --fs-page: 1.25rem;
  --fs-panel: 1rem;
  --fs-stat: 1.5rem;
  --fs-body: 0.875rem;
  --fs-meta: 0.78rem;
}

/* Asztali: tömörebb térköz */
@media (min-width: 960px) {
  :root {
    --pad-x: 0.9rem;
    --pad-y: 0.75rem;
    --pad-page: 0.9rem;
    --pad-panel-y: 0.6rem;
    --pad-panel-x: 0.85rem;
    --pad-body-y: 0.75rem;
    --pad-body-x: 0.9rem;
    --pad-card: 0.7rem 0.85rem;
    --pad-cell-y: 0.42rem;
    --pad-cell-x: 0.6rem;
    --pad-btn-y: 0.42rem;
    --pad-btn-x: 0.85rem;
    --pad-field-y: 0.48rem;
    --pad-field-x: 0.7rem;
    --gap-stack: 0.6rem;
    --gap-grid: 0.7rem;
    --gap-stat: 0.6rem;
    --gap-toolbar: 0.45rem;
    --radius: 10px;
    --topbar-h: 50px;
    --sidebar-w: 232px;
  }
}

html[data-theme="dark"] {
  --bg: #071018;
  --bg-soft: #0d1c28;
  --surface: #102231;
  --surface-2: #16304a;
  --field-bg: #0b1a26;
  --ink: #e8f4fb;
  --text: var(--ink);
  --muted: #8aa6ba;
  --line: rgba(125, 211, 252, 0.16);
  --felho: #38bdf8;
  --felho-deep: #7dd3fc;
  --felho-bright: #bae6fd;
  --felho-soft: rgba(56, 189, 248, 0.18);
  --primary-soft: rgba(56, 189, 248, 0.15);
  --primary-grad: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 55%, #7dd3fc 100%);
  --on-primary: #071018;
  --info-text: #7dd3fc;
  --info-border: rgba(125, 211, 252, 0.28);
  --sidebar-bg: #050b12;
  --sidebar-bg-2: #0a1622;
  --sidebar-line: rgba(125, 211, 252, 0.12);
  --topbar-bg: rgba(7, 16, 24, 0.82);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
}

/* ============================================================
   Bázis
   ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.2; letter-spacing: -0.02em; margin: 0; font-weight: 700; }
a { color: var(--felho-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); }
.muted-sm { font-size: var(--fs-meta); color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 0.5rem; top: 0.5rem; z-index: 100; background: var(--surface);
  padding: 0.5rem 1rem; border-radius: var(--radius-sm); box-shadow: var(--shadow);
}

/* ============================================================
   App shell — sidebar + topbar + workspace
   ============================================================ */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar workspace";
  min-height: 100vh;
  background: var(--bg);
  transition: grid-template-columns 0.2s ease;
}
.app-shell.is-collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

/* ----- Oldalsáv ----- */
.sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: var(--sidebar-ink);
  border-right: 1px solid var(--sidebar-line);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 30;
}
.sidebar-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: var(--topbar-h);
  padding: 0 var(--pad-x);
  border-bottom: 1px solid var(--sidebar-line);
  flex-shrink: 0;
  min-width: 0;
}
.brand-mark {
  width: 30px; height: 30px; flex-shrink: 0;
  clip-path: polygon(50% 7.14%, 87.5% 28.57%, 87.5% 71.43%, 50% 92.86%, 12.5% 71.43%, 12.5% 28.57%);
}
.brand-mark img { width: 100%; height: 100%; display: block; }
.brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: #fff;
}
.brand-sub {
  display: block;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sidebar-active-ink);
  margin-top: 1px;
}
.brand-text { min-width: 0; overflow: hidden; }

.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.6rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--sidebar-line); border-radius: 3px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  padding: 0.4rem 0.7rem 0.25rem;
  white-space: nowrap;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--sidebar-ink);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  min-width: 0;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  text-decoration: none;
  color: #fff;
}
.nav-item.is-active {
  background: var(--sidebar-active);
  border-color: rgba(56, 189, 252, 0.32);
  color: var(--sidebar-active-ink);
  font-weight: 600;
}
.nav-ico { width: 18px; height: 18px; flex-shrink: 0; display: grid; place-items: center; }
.nav-ico svg { width: 18px; height: 18px; }
.nav-label { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.nav-badge {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.05rem 0.42rem;
  border-radius: 999px;
  background: var(--felho);
  color: var(--on-primary);
  line-height: 1.45;
}
.nav-badge.muted { background: var(--sidebar-line); color: var(--sidebar-muted); }

.sidebar-spacer { flex: 1; }
.sidebar-foot {
  padding: 0.6rem 0.5rem;
  border-top: 1px solid var(--sidebar-line);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}
.sidebar-company {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(125, 211, 252, 0.06);
  border: 1px solid var(--sidebar-line);
  min-width: 0;
}
.co-dot {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  background: var(--primary-grad); display: grid; place-items: center;
  color: var(--on-primary); font-family: var(--display); font-weight: 700; font-size: 0.78rem;
}
.co-text { min-width: 0; overflow: hidden; }
.co-name {
  font-size: 0.82rem; font-weight: 600; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.co-key { font-size: 0.66rem; color: var(--sidebar-muted); white-space: nowrap; }
.sidebar-user {
  display: flex; align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.6rem; border-radius: var(--radius-sm);
  cursor: pointer; min-width: 0;
}
.sidebar-user:hover { background: var(--sidebar-hover); }
.su-text { min-width: 0; overflow: hidden; }
.su-name { font-size: 0.8rem; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.su-role { font-size: 0.66rem; color: var(--sidebar-muted); white-space: nowrap; }

/* Összecsukott oldalsáv */
.app-shell.is-collapsed .brand-text,
.app-shell.is-collapsed .nav-label,
.app-shell.is-collapsed .nav-group-label,
.app-shell.is-collapsed .nav-badge,
.app-shell.is-collapsed .co-text,
.app-shell.is-collapsed .su-text { display: none; }
.app-shell.is-collapsed .nav-item { justify-content: center; padding: 0.55rem; }
.app-shell.is-collapsed .nav-item[data-tip] { position: relative; }
.app-shell.is-collapsed .sidebar-company { justify-content: center; }
.app-shell.is-collapsed .sidebar-user { justify-content: center; }
.app-shell.is-collapsed .nav-item[data-tip]::after {
  content: attr(data-tip);
  position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  background: var(--ink); color: var(--surface);
  font-size: 0.72rem; padding: 0.28rem 0.5rem; border-radius: 6px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.12s;
  z-index: 40;
}
.app-shell.is-collapsed .nav-item[data-tip]:hover::after { opacity: 1; }

.sidebar-backdrop { display: none; }

/* ----- Topbar ----- */
.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 var(--pad-page);
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  min-width: 0;
}
.topbar-lead { display: flex; align-items: center; gap: 0.5rem; min-width: 0; flex: 0 0 auto; }
.topbar-title {
  font-family: var(--display);
  font-size: var(--fs-page);
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumbs { display: flex; align-items: center; gap: 0.4rem; font-size: 0.86rem; min-width: 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--felho-deep); }
.crumbs .sep { color: var(--line); }
.crumbs .crumb-current { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-toggle {
  width: 38px; height: 38px; flex-shrink: 0;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.sidebar-toggle:hover { border-color: var(--felho); background: var(--primary-soft); color: var(--felho-deep); }
.sidebar-toggle svg { width: 18px; height: 18px; }

.topbar-search {
  flex: 1 1 auto;
  max-width: 460px;
  margin: 0 auto;
  min-width: 0;
}
.topbar-end {
  display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; margin-left: auto;
}
.topbar-btn {
  width: 38px; height: 38px; flex-shrink: 0;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); cursor: pointer;
  position: relative;
}
.topbar-btn:hover { border-color: var(--felho); background: var(--primary-soft); color: var(--felho-deep); }
.topbar-btn svg { width: 18px; height: 18px; }
.topbar-btn .dot {
  position: absolute; top: 7px; right: 7px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--err); border: 2px solid var(--surface);
}
.topbar-user {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer;
}
.topbar-user:hover { border-color: var(--felho); background: var(--primary-soft); }
.topbar-user .avatar { width: 28px; height: 28px; font-size: 0.7rem; }
.topbar-user .tu-name { font-size: 0.82rem; font-weight: 600; white-space: nowrap; }

/* ----- Workspace ----- */
.workspace {
  grid-area: workspace;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--bg);
}
.screen { padding: var(--pad-page); display: none; }
.screen.is-active { display: block; }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.page-head h1 { font-size: var(--fs-page); }
.page-head .muted { font-size: var(--fs-meta); margin-top: 0.2rem; }
.page-head .toolbar { margin-left: auto; }

/* ============================================================
   Panel / kártya
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--pad-card);
}
.panel { padding: 0; overflow: hidden; }
.panel.is-flush { border-radius: 0; border: 0; box-shadow: none; background: var(--surface); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.6rem 0.8rem; flex-wrap: wrap;
  padding: var(--pad-panel-y) var(--pad-panel-x);
  border-bottom: 1px solid var(--line);
  min-height: 0;
}
.panel-head h2 { font-size: var(--fs-panel); font-weight: 700; }
.panel-head .muted { font-size: var(--fs-meta); margin-top: 0.1rem; }
.panel-head .left { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.panel-head .right { margin-left: auto; display: flex; align-items: center; gap: var(--gap-toolbar); flex-wrap: wrap; }
.panel-body { padding: var(--pad-body-y) var(--pad-body-x); }
.panel-body.is-tight { padding: 0; }

/* ============================================================
   Stat / KPI
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--gap-stat);
  margin-bottom: 1rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--pad-card);
  display: flex; flex-direction: column; gap: 0.25rem;
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--felho);
}
.stat.is-ok::before { background: var(--ok); }
.stat.is-warn::before { background: var(--warn); }
.stat.is-err::before { background: var(--err); }
.stat .tag {
  font-size: 0.7rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.stat .value {
  font-family: var(--display); font-size: var(--fs-stat); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.stat .sub { font-size: var(--fs-meta); color: var(--muted); }
.stat .trend {
  display: inline-flex; align-items: center; gap: 0.2rem;
  font-size: 0.74rem; font-weight: 600;
}
.trend.up { color: var(--ok); }
.trend.down { color: var(--err); }
.trend.flat { color: var(--muted); }

/* ============================================================
   Tábla
   ============================================================ */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-size: var(--fs-body);
  font-variant-numeric: tabular-nums;
}
table.data th, table.data td {
  text-align: left; padding: var(--pad-cell-y) var(--pad-cell-x);
  border-bottom: 1px solid var(--line); vertical-align: middle;
}
table.data th {
  color: var(--muted); font-weight: 600; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--surface-2); position: sticky; top: 0;
}
table.data tbody tr { transition: background 0.12s; }
table.data tbody tr:hover { background: var(--primary-soft); }
table.data tbody tr.is-clickable { cursor: pointer; }
table.data tbody tr.is-selected { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--felho); }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--felho-deep); }
table.data th .sort-ico { opacity: 0.4; margin-left: 0.2rem; font-size: 0.7rem; }
table.data th.sort-asc .sort-ico, table.data th.sort-desc .sort-ico { opacity: 1; color: var(--felho); }
table.data td .row-main { font-weight: 600; color: var(--ink); }
table.data td .row-sub { font-size: 0.76rem; color: var(--muted); }
.cell-amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-amount.neg { color: var(--err); }
.row-actions { display: flex; gap: 0.3rem; justify-content: flex-end; flex-wrap: nowrap; }

/* ============================================================
   Pill / státusz
   ============================================================ */
.pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  border-radius: 999px; padding: 0.16rem 0.6rem;
  font-size: 0.74rem; font-weight: 600; line-height: 1.5;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
  white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.pill.no-dot::before { display: none; }
.pill-ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(5,150,105,0.25); }
.pill-warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(217,119,6,0.25); }
.pill-bad { background: var(--err-soft); color: var(--err); border-color: rgba(220,38,38,0.25); }
.pill-info { background: var(--primary-soft); color: var(--info-text); border-color: var(--info-border); }
.pill-muted { background: rgba(90,113,132,0.1); color: var(--muted); border-color: var(--line); }

/* ============================================================
   Gombok
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--radius-sm); padding: var(--pad-btn-y) var(--pad-btn-x);
  font: inherit; font-weight: 600; font-size: 0.86rem; cursor: pointer;
  white-space: nowrap; transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  text-decoration: none;
}
.btn:hover { border-color: var(--felho); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--felho); outline-offset: 2px; }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--primary-grad); color: var(--on-primary); border-color: transparent;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.28);
}
.btn-primary:hover { filter: brightness(1.05); border-color: transparent; box-shadow: 0 6px 18px rgba(14, 165, 233, 0.36); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--primary-soft); border-color: var(--felho); color: var(--felho-deep); }
.btn-danger { background: var(--err); color: #fff; border-color: transparent; }
.btn-danger:hover { filter: brightness(1.06); border-color: transparent; }
.btn-success { background: var(--ok); color: #fff; border-color: transparent; }
.btn-success:hover { filter: brightness(1.06); border-color: transparent; }
.btn-block { width: 100%; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.78rem; }
.btn-lg { padding: 0.7rem 1.3rem; font-size: 0.95rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: inline-grid; place-items: center;
  background: var(--field-bg); border: 1px solid var(--line); color: var(--muted); cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.icon-btn:hover { color: var(--felho-deep); border-color: var(--felho); background: var(--primary-soft); }
.icon-btn svg { width: 16px; height: 16px; }

/* ============================================================
   Toolbar
   ============================================================ */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-toolbar);
}
.toolbar--inline { gap: var(--gap-toolbar); }
.toolbar .spacer { flex: 1; }

/* ============================================================
   Űrlap
   ============================================================ */
.stack { display: grid; gap: var(--gap-stack); }
.field { display: grid; gap: 0.3rem; }
.field > span, .field > label {
  font-size: 0.78rem; font-weight: 600; color: var(--muted);
}
.field > span .req, .field > label .req { color: var(--err); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--pad-field-y) var(--pad-field-x);
  background: var(--field-bg);
  color: var(--ink);
  font: inherit; font-size: 0.88rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.7; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--felho) 40%, var(--line)); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--felho);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: var(--surface);
}
input:disabled, select:disabled, textarea:disabled {
  opacity: 0.6; cursor: not-allowed; background: var(--surface-2);
}
textarea { min-height: 5rem; resize: vertical; line-height: 1.45; }
.form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-grid);
}
.form-grid .field--wide { grid-column: 1 / -1; }
.form-grid .field--span-3 { grid-column: span 3; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } .form-grid .field--span-3 { grid-column: 1 / -1; } }
.field-row { display: flex; gap: 0.6rem; align-items: flex-end; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 0; }
.hint {
  font-size: 0.76rem; color: var(--muted); display: flex; align-items: center; gap: 0.35rem;
  margin-top: 0.1rem;
}
.hint svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--felho); }
.hint.is-warn { color: var(--warn); }
.hint.is-warn svg { color: var(--warn); }

/* ============================================================
   Kereső
   ============================================================ */
.search { position: relative; display: flex; align-items: center; }
.search svg {
  position: absolute; left: 0.6rem; width: 16px; height: 16px; color: var(--muted); pointer-events: none;
}
.search input {
  padding-left: 2rem; border-radius: 999px; background: var(--field-bg);
}
.search input:focus { background: var(--surface); }
.search.is-block { width: 100%; }

/* ============================================================
   Szegmens (nézet-/típusváltó)
   ============================================================ */
.seg {
  display: inline-flex; padding: 3px; border-radius: 999px;
  background: var(--field-bg); border: 1px solid var(--line); gap: 2px;
}
.seg-item {
  border: 0; background: transparent; color: var(--muted);
  padding: 0.35rem 0.85rem; border-radius: 999px; cursor: pointer;
  font-size: 0.82rem; font-weight: 600; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.seg-item:hover { color: var(--ink); }
.seg-item.is-on {
  background: var(--surface); color: var(--felho-deep);
  box-shadow: var(--shadow-sm);
}
.seg.is-block { display: flex; width: 100%; }
.seg.is-block .seg-item { flex: 1; text-align: center; }

/* ============================================================
   Alert
   ============================================================ */
.alert {
  display: flex; gap: 0.6rem; align-items: flex-start;
  border-radius: var(--radius-sm); padding: 0.7rem 0.85rem;
  margin-bottom: 0.8rem; font-size: 0.86rem; border: 1px solid var(--line);
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--ok-soft); color: var(--ok); border-color: rgba(5,150,105,0.25); }
.alert-warning { background: var(--warn-soft); color: var(--warn); border-color: rgba(217,119,6,0.25); }
.alert-error { background: var(--err-soft); color: var(--err); border-color: rgba(220,38,38,0.25); }
.alert-info { background: var(--primary-soft); color: var(--info-text); border-color: var(--info-border); }
.alert .alert-body { flex: 1; min-width: 0; }
.alert .alert-title { font-weight: 700; margin-bottom: 0.1rem; }

/* ============================================================
   Modal
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(7, 16, 24, 0.5); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 1rem;
  animation: fadeIn 0.15s ease;
}
.modal {
  width: min(560px, 100%); max-height: 90vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: popIn 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal.modal-lg { width: min(820px, 100%); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  padding: 1rem 1.2rem; border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 1.05rem; }
.modal-body { padding: 1.2rem; overflow: auto; }
.modal-foot {
  display: flex; gap: 0.5rem; justify-content: flex-end; flex-wrap: wrap;
  padding: 0.9rem 1.2rem; border-top: 1px solid var(--line);
}
.modal-close {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  display: inline-grid; place-items: center;
}
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ============================================================
   Toast
   ============================================================ */
.toast-host {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 80;
  display: grid; gap: 0.5rem; pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 0.7rem 0.95rem; min-width: 240px; max-width: 360px;
  display: flex; gap: 0.55rem; align-items: flex-start; font-size: 0.86rem;
  animation: toastIn 0.2s ease;
}
.toast.ok { border-color: rgba(5,150,105,0.35); }
.toast.err { border-color: rgba(220,38,38,0.35); }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.toast.ok svg { color: var(--ok); }
.toast.err svg { color: var(--err); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Üres / hibaállapot
   ============================================================ */
.empty-state {
  display: grid; justify-items: center; gap: 0.6rem;
  padding: 3rem 1.5rem; text-align: center; color: var(--muted);
}
.empty-ico {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--felho-deep);
  border: 1px solid var(--info-border);
}
.empty-ico svg { width: 28px; height: 28px; }
.empty-state h3 { font-size: 1.05rem; color: var(--ink); }
.empty-state p { font-size: 0.88rem; max-width: 36ch; margin: 0; }
.empty-state .actions { display: flex; gap: 0.5rem; margin-top: 0.3rem; }

.error-state {
  display: grid; justify-items: center; gap: 0.7rem;
  padding: 4rem 1.5rem; text-align: center; color: var(--muted);
  min-height: 60vh; align-content: center;
}
.error-ico {
  width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--err-soft); color: var(--err);
  border: 1px solid rgba(220,38,38,0.25);
}
.error-ico svg { width: 38px; height: 38px; }
.error-state .err-code {
  font-family: var(--display); font-weight: 800; font-size: 1.1rem;
  letter-spacing: 0.12em; color: var(--err);
}
.error-state h2 { font-size: 1.4rem; color: var(--ink); }
.error-state p { font-size: 0.92rem; max-width: 44ch; margin: 0; }
.error-state .actions { display: flex; gap: 0.55rem; margin-top: 0.4rem; flex-wrap: wrap; justify-content: center; }

/* ============================================================
   Spinner
   ============================================================ */
.spinner {
  width: 1em; height: 1em; border: 2px solid currentColor;
  border-right-color: transparent; border-radius: 50%;
  display: inline-block; animation: spin 0.7s linear infinite; vertical-align: -0.15em;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { color: var(--muted); padding: 2rem 0; text-align: center; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }

/* ============================================================
   Téma kapcsoló
   ============================================================ */
.theme-toggle {
  width: 38px; height: 38px; flex-shrink: 0;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.theme-toggle:hover { border-color: var(--felho); background: var(--primary-soft); color: var(--felho-deep); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .moon { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: block; }
.theme-toggle-auth { position: fixed; top: 1rem; right: 1rem; z-index: 50; }

/* ============================================================
   Lépés (varázsló)
   ============================================================ */
.steps {
  display: flex; gap: 0.5rem; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 1.2rem;
}
.step {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.85rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 0.84rem; font-weight: 600; color: var(--muted);
}
.step .step-no {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.74rem;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line);
}
.step.is-active { color: var(--felho-deep); border-color: var(--felho); background: var(--primary-soft); }
.step.is-active .step-no { background: var(--primary-grad); color: var(--on-primary); border-color: transparent; }
.step.is-done { color: var(--ok); border-color: rgba(5,150,105,0.3); }
.step.is-done .step-no { background: var(--ok); color: #fff; border-color: transparent; }
.step.is-done .step-no::before { content: "✓"; }
.step.is-done .step-no span { display: none; }

/* ============================================================
   Avatar
   ============================================================ */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary-grad); color: var(--on-primary);
  display: inline-grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 0.8rem;
  flex-shrink: 0; overflow: hidden;
}
.avatar--sm { width: 28px; height: 28px; font-size: 0.7rem; }
.avatar--lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   Cégkulcs-jelzés (diszkrét)
   ============================================================ */
.key-hint {
  display: flex; align-items: center; gap: 0.45rem;
  font-size: 0.74rem; color: var(--muted);
  padding: 0.55rem 0.75rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line);
}
.key-hint svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--felho); }

/* ============================================================
   Lapozó
   ============================================================ */
.pagination {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  flex-wrap: wrap; padding: var(--pad-panel-y) var(--pad-panel-x);
  border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--muted);
}
.pagination .pages { display: flex; gap: 0.3rem; }
.page-btn {
  min-width: 30px; height: 30px; padding: 0 0.5rem;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer;
  display: inline-grid; place-items: center; font-size: 0.8rem;
}
.page-btn:hover { border-color: var(--felho); background: var(--primary-soft); color: var(--felho-deep); }
.page-btn.is-active { background: var(--primary-grad); color: var(--on-primary); border-color: transparent; font-weight: 700; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   Fülek (tabok a tartalomban — pl. pénztár, törzsadatok)
   ============================================================ */
.tabs {
  display: flex; gap: 0.2rem; padding: 0 var(--pad-panel-x);
  border-bottom: 1px solid var(--line); overflow-x: auto;
}
.tabs::-webkit-scrollbar { height: 0; }
.tab {
  border: 0; background: transparent; color: var(--muted);
  padding: 0.7rem 0.9rem; cursor: pointer; font-size: 0.86rem; font-weight: 600;
  white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--ink); }
.tab.is-on { color: var(--felho-deep); border-bottom-color: var(--felho); }
.tab-pane { display: none; }
.tab-pane.is-on { display: block; }

/* ============================================================
   Részlet-rácsok
   ============================================================ */
.detail-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--gap-stack);
}
.detail-field { min-width: 0; }
.detail-label {
  display: block; font-size: 0.7rem; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.2rem;
}
.detail-value { font-size: 0.9rem; word-break: break-word; }
.detail-value.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.84rem; }

.kv-list { display: grid; gap: 0; }
.kv-row {
  display: grid; grid-template-columns: minmax(7rem, 32%) 1fr;
  gap: 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); align-items: baseline;
}
.kv-row:last-child { border-bottom: 0; }
.kv-row dt { margin: 0; color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.kv-row dd { margin: 0; color: var(--ink); font-size: 0.88rem; word-break: break-word; }

/* ============================================================
   Partner / termék adatlap
   ============================================================ */
.sheet-hero {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: var(--pad-body-y) var(--pad-body-x);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, var(--primary-soft), transparent 60%);
}
.sheet-hero .hero-ico {
  width: 56px; height: 56px; border-radius: var(--radius);
  background: var(--primary-grad); color: var(--on-primary);
  display: grid; place-items: center; flex-shrink: 0;
  font-family: var(--display); font-weight: 700; font-size: 1.3rem;
}
.sheet-hero .hero-name { font-family: var(--display); font-size: 1.2rem; font-weight: 700; }
.sheet-hero .hero-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.35rem; }
.sheet-body { padding: var(--pad-body-y) var(--pad-body-x); display: grid; gap: var(--gap-grid); }
.sheet-cols {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-grid);
}
@media (max-width: 760px) { .sheet-cols { grid-template-columns: 1fr; } }
.sheet-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2); padding: 0.85rem 0.95rem;
}
.sheet-card--wide { grid-column: 1 / -1; }
.sheet-card-title {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--felho-deep); margin: 0 0 0.6rem;
}

/* Termék fotó-hely */
.product-photo {
  width: 100%; aspect-ratio: 1 / 1; max-width: 320px;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface-2);
  display: grid; place-items: center; color: var(--muted);
  background-image: linear-gradient(135deg, var(--surface-2), var(--field-bg));
}
.product-photo svg { width: 64px; height: 64px; opacity: 0.4; }
.product-photo .ph-label { font-size: 0.78rem; margin-top: 0.4rem; }

/* ============================================================
   Számla PDF előnézet-hely
   ============================================================ */
.pdf-preview {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 2rem; min-height: 360px;
  display: grid; place-items: center; text-align: center; color: var(--muted);
  position: relative; overflow: hidden;
}
.pdf-preview::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px; opacity: 0.4; pointer-events: none;
}
.pdf-preview .pdf-inner { position: relative; z-index: 1; display: grid; gap: 0.5rem; place-items: center; }
.pdf-preview svg { width: 56px; height: 56px; color: var(--felho); }
.pdf-preview .pdf-title { font-family: var(--display); font-weight: 700; color: var(--ink); font-size: 1rem; }

/* ============================================================
   Login / auth
   ============================================================ */
.auth-body {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(14, 165, 233, 0.18), transparent 55%),
    radial-gradient(720px 380px at 100% 0%, rgba(3, 105, 161, 0.12), transparent 50%),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
}
.auth-shell { width: min(420px, 100%); }
.auth-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 1.9rem 1.75rem 1.6rem;
}
.auth-brand {
  display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1.4rem;
  justify-content: center;
}
.auth-brand .brand-mark { width: 44px; height: 44px; }
.auth-brand .brand-name { font-size: 1.35rem; }
.auth-brand .brand-sub { font-size: 0.62rem; }
.auth-title { font-size: 1.25rem; text-align: center; margin-bottom: 0.3rem; }
.auth-sub { text-align: center; color: var(--muted); font-size: 0.86rem; margin-bottom: 1.4rem; }
.auth-foot { margin-top: 1.2rem; font-size: 0.8rem; text-align: center; color: var(--muted); }
.auth-divider {
  display: flex; align-items: center; gap: 0.6rem; margin: 1.2rem 0;
  color: var(--muted); font-size: 0.76rem;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

/* ============================================================
   Egyebek
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-grid); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-grid); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }
.section-title {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--felho-deep); margin: 0 0 0.5rem;
}
.divider { height: 1px; background: var(--line); margin: 0.6rem 0; border: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.18rem 0.6rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 0.78rem; font-weight: 600; color: var(--muted);
}
.badge {
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 0.18rem 0.5rem; border-radius: 999px;
  background: var(--primary-soft); color: var(--felho-deep); border: 1px solid var(--info-border);
}
.badge-soft { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(5,150,105,0.25); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(217,119,6,0.25); }
.soon-state {
  display: grid; justify-items: center; gap: 0.6rem; align-content: center;
  min-height: 56vh; padding: 2.5rem 1.5rem; text-align: center;
}
.soon-badge {
  display: inline-flex; padding: 0.28rem 0.85rem; border-radius: 999px;
  background: var(--primary-soft); color: var(--felho-deep);
  border: 1px solid var(--info-border);
  font-family: var(--display); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.soon-title { font-size: 1.35rem; }
.soon-copy { color: var(--muted); max-width: 32rem; font-size: 0.92rem; }

/* ============================================================
   Grafikon (oszlopdiagram)
   ============================================================ */
.chart { padding: 0.5rem 0; }
.chart-bars {
  display: flex; align-items: flex-end; gap: 0.5rem;
  height: 220px; padding: 0.5rem 0.25rem 1.6rem;
  border-bottom: 1px solid var(--line);
}
.chart-bars .bar {
  flex: 1; min-width: 0; position: relative; height: var(--h, 50%);
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--felho), var(--felho-deep));
  opacity: 0.85; transition: opacity 0.15s;
}
.chart-bars .bar:hover { opacity: 1; }
.chart-bars .bar.is-now {
  background: linear-gradient(180deg, var(--felho-bright), var(--felho));
  box-shadow: 0 0 0 1px var(--felho-bright);
}
.chart-bars .bar-label {
  position: absolute; bottom: -1.3rem; left: 0; right: 0;
  text-align: center; font-size: 0.72rem; color: var(--muted);
}

/* ============================================================
   Mobil reszponzív
   ============================================================ */
@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "workspace";
  }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: min(280px, 86vw);
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow-lg);
  }
  .app-shell.is-nav-open .sidebar { transform: none; }
  .app-shell.is-collapsed { grid-template-columns: 1fr; }
  .app-shell.is-collapsed .brand-text,
  .app-shell.is-collapsed .nav-label,
  .app-shell.is-collapsed .nav-group-label,
  .app-shell.is-collapsed .nav-badge,
  .app-shell.is-collapsed .co-text,
  .app-shell.is-collapsed .su-text { display: revert; }
  .app-shell.is-collapsed .nav-item { justify-content: flex-start; padding: 0.5rem 0.7rem; }
  .app-shell.is-collapsed .sidebar-company,
  .app-shell.is-collapsed .sidebar-user { justify-content: flex-start; }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 25;
    background: rgba(7, 16, 24, 0.45); opacity: 0; pointer-events: none;
    transition: opacity 0.2s;
  }
  .app-shell.is-nav-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .topbar-search { display: none; }
  .topbar-user .tu-name { display: none; }
  .topbar-user { padding: 0.2rem; }
  .screen { padding: var(--pad-page); }
  .page-head { gap: 0.5rem; }
  .page-head .toolbar { margin-left: 0; width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field--span-3 { grid-column: 1 / -1; }
  .panel-head { flex-direction: column; align-items: stretch; }
  .panel-head .right { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Asztali IRS szalagmenü — IrsTema / IrsParancssav metrika
   Alapszín #C8C8C8, test Sotetit 6%, fül+test összeolvad,
   nagy ikon 50px, kicsi 24px, Segoe UI 7.5–9pt.
   ============================================================ */
.app-shell.is-ribbon {
  --ribbon-font: "Segoe UI", "Segoe UI Variable Text", system-ui, sans-serif;
  --ribbon-base: #f3f3f3;
  --ribbon-body: color-mix(in srgb, var(--ribbon-base) 97%, #000);
  --ribbon-tab-hover: color-mix(in srgb, var(--ribbon-base) 90%, #000);
  --ribbon-text: #1c2028;
  --ribbon-muted: color-mix(in srgb, var(--ribbon-text) 52%, var(--ribbon-base));
  --ribbon-accent: #8bb601;
  --ribbon-cmd-hover: color-mix(in srgb, var(--ribbon-base) 86%, var(--ribbon-accent));
  --ribbon-cmd-press: color-mix(in srgb, var(--ribbon-base) 74%, var(--ribbon-accent));
  --ribbon-field: #ffffff;
  --ribbon-hairline: color-mix(in srgb, var(--ribbon-accent) 35%, var(--ribbon-base));
  --ribbon-danger: #c42b1c;
  --bg: color-mix(in srgb, var(--ribbon-base) 86%, #ffffff);
  --bg-soft: color-mix(in srgb, var(--ribbon-base) 94%, #000000);
  --surface: color-mix(in srgb, var(--ribbon-base) 16%, #ffffff);
  --surface-2: color-mix(in srgb, var(--ribbon-base) 24%, #ffffff);
  --field-bg: color-mix(in srgb, var(--ribbon-base) 10%, #ffffff);
  --ink: var(--ribbon-text);
  --text: var(--ribbon-text);
  --muted: var(--ribbon-muted);
  --line: color-mix(in srgb, var(--ribbon-text) 14%, var(--ribbon-base));
  --border: var(--line);
  --felho: var(--ribbon-accent);
  --felho-deep: color-mix(in srgb, var(--ribbon-accent) 78%, #000);
  --felho-bright: color-mix(in srgb, var(--ribbon-accent) 70%, #fff);
  --felho-soft: color-mix(in srgb, var(--ribbon-accent) 18%, var(--surface));
  --primary: var(--ribbon-accent);
  --primary-hover: var(--felho-deep);
  --primary-soft: var(--felho-soft);
  --primary-grad: linear-gradient(135deg, var(--felho-bright) 0%, var(--felho) 48%, var(--felho-deep) 100%);
  --on-primary: var(--ribbon-on-accent, #ffffff);
  --info-text: var(--felho-deep);
  --info-border: color-mix(in srgb, var(--ribbon-accent) 35%, var(--line));
  --shadow: 0 8px 24px color-mix(in srgb, var(--ribbon-text) 10%, transparent);
  --shadow-sm: 0 2px 8px color-mix(in srgb, var(--ribbon-text) 8%, transparent);
  --shadow-lg: 0 18px 48px color-mix(in srgb, var(--ribbon-text) 14%, transparent);
  grid-template-columns: 1fr;
  grid-template-rows: auto auto 1fr;
  grid-template-areas:
    "ribbon"
    "tabs"
    "workspace";
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--ribbon-base);
}
.ribbon {
  grid-area: ribbon;
  min-width: 0;
  background: var(--ribbon-base);
  color: var(--ribbon-text);
  font-family: var(--ribbon-font);
  border-bottom: 1px solid color-mix(in srgb, var(--ribbon-text) 10%, var(--ribbon-base));
  z-index: 4;
}
.ribbon-fulsav {
  display: flex;
  align-items: stretch;
  height: 32px;
  padding: 0 0 0 2px;
  background: var(--ribbon-base);
  min-width: 0;
}
.ribbon-logo {
  width: 32px;
  height: 32px;
  padding: 0;
  box-sizing: border-box;
  object-fit: contain;
  flex-shrink: 0;
}
.ribbon-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 32px;
  padding: 0;
  overflow-x: auto;
  background: transparent;
  min-width: 0;
}
.ribbon-tabs::-webkit-scrollbar { height: 0; }
.ribbon-tab {
  appearance: none;
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  color: var(--ribbon-text);
  font-family: var(--ribbon-font);
  font-size: 12px;
  font-weight: 400;
  line-height: 29px;
  height: 32px;
  padding: 3px 10px 0;
  cursor: pointer;
  white-space: nowrap;
}
.ribbon-tab::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0; top: 3px;
  border-radius: 8px 8px 0 0;
  background: transparent;
  z-index: -1;
}
.ribbon-tab:hover::before { background: var(--ribbon-tab-hover); }
.ribbon-tab.is-active {
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--ribbon-accent);
}
.ribbon-search {
  width: 280px;
  max-width: 32vw;
  min-width: 8rem;
  height: 24px;
  margin: 4px 8px 0 auto;
  padding: 0 8px 0 28px;
  border: 1px solid color-mix(in srgb, var(--ribbon-text) 16%, var(--ribbon-base));
  border-radius: 4px;
  background: var(--ribbon-field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%235a5e66' stroke-width='2'%3E%3Ccircle cx='6' cy='6' r='4'/%3E%3Cpath d='M9.5 9.5 13 13'/%3E%3C/svg%3E") 8px 50% no-repeat;
  color: var(--ribbon-text);
  font-family: var(--ribbon-font);
  font-size: 11px;
  outline: none;
  flex-shrink: 1;
}
.ribbon-search:focus {
  border-color: var(--ribbon-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ribbon-accent) 45%, transparent);
}
.ribbon-ceg {
  align-self: center;
  max-width: 22vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--ribbon-muted);
  padding: 0 8px;
  font-variant-numeric: tabular-nums;
}
.ribbon-menu-btn,
.ribbon-search-btn { display: none; }
.ribbon-sheet { display: none; }
.ribbon-user {
  align-self: center;
  font-size: 11px;
  color: var(--ribbon-text);
  text-decoration: none;
  padding: 0 10px;
  white-space: nowrap;
}
.ribbon-user:hover { text-decoration: underline; }
.ribbon .theme-toggle.ribbon-winbtn,
.ribbon-winbtn {
  width: 44px;
  height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ribbon-text);
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  font-family: var(--ribbon-font);
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.12s;
}
.ribbon .theme-toggle.ribbon-winbtn:hover,
.ribbon-winbtn:hover {
  background: color-mix(in srgb, var(--ribbon-accent) 24%, var(--ribbon-base));
  color: var(--ribbon-text);
  border-color: transparent;
}
.ribbon-winbtn.is-close:hover {
  background: var(--ribbon-danger);
  color: #fff;
}
.ribbon .theme-toggle svg { width: 16px; height: 16px; }
.ribbon-theme { position: relative; align-self: stretch; display: flex; }
.ribbon-dots {
  display: block;
  width: 4px;
  height: 14px;
  background:
    radial-gradient(circle, currentColor 1.4px, transparent 1.5px) 50% 1px / 4px 4px no-repeat,
    radial-gradient(circle, currentColor 1.4px, transparent 1.5px) 50% 6px / 4px 4px no-repeat,
    radial-gradient(circle, currentColor 1.4px, transparent 1.5px) 50% 11px / 4px 4px no-repeat;
}
.ribbon-theme-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  min-width: 220px;
  padding: 0.55rem 0.65rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--ribbon-text) 14%, var(--ribbon-base));
  border-radius: 6px;
  background: #fff;
  color: #1c2028;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
  font-family: var(--ribbon-font);
}
html[data-theme="dark"] .ribbon-theme-menu {
  background: #2c2e32;
  color: #f8f9fc;
  border-color: #4a4d52;
}
.ribbon-theme-title {
  margin: 0 0 0.45rem;
  font-size: 11px;
  font-weight: 600;
}
.ribbon-theme-swatches {
  display: grid;
  grid-template-columns: repeat(4, 28px);
  gap: 6px;
}
.ribbon-swatch {
  width: 28px;
  height: 22px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  background: var(--swatch);
}
.ribbon-swatch.is-on { outline: 2px solid var(--ribbon-accent); outline-offset: 1px; }
.ribbon-theme-custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.65rem;
  font-size: 11px;
}
.ribbon-theme-custom input { width: 42px; height: 24px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.ribbon-body {
  height: 104px;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--ribbon-body);
}
.ribbon-panel {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 104px;
  padding: 4px 4px 0;
}
.ribbon-panel[hidden] { display: none; }
.ribbon-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0 8px;
  position: relative;
}
.ribbon-group::after {
  content: "";
  position: absolute;
  right: 0;
  top: 8px;
  width: 2px;
  height: 72px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--ribbon-hairline) 48%,
    transparent 100%
  );
  opacity: 0.85;
}
.ribbon-group:last-child::after { content: none; }
.ribbon-group-cmds {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  height: 80px;
}
.ribbon-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 1px;
}
.ribbon-cmd {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ribbon-text);
  font-family: var(--ribbon-font);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
}
.ribbon-cmd:hover, .ribbon-cmd.is-active {
  background: var(--ribbon-cmd-hover);
}
.ribbon-cmd:active { background: var(--ribbon-cmd-press); }
.ribbon-cmd.is-denied,
.ribbon-cmd:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}
.ribbon-cmd img { display: block; flex-shrink: 0; object-fit: contain; }
.ribbon-cmd.is-large {
  flex-direction: column;
  justify-content: flex-start;
  width: 88px;
  min-width: 56px;
  max-width: 90px;
  height: 80px;
  padding: 2px 3px 0;
  gap: 1px;
  font-size: 10px;
  line-height: 1.15;
  font-weight: 400;
}
.ribbon-cmd.is-large img { width: 50px; height: 50px; margin-top: 0; }
.ribbon-cmd.is-large span {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: center;
  width: 100%;
}
.ribbon-cmd.is-small {
  width: 170px;
  min-width: 56px;
  height: 26px;
  padding: 0 8px 0 9px;
  gap: 8px;
  font-size: 11px;
  font-weight: 400;
  text-align: left;
}
.ribbon-cmd.is-small img { width: 24px; height: 24px; }
.ribbon-cmd.is-small span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ribbon-group-label {
  height: 20px;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ribbon-text);
}
/* Nyitott ablakok tabsora — az asztali IRS (IrsAblakFulek) metrikája:
   sáv 36px, aktív fül teljes magas + 1px keret + 4px lekerekítés, inaktív 4px-el
   alacsonyabb, egymáshoz 1px elválasztóval; nincs akcent-aláhúzás, nincs alcím. */
.app-shell.is-ribbon {
  --wstab-tint: #ffffff;
  --wstab-active-bg: color-mix(in srgb, var(--ribbon-base) 50%, var(--wstab-tint));
  --wstab-idle-bg: color-mix(in srgb, var(--ribbon-base) 65%, var(--wstab-tint));
  --wstab-hover-bg: color-mix(in srgb, var(--ribbon-base) 56%, var(--wstab-tint));
  --wstab-border: color-mix(in srgb, var(--ribbon-text) 14%, var(--ribbon-base));
  --wstab-sep: color-mix(in srgb, var(--ribbon-text) 9%, var(--wstab-idle-bg));
}
.app-shell.is-ribbon.is-ribbon-dark {
  --wstab-active-bg: color-mix(in srgb, var(--ribbon-base) 78%, var(--wstab-tint));
  --wstab-idle-bg: color-mix(in srgb, var(--ribbon-base) 88%, var(--wstab-tint));
  --wstab-hover-bg: color-mix(in srgb, var(--ribbon-base) 84%, var(--wstab-tint));
  --wstab-border: color-mix(in srgb, var(--ribbon-text) 22%, var(--ribbon-base));
  --wstab-sep: color-mix(in srgb, var(--ribbon-text) 16%, var(--wstab-idle-bg));
}
.app-shell.is-ribbon .workspace-tabs {
  display: flex;
  align-items: flex-end;
  gap: 0;
  height: 42px;
  min-height: 42px;
  padding: 0 8px;
  /* az alsó 1px vonal háttérként, hogy az aktív fül el tudja fedni */
  background:
    linear-gradient(var(--wstab-border), var(--wstab-border)) left bottom / 100% 1px no-repeat,
    var(--ribbon-base);
  border-bottom: 0;
  font-family: var(--ribbon-font);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.app-shell.is-ribbon .ws-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  height: 37px;
  min-height: 0;
  max-width: none;
  margin: 0 0 1px -1px;
  padding: 0 6px 0 14px;
  border: 1px solid var(--wstab-sep);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: var(--wstab-idle-bg);
  color: var(--ribbon-muted);
  font-family: var(--ribbon-font);
  font-size: 12px;
  font-weight: 400;
  line-height: 14px;
  box-shadow: none;
  white-space: normal;
}
.app-shell.is-ribbon .ws-tab:first-child { margin-left: 0; }
.app-shell.is-ribbon .ws-tab:hover { background: var(--wstab-hover-bg); }
.app-shell.is-ribbon .ws-tab .ws-tab-text {
  display: block;
  /* asztali viselkedés: a cím a leghosszabb szónál törik két sorra */
  width: min-content;
  min-width: 60px;
  max-width: 132px;
  text-align: left;
  line-height: inherit;
}
.app-shell.is-ribbon .ws-tab .ws-label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 400;
  word-break: normal;
  overflow-wrap: normal;
}
.app-shell.is-ribbon .ws-tab .ws-sub { display: none; }
.app-shell.is-ribbon .ws-tab .ws-close {
  position: relative;
  width: 11px;
  height: 11px;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 0;
  line-height: 0;
  opacity: 0.75;
}
.app-shell.is-ribbon .ws-tab .ws-close::before,
.app-shell.is-ribbon .ws-tab .ws-close::after {
  content: "";
  position: absolute;
  left: -1px;
  top: 5px;
  width: 13px;
  height: 1px;
  background: currentColor;
  transform: rotate(45deg);
}
.app-shell.is-ribbon .ws-tab .ws-close::after { transform: rotate(-45deg); }
.app-shell.is-ribbon .ws-tab .ws-close:hover { opacity: 1; background: transparent; color: inherit; }
.app-shell.is-ribbon .ws-tab.is-active {
  z-index: 1;
  height: 42px;
  margin-bottom: 0;
  margin-right: 1px;
  padding-left: 16px;
  border-color: var(--wstab-border);
  background: var(--wstab-active-bg);
  color: var(--ribbon-text);
  font-weight: 700;
  box-shadow: none;
}
.app-shell.is-ribbon .ws-tab.is-active + .ws-tab { margin-left: 0; }
.app-shell.is-ribbon .ws-tab.is-active:hover { background: var(--wstab-active-bg); }
.app-shell.is-ribbon .ws-tab.is-active .ws-label { font-weight: 700; }
.app-shell.is-ribbon .ws-tab.is-active .ws-close { opacity: 0.9; }
.app-shell.is-ribbon .workspace {
  background: var(--ribbon-base);
}
@media (max-width: 860px) {
  .app-shell.is-ribbon {
    grid-template-areas:
      "ribbon"
      "tabs"
      "workspace";
    height: 100dvh;
    max-height: 100dvh;
    min-height: 100dvh;
  }
  .ribbon {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  .ribbon-fulsav {
    height: 48px;
    padding: 0 4px 0 2px;
    align-items: center;
  }
  .ribbon-logo { width: 36px; height: 36px; }
  .ribbon-tabs {
    flex: 1;
    height: 48px;
    min-width: 0;
  }
  .ribbon-tab {
    height: 48px;
    line-height: 44px;
    font-size: 14px;
    padding: 0 12px;
    min-height: 44px;
  }
  .ribbon-tab::before { top: 6px; }
  .ribbon-body { display: none; }
  .ribbon-ceg { display: none; }
  .ribbon-user { display: none; }
  .ribbon-theme { display: none; }
  .ribbon-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin: 0 2px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: color-mix(in srgb, var(--ribbon-accent) 22%, var(--ribbon-base));
    color: var(--ribbon-text);
    font-family: var(--ribbon-font);
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
  }
  .ribbon-search-btn {
    display: inline-grid;
    place-items: center;
  }
  .ribbon-search {
    display: none;
    position: absolute;
    left: 8px;
    right: 8px;
    top: 52px;
    z-index: 8;
    width: auto;
    max-width: none;
    min-width: 0;
    height: 44px;
    margin: 0;
    padding: 0 12px 0 36px;
    font-size: 16px;
    border-radius: 10px;
    box-shadow: var(--shadow);
  }
  .ribbon.is-search-open { position: relative; }
  .ribbon.is-search-open .ribbon-search { display: block; }
  .ribbon .theme-toggle.ribbon-winbtn,
  .ribbon-winbtn {
    width: 44px;
    height: 48px;
  }
  .app-shell.is-ribbon .workspace-tabs {
    height: 46px;
    min-height: 46px;
    padding: 0 8px;
  }
  .app-shell.is-ribbon .ws-tab {
    height: 41px;
    font-size: 13px;
    line-height: 15px;
    padding: 0 8px 0 12px;
  }
  .app-shell.is-ribbon .ws-tab .ws-tab-text { min-width: 64px; max-width: 150px; }
  .app-shell.is-ribbon .ws-tab .ws-close { width: 18px; height: 18px; }
  .app-shell.is-ribbon .ws-tab .ws-close::before,
  .app-shell.is-ribbon .ws-tab .ws-close::after { left: 1px; top: 8px; width: 16px; }
  .app-shell.is-ribbon .ws-tab.is-active {
    height: 46px;
    font-size: 14px;
    line-height: 16px;
  }
  .workspace {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }
  .data th, .data td {
    padding: 0.7rem 0.65rem;
    font-size: 13px;
  }
  .btn, .btn-sm {
    min-height: 44px;
  }
  .form-grid input,
  .form-grid select,
  .field input,
  .field select {
    min-height: 44px;
    font-size: 16px;
  }
  .ribbon-sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
  }
  .ribbon-sheet[hidden] { display: none; }
  .ribbon-sheet-backdrop {
    appearance: none;
    border: 0;
    position: absolute;
    inset: 0;
    background: rgba(7, 16, 24, 0.45);
  }
  .ribbon-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(82dvh, 640px);
    overflow: auto;
    padding: 0.75rem 0.85rem calc(1rem + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-lg);
  }
  .ribbon-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
  }
  .ribbon-sheet-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }
  .ribbon-sheet-cmd {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 52px;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--ink);
    text-align: left;
    font: inherit;
  }
  .ribbon-sheet-cmd img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
  }
  .ribbon-sheet-cmd.is-denied {
    opacity: 0.42;
    pointer-events: none;
  }
}

/* ============================================================
   Élő SPA kompatibilitás: dokumentum-tabok + partnerlap
   ============================================================ */
.app-shell:not(.is-ribbon) {
  grid-template-rows: var(--topbar-h) auto 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar tabs"
    "sidebar workspace";
}
.workspace-tabs {
  grid-area: tabs;
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 0.15rem;
  min-height: 42px;
  padding: 0.3rem 0.65rem 0;
  background: var(--ribbon-base, color-mix(in srgb, var(--bg-soft) 70%, transparent));
  border-bottom: 1px solid color-mix(in srgb, var(--ribbon-text, var(--ink)) 12%, var(--ribbon-base, var(--line)));
  overflow-x: auto;
}
.workspace-tabs::-webkit-scrollbar { height: 0; }
.ws-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 220px;
  min-height: 36px;
  padding: 0.35rem 0.45rem 0.35rem 0.65rem;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: color-mix(in srgb, var(--ribbon-base, var(--bg-soft)) 88%, var(--ribbon-text, var(--ink)));
  color: var(--ribbon-muted, var(--muted));
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}
.ws-tab-text { display: grid; gap: 0.05rem; min-width: 0; text-align: left; line-height: 1.15; }
.ws-tab .ws-label { overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ws-tab .ws-sub { overflow: hidden; text-overflow: ellipsis; font-size: 0.68rem; opacity: 0.78; }
.ws-tab .ws-close {
  width: 18px; height: 18px; border: 0; border-radius: 5px;
  background: transparent; color: inherit; cursor: pointer;
  display: inline-grid; place-items: center; opacity: 0.55; flex-shrink: 0;
}
.ws-tab .ws-close:hover { opacity: 1; background: var(--primary-soft); color: var(--felho-deep); }
.ws-tab.is-active {
  background: var(--surface);
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ribbon-text, var(--ink)) 12%, var(--ribbon-base, var(--line)));
  box-shadow: inset 0 -2px 0 var(--ribbon-accent, var(--felho));
}
.app-shell.is-ribbon .workspace {
  background: var(--bg);
}
.workspace { display: flex; flex-direction: column; min-height: 0; overflow: auto; padding: 0; }
.workspace:has(.ws-panel:not([hidden]) .desk),
.workspace:has(.ws-panel:not([hidden]) .bksz) { overflow: hidden; }
.workspace > .card,
.workspace > .ws-panel,
.workspace > .ws-panel > .card {
  border: 0; border-radius: 0; box-shadow: none; background: var(--surface);
  flex: 1 1 auto; min-height: 0; width: 100%;
}
.ws-panel { display: flex; flex-direction: column; min-height: 0; }
.ws-panel[hidden] { display: none !important; }
.panel-flush { padding: 0; overflow: hidden; }
.panel-toolbar, .panel-head {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 0.5rem 0.75rem; flex-wrap: wrap;
  padding: var(--pad-panel-y) var(--pad-panel-x);
  border-bottom: 1px solid var(--line);
}
.panel-toolbar:empty, .panel-head:empty { display: none; }
.panel-body { padding: var(--pad-body-y) var(--pad-body-x); }
.toolbar--inline { display: flex; align-items: center; gap: var(--gap-toolbar); flex-wrap: wrap; }
.toolbar--inline .field { min-width: 0; flex: 0 0 auto; }
.toolbar--inline .field--stat-select { flex: 1 1 220px; min-width: min(100%, 200px); max-width: 360px; }
.stats-desc { margin: -0.15rem 0 0.75rem; }
.partner-hero {
  padding: calc(var(--pad-body-y) + 0.15rem) var(--pad-body-x);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary-soft) 70%, transparent), transparent 70%), var(--surface);
}
.partner-hero-name { margin: 0; font-size: 1.2rem; }
.partner-hero-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.55rem; }
.partner-chip {
  display: inline-flex; padding: 0.2rem 0.55rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 0.78rem;
}
.partner-sections {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap-grid); padding: var(--pad-body-y) var(--pad-body-x);
}
.partner-card {
  min-width: 0; padding: 0.85rem 0.95rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface-2);
}
.partner-card--wide { grid-column: 1 / -1; }
.partner-card-title {
  margin: 0 0 0.7rem; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--felho-deep);
}
.partner-dl { display: grid; gap: 0.45rem 0; margin: 0; }
.partner-row {
  display: grid; grid-template-columns: minmax(6.5rem, 34%) minmax(0, 1fr);
  gap: 0.35rem 0.85rem; align-items: baseline; padding: 0.28rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.partner-row:last-child { border-bottom: 0; }
.partner-row dt { margin: 0; color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.partner-row dd { margin: 0; color: var(--ink); font-size: 0.92rem; word-break: break-word; }
.partner-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-grid); }
.partner-edit-grid .field--wide { grid-column: 1 / -1; }
.partner-extras { padding: 0 var(--pad-body-x) var(--pad-body-y); }
.panel-flush .pagination {
  margin-top: 0; padding: 0.45rem var(--pad-panel-x);
  border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center;
}
.pagination .pages { display: flex; gap: 0.35rem; }
.panel-flush .table-wrap { border: 0; border-radius: 0; }
/* ---- Bizonylatkészítő — az asztali BizonylatKeszitoAblak elrendezése ----
   Bal: termékkereső. Jobb (fentről): Helyszín kártya · Partner kártya · Kosár (kitölt) · Checkout.
   A checkout részletei / kimenete összecsukható, alapból zárva — így a kosár kapja a helyet. */
.bksz {
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(380px, 0.85fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.bksz-left, .bksz-right {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0.55rem 0.6rem;
}
.bksz-left { border-right: 1px solid var(--line); }
/* Ha a nyitott részletek miatt nem fér el, a jobb oszlop görgethető — a kosár nem zsugorodik 180px alá. */
.bksz-right { overflow: hidden auto; scrollbar-gutter: stable; }
.bksz-searchbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.bksz-q { flex: 1 1 220px; min-height: 40px; font-size: 0.95rem; }
.bksz-check { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; white-space: nowrap; }
.bksz-check input { width: auto; }
.bksz-view { display: inline-flex; gap: 0.25rem; }
.bksz-products { flex: 1; min-height: 160px; overflow: auto; }
.bksz-empty { padding: 2rem 1rem; text-align: center; color: var(--muted); line-height: 1.5; }
.bksz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 0.55rem; }
.bksz-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem;
  min-height: 132px; padding: 0.65rem 0.7rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.bksz-tile:hover, .bksz-tile:focus-visible { border-color: var(--felho); background: var(--felho-soft); outline: none; }
.bksz-tile-name { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bksz-tile-price { margin-top: auto; font-weight: 700; }
.bksz-tile.is-out, .bksz-prod-table tr.is-out td { color: var(--err); }
.bksz-tile.is-ok .bksz-tile-stock { color: var(--ok); }
.bksz-more { align-self: flex-start; }
.bksz-more[hidden], .bksz [hidden] { display: none; }

/* Kártyák */
.bksz-card {
  flex: 0 0 auto;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.bksz-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.bksz-actions { display: flex; gap: 0.25rem; flex-wrap: nowrap; }
.bksz-actions .btn-sm { padding: 0.2rem 0.5rem; min-height: 26px; font-size: 0.76rem; white-space: nowrap; }
.bksz-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.bksz-szekcio { font-size: 0.74rem; font-weight: 700; color: var(--muted); }
.bksz-card .field { gap: 0.1rem; }
.bksz-card .field > span { font-size: 0.7rem; line-height: 1.15; }
.bksz-card .field input, .bksz-card .field select, .bksz-card .field textarea {
  padding-top: 0.28rem; padding-bottom: 0.28rem; font-size: 0.84rem; min-height: 30px;
}

/* 1. Helyszín */
.bksz-helyszin { display: grid; gap: 0.3rem; padding: 0.45rem 0.7rem 0.5rem; }
.bksz-helyszin .bksz-type { font-weight: 600; font-size: 0.9rem; }
.bksz-helyszin .field[hidden] { display: none; }
.bksz-helyszin .bksz-2:has(.field[hidden]) { grid-template-columns: 1fr; }

/* 2. Partner — kattintható kártya (F2) */
.bksz-partner { cursor: pointer; position: relative; padding: 0.4rem 0.7rem 0.45rem; }
.bksz-partner:hover { border-color: color-mix(in srgb, var(--felho) 45%, var(--line)); }
.bksz-partner.has-partner { border-left: 3px solid var(--felho); }
.bksz-partner-nev { margin-top: 0.15rem; font-weight: 700; font-size: 0.94rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bksz-partner-sor { font-size: 0.75rem; line-height: 1.25; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 0.95rem; }
.bksz-partner-kereso { margin-top: 0.4rem; cursor: default; }
.bksz-partner-kereso[hidden] { display: none; }
.bksz-partner .bk-hits { max-height: 240px; }

/* 3. Kosár — kitölti a maradék helyet */
.bksz-kosar { flex: 1 1 auto; min-height: 180px; display: flex; flex-direction: column; padding: 0.4rem 0.5rem 0.5rem; }
.bksz-kosar-fejlec { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; padding: 0 0.25rem 0.3rem; }
.bksz-kosar-cimek { display: grid; gap: 0.1rem; min-width: 0; }
.bksz-kosar-cimek strong { font-size: 0.86rem; line-height: 1.25; }
.bksz-osszesito { font-size: 0.74rem; line-height: 1.3; color: var(--muted); font-variant-numeric: tabular-nums; }
.bksz-cart-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; border-top: 1px solid var(--line); }
.bksz-cart-empty { margin: 0; padding: 1.5rem 1rem; text-align: center; color: var(--muted); font-size: 0.84rem; line-height: 1.5; }
.bksz-cart { width: 100%; border-collapse: collapse; }
.bksz-cart th {
  position: sticky; top: 0; z-index: 1; background: var(--surface);
  padding: 0.3rem 0.4rem; font-size: 0.7rem; font-weight: 600; color: var(--muted); text-align: left;
  border-bottom: 1px solid var(--line);
}
.bksz-cart td { padding: 0.28rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.bksz-cart th.center, .bksz-cart td.center { text-align: center; }
.bksz-cart th.right, .bksz-cart td.right { text-align: right; font-variant-numeric: tabular-nums; }
.bksz-cart td.center { width: 10.5rem; }
.bksz-cart td.right { width: 7rem; white-space: nowrap; }
.bksz-cart tr[data-line] { cursor: default; }
.bksz-cart tr[data-line]:hover td { background: color-mix(in srgb, var(--felho-soft) 55%, transparent); }
.bksz-cart tr.is-on td { background: var(--primary-soft); }
.bksz-cart tr[data-line]:focus-visible { outline: 2px solid var(--felho); outline-offset: -2px; }
.bksz-tetel-nev { font-weight: 600; font-size: 0.84rem; line-height: 1.25; word-break: break-word; }
.bksz-tetel-kod { font-size: 0.7rem; color: var(--muted); line-height: 1.25; }
.bksz-tetel-osszeg { font-weight: 700; font-size: 0.88rem; line-height: 1.25; }
.bksz-qty { display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; }
.bksz-qty button {
  width: 26px; height: 26px; flex: 0 0 26px; padding: 0; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; font-size: 1rem; line-height: 1; cursor: pointer;
}
.bksz-qty button:hover { background: var(--felho-soft); border-color: var(--felho); }
.bksz-qty-ertek { display: inline-flex; align-items: baseline; gap: 0.2rem; }
.bksz-qty-ertek input { width: 3.2rem; min-height: 26px; padding: 0.1rem 0.3rem; text-align: right; font-size: 0.84rem; }
.bksz-qty-egyseg { font-size: 0.7rem; color: var(--muted); }

/* 4. Checkout */
.bksz-checkout { display: grid; gap: 0.3rem; padding: 0.45rem 0.7rem 0.5rem; }
.bksz-fizetes-sor[hidden] { display: none; }
/* Fizetési mód: címke és lenyíló egy sorban — mint az asztali 36px-es fizetés-sor. */
.bksz-fizetes-sor .field { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0.5rem; }
.bksz-fizetes-sor .field > span { white-space: nowrap; font-size: 0.76rem; font-weight: 600; color: var(--muted); }
.bksz-blokk { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; }
.bksz-fold {
  appearance: none; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  width: 100%; padding: 0.3rem 0.6rem; min-height: 28px; border: 0; background: transparent;
  font: inherit; font-size: 0.78rem; font-weight: 700; color: var(--ink); cursor: pointer; text-align: left;
}
.bksz-fold:hover { background: var(--felho-soft); }
.bksz-nyil { color: var(--muted); font-size: 0.8rem; }
.bksz-details { display: none; padding: 0.35rem 0.6rem 0.55rem; border-top: 1px solid var(--line); background: var(--surface); }
.bksz-blokk.is-open .bksz-details { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 0.5rem; }
.bksz-details .field[hidden] { display: none; }
.bksz-details .field--wide { grid-column: 1 / -1; }
.bksz-details textarea { min-height: 2.8rem; font-size: 0.84rem; }
.bksz-blokk.is-open .bksz-kimenet { grid-template-columns: 1fr; gap: 0.3rem; }
.bksz-primary { width: 100%; min-height: 46px; font-size: 1rem; font-weight: 700; margin-top: 0.1rem; }
.bksz-checkout .muted-sm { margin: 0; }
.bksz-tile-add, .bksz-dock, .bksz-cart-nav { display: none; }

/* Kosár „…” menü */
.bksz-menu {
  position: fixed; z-index: 1200; min-width: 230px; padding: 0.3rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow);
  display: grid; gap: 0.1rem;
}
.bksz-menu button {
  appearance: none; width: 100%; padding: 0.45rem 0.65rem; border: 0; border-radius: 6px;
  background: transparent; text-align: left; font: inherit; font-size: 0.84rem; color: var(--ink); cursor: pointer;
}
.bksz-menu button:hover { background: var(--felho-soft); }
.bksz-menu button.is-danger { color: var(--err); }
.bksz-menu hr { margin: 0.2rem 0; border: 0; border-top: 1px solid var(--line); }

.ws-panel:not([hidden]):has(.bksz) { padding: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ws-panel:has(.bksz) > .card { display: none; }

@media (max-width: 1180px) {
  .bksz { grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr); }
  .bksz-cart td.center { width: 9.5rem; }
}
@media (max-width: 980px) {
  .bksz {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .bksz-left, .bksz-right {
    flex: 1 1 auto;
    min-height: 0;
    border-right: 0;
  }
  .bksz-left { border-bottom: 0; padding-bottom: 0.35rem; }
  .bksz-searchbar {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg);
    padding-bottom: 0.2rem;
  }
  .bksz-q { flex: 1 1 100%; min-height: 48px; font-size: 16px; }
  .bksz-searchbar .btn { min-width: 48px; min-height: 44px; }
  .bksz-check { min-height: 44px; }
  .bksz-check input { width: 18px; height: 18px; }
  .bksz-products { flex: 1; max-height: none; min-height: 0; }
  .bksz-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
  .bksz-tile {
    position: relative;
    min-height: 148px;
    padding: 0.75rem 0.75rem 0.7rem;
    border-radius: var(--radius);
  }
  .bksz-tile-price { padding-right: 2.6rem; font-size: 1.05rem; }
  .bksz-tile-add {
    display: grid;
    place-items: center;
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: var(--felho);
    color: var(--on-primary);
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1;
  }
  .bksz-view { display: none; }
  .bksz-dock {
    display: block;
    flex: 0 0 auto;
    padding: 0.45rem 0.55rem calc(0.45rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--surface);
  }
  .bksz-dock-btn {
    appearance: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 56px;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-2);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  .bksz-dock.is-filled .bksz-dock-btn {
    border-color: color-mix(in srgb, var(--felho) 45%, var(--line));
    background: color-mix(in srgb, var(--felho-soft) 70%, var(--surface));
  }
  .bksz-dock-ico {
    position: relative;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    color: var(--felho-deep);
  }
  .bksz-dock-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: var(--felho);
    color: var(--on-primary);
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.25rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
  }
  .bksz-dock-badge[hidden] { display: none; }
  .bksz-dock-badge.is-pop { animation: bksz-pop 0.35s ease; }
  @keyframes bksz-pop {
    0% { transform: scale(0.55); }
    55% { transform: scale(1.22); }
    100% { transform: scale(1); }
  }
  .bksz-dock-text { display: grid; gap: 0.05rem; min-width: 0; flex: 1; }
  .bksz-dock-label { font-weight: 700; font-size: 0.95rem; line-height: 1.2; }
  .bksz-dock-sum {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
  }
  .bksz-dock-go { color: var(--muted); font-size: 1.4rem; line-height: 1; }
  .bksz-cart-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    position: sticky;
    top: 0;
    z-index: 3;
    margin: -0.5rem -0.55rem 0.15rem;
    padding: 0.45rem 0.55rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .bksz-back {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    min-height: 44px;
    padding: 0.3rem 0.55rem 0.3rem 0.2rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--felho-deep);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }
  .bksz-back:hover, .bksz-back:focus-visible { background: var(--felho-soft); outline: none; }
  .bksz-cart-nav strong { font-size: 1rem; }
  .bksz[data-bk-pane="shop"] .bksz-right { display: none; }
  .bksz[data-bk-pane="cart"] .bksz-left,
  .bksz[data-bk-pane="cart"] .bksz-dock { display: none; }
  .bksz-right { overflow: auto; padding-bottom: calc(0.55rem + env(safe-area-inset-bottom)); }
  .bksz-kosar { flex: 1 1 auto; min-height: 8rem; }
  .bksz-cart-wrap { max-height: none; min-height: 0; }
  .bksz-cart, .bksz-cart tbody { display: block; width: 100%; }
  .bksz-cart thead { display: none; }
  .bksz-cart tr[data-line] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name value" "qty value";
    gap: 0.2rem 0.75rem;
    align-items: center;
    padding: 0.7rem 0.35rem;
    border-bottom: 1px solid var(--line);
  }
  .bksz-cart td { padding: 0; border: 0; width: auto; white-space: normal; }
  .bksz-cart td:first-child { grid-area: name; }
  .bksz-cart td.center { grid-area: qty; text-align: left; }
  .bksz-cart td.right { grid-area: value; align-self: center; }
  .bksz-qty button { width: 40px; height: 40px; flex-basis: 40px; border-radius: 10px; font-size: 1.2rem; }
  .bksz-qty-ertek input { width: 2.8rem; min-height: 40px; font-size: 16px; }
  .bksz-checkout {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: auto -0.55rem 0;
    padding: 0.55rem 0.7rem calc(0.55rem + env(safe-area-inset-bottom));
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    box-shadow: 0 -10px 24px color-mix(in srgb, var(--ink) 8%, transparent);
  }
  .bksz-blokk.is-open .bksz-details { grid-template-columns: 1fr; }
  .bksz-primary { min-height: 52px; }
  .bksz-actions { flex-wrap: wrap; }
  .bksz-actions .btn-sm { min-height: 40px; }
}
.ws-panel:not([hidden]):has(.desk) {
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ws-panel:has(.desk) > .card { display: none; }
.desk {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background: var(--surface);
}
.desk-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.55rem 0.85rem 0.45rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.desk-head h2 { font-size: 1.05rem; }
.desk-head p { margin: 0.15rem 0 0; }
.desk-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.55rem 0.85rem 0.75rem;
}
.desk-body--partner {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(260px, 0.85fr);
  gap: 0.75rem 1.1rem;
  align-content: start;
}
.desk-body--product {
  max-width: 36rem;
  display: grid;
  align-content: start;
  gap: 0.28rem;
}
.desk-pane { display: grid; gap: 0.28rem; align-content: start; }
.desk-row {
  display: grid;
  grid-template-columns: 9.4rem minmax(0, 1fr);
  align-items: center;
  gap: 0.35rem 0.55rem;
  min-height: 30px;
}
.desk-row > span {
  font-size: 0.8rem;
  color: var(--ink);
  line-height: 1.25;
}
.desk-row input,
.desk-row select,
.desk-row textarea {
  min-height: 30px;
  padding: 0.22rem 0.45rem;
}
.desk-row textarea { min-height: 6.5rem; }
.desk-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; min-width: 0; }
.desk-row--zip .desk-split { grid-template-columns: 5.4rem minmax(0, 1fr); }
.desk-box {
  padding: 0.45rem 0.55rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  margin-top: 0.35rem;
}
.desk-box--tight { padding: 0.4rem 0.5rem 0.5rem; }
.desk-box h3 {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--felho-deep);
}
.desk-2, .desk-3 { display: grid; gap: 0.4rem; }
.desk-2 { grid-template-columns: 1fr 1fr; }
.desk-3 { grid-template-columns: 7rem 1fr; }
.desk-inline { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.desk-inline input, .desk-inline select { flex: 1; min-width: 0; }
.desk-inline .btn { flex: 0 0 auto; }
.desk-inline .field--grow { flex: 1; min-width: 0; }
.desk-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.1rem 0;
  font-size: 0.86rem;
}
.desk-check input { width: auto; }
.desk-checks { display: grid; gap: 0.15rem; }
.desk-hint { margin: 0.15rem 0 0.25rem; }
.desk-body--product .desk-hint { margin-left: 9.95rem; }
.desk-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.85rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
  flex-shrink: 0;
}
.desk-foot .btn-primary { min-width: 10rem; min-height: 38px; }
.desk-tabs {
  display: flex;
  gap: 0.2rem;
  padding: 0.3rem 0.85rem 0;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.desk-tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.45rem 0.75rem;
  font: inherit;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.desk-tabs button.is-on { color: var(--ink); font-weight: 600; border-bottom-color: var(--felho); }
.desk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
  padding: 0.5rem 0.85rem 0.35rem;
  flex-shrink: 0;
}
.desk-toolbar .field--grow { flex: 1 1 180px; }
.desk-toolbar--inline { flex-wrap: wrap; }
.desk-inline-field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.desk-inline-field > span { font-size: 0.8rem; color: var(--ink); white-space: nowrap; }
.desk-inline-field input,
.desk-inline-field select { width: auto; min-width: 10rem; min-height: 30px; padding: 0.22rem 0.45rem; }
.desk-suggest { position: relative; min-height: 0; }
.desk-suggest .bk-hits {
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  top: 0;
  z-index: 6;
  margin: 0;
}
.desk-steps { display: flex; gap: 0.65rem; font-size: 0.8rem; color: var(--muted); }
.desk-steps .is-on { color: var(--ink); font-weight: 700; }
.desk--orders { min-height: 0; }
.desk--orders .table-wrap {
  margin: 0 0.85rem 0.55rem;
  flex: 1;
  min-height: 12rem;
  overflow: auto;
}
.desk--orders [data-tab-lista]:not([hidden]),
.desk--orders [data-tab-elokeszites]:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
@media (max-width: 860px) {
  .desk-body--partner, .desk-2, .desk-3 { grid-template-columns: 1fr; }
  .desk-row { grid-template-columns: 1fr; }
  .desk-hint { margin-left: 0; }
  .desk-foot { padding-bottom: calc(0.5rem + env(safe-area-inset-bottom)); }
  .desk-foot .btn, .desk-foot .btn-primary { min-height: 44px; }
}
.bk-hits {
  display: none;
  margin-top: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  max-height: 220px;
  overflow: auto;
}
.bk-hits.is-open { display: block; }
.bk-hit {
  display: block;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
}
.bk-hit:last-child { border-bottom: 0; }
.bk-hit:hover { background: var(--primary-soft); }
.bk-cart { width: 100%; border-collapse: collapse; margin: 0.65rem 0; }
.bk-cart th, .bk-cart td { padding: 0.45rem 0.4rem; border-bottom: 1px solid var(--line); text-align: left; }
.bk-cart input { width: 5.5rem; min-height: 36px; }
.bk-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
@media (max-width: 860px) {
  .bk-grid { grid-template-columns: 1fr; }
}
/* A user-akcentus tokeneket a chrome.js írja (IrsTema paletta a szalag alapszínéből). */
@media (max-width: 860px) {
  .app-shell {
    grid-template-areas:
      "topbar"
      "tabs"
      "workspace";
  }
  .partner-sections, .partner-edit-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Kezdőlap (Áttekintés) — asztali IRS Kezdolap paritás
   ============================================================ */
.ws-panel:has(.kz) > .card { display: none; }
.ws-panel:has(.kz) { padding: 0; }
.kz {
  --kz-gap: 0.8rem;
  padding: 1rem 1.2rem 1.6rem;
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--felho) 22%, transparent) 0%, transparent 55%),
    linear-gradient(180deg, color-mix(in srgb, var(--felho) 12%, transparent) 0%, transparent 50%),
    var(--bg);
  min-height: 100%;
}
.kz-hero {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.85rem 1.1rem; margin-bottom: var(--kz-gap);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.kz-brand { display: flex; align-items: center; gap: 0.9rem; }
.kz-logo { position: relative; display: block; width: 56px; height: 56px; color: var(--felho); flex-shrink: 0; }
.kz-logo svg { position: absolute; inset: 0; }
.kz-greet { margin: 0; font-family: var(--display); font-size: 1.35rem; font-weight: 600; line-height: 1.2; }
.kz-sub { margin: 0.2rem 0 0; font-size: var(--fs-meta); }
.kz-hero-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.kz-version { font-size: var(--fs-meta); }

.kz-kpis {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--kz-gap); margin-bottom: var(--kz-gap);
}
.kz-tile {
  font: inherit; text-align: left; cursor: pointer; min-width: 0; min-height: 92px;
  padding: 0.8rem 0.95rem; border-radius: var(--radius); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: border-color .15s, transform .15s;
}
.kz-tile:hover { border-color: var(--felho); transform: translateY(-2px); }
.kz-tile-label { color: var(--muted); font-size: var(--fs-meta); margin-bottom: 0.4rem; }
.kz-tile-value { font-family: var(--display); font-size: 1.45rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kz-tile-sub { color: var(--muted); font-size: 0.72rem; margin-top: 0.3rem; }
.kz-tile.warn .kz-tile-value { color: var(--warn); }
.kz-tile.danger .kz-tile-value { color: var(--err); }
.kz-tile.ok .kz-tile-value { color: var(--ok); }
.kz-span-all { grid-column: 1 / -1; }

.kz-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--kz-gap); }
.kz-card {
  min-width: 0; padding: 0.9rem 1.05rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.kz-span-8 { grid-column: span 8; }
.kz-span-7 { grid-column: span 7; }
.kz-span-5 { grid-column: span 5; }
.kz-span-4 { grid-column: span 4; }
.kz-card-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
.kz-card-head h2 { margin: 0; font-size: 0.95rem; font-family: var(--display); font-weight: 600; }
.kz-link { background: none; border: 0; padding: 0; color: var(--felho-deep); font: inherit; font-weight: 600; cursor: pointer; }
.kz-link:hover { text-decoration: underline; }
.kz-empty { color: var(--muted); padding: 1rem 0.2rem; }

.kz-chart { height: 240px; position: relative; }
.kz-chart svg { width: 100%; height: 100%; display: block; }
.kz-chart-tools { display: flex; align-items: center; gap: 0.6rem; }
.kz-bar-from { stop-color: var(--felho-bright); }
.kz-bar-to { stop-color: var(--felho-deep); }
.kz-bar { fill: url(#kzBarGrad); transition: opacity .15s; }
.kz-bar.dim { opacity: .35; }
.kz-gridline { stroke: var(--line); stroke-dasharray: 3 4; }
.kz-axis, .kz-axis-val { fill: var(--muted); font-family: var(--font); font-variant-numeric: tabular-nums; }
.kz-axis { font-size: 11px; }
.kz-axis-val { font-size: 10px; text-anchor: end; }
.kz-tip {
  position: absolute; pointer-events: none; padding: 0.45rem 0.6rem; font-size: 12px; opacity: 0;
  transition: opacity .12s; z-index: 5; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--radius-sm);
}
.kz-tip-date { color: var(--muted); }
.kz-tip-val { font-weight: 700; font-size: 14px; }
.kz-tip-sub { color: var(--muted); font-size: 11px; }
.kz-seg { display: inline-flex; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.kz-seg button { background: transparent; border: 0; color: var(--muted); padding: 0.3rem 0.65rem; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.kz-seg button.is-active { background: var(--primary); color: var(--on-primary); }

.kz-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.kz-qa {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 0.75rem; min-width: 0;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink); font: inherit; font-weight: 600; text-align: left; cursor: pointer;
  transition: transform .12s, border-color .12s;
}
.kz-qa:hover { border-color: var(--felho); transform: translateY(-2px); }
.kz-qa.is-denied { opacity: .45; cursor: not-allowed; transform: none; }
.kz-qa-ic { display: flex; width: 28px; height: 28px; flex-shrink: 0; align-items: center; justify-content: center; }
.kz-qa-ic img { width: 28px; height: 28px; display: block; }

.kz-table-wrap { overflow: auto; max-height: 300px; }
.kz-table { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
.kz-table th, .kz-table td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.kz-table th { color: var(--muted); font-weight: 600; font-size: var(--fs-meta); position: sticky; top: 0; background: var(--surface); }
.kz-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.kz-table tr.kz-row { cursor: pointer; }
.kz-table tr.kz-row:hover { background: var(--primary-soft); }
.kz-overdue { color: var(--err); font-weight: 600; }

.kz-users { display: flex; flex-direction: column; gap: 0.45rem; max-height: 300px; overflow: auto; }
.kz-user {
  display: flex; justify-content: space-between; gap: 0.6rem; align-items: center;
  padding: 0.5rem 0.65rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line);
}
.kz-user-left { display: flex; gap: 0.6rem; align-items: center; min-width: 0; }
.kz-dot { width: 10px; height: 10px; border-radius: 50%; background: #9ca3af; flex-shrink: 0; }
.kz-user.is-me .kz-dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.kz-user.is-me { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.kz-meta { color: var(--muted); font-size: var(--fs-meta); }

@media (max-width: 1200px) {
  .kz-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kz-span-8, .kz-span-7, .kz-span-5, .kz-span-4 { grid-column: span 12; }
}
@media (max-width: 760px) {
  .kz { padding: 0.75rem 0.8rem 1.2rem; }
  .kz-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kz-hero { flex-direction: column; align-items: flex-start; }
  .kz-quick { grid-template-columns: 1fr 1fr; }
  .kz-chart { height: 200px; }
  .kz-card-head { flex-wrap: wrap; }
  .kz-chart-tools { flex-wrap: wrap; width: 100%; justify-content: space-between; }
  .kz-tile { min-height: 80px; }
}
