/* ============================================================================================
   DESIGN TOKENS — single source of truth for the whole app set (portal + all integrations).
   Pixel-exact: every token holds the value the app already uses, so this layer is a pure
   refactor (no visual change). Two tiers:
     1. Raw palette primitives (--c-*): the actual color values, grouped by hue/ramp.
     2. Semantic aliases (--color-*): role-based names that components reference.
   Legacy names (--bg, --panel, --primary, --line, --radius, --shadow, …) are kept as aliases
   so existing rules keep working. To re-theme: change the primitives (and optionally remap the
   semantic aliases); components need no edits.
   ============================================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  /* --- Neutral ramp (fehér alap) --- */
  --c-neutral-0:   #ffffff;
  --c-neutral-50:  #f7f7f7;
  --c-neutral-100: #f0f0f0;
  --c-neutral-150: #ebebeb;
  --c-neutral-200: #e4e4e4;
  --c-neutral-250: #f7f7f7;
  --c-neutral-300: #e4e4e4;
  --c-neutral-350: #e4e4e4;
  --c-neutral-400: #d8d8d8;
  --c-neutral-450: #f0f0f0;
  --c-neutral-500: #d8d8d8;
  --c-neutral-550: #d8d8d8;
  --c-neutral-600: #c8c8c8;
  --c-neutral-650: #a8a8a8;

  /* --- Ink ramp (semleges, nem meleg) --- */
  --c-ink-400: #9A9A93;
  --c-ink-500: #6b6b6b;
  --c-ink-600: #444444;
  --c-ink-700: #333333;
  --c-ink-750: #333333;
  --c-ink-800: #555555;
  --c-ink-850: #333333;
  --c-ink-900: #222222;

  /* --- Brand: navy --- */
  --c-navy:       #102A3D;
  --c-navy-hover: #0d2233;

  /* --- Brand: green --- */
  --c-green-50:  #EDF5E2;
  --c-green-500: #7FB83D;
  --c-green-600: #5E9E2E;
  --c-green-700: #4a7d22;

  /* --- Amber (warning) --- */
  --c-amber-400: #c8870c;
  --c-amber-600: #9a6606;
  --c-amber-700: #9a6606;

  /* --- Red (danger) --- */
  --c-red-50:  #fdecec;
  --c-red-100: #f7d7d7;
  --c-red-500: #d24545;
  --c-red-600: #b83838;
  --c-red-700: #962d2d;

  /* --- Translucent --- */
  --c-overlay-strong: rgba(16, 42, 61, 0.50);
  --c-overlay-soft:   rgba(16, 42, 61, 0.40);
  --c-white-94: rgba(255, 255, 255, 0.94);
  --c-white-78: rgba(255, 255, 255, 0.78);
  --c-white-72: rgba(255, 255, 255, 0.72);
  --c-focus-ring: rgba(127, 184, 61, 0.30);
  --c-green-tint: rgba(127, 184, 61, 0.15);
  --c-amber-tint: rgba(200, 135, 12, 0.18);
  --c-red-tint:   rgba(210, 69, 69, 0.16);
  --c-shadow:     rgba(16, 42, 61, 0.12);

  /* --- Semantic aliases --- */
  --color-bg:               var(--c-neutral-250);
  --color-surface:          var(--c-neutral-0);
  --color-surface-subtle:   var(--c-neutral-100);
  --color-surface-subtle-2: var(--c-neutral-50);
  --color-surface-raised:   var(--c-neutral-150);
  --color-surface-inset:    var(--c-neutral-200);
  --color-surface-alt:      var(--c-neutral-300);
  --color-surface-muted:    var(--c-neutral-350);
  --color-surface-hover:    var(--c-neutral-400);
  --color-surface-sidebar:  var(--c-navy);
  --color-border:           var(--c-neutral-550);
  --color-border-strong:    var(--c-neutral-650);
  --color-text:             var(--c-ink-800);
  --color-text-row:         var(--c-ink-700);
  --color-text-strong:      var(--c-ink-600);
  --color-text-subtle:      var(--c-ink-500);
  --color-text-muted:       var(--c-ink-400);
  --color-primary:          var(--c-green-600);
  --color-primary-hover:    var(--c-green-700);
  --color-primary-soft:     var(--c-green-50);
  --color-danger:           var(--c-red-600);
  --color-danger-hover:     var(--c-red-700);
  --color-danger-soft:      var(--c-red-50);
  --color-warning:          var(--c-amber-400);
  --color-focus:            var(--c-green-500);
  --color-on-primary:       var(--c-neutral-0);
  --color-overlay:          var(--c-overlay-strong);

  /* --- Navy: direkt hivatkozáshoz --- */
  --navy: var(--c-navy);
  --navy-hover: var(--c-navy-hover);
  --green: var(--c-green-500);
  --green-strong: var(--c-green-600);
  --green-soft-bg: var(--c-green-50);
  --green-soft-text: #3F6B16;

  /* --- Header + Sidebar reskin v2 (fejléc/menüsáv látványterv) --- */
  --navy-header:  #0C2230;               /* fejléc háttér (a sávnál sötétebb navy) */
  --navy-raise:   #193C52;               /* kiemelt panel a sávban (szinkron-kártya) */
  --navy-overlay: rgba(255,255,255,.07); /* hover-overlay sötét felületen */
  --navy-line:    rgba(255,255,255,.09); /* hajszálvonal sötét felületen */
  --green-dark:   #4E872A;               /* zöld gomb hover */
  --on-navy:       #FFFFFF;              /* elsődleges szöveg sötét sávon */
  --on-navy-muted: #B9C7CF;              /* halványabb szöveg sötét sávon */
  --on-navy-faint: #7E939E;              /* tompított szöveg/ikon sötét sávon */
  --radius-ctl:   9px;                   /* vezérlők sarka a v2 fejléc/sávban */

  /* --- Legacy aliases (megtartva, komponensek ezekre hivatkoznak) --- */
  --bg: var(--color-bg);
  --panel: var(--color-surface);
  --panel-muted: var(--color-surface-muted);
  --text: var(--color-text);
  --muted: var(--color-text-muted);
  --line: var(--color-border);
  --line-strong: var(--color-border-strong);
  --primary: var(--color-primary);
  --primary-hover: var(--color-primary-hover);
  --primary-soft: var(--color-primary-soft);
  --error: var(--color-danger);
  --error-soft: var(--color-danger-soft);
  --focus: var(--color-focus);
  --ink: var(--c-ink-750);

  /* --- Tipográfia --- */
  --font-sans: "Outfit", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --text-2xs: 11px;
  --text-xs:  12px;
  --text-sm:  13px;
  --text-base:14px;
  --text-md:  15px;
  --text-lg:  17px;
  --text-xl:  18px;
  --text-2xl: 20px;
  --text-3xl: 24px;
  --text-4xl: 26px;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --weight-heavy:    700;
  --leading-tight: 1.35;
  --leading-normal: 1.5;

  /* --- Spacing (változatlan) --- */
  --space-1: 2px;   --space-2: 4px;   --space-3: 6px;
  --space-4: 8px;   --space-5: 10px;  --space-6: 12px;
  --space-7: 14px;  --space-8: 16px;  --space-9: 18px;
  --space-10: 20px; --space-12: 24px; --space-14: 28px;
  --space-16: 32px;

  /* --- Radius (változatlan) --- */
  --radius-sm: 6px;
  --radius:    8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* --- Elevation --- */
  --shadow-md: 0 4px 24px var(--c-shadow);
  --shadow: var(--shadow-md);

  /* --- Motion (változatlan) --- */
  --transition-fast: 160ms ease;

  /* --- Layout (változatlan) --- */
  --sidebar-width: 310px;
}

/* FF-TABLE szabályzók — az egyetlen hely, ahol a platform táblázatainak kinézete állítható.
   Forrás: specs/platform/ff-table-referencia.html (elfogadott vizuális igazság). Ahol a referencia
   értéke pontosan vagy közelítőleg megfelel egy meglévő szemantikus tokennek, arra hivatkozunk;
   ahol nincs megfelelő, a referencia nyers értéke marad — kizárólag ebben a blokkban. */
:root {
  --ff-cell-pad-y: var(--space-3);     /* 6px — kompakt sormagasság */
  --ff-cell-pad-x: var(--space-6);     /* 12px */
  --ff-head-pad-y: var(--space-4);     /* 8px */
  --ff-grid-width: 1px;                /* cellák közti függőleges vonal */
  --ff-grid-color: #E6EBEF;            /* nincs pontos szemantikus megfelelő */
  --ff-row-line: #E1E7EB;              /* nincs pontos szemantikus megfelelő */
  --ff-zebra: #F1F5F8;                 /* sorcsíkozás — elfogadott, egyedi árnyalat */
  --ff-hover: #E9F1F6;                 /* nincs pontos szemantikus megfelelő */
  --ff-font-size: var(--text-base);    /* 14px */
  --ff-head-font-size: 12.5px;         /* nincs pontos szemantikus megfelelő */
  --ff-head-bg: var(--navy);           /* #102A3D — pontos egyezés */
  --ff-filter-bg: #0B1F2E;             /* nincs pontos szemantikus megfelelő */

  /* A referencia komponens-törzse további, névvel el nem látott egyedi színeket is használ
     (badge/bulkbar/kijelölés/kiemelés árnyalatok). Hogy a szekció törzsében ne maradjon nyers
     hex, ezeket is szabályzóként nevezzük meg — ahol volt közeli szemantikus token, azt a
     törzsben közvetlenül használjuk (ld. lent), ez a lista csak azokat tartalmazza, amikhez nem
     volt megfelelő. */
  --ff-text: #16202B;                  /* elsődleges cellaszöveg — nincs pontos szemantikus megfelelő */
  --ff-text-faint: #93A1AC;            /* halvány szöveg/ikon — nincs pontos szemantikus megfelelő */
  --ff-danger-border: #E7CFCC;
  --ff-danger-bg-hover: #FBF1F0;
  --ff-bulk-border: #CFE0BE;
  --ff-bulk-text: #2F5417;
  --ff-runstate-bg: #FBFCFD;
  --ff-filter-placeholder: #7E97A8;
  --ff-link-underline: rgba(16, 42, 61, 0.25);
  --ff-flag-bg-strong: #DCEAD1;
  --ff-select-bg: #E4EEF6;
  --ff-select-bg-strong: #D9E7F2;
  --ff-count-active-bg: rgba(255, 255, 255, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--c-focus-ring);
  outline-offset: 2px;
}

.is-hidden {
  display: none !important;
}

.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;
}

.shop-select-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 40px 24px;
  background: var(--navy);
  position: relative;
  overflow: hidden;
}

.shop-select-screen::before {
  content: '';
  position: absolute;
  right: -160px;
  top: -160px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  border: 56px solid rgba(127, 184, 61, 0.07);
  pointer-events: none;
}

.shop-select-screen::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 36px solid rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--navy);
  position: relative;
  overflow: hidden;
}

.login-screen::before {
  content: '';
  position: absolute;
  right: -160px;
  top: -160px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  border: 56px solid rgba(127, 184, 61, 0.07);
  pointer-events: none;
}

.login-screen::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 36px solid rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.shop-select-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 820px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 36px 32px;
  box-shadow: 0 8px 48px rgba(16, 42, 61, 0.28);
}

.shop-select-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.login-panel {
  width: min(100%, 420px);
  padding: 36px 36px 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 48px rgba(16, 42, 61, 0.28);
  position: relative;
  z-index: 1;
}

.login-panel h1 {
  margin: 28px 0 20px;
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  color: var(--navy);
}

/* FlowFactory wordmark — tömör, egyszínű szöveg (a színes/kéttónusú lockup a
   logó-SVG-ben él). Fehér felületen navy; navy fejléceken a kontextus felülírja fehérre. */
.login-brand-name {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--navy);
  line-height: 1;
  letter-spacing: -0.3px;
}

.login-brand-sub {
  margin-top: 4px;
  font-size: var(--text-xs);
  color: var(--muted);
}

/* FlowFactory színes lockup a világos-hátterű képernyők fejlécein (shop-választó,
   landing, admin) — a korábbi szöveges wordmark helyett. */
.screen-brand-logo {
  height: 28px;
  width: auto;
  display: block;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  color: var(--text);
}

.brand-logo {
  display: block;
  width: 150px;
  height: auto;
}

.brand-product {
  padding-left: 10px;
  border-left: 1px solid var(--line);
  color: var(--color-text-strong);
  font-weight: var(--weight-heavy);
  white-space: nowrap;
}

.sidebar-brand {
  align-items: flex-start;
  flex-direction: column;
  gap: var(--space-3);
}

.sidebar-brand .brand-logo {
  width: 180px;
}

.sidebar-brand .brand-product {
  padding-left: 0;
  border-left: 0;
}

/* The app name under the sidebar logo is redundant (the shop/app is shown in the header). */
#app-brand-product {
  display: none;
}

.shop-select-header {
  margin-bottom: 24px;
}

.shop-select-header h1 {
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  color: var(--navy);
  margin: 0 0 6px;
}

.shop-select-header p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* Kilépés — ghost, navy háttéren fehér, panel felett */
.shop-logout-btn {
  position: absolute;
  top: 20px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: color var(--transition-fast);
}

.shop-logout-btn:hover { color: #fff; }

/* Vissza gomb — másodlagos, panel bal felső */
.shop-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 14px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-strong);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.shop-back-btn:hover { background: var(--color-surface-subtle); }

/* Kártyák */
.shop-select-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 0;
}

.select-shop-card {
  background: var(--color-surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

/* Admin kártya — navy */
.select-shop-card.is-admin {
  background: var(--navy);
  border-color: var(--navy);
}

/* Monogram háttér-elem */
.select-shop-card .card-monogram {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 72px;
  font-weight: var(--weight-bold);
  color: rgba(16, 42, 61, 0.07);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.select-shop-card.is-admin .card-monogram {
  color: rgba(255, 255, 255, 0.06);
}

/* Kártya ikon */
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(16, 42, 61, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
  color: var(--navy);
}

.select-shop-card.is-admin .card-icon {
  background: rgba(255, 255, 255, 0.12);
  color: var(--green);
}

/* App kártya — vertikális layout */
.select-shop-card.is-app {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

.select-shop-card.is-app .card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.select-shop-card.is-app .card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--navy);
  color: var(--green);
  font-size: 22px;
  flex-shrink: 0;
}

/* Kártya tartalom */
.card-body {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.card-name {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--navy);
  margin-bottom: 5px;
}

.select-shop-card.is-admin .card-name { color: #fff; }

.card-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.card-badge-type {
  font-size: 11px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.3px;
  background: rgba(16, 42, 61, 0.10);
  color: var(--navy);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}

.select-shop-card.is-admin .card-badge-type {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
}

.card-badge-active {
  font-size: 11px;
  font-weight: var(--weight-semibold);
  background: var(--green-soft-bg);
  color: var(--green-soft-text);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}

.card-badge-admin {
  font-size: 11px;
  font-weight: var(--weight-semibold);
  background: rgba(127, 184, 61, 0.25);
  color: var(--green);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}

.card-meta {
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.6;
}

.select-shop-card.is-admin .card-meta { color: rgba(255, 255, 255, 0.5); }

/* CTA gomb a kártyán */
.select-shop-button {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  background: var(--primary);
  color: var(--color-on-primary);
  border: none;
  border-radius: var(--radius);
  padding: 9px 18px;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  font-family: var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast);
}

.select-shop-button:hover { background: var(--primary-hover); }

.select-shop-button:disabled {
  background: var(--color-border-strong);
  cursor: not-allowed;
}

/* App kártya gombja — teljes szélesség */
.select-shop-card.is-app .select-shop-button {
  width: 100%;
}

/* Háttér ikon app kártyákon */
.card-bg-icon {
  position: absolute;
  right: -4px;
  bottom: -8px;
  font-size: 64px;
  color: rgba(16, 42, 61, 0.05);
  pointer-events: none;
}

/* === NAV CONTEXT ===
   A két felső szintű admin-rács (Ügyfelek / Alkalmazások) vizuális kontextus-jelzése:
   színes shell + kontextus-fejléc + kártya-szintű bal-szegély. A Beállítások platform-elem
   önálló gombként a fejlécben (nem app-típus kártya). */

/* Beállítások gomb — az Alkalmazások nézet kontextus-fejlécében, navy primary */
.nav-settings-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: #fff;
  background: var(--c-navy);
  border: none;
  border-radius: var(--radius);
  padding: 7px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast);
}
.nav-settings-btn:hover { background: var(--c-navy-hover); }

/* A rács maga lesz a shell: színezett háttér + padding; a fejléc full-width grid-elem */
.shop-select-list.nav-context-shell {
  padding: 14px;
  border-radius: var(--radius-md);
}
.shop-select-list.ctx-clients { background: #EBF4FF; }
.shop-select-list.ctx-apps    { background: #EEF6E4; }

.nav-context-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(16, 42, 61, 0.08);
}
.nav-ctx-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  color: #fff;
}
.nav-ctx-icon.ctx-clients { background: #378ADD; }
.nav-ctx-icon.ctx-apps    { background: #639922; }

.nav-ctx-titles { line-height: 1.25; }
.nav-ctx-title  { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--navy); }
.nav-ctx-sub    { font-size: var(--text-xs); color: var(--muted); margin-top: 1px; }

/* Réteg 3 — kártya-szintű jelzés. Az Adminisztráció (.is-admin) navy kártya változatlan. */
.shop-select-list.ctx-clients .select-shop-card:not(.is-admin) {
  border-left: 3px solid #378ADD;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.shop-select-list.ctx-clients .select-shop-card:not(.is-admin) .card-icon {
  background: #E6F1FB;
  color: #378ADD;
}
.shop-select-list.ctx-clients .select-shop-card:not(.is-admin) .card-badge-type {
  background: #E6F1FB;
  color: #185FA5;
  border: 1px solid #B5D4F4;
}

.shop-select-list.ctx-apps .select-shop-card {
  border-left: 3px solid #639922;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.shop-select-list.ctx-apps .select-shop-card .card-badge-type {
  background: #EAF3DE;
  color: #3B6D11;
  border: 1px solid #C0DD97;
}

.login-form {
  display: grid;
  gap: var(--space-8);
}

.field-group {
  display: grid;
  gap: 7px;
}

.field-group label {
  color: var(--color-text-strong);
  font-size: var(--text-base);
  font-weight: 650;
}

.field-group input,
.composer textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--text);
}

.field-group input {
  height: 44px;
  padding: 0 12px;
}

.password-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-4);
}

.ghost-button,
.primary-button,
.sync-action-button {
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: var(--weight-bold);
}

.primary-button,
.sync-action-button {
  background: var(--primary);
  color: var(--color-on-primary);
}

.primary-button:hover,
.sync-action-button:hover {
  background: var(--primary-hover);
}

.primary-button:disabled,
.sync-action-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.sync-cancel-button {
  margin-top: 8px;
  background: var(--color-danger);
}

.sync-cancel-button:hover {
  background: var(--color-danger-hover);
}

.ghost-button {
  background: var(--color-surface);
  border-color: var(--line);
  color: var(--color-text-strong);
}

.ghost-button:hover {
  background: var(--panel-muted);
}

/* Letiltott állapot: enélkül a gomb kattinthatónak LÁTSZIK, pedig nem az (a wizard-váz az első
   lépésen letiltja a „Vissza"-t, ha nincs hova kilépnie). */
.ghost-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ghost-button:disabled:hover {
  background: var(--color-surface);
}

.password-toggle {
  min-width: 78px;
}

.form-error,
.sync-message {
  min-height: 20px;
  margin: 0;
  color: var(--error);
  font-size: var(--text-base);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* === LOGIN RESKIN — FlowFactory split layout =======================
   Csak a #login-view-t érinti. A meglévő auth-logika változatlan: az
   #login-form / #email / #password / #login-button / #show-pricing hookok
   megmaradnak; a stílus scope-olva van a .login-form-panel-re, hogy más
   űrlapokat ne befolyásoljon. */

/* A login-screen full-bleed konténer, ha a split benne van (a régi navy
   középre-igazítás + dekor-körök kikapcsolva ennél a nézetnél). */
.login-screen:has(.login-split) {
  display: block;
  padding: 0;
  background: var(--navy);
}
.login-screen:has(.login-split)::before,
.login-screen:has(.login-split)::after { display: none; }

.login-split {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* --- Bal: brand panel --- */
.login-brand-panel {
  position: relative;
  flex: 0 0 52%;
  background: var(--navy);
  padding: 56px 56px 48px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.login-brand-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.login-brand-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
}
.login-logo {
  height: 144px;
  width: auto;
  align-self: flex-start;
}
.login-tagline-lead {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 14px;
}
.login-tagline-grad {
  background: linear-gradient(90deg, var(--green), var(--green-strong));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.login-tagline-white { color: #ffffff; }
.login-tagline-sub {
  font-size: 17px;
  color: #4a6a7a;
  max-width: 340px;
  line-height: 1.65;
  margin: 0;
}
.login-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  color: #3a5a6a;
}
.login-feature-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-strong));
  flex-shrink: 0;
}

/* --- Jobb: form panel --- */
.login-form-panel {
  flex: 1 1 48%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 58px 48px;
}
.login-form-inner { width: min(100%, 432px); }
.login-form-head { margin-bottom: 34px; }
.login-form-head h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
}
.login-form-sub {
  margin: 0;
  font-size: 16px;
  color: #7a8fa0;
}

/* Mezők — scoped a login form panelre */
.login-form-panel .field-group label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #3a5068;
}
.login-form-panel .field-group input {
  height: 50px;
  font-size: 16px;
  border: 1.5px solid #dde6f0;
  border-radius: 8px;
  background: #f6fafc;
  color: var(--navy);
}
.login-form-panel .field-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(94, 158, 46, 0.12);
}
.login-form-panel .password-control {
  display: block;
  position: relative;
}
.login-form-panel .password-control input { padding-right: 72px; }
.login-form-panel .password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 0;
  min-height: 0;
  padding: 0;
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}
.login-form-panel .password-toggle:hover { background: none; opacity: 0.8; }

.login-form-panel .primary-button {
  width: 100%;
  height: 53px;
  margin-top: 4px;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}
.login-form-panel .primary-button:hover { background: var(--primary-hover); }

.login-divider {
  height: 1px;
  background: #edf2f7;
  margin: 24px 0 16px;
}
.login-form-panel .pricing-link {
  display: block;
  width: 100%;
  text-align: center;
  background: none;
  border: none;
  font-size: 16px;
  color: #9aacbe;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.login-form-panel .pricing-link:hover { color: var(--primary); }

/* Mobil: egymás alá (brand felül, form alatta) */
@media (max-width: 768px) {
  .login-split { flex-direction: column; }
  .login-brand-panel { flex: none; padding: 32px 28px; min-height: 360px; gap: 28px; }
  .login-brand-content { gap: 28px; }
  .login-logo { height: 104px; }
  .login-form-panel { flex: none; padding: 36px 28px; }
}

/* ── APP SHELL ───────────────────────────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── HEADER ──────────────────────────────────────────────── */
/* === HEADER (reskin v2) ============================================
   Bal: FlowFactory logó + shop-kijelzés (nem interaktív) + szerep-badge.
   Jobb: Alkalmazások gomb + profil-chip legördülővel. A navigáció/logout/
   dispatch funkció változatlan; csak a megjelenés + profil-legördülő új. */
.app-header {
  background: var(--navy-header);
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 60px;
  gap: 14px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--navy-line);
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

/* FlowFactory márkajel (világos lockup — minden aloldalon látszik) */
.app-brand { display: flex; align-items: center; flex-shrink: 0; }
.app-brand-logo { height: 26px; width: auto; display: block; }

.app-header-sep {
  width: 1px;
  height: 26px;
  background: var(--navy-line);
  flex-shrink: 0;
}

/* Shop = csak kijelzés (nem kattintható, nincs nyíl/keret) */
.header-shop { display: flex; align-items: center; gap: 9px; min-width: 0; }
.header-shop-icon { color: var(--green); font-size: 18px; flex-shrink: 0; }
.header-datasource {
  font-size: 15px;
  font-weight: var(--weight-semibold);
  color: var(--on-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Szerep-badge (a korábbi "Agency nézet" indikátor átstílozva; a megjelenítés
   feltétele változatlan — a JS ugyanúgy tölti/üríti a #client-label szöveget) */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(127, 184, 61, 0.5);
  color: var(--green);
  font-size: 11.5px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  flex-shrink: 0;
}
.role-badge i { font-size: 14px; }

.app-header-spacer { flex: 1; }

/* ── HEADER: jobb klaszter (Alkalmazások gomb + profil-chip) ── */
.hbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--navy-line);
  color: #D7E1E6;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: var(--weight-medium);
  padding: 8px 13px;
  border-radius: var(--radius-ctl);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.hbtn:hover { background: var(--navy-overlay); color: #fff; }
.hbtn i { font-size: 17px; }

.header-profile { position: relative; }
.header-profile-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--navy-overlay);
  border: 1px solid var(--navy-line);
  padding: 5px 11px 5px 6px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background var(--transition-fast);
}
.header-profile-chip:hover { background: rgba(255, 255, 255, 0.12); }
.header-profile-av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: var(--weight-semibold);
  font-size: 12.5px;
  flex-shrink: 0;
}
.header-profile-name {
  font-size: 14px;
  color: #EAF0F2;
  font-weight: var(--weight-medium);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-profile-chev { color: #8DA2AD; font-size: 15px; transition: transform var(--transition-fast); }
.header-profile.is-open .header-profile-chev { transform: rotate(180deg); }

.header-profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 230px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(16, 42, 61, 0.18);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}
.header-profile.is-open .header-profile-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.header-profile-who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.header-profile-who-name { font-weight: var(--weight-semibold); font-size: 14px; }
.header-profile-who-email { font-size: 12.5px; color: var(--muted); margin-top: 2px; word-break: break-all; }
.header-profile-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.header-profile-item i { font-size: 18px; color: var(--muted); width: 18px; text-align: center; }
.header-profile-item:hover { background: var(--panel-muted); }
.header-profile-item--danger, .header-profile-item--danger i { color: var(--color-danger); }

/* ── HEADER: content-creation buttons ── */
.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: var(--weight-regular);
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  padding: 5px 13px;
  transition: opacity 0.15s;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.82);
}

.btn-header:hover { opacity: 0.80; }

.btn-header--secondary { color: rgba(255, 255, 255, 0.65); }

.btn-header--cta {
  background: var(--color-primary);
  border: 2px solid transparent;
  color: #fff;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.01em;
  box-shadow: 0 0 0 3px rgba(127, 184, 61, 0.28);
}

.btn-header--cta:hover { opacity: 0.88; }

.btn-header-icon { font-size: 15px; }

.app-header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: rgba(255, 255, 255, 0.80);
  font-family: var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast);
}

.btn-nav:hover { background: rgba(255, 255, 255, 0.14); }

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px 8px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: rgba(255, 255, 255, 0.40);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.btn-logout:hover { color: rgba(255, 255, 255, 0.75); }

/* ── BODY (sidebar + content) ────────────────────────────── */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 60px);
}

/* === SIDEBAR (reskin v2) ===========================================
   266px navy sáv: szinkron-kártya (felül), ikonos könnyed navigációs sorok,
   alul összecsukó. A dispatch/aktív-állapot/szinkron-handler változatlan. */
.app-sidebar {
  width: 266px;
  flex-shrink: 0;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 14px;
  overflow-y: auto;
  border-right: 1px solid var(--navy-line);
}

/* Szinkron-kártya (kiemelt panel a sávban) */
.sync-card {
  background: var(--navy-raise);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
  padding: 12px;
}

.sidebar-sync {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-sync-btn {
  width: 100%;
  background: var(--primary);
  color: var(--color-on-primary);
  border: none;
  border-radius: var(--radius-ctl);
  padding: 11px 12px;
  font-size: 14.5px;
  font-weight: var(--weight-semibold);
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: background var(--transition-fast);
}

.sidebar-sync-btn:hover { background: var(--green-dark); }

.sidebar-sync-btn:disabled {
  cursor: wait;
  opacity: 0.68;
}

.sidebar-sync-cancel {
  background: var(--color-danger);
}

.sidebar-sync-cancel:hover { background: var(--color-danger-hover); }

.sidebar-sync-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--on-navy-muted);
}

.sidebar-sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(127, 184, 61, 0.18);
  flex-shrink: 0;
}

/* Last sync older than 2 days: flag it in red as a gentle "data may be stale" hint. */
.sidebar-sync-meta.is-stale { color: var(--c-red-500); font-weight: var(--weight-semibold); }
.sidebar-sync-meta.is-stale .sidebar-sync-dot { background: var(--c-red-500); box-shadow: 0 0 0 3px rgba(210, 69, 69, 0.18); }

/* Szekció-címke + összecsukó */
.sidebar-nav-label {
  color: var(--on-navy-faint);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0 8px;
  margin: 2px 0 -8px;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--navy-line);
}

.sidebar-collapse {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  color: var(--on-navy-faint);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 9px 13px;
  border-radius: var(--radius-ctl);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.sidebar-collapse:hover { background: var(--navy-overlay); color: var(--on-navy-muted); }
.sidebar-collapse i { font-size: 20px; width: 20px; text-align: center; }

/* Sync progress (kept; recoloured for the navy sidebar) */
.sync-progress {
  display: grid;
  gap: var(--space-5);
}

.sync-progress-bar {
  height: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
}

.sync-progress-fill {
  display: block;
  /* Width is data, not style: JS sets the --sync-progress custom property (0%–100%). */
  width: var(--sync-progress, 0%);
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-pill);
  transition: width 180ms ease;
}

.sync-progress-steps {
  display: grid;
  gap: 7px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.sync-progress-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--text-sm);
}

.sync-progress-step strong {
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--text-xs);
}

.sync-step-main {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.sync-step-detail {
  min-height: 15px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.40);
  font-size: var(--text-2xs);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-step-dot {
  width: 9px;
  height: 9px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-pill);
}

.sync-progress-step.is-running .sync-step-dot {
  background: var(--color-warning);
}

.sync-progress-step.is-running strong {
  color: var(--c-amber-400);
}

.sync-progress-step.is-done .sync-step-dot {
  background: var(--primary);
}

.sync-progress-step.is-done strong {
  color: var(--green);
}

.sync-progress-step.is-failed .sync-step-dot {
  background: var(--c-red-500);
}

.sync-progress-step.is-failed strong {
  color: var(--c-red-500);
}

.sync-message {
  color: var(--c-red-500);
}

.sync-message:empty {
  display: none;
}

/* ── SIDEBAR MENU ────────────────────────────────────────── */
.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-menu:empty { display: none; }

/* The collapsible wrapper is kept (the existing toggle handler drives `.is-open`),
   but visually it reads as a flat group of headers + items per the new design. */
.menu-section {
  display: block;
}

.menu-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 4px;
  font-size: 12px;
  font-weight: var(--weight-semibold);
  color: rgba(255, 255, 255, 0.30);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--transition-fast);
  background: none;
  border: none;
  width: 100%;
  font-family: var(--font-sans);
  text-align: left;
}

.menu-group-header:hover { color: rgba(255, 255, 255, 0.55); }

.menu-group-chevron {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.20);
  transition: transform var(--transition-fast);
}

.menu-section.is-open .menu-group-chevron {
  transform: rotate(180deg);
}

.menu-section:not(.is-open) .menu-section-content {
  display: none;
}

.menu-list {
  display: block;
}

.menu-item {
  display: block;
  width: 100%;
  padding: 7px 14px 7px 22px;
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  color: rgba(255, 255, 255, 0.55);
  background: none;
  border: none;
  border-left: 2px solid transparent;
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.menu-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.menu-item.is-active {
  color: #fff;
  font-weight: var(--weight-semibold);
  border-left-color: var(--green);
  background: rgba(127, 184, 61, 0.10);
}

/* Navigációs sorok (reskin v2): könnyed, ikonos sorok a UNAS flat menühöz. Az elem
   megtartja a .menu-item osztályt (is-active + data-action dispatch változatlan);
   a .nav-item adja az új sor-alapú megjelenést + ikont. */
.sidebar-menu .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 13px;
  border: none;
  border-radius: var(--radius-ctl);
  background: none;
  color: var(--on-navy-muted);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: var(--weight-medium);
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.sidebar-menu .nav-item > i {
  font-size: 20px;
  width: 20px;
  text-align: center;
  color: var(--on-navy-faint);
  flex-shrink: 0;
  transition: color var(--transition-fast);
}
.sidebar-menu .nav-item > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-menu .nav-item:hover { background: var(--navy-overlay); color: #fff; }
.sidebar-menu .nav-item:hover > i { color: var(--on-navy-muted); }
.sidebar-menu .nav-item.is-active { background: var(--primary); color: #fff; font-weight: var(--weight-semibold); }
.sidebar-menu .nav-item.is-active > i { color: #fff; }
.sidebar-menu .nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--green);
}
.menu-list--flat { display: flex; flex-direction: column; gap: 3px; }

/* Összecsukott sáv (74px, csak-ikonos) — munkamenet-szintű (in-memory) állapot. */
.app-sidebar.collapsed { width: 74px; }
.app-sidebar.collapsed .sync-card,
.app-sidebar.collapsed .sidebar-nav-label,
.app-sidebar.collapsed .nav-item > span,
.app-sidebar.collapsed .sidebar-collapse-label { display: none; }
.app-sidebar.collapsed .nav-item { justify-content: center; padding: 11px 0; }
.app-sidebar.collapsed .nav-item.is-active::before { display: none; }
.app-sidebar.collapsed .sidebar-collapse { justify-content: center; padding: 9px 0; }

.empty-list {
  color: var(--muted);
  font-size: var(--text-base);
}

.recent-section {
  min-height: 0;
}

/* ── CONTENT ─────────────────────────────────────────────── */
.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background: var(--bg);
}

.content-page-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 13px 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.content-page-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--navy);
}

.client-label {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.app-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}


.count-separator {
  color: var(--line-strong);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 24px;
  padding: 0 8px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-heavy);
}

.status-pill.is-muted {
  background: var(--panel-muted);
  color: var(--muted);
}

.content-region {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 26px;
}

.empty-state {
  width: min(100%, 640px);
  margin: 16vh auto 0;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 10px;
  font-size: var(--text-3xl);
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.message {
  display: grid;
  gap: 7px;
  width: min(100%, 760px);
  margin: 0 auto 18px;
}

.message-role {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 750;
}

.message-bubble {
  padding: 13px 15px;
  border-radius: var(--radius);
  line-height: 1.55;
  white-space: pre-wrap;
}

.message.user .message-bubble {
  margin-left: auto;
  background: var(--primary);
  color: var(--color-on-primary);
}

.message.assistant .message-bubble {
  background: var(--color-surface-alt);
  color: var(--text);
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-5);
  padding: 16px 26px 22px;
  border-top: 1px solid var(--line);
  background: var(--c-white-94);
}

.composer textarea {
  min-height: 48px;
  max-height: 180px;
  resize: none;
  padding: 13px 14px;
  line-height: 1.45;
}

.send-button {
  align-self: end;
  min-width: 92px;
  height: 48px;
}

.selected-shop-card {
  width: 100%;
}

/* ---- Report chat-bubble + input primitives (shared, not table-related) --------------- */

.report-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  line-height: 1.45;
  margin: 0;
}

.report-msg.is-bot {
  align-self: flex-start;
  background: var(--panel-muted);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.report-msg.is-user {
  align-self: flex-end;
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-weight: var(--weight-semibold);
  border-bottom-right-radius: 4px;
}

.report-input {
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--color-surface);
}

.report-input:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.report-error {
  color: var(--error);
  font-size: var(--text-sm);
  min-height: 0;
}

.report-error:empty {
  display: none;
}

.report-result {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.report-result {
  /* Allow the result section to span the full content width, regardless of any parent
     wizard / chat column. */
  width: 100%;
  min-width: 0;
}

/* ---- Report parameter bar (compact chips; replaces the old chat-style wizard) --------- */
.report-view {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  width: 100%;
  min-width: 0;
}

.report-loading,
.report-error {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.report-error { color: var(--c-red-500); }

.report-params {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--color-surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.param-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.param-label {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 68px;
}

.param-options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.param-option {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-subtle);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.param-option:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.param-option.is-selected {
  background: var(--primary);
  color: var(--color-on-primary);
  border-color: var(--primary);
}

.param-custom-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.param-dash { color: var(--muted); }

.param-input {
  min-height: 30px;
  padding: 4px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}

.param-input:focus {
  outline: none;
  border-color: var(--primary);
}

.report-params-meta {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

/* ---- Költségelemzés — „Frissítés most" sáv + kapcsolat-hiány üzenet --------------------- */

.report-cost-refresh {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 2px;
}

.report-cost-refresh-status {
  font-size: var(--text-xs);
  color: var(--muted);
}

.report-connect-required {
  width: min(100%, 640px);
  margin: 6vh auto;
  text-align: center;
}

.report-connect-required h2 {
  margin: 0 0 10px;
  font-size: var(--text-2xl);
}

.report-connect-required p {
  margin: 0;
  color: var(--muted);
}

/* ---- .report-table — navy-header, striped table style ---------------------------------- */
/* Kept only for the Árajánlat-generáló PDF-előnézet (quotes.js `quote-preview__table`); the
   live UNAS report tables migrated to the shared `.ff-table` (FF-TABLE) system. */

.report-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.report-table thead tr { background: var(--navy); }

.report-table thead th {
  padding: 9px 13px;
  text-align: left;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  color: rgba(255, 255, 255, 0.70);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  /* Header may wrap onto multiple lines so a long label doesn't dictate column width —
     the table fills the available width and only scrolls horizontally as a last resort. */
  white-space: normal;
  line-height: 1.2;
  vertical-align: bottom;
  cursor: pointer;
  user-select: none;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.report-table thead th:last-child { border-right: none; }

.report-table thead th:hover { background: var(--navy-hover); }

/* Section title above each table in the combined fizetés+szállítás view. */
.report-section-title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--color-text-strong);
  margin: 18px 0 8px;
}

.report-table tbody tr:nth-child(odd)  { background: var(--panel); }
.report-table tbody tr:nth-child(even) { background: var(--color-surface-subtle); }
.report-table tbody tr:hover { background: var(--primary-soft); }

.report-table tbody td {
  padding: 8px 13px;
  color: var(--color-text-row);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.report-table tbody td:last-child { border-right: none; }

.report-table tbody td:first-child {
  color: var(--muted);
  font-size: var(--text-xs);
}

@media (max-width: 960px) {
  :root {
    --sidebar-width: 260px;
  }

  .shop-select-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  /* Fejléc: keskeny nézetben a klaszterek ne fussanak egymásra — a szerep-badge
     és a profil-név elrejtve (a monogram marad), kisebb köz/padding. */
  .app-header { gap: 10px; padding: 0 14px; }
  .role-badge { display: none; }
  .header-profile-name { display: none; }
  .header-profile-chip { padding: 5px 8px 5px 5px; }

  .app-body {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .app-sidebar {
    width: 100%;
    border-top: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .app-content {
    overflow: visible;
  }

  .content-page-header {
    flex-wrap: wrap;
  }

  .content-region,
  .composer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  .send-button {
    width: 100%;
  }
}

@media (max-width: 460px) {
  .login-panel {
    padding: 24px;
  }

  .password-control {
    grid-template-columns: 1fr;
  }

  .brand-mark {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-product {
    padding-left: 0;
    border-left: 0;
  }
}

/* ===== SocialMedia: prompt-schema editor (admin.schema_edit) ===== */

.ps-editor {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-8);
  align-items: start;
  width: 100%;
}

.ps-list-pane {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 12px;
}

.ps-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ps-pane-head h3 {
  margin: 0;
  font-size: var(--text-md);
}

/* Category filter above the schema list (prompt_categories-driven tabs). */
.ps-list-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: 10px;
}

/* Required category select at the top of the schema editor body. */
.ps-category-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
}

.ps-category-row select {
  max-width: 220px;
}

.ps-list-item .ps-list-btn .badge {
  margin-left: var(--space-2);
}

.ps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ps-list-item .ps-list-btn {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius);
  padding: 7px 9px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.ps-list-item .ps-list-btn:hover {
  background: var(--primary-soft);
}

.ps-list-item.is-active .ps-list-btn {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: var(--weight-bold);
}

.ps-list-empty,
.ps-hint,
.ps-empty {
  color: var(--muted);
  font-size: var(--text-sm);
}

.ps-edit-pane {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 14px;
  min-width: 0;
}

.ps-edit-head {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.ps-current {
  font-weight: 750;
}

.ps-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-left: auto;
}

.ps-status {
  min-height: 18px;
  margin: 4px 0;
  font-size: var(--text-sm);
  color: var(--muted);
}

.ps-status.is-error {
  color: var(--color-danger);
}

.ps-edit-title {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

/* A séma egész szerkesztője egy függőleges folyam: mező-kártyák → "+ hozzáadás" → előnézet. */
.ps-edit-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.ps-tree {
  min-width: 0;
}

/* Mező = összecsukható kártya (a közös .card primitívre épül). */
.ps-card .card-head {
  flex-wrap: wrap;
}

.ps-card-title {
  flex: 1 1 200px;
  min-width: 140px;
  font-weight: var(--weight-medium);
}

.ps-type-select {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--color-surface-subtle);
  color: var(--color-text-strong);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 6px 8px;
  cursor: pointer;
}

/* A fel/le nyilak a drag-fogantyú melletti fallback — kompakt, halvány. */
.ps-move {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.ps-move-btn {
  width: 26px;
  height: 18px;
  color: var(--muted);
}

.ps-move-btn .icon-svg {
  width: 12px;
  height: 12px;
}

/* A technikai `name` háttérben: halvány azonosító-sor, igény esetén szerkeszthető. */
.ps-id-line {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-bottom: 8px;
}

.ps-id-line code {
  font-family: var(--font-mono);
  color: var(--color-text-strong);
}

.ps-id-edit {
  border: none;
  background: transparent;
  color: var(--color-focus);
  cursor: pointer;
  font: inherit;
  font-size: var(--text-xs);
  padding: 0;
}

.ps-field-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ps-field-help {
  font-size: var(--text-xs);
  color: var(--muted);
}

.ps-children {
  margin: 10px 0 0 14px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

.ps-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Értékkészlet: fejléces, párba rendezett opciósorok (megjelenő szöveg / érték a promptba). */
.ps-option {
  display: grid;
  grid-template-columns: 1fr 1fr 32px;
  gap: var(--space-4);
  align-items: center;
}

.ps-option-head {
  padding: 0 2px;
}

.ps-add-sub,
.ps-add-opt {
  margin-top: 10px;
}

.ps-add-opt {
  width: auto;
}

/* Előnézet: alapból olvasható Prompt-előnézet; a nyers JSON diszkrét kapcsoló mögött. */
.ps-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  padding: 12px 14px;
}

.ps-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: 10px;
}

.ps-preview-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-strong);
}

.ps-preview-tabs {
  display: flex;
  gap: var(--space-3);
}

.ps-preview-prompt {
  font-size: var(--text-base);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ps-pv-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.ps-pv-label {
  color: var(--muted);
}

.ps-pv-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

.ps-preview-json {
  margin: 0;
  max-height: 50vh;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--color-text-row);
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 900px) {
  .ps-editor {
    grid-template-columns: 1fr;
  }
}

/* Általános gomb-variánsok — a SocialMedia image editor (és bárki) használja. */
.ps-btn {
  border: 1px solid var(--line);
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 6px 10px;
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
  color: inherit;
}

.ps-btn:hover {
  background: var(--primary-soft);
}

.ps-btn.ps-mini {
  padding: 3px 7px;
  font-size: var(--text-xs);
}

.ps-btn.ps-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--color-on-primary);
}

.ps-btn.ps-primary:hover {
  filter: brightness(0.96);
}

.ps-btn.ps-danger {
  color: var(--color-danger);
}

.ps-btn.ps-danger:hover {
  background: var(--c-red-100);
}

/* ===== SocialMedia: image editor (creative.image_editor) ===== */

.img-editor {
  width: 100%;
}

.img-tabs {
  display: flex;
  gap: var(--space-2);
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.img-tab {
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 9px 14px;
  font: inherit;
  cursor: pointer;
  color: var(--muted);
}

.img-tab:hover {
  background: var(--primary-soft);
}

.img-tab.is-active {
  background: var(--color-surface);
  border-color: var(--line);
  color: var(--primary);
  font-weight: var(--weight-bold);
}

/* === Prompt Garden ====================================================================== */
/* A lista + szerkesztő nézet apró elrendezés-segédei; minden más a közös primitívekből jön
   (.ff-table, .img-field, .img-tabs, .ps-btn, .empty-state). */

.garden-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.garden-toolbar .img-tabs {
  margin-bottom: 0;
}

.garden-editor {
  max-width: 720px;
}

/* Name cell rendered as an inline link-style button (no native button chrome). */
.garden-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--primary);
  font-weight: var(--weight-bold);
  cursor: pointer;
  text-align: left;
}

.garden-link:hover {
  text-decoration: underline;
}

.garden-actions {
  white-space: nowrap;
}

.garden-actions .ps-btn {
  margin-right: var(--space-2);
}

.garden-missing {
  color: var(--color-danger);
  font-size: var(--text-xs);
}

/* === Kép-készítő v2 + Archívum ========================================================== */
/* Prompt-mód választó (galéria / szabad szöveg), inline mentési panel, archívum-lightbox.
   A többi a meglévő img-* / ff-table / empty-state primitívekből jön. */

.img-mode {
  display: flex;
  gap: var(--space-9);
  flex-wrap: wrap;
  padding: var(--space-4) 0;
}

.img-mode-opt {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  color: var(--color-text-strong);
}

.img-save-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-7);
  margin-top: var(--space-6);
  background: var(--color-surface-raised);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  padding: var(--space-9);
}

.img-lightbox-panel {
  background: var(--color-surface);
  border-radius: var(--radius);
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.img-lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  padding: var(--space-6) var(--space-7);
  border-bottom: 1px solid var(--line);
  color: var(--color-text-strong);
  font-weight: var(--weight-bold);
}

.img-lightbox-panel img {
  max-width: 86vw;
  max-height: 78vh;
  object-fit: contain;
}

.img-pane {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
  max-width: 760px;
}

.img-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: var(--text-sm);
  font-weight: 650;
}

.img-textarea {
  resize: vertical;
  min-height: 84px;
  font-weight: var(--weight-regular);
}

/* Tall multiline boxes on Tab 1: free-text prompt + generated-prompt preview (>= ~15 rows). */
.img-textarea-tall {
  min-height: 320px;
  line-height: 1.45;
}

.img-textarea-tall[readonly] {
  background: var(--color-surface-inset);
  color: var(--ink);
}

.img-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--color-surface-subtle-2);
}

/* A "none"-type schema field: fixed prompt text, shown as a marker (no input). */
.img-fixed {
  flex-direction: row;
  align-items: baseline;
  gap: var(--space-4);
}

/* A "text"/"multiline" schema field: predefined value shown read-only as "label: value". */
.img-fixed-pair {
  flex-wrap: wrap;
}

.img-fixed-key {
  font-weight: 650;
}

.img-fixed-val {
  font-weight: var(--weight-regular);
  white-space: pre-wrap;
}

.img-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.img-group > legend {
  padding: 0 6px;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--primary);
  text-transform: uppercase;
}

.img-req {
  color: var(--color-danger);
}

.img-buttons {
  display: flex;
  gap: var(--space-4);
}

.img-result {
  position: relative;
  min-height: 220px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--color-surface-inset);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  overflow: hidden;
}

.img-placeholder {
  color: var(--muted);
  font-size: var(--text-sm);
  text-align: center;
}

.img-output {
  max-width: 100%;
  max-height: 460px;
  border-radius: var(--radius);
}

.img-progress {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  height: 6px;
  background: var(--line);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.img-progress span {
  display: block;
  height: 100%;
  width: 40%;
  background: var(--primary);
  border-radius: var(--radius-pill);
  animation: img-indeterminate 1.1s infinite ease-in-out;
}

@keyframes img-indeterminate {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(320%); }
}

.img-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-7);
}

.img-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.img-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
  font-weight: 650;
}

@media (max-width: 900px) {
  .img-split {
    grid-template-columns: 1fr;
  }
}

/* ===== SocialMedia: video creator (creative.video_editor) =====
   Reuses the image-editor layout (.img-*); only the result media is a <video> player. */

.vid-output {
  width: 100%;
  max-height: 460px;
  background: #000;
}

.img-lightbox-panel video {
  max-width: 86vw;
  max-height: 78vh;
}

/* ===== SocialMedia: post creator (creative.post_editor) =====
   Two styled platform cards (Instagram + Meta). The platform accent colours below are
   third-party BRAND identities (not theme tokens) — they must not recolour with the app theme. */

.post-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-7);
}

.post-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--color-surface);
  overflow: hidden;
}

.post-card-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  font-weight: var(--weight-bold);
  color: #fff;
}

.post-card-head .ti {
  font-size: 1.15em;
}

/* Instagram brand gradient + Meta brand blue (third-party identities). */
.post-card-instagram .post-card-head {
  background: linear-gradient(95deg, #f58529, #dd2a7b 45%, #8134af 75%, #515bd4);
}

.post-card-meta .post-card-head {
  background: #1877f2;
}

.post-card-body {
  position: relative;
  flex: 1;
  min-height: 180px;
  padding: var(--space-6);
}

.post-text {
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: var(--text-sm);
  color: var(--color-text);
}

.post-hashtag {
  color: var(--primary);
  font-weight: 650;
}

.post-empty {
  color: var(--muted);
  font-size: var(--text-sm);
  font-style: italic;
}

.img-lightbox-panel .post-cards {
  padding: var(--space-7);
  max-width: 86vw;
  max-height: 78vh;
  overflow: auto;
}

@media (max-width: 900px) {
  .post-cards {
    grid-template-columns: 1fr;
  }
}

/* ===== SocialMedia: SEO content creator (seo.keyword_research / seo.topic_research / seo.content_generation) ===== */

.seo-actions-cell { display: flex; gap: var(--space-3); flex-wrap: wrap; }

.seo-form,
.seo-readonly,
.seo-topic-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin: var(--space-5) 0;
}

.seo-readonly {
  gap: 4px;
  padding: var(--space-5) var(--space-6);
  background: var(--color-surface-inset);
  border-radius: var(--radius);
  font-size: var(--text-sm);
}

/* Generation phase steps */
.seo-phases {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  margin: var(--space-6) 0;
}
.seo-phase {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
}
.seo-phase-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--line);
}
.seo-phase-active { color: var(--primary); }
.seo-phase-active .seo-phase-dot { background: var(--primary); animation: img-indeterminate 1.1s infinite ease-in-out; }
.seo-phase-done { color: var(--color-text-strong); }
.seo-phase-done .seo-phase-dot { background: var(--primary); }
.seo-phase-error { color: var(--color-danger); }
.seo-phase-error .seo-phase-dot { background: var(--color-danger); }

/* Result panels */
.seo-result { display: flex; flex-direction: column; gap: var(--space-7); margin-top: var(--space-7); }
.seo-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-6) var(--space-7);
  background: var(--color-surface);
}
.seo-panel > h3 { margin: 0 0 var(--space-5); }
.seo-panel > summary { font-weight: var(--weight-bold); cursor: pointer; }
.seo-report h4 { margin: var(--space-6) 0 var(--space-3); }

/* Rulebook admin-diagnostics panel (agency_admin only): effective composed rulebook + brand book. */
.seo-rb-debug h4 { margin: var(--space-5) 0 var(--space-2); font-size: var(--text-sm); }
.seo-rb-pre {
  margin: 0;
  padding: var(--space-4);
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: var(--text-xs);
  background: var(--color-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.seo-title-opts { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-5); }
.seo-title-opt { font-size: var(--text-sm); }

.seo-article-frame {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  margin: var(--space-5) 0;
}

.seo-hero {
  max-width: 100%;
  max-height: 280px;
  border-radius: var(--radius);
}

.seo-archive-view { display: flex; flex-direction: column; gap: var(--space-6); max-width: 86vw; width: 760px; max-height: 80vh; overflow: auto; padding: var(--space-6); }
.seo-archive-head { border: 0; }

/* ---- SEO content creator module: topic table, keyword wizard, result pager, settings ---- */

.seo-toolbar-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.seo-check-cell { width: 2.5rem; text-align: center; }

/* Keyword wizard: seed form + suggestion tables */
.seo-wizard-form { display: flex; flex-direction: column; gap: var(--space-5); max-width: 520px; }
.seo-wizard-table { width: 100%; }
.seo-topic-groups { display: flex; flex-direction: column; gap: var(--space-6); margin: var(--space-5) 0; }
.seo-topic-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-5) var(--space-6);
  background: var(--color-surface);
}
.seo-topic-group h4 { margin: 0 0 var(--space-4); }
.seo-topic-check { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-2) 0; font-size: var(--text-sm); }

/* Keyword wizard step 1: source selector (AI / DataForSEO) */
.seo-source-select { display: flex; flex-direction: column; gap: var(--space-2); }
.seo-source-select .img-field-label { font-size: var(--text-sm); color: var(--muted); }
.seo-source-checks { display: flex; flex-wrap: wrap; gap: var(--space-5); }
.seo-source-check { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
.seo-source-check.is-disabled { color: var(--muted); }

/* Generation setup: topic checklist */
.seo-topic-select {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
}

/* Result pager (multi-topic) + resolved (saved/discarded) state */
.seo-pager { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-5); }
.seo-pager-info { font-size: var(--text-sm); color: var(--muted); }
.seo-result-actions { flex-wrap: wrap; }
.seo-resolved {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

/* Title-options label (the radio list = the article's SEO title choices) */
.seo-title-label { display: block; font-size: var(--text-sm); font-weight: var(--weight-bold); margin-bottom: var(--space-3); }

/* Visible generation progress (sequential, per-topic) */
.seo-generating { display: flex; align-items: center; gap: var(--space-6); padding: var(--space-9) var(--space-6); }
.seo-generating h3 { margin: 0 0 var(--space-3); }
.seo-generating-spinner {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  animation: seo-spin 0.9s linear infinite;
}
@keyframes seo-spin { to { transform: rotate(360deg); } }

/* Client settings editors (brand book + rulebook extension): big textarea */
.seo-settings-textarea { width: 100%; min-height: 320px; resize: vertical; font-family: var(--font-mono, monospace); }

/* ===========================================================================
   Admin CRUD surface (agency_admin only). Central stylesheet — no per-app CSS.
   =========================================================================== */

.admin-tile .status-pill {
  background: var(--primary-soft);
  color: var(--primary);
}

.admin-screen {
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 28px 48px;
  display: flex;
  flex-direction: column;
  gap: var(--space-9);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.admin-tab {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-weight: var(--weight-semibold);
}

.admin-tab:hover {
  border-color: var(--line-strong);
}

.admin-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--color-on-primary);
}

.admin-message {
  margin: 0;
  min-height: 18px;
  font-size: var(--text-base);
  color: var(--primary);
}

.admin-message.is-error {
  color: var(--error);
}

.admin-content {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  margin-bottom: 14px;
}

.admin-toolbar h2 {
  margin: 0;
  font-size: var(--text-xl);
}

/* Layer 2 insights admin tab: manual "Frissítés most" controls + run log. */
.admin-help {
  color: var(--muted);
  font-size: var(--text-sm);
  margin: 0 0 12px;
}

.admin-insights-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-7);
  margin-bottom: 18px;
}

.admin-insights-controls label {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--muted);
}

.admin-insights-controls select {
  min-width: 200px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: inherit;
  font-size: var(--text-base);
}

/* Kulcsszó-API hitelesítő űrlap (DataForSEO) — egyoszlopos, széles beviteli mezők. */
.admin-kw-form {
  flex-direction: column;
  align-items: flex-start;
}

.admin-kw-form input {
  min-width: 340px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: inherit;
  font-size: var(--text-base);
}

.admin-insights-error {
  white-space: normal;
  max-width: 320px;
  color: var(--c-red-500);
  font-size: var(--text-xs);
}

.admin-empty {
  color: var(--muted);
  text-align: center;
  padding: 22px 12px;
}

.admin-actions-cell {
  display: flex;
  gap: var(--space-4);
}

.admin-row-action {
  padding: 5px 12px;
  font-size: var(--text-sm);
}

.admin-row-delete {
  color: var(--error);
  border-color: var(--error);
}

.admin-row-delete:hover {
  background: var(--error-soft);
}

/* Modal (forms + delete confirm) */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  z-index: 1000;
  overflow-y: auto;
}

.admin-modal-panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 540px;
  padding: 22px 24px;
}

.admin-confirm-panel {
  max-width: 480px;
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  margin-bottom: 16px;
}

.admin-modal-header h3 {
  margin: 0;
  font-size: var(--text-lg);
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.admin-form-section {
  margin: 14px 0 2px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-strong);
}

/* M:N hozzárendelés — kereshető chip/tag multi-select (datasource↔kliens, mindkét irányból) */
.admin-tags {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--color-surface-subtle, var(--panel));
}
.admin-tags-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-tags-empty { color: var(--color-text-muted); font-size: var(--text-sm); }
.admin-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px 2px 10px;
  background: var(--color-primary, var(--primary));
  color: #fff;
  border-radius: 999px;
  font-size: var(--text-sm);
}
.admin-tag-x {
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 1.05em;
  line-height: 1;
  padding: 0 2px;
}
.admin-tag-x:hover { opacity: 0.7; }
.admin-tags-input { position: relative; }
.admin-tags-search {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.admin-tags-dropdown {
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  margin-top: 2px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--color-surface, #fff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.admin-tags-option {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 7px 10px;
  cursor: pointer;
  font-size: var(--text-sm);
}
.admin-tags-option:hover { background: var(--color-surface-subtle, var(--panel)); }

.admin-field label {
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
}

.admin-field input[type="text"],
.admin-field input[type="password"],
.admin-field select,
.admin-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  background: var(--color-surface);
  color: var(--text);
}

.admin-field textarea {
  resize: vertical;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.admin-field-check label {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-weight: var(--weight-medium);
}

.admin-app-visibility { display: flex; flex-direction: column; gap: var(--space-2); }

.admin-app-hidden-toggle {
  margin-left: var(--space-16);
  font-weight: var(--weight-regular);
  font-size: var(--text-sm);
  color: var(--muted);
}

.admin-app-hidden-toggle:has(input:disabled) { opacity: 0.5; }

.admin-field-help {
  color: var(--muted);
  font-size: var(--text-xs);
}

.admin-secret-status {
  color: var(--muted);
  font-weight: var(--weight-medium);
}

.admin-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-5);
  margin-top: 4px;
}

.admin-form-error {
  margin: 0;
  min-height: 0;
}

.danger-button {
  border: 1px solid var(--error);
  background: var(--error);
  color: var(--color-on-primary);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-weight: 650;
}

.danger-button:hover {
  background: var(--color-danger-hover);
}

.danger-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.admin-confirm-body {
  font-size: var(--text-base);
  line-height: 1.5;
}

.admin-impact-list {
  margin: 8px 0;
  padding-left: 20px;
}

.admin-impact-nested {
  color: var(--muted);
  font-size: var(--text-sm);
}

.admin-warn {
  color: var(--error);
  font-weight: var(--weight-semibold);
}

/* ============================================================================================
   Mini-PIM (prompt-admin sub-nav + terméktáblázat + ellenőrző ablak)
   ============================================================================================ */

/* Prompt-admin sub-navigation (Promptok tab inner switching) */
.admin-subnav {
  display: flex;
  gap: var(--space-4);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-subtab {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

.admin-subtab.is-active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.admin-assignment-client {
  max-width: 360px;
  margin-bottom: 14px;
}

.admin-assignment-select {
  min-width: 240px;
}

/* Mini-PIM table view */
.pim {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}

/* Mini-PIM ellenőrző ablak (a táblázatot az újrahasználható .dg-* adatrács adja). */
.pim-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.pim-count {
  color: var(--muted);
  font-size: var(--text-sm);
}

/* Mini-PIM: a már legyártott tartalmú termékek sor-kiemelése (DataGrid rowClass="pim-has-content";
   a has_content backend-mező alapján). Jól látható zöld háttér + zöld bal-jelölő. A `.dg-grid`
   scope a frozen cella- és hover-háttér fölé visz (különben elnyomnák a kiemelést). */
.dg-grid tbody tr.pim-has-content td {
  background: rgba(94, 158, 46, 0.22);
}
/* A fixált (sticky) oszlop háttere ÁTLÁTSZATLAN kell legyen: vízszintes görgetéskor a mögé úszó
   cellák különben átütnek a féláttetsző zöldön. A #dcead1 a 22% zöld fehérre olvasztott tömör párja
   (a hover a 30%-é: #cfe2c0) — vizuálisan azonos, de takar. */
.dg-grid tbody tr.pim-has-content td.dg-frozen {
  background: #dcead1;
}

.dg-grid tbody tr.pim-has-content:hover td {
  background: rgba(94, 158, 46, 0.30);
}
.dg-grid tbody tr.pim-has-content:hover td.dg-frozen {
  background: #cfe2c0;
}

.dg-grid tbody tr.pim-has-content td:first-child {
  box-shadow: inset 4px 0 0 0 var(--color-primary, var(--primary));
}

.pim-generate-label {
  margin: 0;
  font-weight: 650;
}

.pim-col-check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-base);
}

.pim-generate-msg {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

/* Column config modal */
.pim-col-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 8px 0;
}

.pim-content-link {
  color: var(--primary);
  font-weight: var(--weight-semibold);
}

.pim-publish {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-5);
}

.pim-publish .pim-generate-label {
  width: 100%;
}

.pim-content-text {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--panel-muted);
  border-radius: var(--radius);
  padding: 14px;
  font-size: var(--text-sm);
  line-height: 1.5;
  max-height: 60vh;
  overflow: auto;
}

/* ============================================================================================
   REUSABLE UI PRIMITIVES — single definition, reused across the whole app set.
   Added for the Mini-PIM data-grid + prompt-editor redesign; usable anywhere.
   Style comes only from here (no per-app CSS, no inline style) — components reference tokens.
   ============================================================================================ */

/* Inline SVG icons inherit color/size via currentColor; sized centrally here. */
.icon-svg {
  width: 16px;
  height: 16px;
  display: block;
  flex: none;
}

/* Small type/status marker (e.g. field type, product state). */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 2px 9px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted);
  color: var(--color-text-strong);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.badge.is-accent {
  background: var(--primary-soft);
  color: var(--primary);
}

/* Neutral context chip + accent (value-pill) variant. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 3px 9px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--color-surface-subtle);
  color: var(--color-text-strong);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.chip-accent {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: transparent;
}

/* Accessible on/off switch. Markup: <label class="toggle"><input type="checkbox"><span class="toggle-track"></span> label</label> */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-strong);
  cursor: pointer;
  user-select: none;
}

.toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: var(--line-strong);
  transition: background 0.15s ease;
  flex: none;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: 0 1px 2px var(--c-shadow);
  transition: left 0.15s ease;
}

.toggle input:checked + .toggle-track {
  background: var(--primary);
}

.toggle input:checked + .toggle-track::after {
  left: 16px;
}

.toggle input:focus-visible + .toggle-track {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Square, icon-only button (32px). */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  flex: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text-strong);
  cursor: pointer;
  line-height: 1;
}

.icon-btn:hover {
  background: var(--panel-muted);
}

.icon-btn.is-danger {
  color: var(--color-danger);
}

.icon-btn.is-danger:hover {
  background: var(--color-danger-soft);
}

.icon-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Dashed "+ add" affordance, full width. */
.add-dashed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  padding: 11px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: var(--text-base);
  cursor: pointer;
}

.add-dashed:hover {
  background: var(--color-surface-subtle);
  color: var(--color-text-strong);
}

/* Collapsible card. Markup: <div class="card"><div class="card-head">…</div><div class="card-body">…</div></div> */
.card {
  background: var(--color-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.card-body {
  margin-top: 10px;
}

.card.is-collapsed .card-body {
  display: none;
}

.card-grip {
  color: var(--muted);
  cursor: grab;
  border-color: transparent;
  background: transparent;
}

.card-grip:active {
  cursor: grabbing;
}

.card.is-dragging {
  opacity: 0.55;
}

.card.is-drop-target {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.card-chevron {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  transition: transform 0.15s ease;
}

.card.is-collapsed .card-chevron {
  transform: rotate(-90deg);
}

/* ============================================================================================
   REUSABLE DATA GRID — config-driven grid component (app/static/datagrid.js).
   Built on the shared .data-table/.data-table-wrapper; adds frozen columns, per-column filter
   row, hover bubble, row expand, contextual action bars and a full-window mode. The Mini-PIM
   product table is one instance; other lists (orders, customers, …) can reuse it.
   Frozen-column left offsets are passed as DATA via the --dg-left custom property (same pattern
   as the sync progress bar's --sync-progress) — never as inline formatting.
   ============================================================================================ */

.dg {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.dg-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.dg-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.dg-search {
  flex: 1 1 320px;
  max-width: 560px;
  position: relative;
  display: flex;
  align-items: center;
}
.dg-search-icon {
  position: absolute;
  left: 12px;
  font-size: 18px;
  color: var(--color-text-muted, var(--muted));
  pointer-events: none;
}
.dg-search-input {
  flex: 1;
  padding-left: 38px;
}

/* Jobb oldali klaszter: darabszám · elválasztó · Oszlopok · Teljes ablak (a screenshot szerint). */
.dg-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-left: auto;
  flex-wrap: wrap;
}
.dg-toolbar-sep {
  width: 1px;
  align-self: stretch;
  min-height: 22px;
  background: var(--color-border, var(--line));
}

.dg-count {
  color: var(--muted);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.dg-count strong {
  color: var(--primary-hover);
  font-weight: var(--weight-semibold);
}

.dg-check-col {
  width: 40px;
  text-align: center;
}

/* Grid-specific z-index layering on top of the reused .data-table sticky header. */
.dg-grid {
  width: max-content;
  min-width: 100%;
}

.dg-grid thead th {
  z-index: 3;
}

.dg-grid td {
  vertical-align: middle;
}

.dg-grid th.is-right,
.dg-grid td.is-right {
  text-align: right;
}

/* Per-column width carried as DATA via --dg-w (same pattern as --sync-progress / --dg-left). */
.dg-sized {
  width: var(--dg-w);
  min-width: var(--dg-w);
  max-width: var(--dg-w);
}

.dg-grid tbody tr:hover td {
  background: var(--color-surface-subtle);
}

.dg-frozen {
  position: sticky;
  left: var(--dg-left, 0);
  z-index: 2;
  background: var(--color-surface);
}

.dg-grid thead th.dg-frozen {
  z-index: 5;
  background: var(--color-surface-raised);
}

.dg-grid tbody tr:hover td.dg-frozen {
  background: var(--color-surface-subtle);
}

.dg-frozen.is-edge::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  background: var(--line-strong);
}

/* Per-column filter row (second header row), sticky just below the header row. */
.dg-filter-row th {
  top: var(--dg-head-h, 38px);
  background: var(--color-surface-subtle);
  padding: 6px 10px;
  text-transform: none;
  font-weight: var(--weight-regular);
}

.dg-filter-input {
  width: 100%;
  min-width: 64px;
  font: inherit;
  font-size: var(--text-xs);
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--text);
}

.dg-filter-input:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.dg-filter-range {
  display: flex;
  gap: 4px;
}

/* Text-oszlop szűrő: típusváltó (tartalmaz / üres / nem üres) + szövegmező egy sorban. */
.dg-filter-text {
  display: flex;
  gap: 4px;
  align-items: center;
}

.dg-filter-op {
  font: inherit;
  font-size: var(--text-xs);
  padding: 4px 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--text-muted);
  flex: 0 0 auto;
  max-width: 92px;
}

.dg-filter-op:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.dg-filter-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Generikus PIM-akció paraméter-modál (a leszűrt táblából indított tömeges művelet előtt). */
.pim-modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 64px 16px;
  z-index: 1100;
  overflow-y: auto;
}

.pim-modal {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 460px;
  padding: 20px 22px;
}

.pim-modal h3 {
  margin: 0 0 14px;
}

.pim-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pim-modal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.pim-modal-field input,
.pim-modal-field select {
  font: inherit;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--text);
}

.pim-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

/* Single-line truncated cell + JS-positioned hover bubble. The clip bound comes from the
   column's --dg-w (.dg-sized); a default caps un-sized columns. */
.cell-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.cell-truncate.dg-sized {
  max-width: var(--dg-w);
}

.cell-tooltip {
  position: fixed;
  z-index: 1100;
  max-width: 320px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--line-strong);
  box-shadow: 0 2px 12px var(--c-shadow);
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--text);
  pointer-events: none;
}

/* Row-expand toggle + detail row. */
.dg-expand {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px 0 0;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.dg-detail-row td {
  background: var(--color-surface-subtle);
}

.dg-detail {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 6px 16px;
  padding: 4px 2px;
  font-size: var(--text-sm);
}

.dg-detail-key {
  color: var(--muted);
}

.dg-detail-val {
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.dg-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-7);
  color: var(--muted);
  font-size: var(--text-sm);
}

/* Contextual action bar — shown on selection, above the table and stuck to the bottom. */
.action-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-6);
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  background: var(--primary-soft);
  border: 1px solid var(--c-green-tint);
}

.action-bar-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--primary-hover);
}

.action-bar-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.action-bar-hint {
  font-size: var(--text-xs);
  color: var(--primary-hover);
}

.action-bar.is-sticky-bottom {
  position: sticky;
  bottom: 0;
  z-index: 30;
  box-shadow: 0 -2px 10px var(--c-shadow);
}

/* Rectangular on/off chip (e.g. content-type pick in the Mini-PIM bulk action). */
.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px 11px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--color-surface);
  color: var(--muted);
  font-size: var(--text-xs);
  cursor: pointer;
}

.toggle-chip.is-on {
  background: var(--primary-soft);
  color: var(--primary-hover);
  border-color: transparent;
}

/* Full-window mode: hide the portal sidebar so a wide, many-column grid gets the whole width.
   The shell is flex now (.app-body row of .app-sidebar + .app-content), so hiding the sidebar
   lets the content take the full width on its own. */
body.is-grid-maximized .app-sidebar {
  display: none;
}

/* ── PRICING ─────────────────────────────────────────────── */
.pricing-wrap {
  background: var(--navy);
  min-height: 100%;
  padding: 40px 28px;
}

.pricing-title {
  text-align: center;
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: #fff;
  margin-bottom: 8px;
}

.pricing-subtitle {
  text-align: center;
  font-size: var(--text-md);
  color: rgba(255,255,255,0.40);
  margin-bottom: 32px;
}

.pricing-grid {
  display: grid;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
}

.pricing-col-head {
  padding: 22px 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  border-right: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.pricing-col-head:last-child { border-right: none; }

.pricing-col-featured { background: var(--green); }

.pricing-col-cta { background: rgba(255,255,255,0.06); }

.pricing-plan-badge {
  display: inline-block;
  font-size: 11px; font-weight: var(--weight-bold);
  letter-spacing: 0.4px; text-transform: uppercase;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.75);
  border-radius: var(--radius-pill);
  padding: 3px 10px; margin-bottom: 8px;
}

.pricing-col-featured .pricing-plan-badge {
  background: rgba(255,255,255,0.25); color: #fff;
}

.pricing-plan-name {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: rgba(255,255,255,0.85);
  margin-bottom: 5px;
}

.pricing-col-featured .pricing-plan-name { color: #fff; }

.pricing-plan-price {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: #fff;
}

.pricing-plan-price em {
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  color: rgba(255,255,255,0.38);
  font-style: normal;
}

.pricing-plan-sub {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.32);
  margin-top: 3px;
}

.pricing-col-featured .pricing-plan-sub { color: rgba(255,255,255,0.60); }

.pricing-btn {
  margin-top: 14px; width: 100%;
  border-radius: var(--radius);
  padding: 10px;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  font-family: var(--font-sans);
  cursor: pointer;
}

.pricing-btn-outline {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.75);
}

.pricing-btn-primary {
  background: #fff; color: var(--navy);
  border: none; font-weight: var(--weight-bold);
}

.pricing-btn-ghost {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.45);
}

.pricing-section {
  grid-column: 1 / -1;
  background: rgba(255,255,255,0.03);
  border-top: 1px solid rgba(255,255,255,0.07);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 9px 16px;
  font-size: 11px; font-weight: var(--weight-bold);
  letter-spacing: 0.5px; text-transform: uppercase;
  color: rgba(255,255,255,0.28);
}

.pricing-row { display: contents; }

.pricing-row:hover > .pricing-cell { background: rgba(255,255,255,0.04); }
.pricing-row:hover > .pricing-cell-featured { background: rgba(127,184,61,0.18); }

.pricing-cell {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center;
  background: transparent;
}

.pricing-cell:last-child { border-right: none; }

.pricing-cell-label {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  border-right: 1px solid rgba(255,255,255,0.09);
}

.pricing-cell-featured {
  background: rgba(127,184,61,0.09);
  border-right: 1px solid rgba(255,255,255,0.09);
}

.pricing-cell-cta { background: rgba(255,255,255,0.02); }

.pricing-feat-name {
  font-size: var(--text-md);
  color: rgba(255,255,255,0.78);
  font-weight: var(--weight-medium);
}

.pricing-feat-desc {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.28);
  line-height: 1.4;
}

.pricing-check { color: var(--green); font-size: 20px; font-weight: var(--weight-bold); }
.pricing-cross { color: rgba(255,255,255,0.15); font-size: 18px; }

.pricing-qty {
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
  color: rgba(255,255,255,0.72);
  background: rgba(255,255,255,0.10);
  border-radius: var(--radius-pill);
  padding: 3px 11px; white-space: nowrap;
}

.pricing-cell-featured .pricing-qty {
  background: rgba(127,184,61,0.25); color: #d4f0a0;
}

.pricing-unlimited {
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
  background: rgba(127,184,61,0.15); color: var(--green);
  border-radius: var(--radius-pill); padding: 3px 11px;
}

.pricing-cell-featured .pricing-unlimited {
  background: rgba(127,184,61,0.28); color: #c8e89a;
}

.pricing-custom {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.28);
  font-style: italic;
}

/* Pricing — standalone pre-login view + login-page link + back button */
.pricing-view {
  min-height: 100vh;
  overflow-y: auto;
  background: var(--navy);
}

.pricing-link {
  margin-top: 2px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-family: var(--font-sans);
  cursor: pointer;
  text-align: center;
  transition: color var(--transition-fast);
}

.pricing-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.pricing-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.75);
  border-radius: var(--radius);
  padding: 7px 14px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.pricing-back:hover { background: rgba(255,255,255,0.14); }

/* ============================================================================
   Batch tartalomgyártás (Mini-PIM × SocialMedia): előkészítő mátrix + státusz oldal
   ============================================================================ */

.batch { display: grid; gap: var(--space-6); }

/* A mátrix celláiban kompakt dropdownok; az oszlop-fejléc "Összes beállítása" kisebb. */
.batch-matrix select { width: 100%; min-width: 120px; }
.batch-matrix .batch-default { font-size: var(--text-xs, 12px); font-weight: var(--weight-regular, 400); margin-top: var(--space-4); }
.batch-remove { padding: 2px 10px; line-height: 1; }

/* "Képek száma" batch-szintű 1/2/3 váltó (SPEC-pim-tobbkepes-termekgeneralas.md). */
.batch-imgcount { display: flex; align-items: center; gap: var(--space-3); margin-left: var(--space-6); }
.batch-imgcount-label { font-size: var(--text-sm); color: var(--muted); margin: 0; }
.batch-imgcount .ghost-button { padding: 2px 12px; min-width: 32px; }
.batch-imgcount .ghost-button.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
/* image_2/image_3 oszlop rejtése a "Képek száma" váltónál (batch_prepare.js, nincs inline style). */
.imgcol-hidden { display: none; }

.batch-actions { display: flex; align-items: center; gap: var(--space-6); }

/* Státusz oldal: összesítő sor + progress (a --sync-progress mintát követi, világos sávon). */
.batch-summary { display: flex; align-items: center; gap: var(--space-6); flex-wrap: wrap; }
.batch-progress {
  flex: 1 1 220px;
  height: 8px;
  min-width: 160px;
  overflow: hidden;
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}
.batch-counts { font-size: var(--text-sm); color: var(--text); }

/* Státusz-badge (job-szintű) + tétel-szintű állapotjelzés. */
.batch-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  background: var(--panel-muted);
  color: var(--text);
}
.batch-badge.is-running { background: var(--c-green-tint); color: var(--color-primary-hover); }
.batch-badge.is-done { background: var(--color-primary-soft); color: var(--color-primary-hover); }
.batch-badge.is-error { background: var(--error-soft); color: var(--error); }

/* v2 — Mini-PIM bulk-sáv: a kijelölt termékek művelet-csoportja (ikon + címke + gomb). */
.batch-bulkbar { display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; }
.batch-bulk-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--muted);
}

/* v2 — letiltott oszlop (nincs batch-generátor / aktív modell): halvány fejléc + tiltott cellák. */
.batch-matrix th.batch-col-off { color: var(--muted); }
.batch-matrix th.batch-col-off .ti-alert-triangle { color: var(--error); }
.batch-matrix td.batch-col-off select { opacity: 0.5; cursor: not-allowed; }

/* v2 — eredmény-mátrix cella-státuszok (ikon + szín); a done cella kattintható link. */
.batch-cell-st { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.batch-cell-st.is-pending { color: var(--muted); }
.batch-cell-st.is-running { color: var(--color-primary-hover); }
.batch-cell-st.is-done { color: var(--color-primary-hover); text-decoration: none; font-size: var(--text-md); }
.batch-cell-st.is-error { color: var(--error); font-size: var(--text-xs, 12px); }
.batch-cell-st.is-running .ti-loader-2 { animation: batch-spin 0.9s linear infinite; }
.batch-cell-empty { color: var(--muted); text-align: center; }
@keyframes batch-spin { to { transform: rotate(360deg); } }

/* v2 — poszt-cella lightbox nézet (Meta + Instagram szöveg kártyákban). */
.batch-post-view { display: grid; gap: var(--space-5); }
.batch-post-view .post-card { padding: var(--space-5); }
.batch-post-view .post-card h4 { margin: 0 0 var(--space-4); font-size: var(--text-sm); color: var(--muted); }
.batch-post-view .post-card p { margin: 0; white-space: pre-wrap; }

/* ============================================================================
   === BATCH MODEL ROW ===
   v3 — provider/modell-választó sor a mátrix FEJLÉCÉBEN: content_type-onként egy
   kompakt dropdown, pontosan az oszlop szélességéhez illesztve (a th-ban ül).
   ============================================================================ */

.batch-matrix .batch-model-headrow th {
  background: var(--panel-muted);
  padding: var(--space-4);
  vertical-align: middle;
}
.batch-model-corner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--muted);
  white-space: nowrap;
}
/* A dropdown az oszlop teljes szélességét kitölti; ha a provider nem fér ki, lenyitáskor látszik. */
.batch-model-cell select { width: 100%; max-width: 100%; }

/* A „Termék neve" cella egy sorban marad (mint a Mini-PIM rácsban); túlcsordulás → ellipszis,
   a teljes név egér ráhúzáskor (title) látszik. */
.batch-matrix .batch-prod-name {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === BATCH PREVIEW ===
   v3 — dry-run előnézet popup (lapozós, type-tabos): feldolgozott prompt + CURL.
   A .img-lightbox overlay-re épül; itt csak a panel belső szerkezete. */

.batch-preview-modal .batch-pv-panel {
  width: min(820px, 94vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-6);
  text-align: left;
}
.batch-pv-head { display: flex; align-items: center; gap: var(--space-5); }
.batch-pv-title { flex: 1; font-weight: var(--weight-medium); color: var(--text); }
.batch-pv-nav { padding: 2px 10px; line-height: 1; }
.batch-pv-close { margin-left: auto; }

.batch-pv-tabs { display: flex; flex-wrap: wrap; gap: var(--space-4); border-bottom: 1px solid var(--line); padding-bottom: var(--space-4); }
.batch-pv-tab {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel);
  color: var(--muted);
  font-size: var(--text-sm);
  cursor: pointer;
}
.batch-pv-tab.is-active { background: var(--color-primary-soft); color: var(--color-primary-hover); border-color: transparent; }

.batch-pv-body { overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-4); }
.batch-pv-label { font-size: var(--text-xs, 12px); font-weight: var(--weight-medium); color: var(--muted); }
.batch-pv-prompt {
  width: 100%;
  resize: vertical;
  font-family: var(--font-mono, monospace);
  font-size: var(--text-sm);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 8px);
  background: var(--panel-muted);
  color: var(--text);
}
.batch-pv-img { margin: 0; font-size: var(--text-xs, 12px); color: var(--muted); word-break: break-all; }
.batch-pv-curlhead { display: flex; align-items: center; gap: var(--space-5); }
.batch-pv-curl {
  margin: 0;
  white-space: pre;
  overflow-x: auto;
  font-family: var(--font-mono, monospace);
  font-size: var(--text-xs, 12px);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 8px);
  background: var(--navy, #102A3D);
  color: #e6edf3;
}
.batch-pv-copymsg { font-size: var(--text-xs, 12px); color: var(--color-primary-hover); }
.batch-pv-foot { display: flex; align-items: center; gap: var(--space-6); flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: var(--space-5); }
.batch-pv-warn { display: inline-flex; align-items: center; gap: var(--space-4); font-size: var(--text-sm); color: var(--muted); }

/* v3 — Mini-PIM „Fotó" oszlop linkje (szöveges link, nem <img>). */
.photo-link { white-space: nowrap; text-decoration: none; }

/* Mini-PIM v2 — fotó hover-kép: a link marad, de hoverre (kattintás nélkül) megjelenik a kép. */
.photo-hover { position: relative; display: inline-block; }
.photo-pop {
  display: none;
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  width: 200px;
  height: auto;
  max-height: 200px;
  object-fit: contain;
  padding: var(--space-3);
  background: var(--color-surface, var(--panel));
  border: 1px solid var(--color-border, var(--line));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg, var(--shadow));
}
.photo-hover:hover .photo-pop { display: block; }

/* ============================================================================
   === PIM CONTENT ===
   Mini-PIM v2 termékoldali tartalomgyártás eredménynézet (PDS-stílus): Kész /
   UNAS-ba feltöltve tabok, per-cella státusz, megtekintő popup, writeback.
   ============================================================================ */
/* Tartalomgyártás — a 3 nézet (Alaptábla / Módosított termékek / UNAS-ba feltöltött) közös kerete.
   A PDS-stílusú nézet-váltó (.pds-nav) fölötte ül; a base nézetben a DataGrid a .tartalom-body-ban. */
.tartalom-shell { display: flex; flex-direction: column; gap: var(--space-4); }
.tartalom-body { min-height: 0; }

.pimc { display: flex; flex-direction: column; gap: var(--space-5); }
.pimc-tabs { display: flex; gap: var(--space-3); border-bottom: 1px solid var(--color-border, var(--line)); }
.pimc-tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: var(--space-4) var(--space-5);
  font: inherit;
  font-weight: 600;
  color: var(--color-text-muted, var(--muted));
  cursor: pointer;
}
.pimc-tab.is-active { color: var(--color-primary, var(--primary)); border-bottom-color: var(--color-primary, var(--primary)); }
.pimc-actions { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.pimc-table th, .pimc-table td { vertical-align: middle; }
.pimc-check { width: 36px; text-align: center; }
.pimc-prod { font-weight: 600; max-width: 280px; }
.pimc-cell { white-space: nowrap; }
.pimc-na { color: var(--color-text-subtle, var(--muted)); }
.pimc-ok { color: var(--color-success, #5E9E2E); font-weight: 600; }
.pimc-pending { color: var(--color-text-muted, var(--muted)); }
.pimc-err { color: var(--color-danger, #c0392b); font-weight: 600; }
.pimc-view a { text-decoration: none; white-space: nowrap; }

/* Megtekintő popup */
.pimc-vpanel { max-width: 760px; width: 90vw; display: flex; flex-direction: column; gap: var(--space-4); }
.pimc-vhead { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.pimc-vbody { max-height: 60vh; overflow: auto; }
.pimc-vimg { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.pimc-vframe { width: 100%; height: 50vh; border: 1px solid var(--color-border, var(--line)); border-radius: var(--radius-md); background: #fff; }
.pimc-vtext { white-space: pre-wrap; line-height: 1.5; }
/* Debug (teszt-időszak): a kimenő API-hívás curl-előnézete a megtekintő popupban. */
.pimc-apicall { margin-top: var(--space-4); border-top: 1px dashed var(--color-border, var(--line)); padding-top: var(--space-3); }
.pimc-apicall > summary { cursor: pointer; font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text-muted, var(--muted)); }
.pimc-curl {
  margin: var(--space-3) 0 0;
  padding: var(--space-4);
  background: var(--navy, #102A3D);
  color: #e6edf3;
  border-radius: var(--radius-md);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}
/* Beállítások → Prompt kezelés: a helyettesítők súgó-listája a szerkesztőben. */
.set-ph-help { margin: 0; padding: var(--space-4); background: var(--color-surface-subtle, #eef1f4); border-radius: var(--radius-md); font-size: var(--text-sm); color: var(--color-text-muted, var(--muted)); }
.set-ph-title { display: block; margin-bottom: var(--space-2); font-weight: var(--weight-medium); }
.set-ph-help ul { margin: 0; padding-left: var(--space-6); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px var(--space-6); }
.set-ph-help code { background: var(--color-surface, #fff); padding: 1px 5px; border-radius: var(--radius-sm); font-size: 12px; }
/* Beállítások → Prompt kezelés: „Új prompt" gomb-sáv + a szerkesztő MODAL (magas prompt-mező). */
.set-toolbar { margin-bottom: var(--space-4); }
.set-modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(16, 42, 61, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-6);
}
.set-modal {
  background: var(--color-surface, #fff);
  border-radius: var(--radius-lg, 14px);
  width: min(780px, 96vw); max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.32);
}
.set-modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--color-border, var(--line)); }
.set-modal-head h3 { margin: 0; }
.set-modal-body { padding: var(--space-6); overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-4); }
.set-modal-foot { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-5) var(--space-6); border-top: 1px solid var(--color-border, var(--line)); }
.set-field--grow { flex: 1 1 auto; }
.set-prompt-textarea { width: 100%; min-height: 40vh; resize: vertical; line-height: 1.5; font-family: inherit; }

/* ============================================================================
   === LANDING PAGE ===
   Role-specific home screen after login (agency_admin: 3 cards + 4 widgets;
   client_user: app cards + 2 widgets). Token-driven; navy shell, white surfaces.
   ============================================================================ */

.landing-screen {
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-10) var(--space-12) var(--space-16);
  overflow-y: auto;
}

.landing-header {
  width: min(100%, 1120px);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-12);
}

.landing-body {
  width: min(100%, 1120px);
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

/* ---- agency_admin: the 3 summary cards ---- */

.landing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-10);
}

.landing-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-12);
  box-shadow: var(--shadow-md);
}

/* The admin card matches the others (light text on a light surface), only its background is a
   light grey instead of white so it reads as the distinct "platform" tile without sinking into
   the navy shell. */
.landing-card--admin {
  background: var(--color-surface-inset);
  border-color: var(--line);
}

.landing-card__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: var(--text-2xl);
}

.landing-card__title {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--navy);
}

.landing-card__desc {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--muted);
}

.landing-card__stat-row {
  font-size: var(--text-sm);
  color: var(--color-text);
}

.landing-card__stat-row strong {
  font-size: var(--text-lg);
  color: var(--navy);
  font-weight: var(--weight-bold);
}

.landing-card__app-mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.landing-card__app-mini-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}

.landing-card__app-mini-list li:last-child { border-bottom: none; padding-bottom: 0; }
.landing-card__app-mini-list strong { color: var(--color-text-strong); font-weight: var(--weight-semibold); }

.landing-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  align-self: flex-start;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.landing-chip--warn {
  background: var(--c-amber-tint);
  color: var(--c-amber-700);
}

/* Pushes the card button to the bottom so the 3 cards align regardless of body length. */
.landing-card__spacer { flex: 1 1 auto; }

/* ---- Dashboard section (both roles) ---- */

.dashboard__title {
  margin: 0 0 var(--space-8);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: #fff;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-10);
}

.dashboard-widget {
  background: var(--color-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  box-shadow: var(--shadow-md);
}

.dashboard-widget__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-7);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--navy);
}

.dashboard-empty {
  list-style: none;
  font-size: var(--text-sm);
  color: var(--muted);
}

/* Platform statistics: small number cards. */
.stat-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-7);
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle-2);
  border: 1px solid var(--line);
}

.stat-card__value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--navy);
}

.stat-card__label {
  font-size: var(--text-xs);
  color: var(--muted);
}

/* Sync rows (recent jobs / per-datasource status). */
.sync-row-list,
.health-list,
.notification-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.sync-row {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-text);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  background: var(--color-surface-subtle-2);
}

.sync-row__name { flex: 1 1 auto; font-weight: var(--weight-medium); color: var(--color-text-strong); }
.sync-row__time { color: var(--muted); font-size: var(--text-xs); white-space: nowrap; }
.sync-row__status { white-space: nowrap; font-size: var(--text-xs); }

.sync-row.is-error { border-left-color: var(--color-danger); background: var(--c-red-tint); }
.sync-row.is-warn  { border-left-color: var(--color-warning); background: var(--c-amber-tint); }
.sync-row.is-running { border-left-color: var(--color-primary); background: var(--c-green-tint); }

/* System health rows. */
.health-row {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  font-size: var(--text-sm);
}

.health-row__icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  font-weight: var(--weight-bold);
  font-size: var(--text-xs);
}

.health-row.is-ok  .health-row__icon { background: var(--c-green-tint); color: var(--color-primary); }
.health-row.is-bad .health-row__icon { background: var(--c-red-tint); color: var(--color-danger); }

.health-row__label { flex: 1 1 auto; color: var(--color-text); }
.health-row__count { font-weight: var(--weight-bold); color: var(--navy); }
.health-row.is-bad .health-row__count { color: var(--color-danger); }

/* Quick links. */
.quick-link-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}

.quick-link { justify-content: flex-start; }

/* Notifications. */
.notification-item {
  font-size: var(--text-sm);
  color: var(--color-text);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-border-strong);
  background: var(--color-surface-subtle-2);
}

.notification-item--warning { border-left-color: var(--color-warning); background: var(--c-amber-tint); }
.notification-item--error   { border-left-color: var(--color-danger);  background: var(--c-red-tint); }
.notification-item--ok      { border-left-color: var(--color-primary);  background: var(--c-green-tint); color: var(--color-text-strong); }

/* ---- client_user: app cards ---- */

.landing-app-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-10);
}

.landing-app-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
  background: var(--color-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  box-shadow: var(--shadow-md);
}

.landing-app-card__head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
}

.landing-app-card .card-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: var(--text-xl);
}

.landing-app-card__title { display: flex; flex-direction: column; gap: var(--space-3); }
.landing-app-card .card-name { margin: 0; font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--navy); }

.landing-app-card__actions {
  display: flex;
  gap: var(--space-5);
  margin-top: auto;
}

.landing-app-card__actions .primary-button,
.landing-app-card__actions .ghost-button { flex: 1 1 0; }

/* Inactive / locked app card. */
.app-card--locked { opacity: 0.55; }
.app-card--locked .card-icon { background: var(--color-surface-inset); color: var(--muted); }

/* ---- Responsive: stack everything on narrow screens ---- */
@media (max-width: 880px) {
  .landing-cards,
  .dashboard-grid,
  .dashboard-grid--two,
  .stat-card-grid,
  .quick-link-grid { grid-template-columns: 1fr; }
}

/* Landing header sits directly on the navy shell, so the brand needs light text (the navy
   default would be invisible); the green accent span stays as-is. */
.landing-header .login-brand-name { color: #fff; }
.landing-header .login-brand-sub { color: var(--c-white-72); }

/* === RECOMMENDATIONS PANEL ("Javaslatok" — UNAS app homepage) ============================
   Diagnostic/advice panel: severity-dot rows with actionable CTA buttons. Loaded as the UNAS
   landing (menu.json home_action). Data + behavior live in app/apps/unas/static/recommendations.js. */
.recommendations-view {
  max-width: 760px;
}

.rec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.rec-title {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.rec-loading {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* Run button (top-right / empty-state): bordered, with a leading icon that spins while running. */
.rec-run-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-7);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
}
.rec-run-btn:hover:not([disabled]) { background: var(--color-surface-subtle); }
.rec-run-btn[disabled] { opacity: 0.6; cursor: default; }

.rec-spin { animation: rec-spin 0.9s linear infinite; }
@keyframes rec-spin { to { transform: rotate(360deg); } }

.rec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}

.rec-item {
  display: flex;
  gap: var(--space-6);
  padding: var(--space-7) var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

/* Severity dot — explicit brand-status colors (spec). */
.rec-dot {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-pill);
  margin-top: 5px;
}
.rec-dot--urgent  { background: #E24B4A; }
.rec-dot--warning { background: #EF9F27; }
.rec-dot--success { background: #639922; }

.rec-item-body {
  flex: 1 1 auto;
  min-width: 0;
}

.rec-message {
  margin: 0 0 var(--space-6);
  font-size: var(--text-base);
  color: var(--color-text);
}

.rec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
}

/* Primary CTA: filled dark background, white text, no border (multiple wrap with flex). */
.rec-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-text);
  color: #fff;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
}
.rec-cta:hover { opacity: 0.9; }

.rec-footer {
  margin-top: var(--space-8);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.rec-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-7);
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

.rec-empty-list {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* info severity dot (order_spikes neutral) */
.rec-dot--info { background: #60a5fa; }

/* Revenue inline compare table */
.rec-revenue-detail.is-hidden { display: none; }

.rec-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin: var(--space-5) 0 var(--space-6);
}
.rec-compare-table th,
.rec-compare-table td {
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--color-border);
  text-align: left;
}
.rec-compare-table th {
  background: var(--color-surface-subtle);
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rec-compare-table td:first-child { color: var(--color-text-muted); }
.rec-compare-table td:not(:first-child) { font-weight: 500; }

/* Product mini-table (top_products / zombie / incomplete) */
.rec-product-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin: var(--space-4) 0 var(--space-6);
}
.rec-product-table th,
.rec-product-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
.rec-product-table th {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rec-prod-name {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rec-prod-sku { color: var(--color-text-muted); font-size: var(--text-xs); white-space: nowrap; }
.rec-prod-num { text-align: right; white-space: nowrap; }

/* Incomplete products — field check icons */
.rec-field-ok { color: #ef4444; }
.rec-field-ok--ok { color: #639922; }

/* Chart card */
.rec-item--chart { flex-direction: column; }
.rec-item--chart .rec-dot { margin-top: 0; }
.rec-item--chart > .rec-item-body { width: 100%; }
.rec-chart-wrap {
  position: relative;
  height: 180px;
  margin-top: var(--space-5);
}

/* Placeholder toast */
.rec-toast {
  position: fixed;
  bottom: var(--space-10);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text);
  color: #fff;
  padding: var(--space-5) var(--space-8);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  z-index: 9999;
  pointer-events: none;
  animation: rec-toast-in 0.2s ease;
}
@keyframes rec-toast-in { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ============================================================================================
   RECOMMENDATION CARDS (Javaslatok v3) — akció-vezérelt kezdőlap-kártyák
   Egységes kártya-króm (akcent-sáv + ikon-csempe + badge + meta-sor + navy-fejlécű tábla + CTA-k),
   design-tokenekre építve. A súlyosság (urgent/warning/success) a --rec-accent + tintjeit vezérli.
   ============================================================================================ */

.rec-v3-header { margin-bottom: var(--space-8); }
.rec-v3-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-strong, var(--color-text));
  margin: 0;
}

.rec-cards { display: flex; flex-direction: column; gap: var(--space-8); }

.rec-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  /* Súlyosság-vezérelt akcentus (bal sáv + ikon-csempe + badge). */
  --rec-accent: var(--color-warning);
  --rec-tint: var(--c-amber-tint);
  --rec-strong: var(--c-amber-600);
}
.rec-card--urgent  { --rec-accent: var(--color-danger);  --rec-tint: var(--c-red-tint);   --rec-strong: var(--c-red-600); }
.rec-card--warning { --rec-accent: var(--c-amber-400);   --rec-tint: var(--c-amber-tint); --rec-strong: var(--c-amber-600); }
.rec-card--success { --rec-accent: var(--primary);       --rec-tint: var(--c-green-tint); --rec-strong: var(--c-green-700); }

.rec-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: var(--rec-accent);
}
.rec-card__inner {
  padding: var(--space-10) var(--space-10) var(--space-9) calc(var(--space-10) + var(--space-3));
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

/* Fejléc: ikon-csempe + cím-sor + leírás */
.rec-card__head { display: flex; gap: var(--space-7); align-items: flex-start; }
.rec-card__icon {
  flex: 0 0 auto;
  width: 56px; height: 56px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  background: var(--rec-tint);
  color: var(--rec-strong);
  font-size: 26px;
}
.rec-card__titles { flex: 1 1 auto; min-width: 0; }
.rec-card__title-row { display: flex; align-items: center; gap: var(--space-6); flex-wrap: wrap; }
.rec-card__title {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-strong, var(--color-text));
}
.rec-card__badge {
  display: inline-flex; align-items: center;
  padding: 2px var(--space-5);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--rec-tint);
  color: var(--rec-strong);
}
.rec-card__subtitle {
  margin: var(--space-3) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-base);
  line-height: 1.5;
}

/* Meta-sor: N termék + CSV-gomb */
.rec-card__meta { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); }
.rec-card__meta-count { color: var(--color-text-muted); font-size: var(--text-sm); }
.rec-card__csv {
  display: inline-flex; align-items: center; gap: var(--space-4);
  padding: var(--space-4) var(--space-7);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.rec-card__csv:hover:not(:disabled) { background: var(--panel-muted); border-color: var(--color-border-strong); }
.rec-card__csv:disabled { opacity: 0.5; cursor: default; }

/* Kártya nyitás/zárás toggle */
.rec-card__toggle {
  flex: 0 0 auto;
  align-self: flex-start;
  border: none; background: none;
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  cursor: pointer;
  padding: var(--space-2);
  line-height: 1;
}
.rec-card__toggle:hover { color: var(--color-text); }
.rec-card__toggle i { display: inline-block; transition: transform 0.15s ease; }
.rec-card.is-collapsed .rec-card__toggle i { transform: rotate(180deg); }
.rec-card.is-collapsed .rec-card__meta,
.rec-card.is-collapsed .rec-card__table,
.rec-card.is-collapsed .rec-card__ctas { display: none; }

/* Tábla — közös, navy-fejléc, rendezhető. A kártyán fix magasság-korlát: nagy tábla belül görget,
   a navy fejléc ragadós marad (a modál-táblát nem korlátozza — az a rec-modal__body-ban él). */
.rec-table-wrap { overflow-x: auto; border-radius: var(--radius-md); }
.rec-card__table .rec-table-wrap { max-height: 340px; overflow: auto; }
.rec-card__table .rec-table thead th { position: sticky; top: 0; z-index: 1; }
.rec-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.rec-table thead th {
  background: var(--navy);
  color: var(--on-navy);
  font-weight: var(--weight-semibold);
  text-align: left;
  padding: var(--space-6) var(--space-7);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.rec-table thead th:first-child { border-top-left-radius: var(--radius-md); }
.rec-table thead th:last-child { border-top-right-radius: var(--radius-md); }
.rec-th { }
.rec-th > span:first-child { margin-right: var(--space-4); }
.rec-th--num { text-align: right; }
.rec-th-arrow { color: var(--on-navy-faint); font-size: var(--text-xs); }
.rec-th-arrow.is-active { color: var(--on-navy); }
.rec-table tbody td {
  padding: var(--space-6) var(--space-7);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: middle;
}
.rec-table tbody tr:last-child td { border-bottom: none; }
.rec-td--num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.rec-cell-link {
  border: none; background: none; padding: 0;
  color: var(--navy);
  font: inherit; font-weight: var(--weight-semibold);
  cursor: pointer;
}
.rec-cell-link:hover { text-decoration: underline; }
.rec-cell-photo { width: 40px; height: 40px; object-fit: cover; border-radius: var(--radius-sm, 6px); display: block; }

.rec-pill {
  display: inline-block;
  padding: 2px var(--space-5);
  border-radius: 999px;
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  background: var(--rec-tint);
  color: var(--rec-strong);
  white-space: nowrap;
}

/* CTA-lábléc */
.rec-card__ctas { display: flex; flex-wrap: wrap; gap: var(--space-5); }
.rec-cta {
  display: inline-flex; align-items: center; gap: var(--space-4);
  padding: var(--space-5) var(--space-8);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  border: 1px solid transparent;
}
.rec-cta--primary { background: var(--primary); color: #fff; }
.rec-cta--primary:hover { background: var(--green-dark); }
.rec-cta--secondary { background: var(--panel); color: var(--color-text); border-color: var(--color-border); }
.rec-cta--secondary:hover { background: var(--panel-muted); border-color: var(--color-border-strong); }

.rec-card__loading, .rec-card__empty, .rec-card__error { color: var(--color-text-muted); font-size: var(--text-sm); margin: 0; }
.rec-card__error { color: var(--color-danger); }

/* Akció-modál (ár-szerkesztő / kiegészítő termék) */
.rec-modal-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(16, 42, 61, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-8);
}
.rec-modal {
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg, var(--shadow-md));
  width: min(760px, 100%);
  max-height: 88vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.rec-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-7) var(--space-8);
  background: var(--navy); color: var(--on-navy);
}
.rec-modal__title { margin: 0; font-size: var(--text-lg); font-weight: var(--weight-bold); }
.rec-modal__close {
  border: none; background: none; color: var(--on-navy);
  font-size: var(--text-lg); cursor: pointer; line-height: 1; padding: var(--space-2);
}
.rec-modal__body { padding: var(--space-8); overflow-y: auto; }
.rec-modal__desc { margin: 0 0 var(--space-7); color: var(--color-text-muted); font-size: var(--text-sm); line-height: 1.5; }
.rec-modal__field { display: flex; align-items: center; gap: var(--space-6); margin-bottom: var(--space-7); font-size: var(--text-sm); }
.rec-modal__field input { width: 90px; padding: var(--space-4) var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius-md); font: inherit; }
.rec-modal__foot { display: flex; justify-content: flex-end; gap: var(--space-5); padding: var(--space-7) var(--space-8); border-top: 1px solid var(--color-border); }

/* Tömeges áremelés fejléc-sávja (stars_list.js) — % / Ft választó + mérték, ami a táblázat
   `.rec-edit-price` celláit tölti fel (soronként még felülírhatóak marad). */
.rec-bulk-price-bar {
  display: flex; align-items: center; gap: var(--space-5);
  margin: 0 0 var(--space-7); padding: var(--space-5) var(--space-6);
  background: var(--panel-muted); border-radius: var(--radius-md); font-size: var(--text-sm);
}
.rec-bulk-price-bar select,
.rec-bulk-price-bar input {
  padding: var(--space-3) var(--space-5); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 6px); font: inherit;
}
.rec-bulk-price-bar input { width: 90px; }

.rec-edit-table .rec-edit-price {
  width: 110px; padding: var(--space-3) var(--space-5);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm, 6px);
  font: inherit; text-align: right;
}
.rec-edit-table .rec-edit-check { width: 16px; height: 16px; cursor: pointer; }

@media (max-width: 768px) {
  .rec-card__inner { padding: var(--space-8) var(--space-8) var(--space-8) calc(var(--space-8) + var(--space-3)); gap: var(--space-7); }
  .rec-card__icon { width: 48px; height: 48px; font-size: 22px; }
  .rec-card__meta { flex-wrap: wrap; }
  .rec-cta { flex: 1 1 auto; justify-content: center; }
}

/* ============================================================================================
   SHOPAUDIT — Shop Audit app (3-panel SSE elemző + history + sources)
   ============================================================================================ */

.shopaudit {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

.shopaudit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-8); }
.shopaudit-title { margin: 0; font-size: var(--text-2xl); font-weight: var(--weight-semibold); color: var(--color-text-strong); }
.shopaudit-meta { margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--color-text-subtle); }
.shopaudit-meta a { color: var(--color-primary); text-decoration: none; }
.shopaudit-meta a:hover { text-decoration: underline; }

.shopaudit-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  flex-wrap: wrap;
  padding: var(--space-6) var(--space-8);
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.shopaudit-providers { display: flex; align-items: center; gap: var(--space-4); }
.shopaudit-providers__label { font-size: var(--text-sm); color: var(--color-text-subtle); font-weight: var(--weight-medium); }

.shopaudit-provider {
  padding: var(--space-3) var(--space-7);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.shopaudit-provider:hover { border-color: var(--color-primary); }
.shopaudit-provider.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--color-on-primary);
}

.shopaudit-sources-count { font-size: var(--text-sm); color: var(--color-primary); font-weight: var(--weight-medium); }

.shopaudit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}
@media (max-width: 1100px) { .shopaudit-grid { grid-template-columns: 1fr; } }

.shopaudit-panel {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  max-height: 70vh;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.shopaudit-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-7);
  background: var(--color-surface-subtle);
  border-bottom: 1px solid var(--color-border);
}
.shopaudit-panel__title { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--color-text-strong); }

.shopaudit-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-7);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text);
}
.shopaudit-panel__body h1, .shopaudit-panel__body h2, .shopaudit-panel__body h3 {
  margin: var(--space-7) 0 var(--space-4);
  color: var(--color-text-strong);
  line-height: var(--leading-tight);
}
.shopaudit-panel__body h1 { font-size: var(--text-lg); }
.shopaudit-panel__body h2 { font-size: var(--text-md); }
.shopaudit-panel__body h3 { font-size: var(--text-base); }
.shopaudit-panel__body :first-child { margin-top: 0; }
.shopaudit-panel__body table { width: 100%; border-collapse: collapse; margin: var(--space-6) 0; font-size: var(--text-xs); }
.shopaudit-panel__body th, .shopaudit-panel__body td { border: 1px solid var(--color-border); padding: var(--space-3) var(--space-4); text-align: left; }
.shopaudit-panel__body th { background: var(--color-surface-subtle); }
.shopaudit-panel__body code { font-family: var(--font-mono); font-size: var(--text-xs); background: var(--color-surface-inset); padding: 0 var(--space-2); border-radius: var(--radius-sm); }
.shopaudit-raw { white-space: pre-wrap; font-family: var(--font-mono); font-size: var(--text-xs); }

.shopaudit-status {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  padding: var(--space-1) var(--space-5);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.shopaudit-status--idle { background: var(--color-surface-inset); color: var(--color-text-muted); }
.shopaudit-status--running { background: var(--c-amber-tint); color: var(--c-amber-600); }
.shopaudit-status--done { background: var(--c-green-tint); color: var(--green-soft-text); }
.shopaudit-status--error { background: var(--c-red-tint); color: var(--color-danger); }

.shopaudit-hint { color: var(--color-text-muted); font-size: var(--text-sm); margin: 0; }
.shopaudit-hint--spin::after {
  content: "";
  display: inline-block;
  width: 12px; height: 12px;
  margin-left: var(--space-4);
  border: 2px solid var(--color-border-strong);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: shopaudit-spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes shopaudit-spin { to { transform: rotate(360deg); } }
.shopaudit-error { color: var(--color-danger); font-size: var(--text-sm); margin: 0; }

/* History + Sources táblák */
.shopaudit-url-cell, .shopaudit-summary-cell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.shopaudit-summary-cell { white-space: normal; }

.shopaudit-filters { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.shopaudit-filter {
  padding: var(--space-3) var(--space-7);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-sm);
  cursor: pointer;
}
.shopaudit-filter:hover { border-color: var(--color-primary); }
.shopaudit-filter.is-active { background: var(--navy); border-color: var(--navy); color: var(--color-on-primary); }

.shopaudit-tag {
  display: inline-block;
  font-size: var(--text-2xs);
  background: var(--color-surface-inset);
  color: var(--color-text-subtle);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-pill);
}
.shopaudit-cat {
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  padding: var(--space-1) var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--color-surface-inset);
  color: var(--color-text-subtle);
}
.shopaudit-cat--blog { background: var(--c-green-tint); color: var(--green-soft-text); }
.shopaudit-cat--news { background: var(--c-amber-tint); color: var(--c-amber-600); }
.shopaudit-cat--research { background: var(--c-green-tint); color: var(--green-strong); }

/* Gombok (self-contained, token-vezérelt) */
.shopaudit-btn {
  padding: var(--space-5) var(--space-9);
  border: 1px solid var(--green-strong);
  border-radius: var(--radius);
  background: var(--green-strong);
  color: var(--color-on-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.shopaudit-btn:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.shopaudit-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.shopaudit-btn--secondary {
  background: var(--color-surface);
  color: var(--navy);
  border-color: var(--color-border-strong);
}
.shopaudit-btn--secondary:hover { background: var(--color-surface-subtle); border-color: var(--navy); }
.shopaudit-btn--sm { padding: var(--space-2) var(--space-6); font-size: var(--text-xs); }

/* ============================================================================
   PRODUCT DATA SCRAPER (PDS) — gyártói adatgyűjtő app
   A terméktáblázat a közös .report-table komponenst örökli; itt csak a toolbar,
   a gombok és a státusz-cellák self-contained, token-vezérelt stílusai.
   ========================================================================== */
.pds { display: flex; flex-direction: column; gap: var(--space-6); }

/* A platform-shell `min-height: 100vh`-val él, és a .app-body `flex: 1 1 0%`-ának százalékos flex-basise
   határozatlan magasságú szülőn a TARTALOMRA oldódik fel — ezért a shell a tartalommal együtt nő, valójában
   az ABLAK görget, a .content-region { overflow-y: auto } pedig sosem lép működésbe. Egy sticky elem a
   (nem görgő) .content-region scrollportjához tapadna, vagyis hatástalan maradna.
   A PDS-oldalon a shellt a viewporthoz kötjük, így a .content-region tényleg görgetővé válik — pontosan
   úgy, ahogy a shell CSS-e eleve szánta (app-body height/overflow, app-sidebar overflow-y, sticky
   app-header). A `:has()` miatt a hatókör szándékosan CSAK a PDS-nézet: a többi képernyő görgetés-modellje
   érintetlen. (A shell általános rendbetétele külön, teljes körű átnézést igénylő feladat.) */
.app-shell:has(.pds) { height: 100vh; }

/* A toolbar a tartalom-régió tetejére tapad, hogy hosszú táblázatnál ne kelljen a lista elejére
   visszagörgetni egy művelethez. A --pds-toolbar-h-t a JS méri (lásd trackToolbarHeight) — ez alá
   tapad a tábla fejléce. */
.pds-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg);
}

/* A .content-region 28px felső paddingja a megtapadt sáv FÖLÖTT marad, és az alá csúszó sorok ott
   kilátszanának. Ez a takaró-csík ugyanazzal a háttérrel tölti ki azt a sávot — nyugalomban láthatatlan
   (a padding amúgy is üres háttér), görgetéskor viszont takar. A magassága a .content-region
   padding-topjához igazodik. */
.pds-toolbar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 28px;
  background: var(--bg);
}
.pds-actions { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.pds-scraper { font-size: var(--text-sm); color: var(--color-text-muted); }
.pds-scraper strong { color: var(--navy); }

/* Közös nézet-navigáció — saját sor (teljes szélesség), minden tabon ugyanaz. */
.pds-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  flex-basis: 100%;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-2);
}
.pds-nav-btn {
  padding: var(--space-4) var(--space-7);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--navy);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pds-nav-btn:hover:not(:disabled) { background: var(--color-surface-subtle); border-color: var(--navy); }
.pds-nav-btn.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  cursor: default;
}

.pds-btn {
  padding: var(--space-5) var(--space-9);
  border: 1px solid var(--green-strong);
  border-radius: var(--radius);
  background: var(--green-strong);
  color: var(--color-on-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.pds-btn:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.pds-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.pds-btn--ghost {
  background: var(--color-surface);
  color: var(--navy);
  border-color: var(--color-border-strong);
}
.pds-btn--ghost:hover { background: var(--color-surface-subtle); border-color: var(--navy); }
/* Megszakítás — futás közben jelenik meg. */
.pds-btn--cancel {
  background: var(--color-danger);
  color: var(--color-on-primary);
  border-color: var(--color-danger);
}
.pds-btn--cancel:hover { background: var(--color-danger-hover); border-color: var(--color-danger-hover); }
.pds-btn--cancel:disabled { opacity: 0.6; cursor: not-allowed; }
/* Elsődleges kiemelés — UNAS feltöltés indítása gomb. */
.pds-btn--primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.pds-btn--primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.pds-btn--primary:disabled { opacity: 0.55; cursor: not-allowed; }
/* Tartalomgyártás placeholder — vizuálisan aktív, de „hamarosan" jelzéssel. */
.pds-btn--disabled {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  border-color: var(--color-border);
  cursor: not-allowed;
}
.pds-btn--disabled:hover { background: var(--color-surface-muted); border-color: var(--color-border); }

.pds-progress {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--navy);
  font-weight: var(--weight-semibold);
}

/* Sticky tábla-fejléc a sticky toolbar alatt. A .report-table a hátteret a <tr>-en hordozza, ami a sticky
   <th>-vel nem mozdul együtt — ezért itt a cella kapja meg a navy hátteret. */
.pds-table thead th {
  position: sticky;
  top: var(--pds-toolbar-h, 0px);
  z-index: 2;
  background: var(--navy);
  vertical-align: top;
}


.pds-table .pds-name { max-width: 360px; }

/* Státusz-cellák */
.pds-err { color: var(--color-danger); font-weight: var(--weight-semibold); }
/* UNAS write-back per-termék hibaszöveg a státusz-oszlopban (tördelt, halvány, olvasható). */
.pds-err-detail {
  display: block;
  margin-top: 2px;
  max-width: 360px;
  color: var(--color-text-muted, #64748b);
  font-weight: var(--weight-regular, 400);
  font-size: var(--text-xs, 0.75rem);
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}
/* Letöltött anyagok cella — kind szerinti csoportok (PDF / Termékkép / App-kép) */
.pds-asset-group { display: inline-block; }
.pds-asset-group b { color: var(--navy); font-weight: var(--weight-semibold); }
.pds-table td a { color: var(--color-primary); }

/* --- 2. fázis: tartalom-oszlop + megtekintő popup --- */
.pds-muted { color: var(--color-text-muted); }
.pds-progress--content { color: var(--navy); }
.pds-open { cursor: pointer; }
.pds-table td a.pds-open { font-weight: var(--weight-semibold); }

/* Megtekintő popup — overlay + panel (a Mini-PIM ellenőrző-ablak mintájára) */
.pds-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-6);
}
.pds-popup {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: min(960px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pds-popup-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  background: var(--navy);
  color: var(--color-on-primary);
}
.pds-popup-title {
  flex: 1;
  font-weight: var(--weight-semibold);
  font-size: var(--text-md);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pds-popup-nav,
.pds-popup-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: var(--color-on-primary);
  border-radius: var(--radius-sm);
  width: 2rem;
  height: 2rem;
  font-size: var(--text-lg);
  line-height: 1;
  cursor: pointer;
}
.pds-popup-nav:hover:not(:disabled),
.pds-popup-close:hover { background: rgba(255, 255, 255, 0.16); }
.pds-popup-nav:disabled { opacity: 0.35; cursor: not-allowed; }

.pds-popup-tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-5) 0;
  border-bottom: 1px solid var(--color-border);
}
.pds-tab {
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
}
.pds-tab.is-active {
  background: var(--color-surface);
  color: var(--navy);
  font-weight: var(--weight-semibold);
  border-color: var(--color-border-strong);
}
.pds-tab--err { color: var(--color-danger); }
.pds-tab--wait { font-style: italic; }

.pds-popup-body {
  flex: 1;
  overflow: auto;
  padding: var(--space-5);
  background: var(--color-surface);
}
/* Az AI-generált HTML izolált konténere (sandbox-iframe) — az Unas-megjelenést közelíti */
.pds-popup-frame {
  width: 100%;
  min-height: 60vh;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
}
.pds-popup-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--color-text);
}
.pds-popup-msg { padding: var(--space-6) 0; text-align: center; }

/* --- Prompt beállítások (szerkeszthető prompt-admin + modell) --- */
.pds-prompt { display: flex; flex-direction: column; gap: var(--space-5); }
.pds-prompt-help {
  background: var(--color-surface-subtle);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-5);
}
.pds-prompt-help h2 { margin: 0 0 var(--space-2); color: var(--navy); }
.pds-prompt-help p { margin: var(--space-2) 0 0; color: var(--color-text-muted); font-size: var(--text-sm); line-height: 1.6; }
.pds-prompt-help code {
  background: var(--color-surface-muted);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-1);
}
.pds-prompt-editor {
  width: 100%;
  min-height: 60vh;
  resize: vertical;
  padding: var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-mono, monospace);
  font-size: var(--text-sm);
  line-height: 1.55;
  box-sizing: border-box;
}
.pds-prompt-editor:focus { outline: none; border-color: var(--color-primary); }
.pds-prompt-form { display: flex; flex-wrap: wrap; gap: var(--space-5); }
.pds-prompt-form label {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--navy);
  font-weight: var(--weight-semibold);
}
.pds-prompt-form select,
.pds-prompt-form input {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-md);
  min-width: 260px;
}
.pds-prompt-bar { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.pds-prompt-status { font-size: var(--text-sm); color: var(--color-text-muted); }
.pds-prompt-status--ok { color: var(--color-primary); font-weight: var(--weight-semibold); }
.pds-prompt-status--err { color: var(--color-danger); font-weight: var(--weight-semibold); }
.pds-prompt-status--muted { color: var(--color-text-muted); }

/* ============================================================================================
   APP-SZINTŰ BEÁLLÍTÁSOK HUB (agency_admin) — az App-ok böngésző "Beállítások" kártyájáról.
   Token-vezérelt, a közös felület-stílusra épül; külön/inline CSS nélkül.
   ============================================================================================ */
.select-shop-card.is-settings .card-icon { color: var(--color-primary); }

.app-settings {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  width: 100%;
}
.app-settings-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.app-settings-section h3 {
  margin: 0;
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--navy);
}
.app-settings-hint {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.app-settings-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  max-width: 360px;
}
.app-settings-field select {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-md);
  font-weight: var(--weight-regular);
}
.app-settings-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ============================================================================================
   QUOTES — Árajánlat-generáló app (builder / modál / előnézet / beállítások / archívum)
   Kizárólag a közös design-tokenekre épül; nincs inline/per-app CSS.
   ============================================================================================ */

.quote-builder { display: flex; flex-direction: column; gap: var(--space-10); }
.quote-modules { display: flex; flex-direction: column; gap: var(--space-12); }

.quote-module__head {
  margin-bottom: var(--space-6);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-8);
}
.quote-builder__hint {
  margin: 0;
  padding: var(--space-5) var(--space-8);
  background: var(--color-surface-subtle);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: var(--text-sm);
}
.quote-module__clear {
  flex: none;
  padding: var(--space-2) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--panel);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.quote-module__clear:hover { color: var(--color-danger); border-color: var(--color-danger); }
.quote-module__name {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--navy);
}
.quote-module__desc { margin: var(--space-2) 0 0; color: var(--muted); font-size: var(--text-sm); }

.quote-tier-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
@media (max-width: 900px) { .quote-tier-row { grid-template-columns: 1fr; } }

.quote-tier {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-8);
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}
.quote-tier:hover { border-color: var(--green); transform: translateY(-1px); }
.quote-tier.is-selected {
  border-color: var(--green-strong);
  box-shadow: 0 0 0 2px var(--c-green-tint);
  background: var(--green-soft-bg);
}
.quote-tier__name {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--navy);
}
.quote-tier__price { font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--text); }
.quote-tier__price small { font-weight: var(--weight-regular); color: var(--muted); font-size: var(--text-xs); }
.quote-tier__quota {
  align-self: flex-start;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--c-green-tint);
  color: var(--green-strong);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
}
.quote-tier__features {
  margin: var(--space-3) 0 0;
  padding-left: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  color: var(--muted);
  font-size: var(--text-sm);
}

.quote-summary-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  flex-wrap: wrap;
  padding: var(--space-6) var(--space-8);
  background: var(--navy);
  color: var(--c-neutral-0);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}
.quote-summary-bar__totals { display: flex; align-items: center; gap: var(--space-10); flex-wrap: wrap; }
.quote-summary-bar__label { font-weight: var(--weight-semibold); text-transform: uppercase; font-size: var(--text-xs); letter-spacing: .04em; opacity: .8; }
.quote-summary-bar__setup, .quote-summary-bar__monthly { font-size: var(--text-md); }
.quote-summary-bar strong { color: var(--c-green-500); }

/* Modál + form (in-flow nézet-csere, nem position:fixed). */
.quote-modal, .quote-preview, .quote-settings, .quote-archive, .quote-detail { display: flex; flex-direction: column; gap: var(--space-8); max-width: 1000px; }
.quote-modal__title { margin: 0; font-size: var(--text-2xl); font-weight: var(--weight-semibold); color: var(--navy); }
.quote-form { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); }
@media (max-width: 700px) { .quote-form { grid-template-columns: 1fr; } }
.quote-field { display: flex; flex-direction: column; gap: var(--space-3); font-size: var(--text-sm); color: var(--muted); }
.quote-field--wide { grid-column: 1 / -1; }
.quote-field input, .quote-field textarea {
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--panel);
}
.quote-field input:focus, .quote-field textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 2px var(--c-green-tint); }
.quote-modal__actions, .quote-preview__actions, .quote-settings__actions, .quote-detail__actions {
  display: flex; gap: var(--space-6); justify-content: flex-end; flex-wrap: wrap;
}

/* Előnézet. */
.quote-preview__meta, .quote-detail__meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
  padding: var(--space-8);
  background: var(--color-surface-subtle);
  border-radius: var(--radius-md);
}
@media (max-width: 700px) { .quote-preview__meta, .quote-detail__meta { grid-template-columns: 1fr 1fr; } }
.quote-preview__meta > div, .quote-detail__meta > div { display: flex; flex-direction: column; gap: var(--space-1); }
.quote-preview__label, .quote-detail__meta span { font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.quote-preview__meta strong, .quote-detail__meta strong { color: var(--navy); font-size: var(--text-md); }
.quote-preview__summary, .quote-detail__summary { margin: 0; color: var(--text); line-height: var(--leading-normal); }
.quote-preview__note { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.quote-preview__tier { color: var(--muted); font-size: var(--text-sm); }
.quote-preview__features { margin: 0; padding-left: var(--space-8); color: var(--muted); font-size: var(--text-sm); }
.quote-preview__total td { font-weight: var(--weight-semibold); color: var(--navy); }
.quote-price-input {
  width: 96px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  text-align: right;
}

/* Beállítások JSON-szerkesztő. */
.quote-settings__hint { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.quote-settings__editor {
  width: 100%;
  min-height: 420px;
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text);
  background: var(--panel);
  resize: vertical;
}
.quote-settings__editor:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 2px var(--c-green-tint); }

/* Archívum + detail. */
.quote-archive__row-actions { display: flex; gap: var(--space-4); }
.quote-detail__head { display: flex; align-items: baseline; gap: var(--space-6); }
.quote-detail__head h2 { margin: 0; color: var(--navy); }
.quote-detail__number {
  padding: var(--space-1) var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--color-surface-subtle);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.ps-status.is-ok { color: var(--green-strong); }

/* Egyedi (csomag nélküli) tétel a builderben. */
.quote-custom { border: 1px dashed var(--color-border); border-radius: var(--radius-md); padding: var(--space-8); }
.quote-custom.is-on { border-style: solid; border-color: var(--green-strong); background: var(--green-soft-bg); }
.quote-custom__toggle { display: inline-flex; align-items: center; gap: var(--space-4); cursor: pointer; }
.quote-custom__toggle input { width: 16px; height: 16px; accent-color: var(--green-strong); }
.quote-custom__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  margin-top: var(--space-8);
}
@media (max-width: 700px) { .quote-custom__fields { grid-template-columns: 1fr; } }
.quote-custom__fields input, .quote-custom__fields textarea {
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--panel);
}
.quote-custom__fields input:focus, .quote-custom__fields textarea:focus {
  outline: none; border-color: var(--focus); box-shadow: 0 0 0 2px var(--c-green-tint);
}

/* Kétsoros összesítő (előnézet + detail) — Üzembehelyezés/testreszabás + havidíj. */
.quote-preview__totals {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-self: flex-end;
  min-width: 320px;
  margin-top: var(--space-2);
}
.quote-preview__total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-10);
  padding: var(--space-5) var(--space-8);
  background: var(--navy);
  color: var(--c-neutral-0);
  border-radius: var(--radius);
}
.quote-preview__total-row strong { color: var(--c-green-500); font-size: var(--text-md); }
.quote-preview__custom-desc { color: var(--muted); font-size: var(--text-sm); }

/* Archívum törlés gomb — finom veszély-jelzés. */
.quote-archive__del { color: var(--color-danger); }
.quote-archive__del:hover { background: var(--error-soft); }

/* ── AI CHAT (Kérdezz az AI-tól) ─────────────────────────── */
.ai-chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  min-height: 420px;
  gap: var(--space-6);
}

.ai-chat__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  flex-wrap: wrap;
}

.ai-chat__title {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--color-text-strong);
  font-weight: 650;
  font-size: var(--text-md);
}

.ai-chat__title .ti { color: var(--color-primary); font-size: 20px; }

.ai-chat__model {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

.ai-chat__model select {
  min-height: 36px;
  padding: 0 var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-sm);
}

.ai-chat__stream {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-8);
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.ai-chat__hint {
  margin: auto;
  max-width: 540px;
  text-align: center;
  color: var(--color-text-subtle);
  font-size: var(--text-base);
  line-height: 1.5;
}

.ai-msg { display: flex; }
.ai-msg--user { justify-content: flex-end; }
.ai-msg--assistant { justify-content: flex-start; }

.ai-msg__bubble {
  max-width: 76%;
  padding: var(--space-6) var(--space-8);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ai-msg--user .ai-msg__bubble {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-bottom-right-radius: var(--radius-sm);
}

.ai-msg--assistant .ai-msg__bubble {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: var(--radius-sm);
}

/* Markdown render az asszisztens-buborékban — tömör, olvasható tipográfia. */
.ai-msg__md { white-space: normal; }
.ai-msg__md p { margin: 0 0 var(--space-5); }
.ai-msg__md p:last-child { margin-bottom: 0; }
.ai-msg__md ul, .ai-msg__md ol { margin: 0 0 var(--space-5); padding-left: var(--space-12); }
.ai-msg__md li { margin-bottom: var(--space-2); }
.ai-msg__md strong { font-weight: 650; color: var(--color-text-strong); }
.ai-msg__md table { border-collapse: collapse; margin: var(--space-4) 0; font-size: var(--text-sm); }
.ai-msg__md th, .ai-msg__md td { border: 1px solid var(--color-border); padding: var(--space-3) var(--space-5); text-align: left; }
.ai-msg__md code { background: var(--color-surface-inset); padding: 1px 4px; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: var(--text-xs); }

.ai-chat__status {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
  min-height: 18px;
}

.ai-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-border-strong);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-pill);
  display: inline-block;
  animation: ai-spin 0.7s linear infinite;
}

@keyframes ai-spin { to { transform: rotate(360deg); } }

.ai-chat__composer {
  display: flex;
  gap: var(--space-6);
  align-items: flex-end;
}

.ai-chat__composer textarea {
  flex: 1;
  resize: vertical;
  min-height: 48px;
  max-height: 180px;
  padding: var(--space-6) var(--space-8);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-base);
  line-height: 1.5;
}

.ai-chat__composer .primary-button { min-width: 100px; }

/* ── AI CHAT archívum ────────────────────────────────────── */
.ai-archive__bar { margin-bottom: var(--space-10); }
.ai-archive__heading {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-xl);
  color: var(--color-text-strong);
}
.ai-archive__heading .ti { color: var(--color-primary); }
.ai-archive__loading { color: var(--color-text-muted); font-size: var(--text-sm); }

.ai-archive__list {
  list-style: none;
  margin: 0 0 var(--space-12);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.ai-archive__card {
  display: flex;
  align-items: stretch;
  gap: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
}

.ai-archive__open {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-7) var(--space-8);
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
}

.ai-archive__open:hover { background: var(--color-surface-subtle); }
.ai-archive__card-title { font-weight: 650; color: var(--color-text-strong); font-size: var(--text-base); }
.ai-archive__card-meta { font-size: var(--text-xs); color: var(--color-text-muted); }

.ai-archive__del {
  margin: var(--space-5);
  min-width: 40px;
  color: var(--color-danger);
}
.ai-archive__del:hover { background: var(--error-soft); }

.ai-archive__detail {
  padding: var(--space-8);
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.ai-archive__thread { display: flex; flex-direction: column; gap: var(--space-6); }

/* =========================================================================
   TARTALOMGYARTO PORTAL  (SocialMedia wizard-redesign — M1)
   CTA-almenük (navy sidebar) + wizard-váz: progress bar, kontextus-sáv,
   forrásválasztó, lépés-keret, navigáció. Token-vezérelt; nincs per-app CSS.
   ========================================================================= */

/* --- CTA-almenük a navy sidebarban (menu.json `"cta": true` szekciók) ------
   A `.menu-item` megmarad (is-active + dispatch változatlan); a `.menu-item-cta`
   gomb-formát ad: zöld-keretes pill, hoverre/aktívan zöld kitöltés. */
.menu-list .menu-item-cta {
  margin: 4px 12px;
  width: calc(100% - 24px);
  padding: 9px 14px;
  border: 1px solid rgba(127, 184, 61, 0.45);
  border-left: 1px solid rgba(127, 184, 61, 0.45);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.82);
  font-weight: var(--weight-semibold);
  background: rgba(127, 184, 61, 0.08);
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.menu-list .menu-item-cta:hover {
  background: rgba(127, 184, 61, 0.20);
  border-color: var(--green);
  color: #fff;
}

.menu-list .menu-item-cta.is-active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* --- Wizard-konténer ------------------------------------------------------- */
.wizard {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  max-width: 980px;
}

/* --- Progress bar (N szegmens, az aktuális lépésig zöld) -------------------- */
.wizard-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.wizard-progress {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  margin: 0;
  padding: 0;
}

.wizard-progress-seg {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.wizard-progress-seg .wizard-progress-bar {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--color-border);
  transition: background var(--transition-fast);
}

.wizard-progress-seg.is-done .wizard-progress-bar { background: var(--green); }
.wizard-progress-seg.is-current .wizard-progress-bar { background: var(--green); }

.wizard-progress-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wizard-progress-seg.is-current .wizard-progress-label,
.wizard-progress-seg.is-done .wizard-progress-label {
  color: var(--color-text-strong);
}

/* --- Kontextus-sáv (kiválasztott termékkép / sablonkép / prompt chip-jei) --- */
.wizard-context {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-8);
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.wizard-ctx-chip {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-3) var(--space-6) var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  font-size: var(--text-sm);
  color: var(--muted);
}

.wizard-ctx-chip.is-filled {
  border-color: var(--green);
  color: var(--color-text-strong);
  font-weight: var(--weight-medium);
}

.wizard-ctx-thumb {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.wizard-ctx-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
}

.wizard-ctx-chip.is-filled .wizard-ctx-dot { background: var(--green); }

/* Kiválasztott kiindulás — jól látható termék/kép előnézet az opciós lépés tetején. */
.wiz-product-preview:empty { display: none; }
.wiz-product-preview {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
  padding: var(--space-5) var(--space-6);
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--green);
  border-radius: var(--radius-md);
}
.wiz-preview-img {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}
.wiz-preview-meta { display: flex; flex-direction: column; gap: var(--space-2); }
.wiz-preview-cap {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.wiz-preview-name { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text-strong); }

/* === API DEBUG („API hívás" gomb + modal; átmeneti, kikapcsolható) === */
.api-debug-btn { opacity: 0.85; }
.api-debug-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  background: rgba(5, 17, 28, 0.55);
}
.api-debug-panel {
  width: min(720px, 100%);
  max-height: 80vh;
  overflow: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.api-debug-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
  font-weight: var(--weight-bold);
  color: var(--color-text-strong);
}
.api-debug-note { margin: 0 0 var(--space-6); font-size: var(--text-sm); color: var(--muted); }
.api-debug-curl {
  margin: 0 0 var(--space-6);
  padding: var(--space-6);
  background: var(--navy);
  color: #e6f0f5;
  border-radius: var(--radius-md);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.api-debug-actions { display: flex; justify-content: flex-end; }

/* --- Lépés-test ------------------------------------------------------------ */
.wizard-step-intro { margin-bottom: var(--space-10); }

.wizard-step-intro h2 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-2xl);
  color: var(--navy);
}

.wizard-step-hint,
.wizard-placeholder-tag {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

/* Forrásválasztó CTA-k (File1) */
.wizard-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-8);
}

.wizard-source-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-12);
  text-align: left;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.wizard-source-cta:hover {
  border-color: var(--green);
  box-shadow: 0 6px 18px rgba(20, 33, 61, 0.08);
  transform: translateY(-2px);
}

.wizard-source-icon {
  font-size: 28px;
  color: var(--green);
}

.wizard-source-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--navy);
}

.wizard-source-desc {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.4;
}

/* „hamarosan" lépés-placeholder (M1 váz) */
.wizard-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
  padding: var(--space-16) var(--space-8);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-subtle);
}

.wizard-placeholder-icon {
  font-size: 36px;
  color: var(--green);
}

.wizard-placeholder h2 {
  margin: 0;
  font-size: var(--text-xl);
  color: var(--navy);
}

.wizard-placeholder p {
  margin: 0;
  max-width: 520px;
  color: var(--text);
  font-size: var(--text-base);
}

/* --- Navigáció ------------------------------------------------------------- */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-8);
  /* A nav a lépés-törzs fölött ül (a fejléc alatt) — a szeparátor és a térköz alulra kerül,
     hogy elváljon a tartalomtól (pl. UNAS terméktábla). */
  padding-bottom: var(--space-8);
  margin-bottom: var(--space-16);
  border-bottom: 1px solid var(--color-border);
}

.wizard-nav-spacer { flex: 0 0 auto; }
.wizard-nav .wizard-nav-next { margin-left: auto; }

/* =========================================================================
   TARTALOMGYARTO PORTAL — M2 (Track A: Webshop képkészítő)
   A wizard-vázra épülő track-lépések: terméktábla / kép-feltöltés, Prompt
   Garden 3 mód + méret/minőség/modell, eredmény-rács. Token-vezérelt; a
   terméktábla a közös .dg-*, a promptok a közös .img-* primitíveket használják.
   ========================================================================= */

/* A track szélesebb lehet, mint az alap wizard (terméktábla + eredmény-rács). */
.wizard:has(.wiz-select),
.wizard:has(.wiz-options),
.wizard:has(.wiz-result) { max-width: 1180px; }

/* --- 2. lépés: UNAS terméktábla --------------------------------------------- */
.wiz-select-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.wiz-shop-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-strong);
}

.wiz-shop-label .ps-input { width: auto; min-width: 220px; }
.wiz-shop-label .ti { color: var(--green); }

/* --- 2. lépés: kép-feltöltés ------------------------------------------------ */
.wiz-upload-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-16) var(--space-8);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-subtle);
  text-align: center;
}

.wiz-upload-icon { font-size: 34px; color: var(--green); }

.wiz-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  margin-top: var(--space-8);
}

.wiz-thumb {
  position: relative;
  width: 104px;
  height: 104px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-subtle);
}

.wiz-thumb img { width: 100%; height: 100%; object-fit: cover; }

.wiz-thumb-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(20, 33, 61, 0.78);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.wiz-thumb-del:hover { background: var(--navy); }

/* --- 3. lépés: prompt-módok + generálási opciók ----------------------------- */
.wiz-pmode { margin: var(--space-8) 0; }

.wiz-genopts {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
}

.wiz-sizes {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 220px;
}

.wiz-sizes legend {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-strong);
  padding: 0;
  margin-bottom: var(--space-4);
}

.wiz-size-opt {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text);
  margin-bottom: var(--space-3);
  cursor: pointer;
}

.wiz-genopts .img-field { min-width: 200px; }

/* --- 4. lépés: eredmény-rács ------------------------------------------------ */
.wiz-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-8);
  margin-bottom: var(--space-10);
}

.wiz-cell {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.wiz-cell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.wiz-cell-name {
  font-weight: var(--weight-semibold);
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wiz-cell-size {
  flex: 0 0 auto;
  font-size: var(--text-xs);
  color: var(--muted);
  background: var(--color-surface-subtle);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}

.wiz-cell-img {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle);
  overflow: hidden;
}

.wiz-cell-img img { width: 100%; height: 100%; object-fit: contain; }

.wiz-cell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.wiz-cell-msg { margin: 0; font-size: var(--text-xs); }

/* =========================================================================
   TARTALOMGYARTO PORTAL — M3 (Sablontár kezelő-UI)
   A Beállítások → "Sablon képek csatolása" per-ügyfél sablonkép-galériája.
   A toolbar/form a közös .garden / .img-* / .ps-* primitíveket használja; itt
   csak a kártyás galéria saját elemei. Token-vezérelt, nincs inline CSS.
   ========================================================================= */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.tpl-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
}

.tpl-card.is-inactive { opacity: 0.6; }

.tpl-thumb {
  aspect-ratio: 4 / 3;
  background: var(--color-surface-muted, var(--panel));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tpl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tpl-thumb span { font-size: var(--text-xs); color: var(--color-text-muted); }

.tpl-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
}

.tpl-label { font-weight: 600; font-size: var(--text-sm); }

.tpl-badge {
  font-weight: 500;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.tpl-prompt {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tpl-actions { display: flex; gap: var(--space-2); margin-top: auto; }

.tpl-active-field {
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
}

/* =========================================================================
   TARTALOMGYARTO PORTAL — M4 (Track B: Sablon tartalomgyártás)
   A sablonválasztó (újrahasznált .tpl-* kártyák, választható állapottal) +
   a kép+szöveg eredmény-elrendezés. Token-vezérelt; a közös .wiz-*/.img-*
   primitívekre épül. Nincs per-app/inline CSS.
   ========================================================================= */
.tpl-card.tpl-pick {
  cursor: pointer;
  text-align: left;
  padding: 0;
  font: inherit;
  color: inherit;
  transition: border-color var(--transition-fast, 0.15s), box-shadow var(--transition-fast, 0.15s);
}

.tpl-card.tpl-pick.is-selected {
  border-color: var(--color-primary, var(--primary));
  box-shadow: 0 0 0 2px var(--color-primary, var(--primary));
}

.wiz-tpl-pick { border: none; padding: 0; margin: 0 0 var(--space-4); }
.wiz-tpl-pick > legend { font-weight: 600; padding: 0; margin-bottom: var(--space-2); }

.wiz-text-opts { margin-top: var(--space-5); border-top: 1px solid var(--color-border); padding-top: var(--space-4); }
.wiz-subhead { margin: 0 0 var(--space-3); font-size: var(--text-md); }

.wiz-post-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: var(--space-5);
  align-items: start;
}

@media (max-width: 760px) { .wiz-post-layout { grid-template-columns: 1fr; } }

.wiz-post-image {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-muted, var(--panel));
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
}

.wiz-post-image img { width: 100%; height: auto; border-radius: var(--radius-sm); }

.wiz-post-texts { display: flex; flex-direction: column; gap: var(--space-4); }

.wiz-text-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.wiz-text-head { font-weight: 600; font-size: var(--text-sm); }

.wiz-text-block { display: flex; flex-direction: column; gap: var(--space-1); }
.wiz-text-block p { margin: 0; white-space: pre-wrap; font-size: var(--text-sm); }

.wiz-text-tag {
  align-self: flex-start;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary, var(--primary));
}

/* =========================================================================
   TARTALOMGYARTO PORTAL — M5 (Track C: Hirdetésikép)
   A nulláról-ág két-kép feltöltő slotjai + a méretenkénti hirdetés-cellák.
   Token-vezérelt; a közös .wiz-*/.img-* primitívekre épül. Nincs inline CSS.
   ========================================================================= */
.wiz-twoslot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

@media (max-width: 640px) { .wiz-twoslot { grid-template-columns: 1fr; } }

.wiz-slot {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
}

.wiz-slot h3 { margin: 0; font-size: var(--text-sm); }

.wiz-slot-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted, var(--panel));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.wiz-slot-preview img { width: 100%; height: 100%; object-fit: contain; }
.wiz-slot-empty { font-size: var(--text-xs); color: var(--color-text-muted); }

.wiz-ad-cell {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-surface);
}

.wiz-ad-cell + .wiz-ad-cell { margin-top: var(--space-3); }
.wiz-ad-cell .wiz-cell-img img { width: 100%; height: auto; border-radius: var(--radius-sm); }

/* =========================================================================
   TARTALOMGYARTO PORTAL — M6 (Jóváhagyó link)
   A track eredmény-nézet „Ügyfélnek küldöm" megosztás-doboza + a publikus
   /review/{token} oldal. Token-vezérelt; a közös primitívekre épül.
   ========================================================================= */
.review-share-box {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted, var(--panel));
}

.review-share-label { margin: 0 0 var(--space-2); font-size: var(--text-sm); font-weight: 600; }
.review-share-row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.review-share-row .ps-input { flex: 1 1 240px; }

/* Publikus review-oldal (önálló, a styles.css-re kötve) */
.review-page {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.review-head { display: flex; flex-direction: column; gap: var(--space-2); }
.review-brand { font-size: var(--text-lg); color: var(--color-primary, var(--primary)); }
.review-title { margin: 0; font-size: var(--text-xl); }

.review-body { display: flex; flex-direction: column; gap: var(--space-4); }

.review-image {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
}
.review-image img { width: 100%; height: auto; display: block; }

.review-texts { display: flex; flex-direction: column; gap: var(--space-3); }

.review-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.review-comment { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3); }

.review-decided {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}
.review-decided.review-approved { border-color: var(--color-primary, var(--primary)); }
.review-note { margin: 0; font-style: italic; }

/* ============================================================================
   === UNAS REDESIGN — REPORTS HOME ===
   A „Riportok" menüpont KPI-kártyarácsa (2×3) + detail nézet (alriport-választó
   chat-wizard). Lásd reports_home.js. (UNAS app redesign §3.)
   ============================================================================ */

/* Flat (csoport-fejléc nélküli) menü-lista a UNAS redesign 6 menüpontjához. */
.menu-list--flat { padding-top: var(--space-2); }

.rh-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-10);
  width: min(100%, 1000px);
  margin: 0 auto;
  padding-top: var(--space-4);
}

@media (max-width: 900px) {
  .rh-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .rh-grid { grid-template-columns: 1fr; }
}

.rh-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 150px;
  padding: var(--space-12) var(--space-12) var(--space-10);
  text-align: left;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.rh-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.rh-card-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rh-card-kpi {
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-strong);
  line-height: 1.1;
}

.rh-card-caption {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: auto;
}

.rh-spark {
  width: 100%;
  height: 40px;
  color: var(--primary);
  margin-top: var(--space-2);
}

/* „Kérdezz az AI-tól" CTA-kártya — márkás kiemelés. */
.rh-card--cta {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border-color: transparent;
  color: #fff;
}
.rh-card--cta .rh-card-title,
.rh-card--cta .rh-card-kpi,
.rh-card--cta .rh-card-caption { color: #fff; }
.rh-card--cta:hover { border-color: transparent; }

/* Detail nézet — vissza-gomb + alriport-választó wizard. */
.rh-detail { width: min(100%, 760px); margin: 0 auto; }

.rh-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  margin-bottom: var(--space-10);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text-strong);
  font-weight: var(--weight-medium);
  cursor: pointer;
}
.rh-back:hover { border-color: var(--primary); color: var(--primary); }

.rh-wizard-q {
  margin: 0 0 var(--space-8);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-text-strong);
}

.rh-pills { display: flex; flex-wrap: wrap; gap: var(--space-5); }

.rh-pill {
  padding: var(--space-5) var(--space-9);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text-strong);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.rh-pill:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================================================================
   === UNAS REDESIGN — ARCHIVE ===
   Egyesített archívum-tábla (Okos hirdetések + Tartalomgyártás kimenetei) +
   típus-badge (hirdetés = kék, webshop-tartalom = zöld) + megtekintő popup.
   Lásd unas_archive.js. (UNAS app redesign §7.)
   ============================================================================ */

.arch { width: min(100%, 980px); margin: 0 auto; }

.arch-tabs { display: flex; gap: var(--space-4); margin-bottom: var(--space-10); }

.arch-tab {
  padding: var(--space-4) var(--space-9);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text-strong);
  font-weight: var(--weight-medium);
  cursor: pointer;
}
.arch-tab.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

.badge-ad { background: rgba(26, 143, 255, 0.14); color: #1a8fff; }
.badge-content { background: var(--primary-soft); color: var(--primary); }

.arch-table { width: 100%; border-collapse: collapse; }
.arch-table th, .arch-table td {
  padding: var(--space-6) var(--space-7);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
}
.arch-table thead th {
  background: var(--c-navy);
  color: #fff;
  font-weight: var(--weight-semibold);
}
.arch-table tbody tr:hover { background: var(--color-surface-subtle); }
.arch-actions { display: flex; gap: var(--space-4); white-space: nowrap; }

.arch-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-strong);
  cursor: pointer;
}
.arch-btn:hover { border-color: var(--primary); color: var(--primary); }
.arch-btn--danger:hover { border-color: #d24; color: #d24; }

/* Megtekintő popup. */
.arch-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(16, 42, 61, 0.55);
  padding: var(--space-10);
}
.arch-modal {
  width: min(100%, 640px);
  max-height: 86vh;
  overflow: auto;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.arch-modal-head {
  display: flex; align-items: center; gap: var(--space-6);
  padding: var(--space-8) var(--space-10);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; background: var(--color-surface);
}
.arch-modal-head strong { flex: 1; }
.arch-modal-close {
  background: transparent; border: none; cursor: pointer;
  color: var(--muted); font-size: var(--text-xl);
}
.arch-modal-body { padding: var(--space-10); }
.arch-media { max-width: 100%; border-radius: var(--radius-md); }
.arch-text { white-space: pre-wrap; line-height: var(--leading-normal); color: var(--color-text); }

/* ============================================================================
   === UNAS REDESIGN — ADS ===
   Okos hirdetések: 5 szegmens-kártya (2-2-1) + detail (tartalom-típus pillek +
   előszűrt DataGrid) + eredmény-popup (lapozható, vágólap). Lásd ads.js. (§6.)
   ============================================================================ */

.ads-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-10);
  width: min(100%, 880px);
  margin: 0 auto;
  padding-top: var(--space-4);
}
/* Az 5. kártya („Én választok") a két oszlop alatt középre kerül (2-2-1). */
.ads-grid > .ads-card:nth-child(5) { grid-column: 1 / -1; max-width: 430px; margin: 0 auto; width: 100%; }

@media (max-width: 640px) {
  .ads-grid { grid-template-columns: 1fr; }
  .ads-grid > .ads-card:nth-child(5) { max-width: none; }
}

.ads-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-12);
  text-align: left;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.ads-card:hover { transform: translateY(-2px); border-color: var(--primary); }

.ads-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: var(--text-2xl);
}
.ads-card-title { font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--color-text-strong); }
.ads-card-desc { font-size: var(--text-sm); color: var(--muted); line-height: var(--leading-normal); }

/* Detail nézet. */
.ads-detail { width: 100%; }
.ads-types {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-5);
  margin: var(--space-6) 0 var(--space-10);
}
.ads-types-label { font-weight: var(--weight-semibold); color: var(--color-text-strong); }
.ads-pill {
  padding: var(--space-4) var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text-strong);
  font-weight: var(--weight-medium);
  cursor: pointer;
}
.ads-pill.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Eredmény-popup. */
.ads-result { width: min(100%, 680px); }
.ads-result-counter { flex: 1; font-size: var(--text-sm); color: var(--color-text-strong); }
.ads-result-body { min-height: 120px; }
.ads-result-foot {
  display: flex; align-items: center; gap: var(--space-5);
  padding: var(--space-7) var(--space-10);
  border-top: 1px solid var(--color-border);
}
.ads-foot-spacer { flex: 1; }
.ads-pager {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); cursor: pointer; color: var(--color-text-strong);
}
.ads-pager:hover { border-color: var(--primary); color: var(--primary); }
.ads-result-foot .secondary-button {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-4) var(--space-8);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); color: var(--color-text-strong);
  font-weight: var(--weight-medium); cursor: pointer;
}
.ads-result-foot .secondary-button:hover { border-color: var(--primary); color: var(--primary); }
.ads-error { color: #d24; margin-top: var(--space-5); }

.ads-toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 1100;
  background: var(--c-navy); color: #fff;
  padding: var(--space-6) var(--space-10);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  font-size: var(--text-sm);
}

/* ============================================================================
   === UNAS REDESIGN — SETTINGS ===
   Beállítások: alapbeállítások form (Facebook/Instagram fiók ID) + kliens
   prompt garden CRUD (+ globális garden import). Lásd unas_settings.js. (§8.)
   ============================================================================ */

.set { width: min(100%, 760px); margin: 0 auto; display: grid; gap: var(--space-12); }

.set-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-12);
}
.set-card h3 { margin: 0 0 var(--space-3); font-size: var(--text-xl); color: var(--color-text-strong); }
.set-hint { margin: 0 0 var(--space-10); color: var(--muted); font-size: var(--text-sm); }

.set-field { display: grid; gap: var(--space-3); margin-bottom: var(--space-8); }
.set-field > span { font-weight: var(--weight-medium); color: var(--color-text-strong); font-size: var(--text-sm); }
.set-field input, .set-field select, .set-field textarea {
  padding: var(--space-5) var(--space-7);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-base);
}
.set-field textarea { resize: vertical; }
.set-field input:focus, .set-field select:focus, .set-field textarea:focus {
  outline: none; border-color: var(--primary);
}

.set-actions { display: flex; align-items: center; gap: var(--space-6); }
.set-msg { color: var(--primary); font-size: var(--text-sm); font-weight: var(--weight-medium); }

.set-editor {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-10);
  margin-bottom: var(--space-10);
}
.set-editor-head { margin-bottom: var(--space-6); }

.set-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-6); }
.set-item {
  display: flex; align-items: flex-start; gap: var(--space-8);
  padding: var(--space-8);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle);
}
.set-item-main { flex: 1; display: grid; gap: var(--space-3); }
.set-item-text { margin: 0; color: var(--muted); font-size: var(--text-sm); white-space: pre-wrap; }
.set-item-actions { display: flex; gap: var(--space-4); white-space: nowrap; }
.set-empty { color: var(--muted); font-size: var(--text-sm); }

/* Saját AI-modellek (SPEC-kliens-szintu-ai-modellek.md): checkbox-mező a modell-modalban. */
.set-field--check {
  display: flex; align-items: center; gap: var(--space-4);
}
.set-field--check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.set-field--check > span { font-weight: var(--weight-medium); color: var(--color-text-strong); font-size: var(--text-sm); }

/* === UNAS REDESIGN — ADS mátrix (Hirdetéskezelés) === */
.ads-cell { text-align: center; }
.ads-cell .ads-check { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); }
.ads-colall {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--text-2xs); font-weight: var(--weight-regular);
  color: var(--muted); cursor: pointer;
}
.ads-colall input { accent-color: var(--primary); cursor: pointer; }
.ads-result-body .arch-text { white-space: pre-wrap; line-height: var(--leading-normal); }

/* === RIPORTOK — ELEMZÉSEK (időszak-összevetés: bázis vs jelenlegi idődiagram) === */
.analysis-summary {
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.analysis-kpi {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2, rgba(0,0,0,.03));
  border: 1px solid var(--border, rgba(0,0,0,.08));
  border-radius: var(--radius-md, 8px);
  min-width: 140px;
}
.analysis-kpi-label { font-size: var(--text-2xs); color: var(--muted); }
.analysis-kpi strong { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.analysis-delta.is-up strong { color: #16a34a; }
.analysis-delta.is-down strong { color: #dc2626; }
.analysis-chart-wrap { position: relative; height: 340px; width: 100%; }

/* === PRODUCT DETAIL MODAL ===
   Egy termék részletes pillanatképe (termékstatisztika-táblákból a névre kattintva megnyílik).
   Csak design-tokeneket használ; a felépítést a product_modal.js adja. */

/* Kattintható terméknév a report-táblákban (a nem-termék sorok sima szövegek maradnak). */
.pm-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--primary);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}
.pm-link:hover { color: var(--primary-hover); text-decoration: underline; }

.product-modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  z-index: 1100;
  overflow-y: auto;
}

.product-modal {
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 720px;
  overflow: hidden;
}

.pm-header {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  background: var(--navy);
  color: #fff;
  padding: var(--space-10) var(--space-12);
}
.pm-header-thumb {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.pm-header-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pm-header-text { flex: 1 1 auto; min-width: 0; }
.pm-header-text h2 { margin: 0; color: #fff; font-size: 1.25rem; font-weight: var(--weight-bold); }
.pm-subtitle { margin: 2px 0 0; color: rgba(255, 255, 255, 0.72); font-size: 0.85rem; }
.pm-close {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: var(--space-2);
}
.pm-close:hover { color: #fff; }

.pm-body {
  padding: var(--space-12);
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.pm-top { display: flex; gap: var(--space-12); }
.pm-photo {
  width: 148px;
  height: 148px;
  flex: 0 0 148px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--color-surface-subtle);
  border: 1px solid var(--line);
}
.pm-photo-empty { display: block; }
.pm-descs { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--space-8); }

.pm-field-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.pm-shortdesc, .pm-descs .pm-field p, .pm-seo p { margin: 0; color: var(--color-text-row); }
.pm-longdesc { color: var(--color-text-row); }
.pm-longdesc.is-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pm-more {
  margin-top: var(--space-3);
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pm-more:hover { color: var(--primary-hover); }

.pm-seo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-10);
  background: var(--color-surface-subtle-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-10) var(--space-12);
}

.pm-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
}
.pm-kpi {
  background: var(--color-surface-subtle);
  border-radius: var(--radius);
  padding: var(--space-8) var(--space-10);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.pm-kpi.is-stock { background: var(--green-soft-bg); }
.pm-kpi-label { font-size: 0.8rem; color: var(--color-text-subtle); }
.pm-kpi.is-stock .pm-kpi-label { color: var(--primary); }
.pm-kpi-value { font-size: 1.4rem; font-weight: var(--weight-bold); color: var(--color-text); }
.pm-kpi.is-stock .pm-kpi-value { color: var(--primary); }
.pm-kpi-sub { font-size: 0.8rem; color: var(--color-text-muted); }
.pm-kpi.is-stock .pm-kpi-sub { color: var(--primary); }

.pm-chart-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-10) var(--space-12) var(--space-12);
}
.pm-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}
.pm-chart-title { font-weight: var(--weight-semibold); color: var(--color-text-strong); }
.pm-chart-total { font-size: 0.85rem; color: var(--color-text-muted); }
.pm-chart-wrap { position: relative; height: 220px; width: 100%; }

/* „Ezeket vették még a termékhez" — társ-termék lista a termék-modálban (kattintható tételek). */
.pm-bought { display: flex; flex-direction: column; gap: var(--space-6); }
.pm-bought-empty { margin: 0; color: var(--color-text-muted); }
.pm-bought-list { display: flex; flex-direction: column; gap: var(--space-4); }
.pm-bought-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  padding: var(--space-6) var(--space-8);
  background: var(--color-surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--color-text);
}
.pm-bought-item:hover { border-color: var(--primary); color: var(--primary); }
.pm-bought-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-bought-qty { flex: 0 0 auto; font-weight: var(--weight-semibold); color: var(--color-text-strong); }
.pm-bought-item:hover .pm-bought-qty { color: var(--primary); }

/* Co-purchase drill-down modál: nézet-váltó. */
.pm-toggle { margin-bottom: var(--space-4); }
/* Tartalom-megtekintő (batch jóváhagyás + UNAS archívum) a report/co-purchase modal designnal —
   szélesebb panel a képek/HTML-előnézetek kényelmes megjelenítéséhez. */
.pimc-vmodal { max-width: 860px; }
.cp-note { margin: var(--space-6) 0 0; font-size: 0.8rem; color: var(--color-text-muted); }

@media (max-width: 640px) {
  .pm-top { flex-direction: column; }
  .pm-photo { width: 120px; height: 120px; flex-basis: 120px; }
  .pm-seo { grid-template-columns: 1fr; }
  .pm-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================================
   UNAS FEED KEZELÉS — általános feed-kezelő (unas.feed)
   Belépő (Feedek + Feed típusok táblázat) · típus-szerkesztő · feed-szerkesztő
   (3-termékes élő minta-panel + attribútum-táblázat + keletkeztetés-modal:
   chip-kompozíció / csereszabályok / AI) · „Megnézem" nézet. Lásd feed_manager.js.
   Gombok: a közös .ps-btn készlet; saját világos-panel vezérlők: .feedm-input/-select.
   ============================================================================ */

.feedm { display: flex; flex-direction: column; gap: var(--space-7); }

.feedm-section { display: flex; flex-direction: column; gap: var(--space-4); }
.feedm-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
}
.feedm-section-head h2 { margin: 0; font-size: var(--text-lg); }

.feedm-toolbar { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.feedm-spacer { flex: 1; }
.feedm-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }

.feedm-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.feedm-muted { color: var(--color-text-muted); font-size: var(--text-sm); }
.feedm-help { display: block; color: var(--color-text-muted); font-size: var(--text-xs); font-weight: var(--weight-regular); }

/* --- űrlap-vezérlők (világos panelen) --- */
.feedm-fields { display: flex; gap: var(--space-7); flex-wrap: wrap; }
.feedm-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.feedm-fields > .feedm-field { min-width: 220px; flex: 1 1 220px; }
.feedm-inline-controls { display: flex; gap: var(--space-3); }
.feedm-input,
.feedm-select,
.feedm-textarea {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-ctl);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  width: 100%;
}
.feedm-textarea { resize: vertical; }
.feedm-input:focus,
.feedm-select:focus,
.feedm-textarea:focus { outline: none; border-color: var(--color-primary); }
.feedm-input:disabled { background: var(--color-surface-muted); color: var(--color-text-muted); }

/* --- termékkör (kategória-checkboxok) --- */
.feedm-scope { display: flex; flex-direction: column; gap: var(--space-3); }
.feedm-scope-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); }
.feedm-cats {
  display: flex;
  flex-direction: column;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-ctl);
}
.feedm-cat {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  cursor: pointer;
}
.feedm-cat:nth-child(even) { background: var(--color-surface-muted); }
.feedm-cat > span:first-of-type { flex: 1; }
.feedm-cat--hidden { display: none; }

/* --- minta-panel --- */
.feedm-sample {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.feedm-sample-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); }

/* --- attribútum-táblázat --- */
.feedm-attrs td { vertical-align: top; }
.feedm-attr-meta { color: var(--color-text-muted); font-size: var(--text-xs); }
.feedm-result { font-size: var(--text-sm); max-width: 420px; overflow-wrap: anywhere; }

/* --- keletkeztetés-modal --- */
.feedm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-8);
}
.feedm-modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  width: min(720px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-7);
}
.feedm-modal-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); }
.feedm-mode-tabs { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.feedm-modal-body { display: flex; flex-direction: column; gap: var(--space-4); }
.feedm-modal-foot { display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* --- kompozíció (chip) szerkesztő --- */
.feedm-compose-wrap { display: flex; flex-direction: column; gap: var(--space-3); flex: 1; }
.feedm-compose {
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-ctl);
  font-size: var(--text-sm);
  line-height: 1.9;
}
.feedm-compose:focus { outline: none; border-color: var(--color-primary); }
.feedm-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--color-primary-soft, #e6f4ef);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-pill, 999px);
  padding: 0 var(--space-3);
  margin: 0 2px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  user-select: none;
}
.feedm-chip-x {
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  font-size: var(--text-sm);
  padding: 0;
  line-height: 1;
}
.feedm-compose-picker { display: flex; gap: var(--space-3); align-items: center; }
.feedm-compose-picker .feedm-select { flex: 1; }

/* --- csereszabályok --- */
.feedm-rules { display: flex; flex-direction: column; gap: var(--space-5); }
.feedm-rule {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-ctl);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.feedm-rule-cond { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; font-size: var(--text-sm); }
.feedm-rule-cond .feedm-select { width: auto; min-width: 180px; }
.feedm-rule-cond .feedm-input { width: auto; min-width: 160px; flex: 1; }
.feedm-rule-cond .feedm-select.feedm-op { min-width: 120px; flex: 0 0 auto; }
.feedm-rule-cond .feedm-input.feedm-num { min-width: 90px; flex: 0 1 120px; }
.feedm-rule-out { display: flex; gap: var(--space-3); align-items: flex-start; font-size: var(--text-sm); }
.feedm-rule-default { display: flex; flex-direction: column; gap: var(--space-3); }

/* --- futás-állapot + publikus URL-ek + eredmény --- */
.feedm-run:empty { display: none; }
.feedm-urls { display: flex; flex-direction: column; gap: var(--space-3); }
.feedm-url-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.feedm-url {
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-ctl);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}
.feedm-url-label {
  background: var(--color-surface-muted);
  border-radius: var(--radius-pill, 999px);
  padding: 0 var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.feedm-warn {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-6);
  color: var(--color-warning-text, #8a6d1a);
  font-size: var(--text-sm);
}
.feedm-items { display: flex; flex-direction: column; gap: var(--space-3); }

@media (max-width: 720px) {
  .feedm-fields { flex-direction: column; }
  .feedm-rule-cond { align-items: stretch; flex-direction: column; }
  .feedm-modal-overlay { padding: var(--space-4); }
}

/* ============================================================================================
   KÍVÁNSÁGLISTA WIDGET (SPEC-wishlist-feedback-widget.md) — shell-szintű lebegő mini-panel,
   jobb alsó sarok, minden appon és a landingon is elérhető bejelentkezés után.
   ============================================================================================ */
.wishlist-widget {
  position: fixed;
  right: var(--space-8);
  bottom: var(--space-8);
  z-index: 9000;
  font-family: inherit;
}
.wishlist-widget.is-hidden { display: none; }

.wishlist-widget-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--color-danger);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: var(--space-5) var(--space-7);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}
.wishlist-widget-toggle:hover { background: var(--color-danger-hover); }

.wishlist-widget-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + var(--space-5));
  width: min(340px, calc(100vw - var(--space-8) * 2));
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.wishlist-widget-panel.is-hidden { display: none; }

.wishlist-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
}
.wishlist-widget-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: var(--space-2);
}
.wishlist-widget-close:hover { color: var(--color-text); }

.wishlist-widget-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.wishlist-widget-empty { color: var(--color-text-muted); font-size: var(--text-sm); margin: var(--space-4) 0; }

.wishlist-widget-row {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  background: var(--panel-muted);
}
.wishlist-widget-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.wishlist-widget-row-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 0;
}
.wishlist-widget-row-delete:hover { color: var(--color-danger); }
.wishlist-widget-row-text { font-size: var(--text-sm); overflow-wrap: break-word; }

.wishlist-widget-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--color-border);
}
.wishlist-widget-form textarea {
  resize: vertical;
  font-family: inherit;
  font-size: var(--text-sm);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--color-text);
}
.wishlist-widget-error {
  margin: 0 var(--space-6) var(--space-4);
  color: var(--color-danger);
  font-size: var(--text-xs);
}
.wishlist-widget-error:empty { display: none; }

/* ============================================================================================
   Ads Monitor (Google Ads agency monitoring) app — Session 1 (Beállítások: kapcsolat, párosítás,
   ügyfelek). A közös design-tokenekre épül; nincs per-app CSS-fájl (a konvenció szerint minden
   osztály ide, a közös styles.css-be kerül, `amon-` prefixszel).
   ============================================================================================ */
.amon-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-12);
  margin-bottom: var(--space-10);
}
.amon-panel > h2 { margin: 0 0 var(--space-4); font-size: var(--text-lg, 1.05rem); color: var(--color-text-strong); }
.amon-panel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); margin-bottom: var(--space-4); }
.amon-panel__head h2 { margin: 0; font-size: var(--text-lg, 1.05rem); color: var(--color-text-strong); }
.amon-muted { color: var(--color-text-muted); font-size: var(--text-sm, .9rem); margin: 0 0 var(--space-8); }
.amon-ok { color: var(--color-primary); font-size: var(--text-sm, .9rem); margin: var(--space-6) 0 0; }
.amon-err { color: var(--color-danger); font-size: var(--text-sm, .9rem); margin: var(--space-6) 0 0; }

.amon-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); margin-bottom: var(--space-8); }
.amon-form-grid label,
.amon-form-inline label { display: flex; flex-direction: column; gap: var(--space-3); font-size: var(--text-sm, .9rem); color: var(--color-text-strong); }
.amon-form-inline { display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: flex-end; margin-bottom: var(--space-8); }
.amon-panel input[type="text"],
.amon-panel input[type="email"],
.amon-panel input[type="password"],
.amon-panel select {
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-subtle-2);
  color: var(--color-text);
  font: inherit;
  min-width: 220px;
}
.amon-panel input:focus, .amon-panel select:focus { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.amon-btn-row { display: flex; flex-wrap: wrap; gap: var(--space-6); margin-top: var(--space-4); }
.amon-link-danger { background: none; border: none; color: var(--color-danger); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.amon-link-danger:hover { color: var(--color-danger-hover); }
@media (max-width: 720px) { .amon-form-grid { grid-template-columns: 1fr; } }

/* ── Session 3 UI: dashboard / riasztás-nézetek / ügyfelek / config-mátrix ─────────────────── */
.amon-view { display: flex; flex-direction: column; gap: var(--space-10); }
.amon-view__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); flex-wrap: wrap; }
.amon-view__head h2 { margin: 0; font-size: var(--text-lg, 1.1rem); color: var(--color-text-strong); display: flex; align-items: center; gap: var(--space-4); }

/* Ügyfélnek szóló magyarázat-box a táblázatok/nézetek fölött */
.amon-intro { display: flex; align-items: flex-start; gap: var(--space-5); padding: var(--space-6) var(--space-8); background: var(--color-primary-soft); border-left: 3px solid var(--color-primary); border-radius: var(--radius-sm); }
.amon-intro > i { color: var(--color-primary); font-size: 1.05rem; margin-top: 1px; flex: 0 0 auto; }
.amon-intro p { margin: 0; font-size: var(--text-sm, .9rem); color: var(--color-text-row); line-height: 1.5; }

/* Link-gomb (sima szöveg-akció márkaszínnel) */
.amon-link { background: none; border: none; color: var(--color-primary); cursor: pointer; font: inherit; padding: 0; text-decoration: none; display: inline-flex; align-items: center; gap: var(--space-3); }
.amon-link:hover { color: var(--color-primary-hover); text-decoration: underline; }

/* Toolbar + vezérlők */
.amon-toolbar { display: flex; align-items: center; gap: var(--space-6); flex-wrap: wrap; }
.amon-chips { display: inline-flex; gap: var(--space-2); background: var(--color-surface-subtle); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-2); }
.amon-chip { border: none; background: none; color: var(--color-text-muted); font: inherit; font-size: var(--text-sm, .9rem); padding: var(--space-3) var(--space-7); border-radius: var(--radius-sm); cursor: pointer; }
.amon-chip:hover { color: var(--color-text-strong); }
.amon-chip.is-active { background: var(--color-primary); color: #fff; }
.amon-select { padding: var(--space-5) var(--space-6); border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface-subtle-2); color: var(--color-text); font: inherit; }
.amon-search, .amon-client-picker { position: relative; display: inline-flex; align-items: center; }
.amon-search > i, .amon-client-picker > i { position: absolute; left: var(--space-5); color: var(--color-text-muted); pointer-events: none; }
.amon-search input, .amon-client-picker input { padding: var(--space-5) var(--space-6) var(--space-5) calc(var(--space-8) + 12px); border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface-subtle-2); color: var(--color-text); font: inherit; min-width: 220px; }
.amon-client-picker input { min-width: 260px; }
.amon-picker-clear { position: absolute; right: var(--space-4); background: none; border: none; color: var(--color-text-muted); cursor: pointer; padding: 0; display: inline-flex; }
.amon-picker-clear:hover { color: var(--color-danger); }
.amon-view input:focus, .amon-view select:focus, .amon-modal input:focus { outline: 2px solid var(--color-focus); outline-offset: 1px; }

/* Dashboard kártyarács */
.amon-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-6); }
.amon-card { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); text-align: left; padding: var(--space-8); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.amon-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,.08)); }
.amon-card.is-active { border-color: var(--color-warning); }
.amon-card__icon { color: var(--color-primary); font-size: 1.2rem; }
.amon-card.is-active .amon-card__icon { color: var(--color-warning); }
.amon-card__count { font-size: 1.6rem; font-weight: 700; color: var(--color-text-strong); line-height: 1; }
.amon-card__label { font-size: var(--text-sm, .85rem); color: var(--color-text-muted); }

/* Trend SVG */
.amon-trend { width: 100%; height: 140px; display: block; }
.amon-trend .amon-bar { fill: var(--color-primary); opacity: .85; }
.amon-trend .amon-bar:hover { opacity: 1; }
.amon-trend .amon-axis { fill: var(--color-text-muted); font-size: 10px; }

/* Legfrissebb riasztások lista */
.amon-latest { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.amon-latest__row { display: grid; grid-template-columns: 200px 1fr 2fr auto; gap: var(--space-6); align-items: center; padding: var(--space-5) 0; border-top: 1px solid var(--color-border); cursor: pointer; font-size: var(--text-sm, .9rem); }
.amon-latest__row:first-child { border-top: none; }
.amon-latest__row:hover { background: var(--color-surface-hover); }
.amon-latest__client { color: var(--color-text-strong); font-weight: 600; }
.amon-latest__sum { color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amon-latest__time { color: var(--color-text-muted); white-space: nowrap; }

.amon-client-row { cursor: pointer; }
.amon-client-row:hover { background: var(--color-surface-hover); }
.amon-url { display: inline-block; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.amon-row-actions { display: flex; gap: var(--space-6); white-space: nowrap; }
.amon-view table input[type="text"], .amon-view table input[type="email"], .amon-view table input[type="number"] {
  padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface-subtle-2); color: var(--color-text); font: inherit; width: 100%; min-width: 90px;
}

/* Chip / badge */
.amon-type-chip { display: inline-flex; align-items: center; gap: var(--space-3); font-size: var(--text-sm, .85rem); color: var(--color-text-row); white-space: nowrap; }
.amon-type-chip i { color: var(--color-primary); }
.amon-badge { display: inline-flex; align-items: center; gap: var(--space-3); font-size: var(--text-xs, .78rem); font-weight: 600; padding: var(--space-2) var(--space-5); border-radius: 999px; white-space: nowrap; }
.amon-badge--ok { background: var(--color-primary-soft); color: var(--color-primary); }
.amon-badge--watch { background: color-mix(in srgb, var(--color-warning) 18%, transparent); color: var(--color-warning); }
.amon-badge--danger { background: var(--color-danger-soft); color: var(--color-danger); }
.amon-badge--open { background: color-mix(in srgb, var(--color-warning) 18%, transparent); color: var(--color-warning); }
.amon-badge--muted { background: var(--color-surface-muted); color: var(--color-text-muted); }
.amon-dev.is-up { color: var(--color-danger); font-weight: 600; }
.amon-dev.is-down { color: var(--color-primary); font-weight: 600; }

/* Pager */
.amon-pager { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); margin-top: var(--space-6); }
.amon-pager__btns { display: flex; gap: var(--space-4); }

/* Ügyfél mini-jelzők */
.amon-mini-row { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.amon-mini { display: inline-flex; align-items: center; gap: 2px; color: var(--color-text-subtle); font-size: var(--text-sm, .85rem); opacity: .45; }
.amon-mini.is-hot { color: var(--color-warning); opacity: 1; font-weight: 600; }
.amon-mini b { font-size: var(--text-xs, .75rem); }

/* Tabok */
.amon-tabs { display: flex; gap: var(--space-2); border-bottom: 1px solid var(--color-border); }
.amon-tab { border: none; background: none; color: var(--color-text-muted); font: inherit; font-size: var(--text-sm, .92rem); padding: var(--space-6) var(--space-8); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: var(--space-3); }
.amon-tab:hover { color: var(--color-text-strong); }
.amon-tab.is-active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }

/* Config-mátrix + tömeges alkalmazás */
.amon-bulk { display: flex; align-items: flex-end; gap: var(--space-6); flex-wrap: wrap; padding: var(--space-8); background: var(--color-surface-subtle); border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: var(--space-8); }
.amon-bulk__f { display: flex; flex-direction: column; gap: var(--space-3); font-size: var(--text-xs, .8rem); color: var(--color-text-muted); }
.amon-bulk__f input { padding: var(--space-3) var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface-subtle-2); color: var(--color-text); font: inherit; width: 110px; }
.amon-col-check { width: 32px; text-align: center; }
.amon-config-table .amon-cfg-input { width: 90px; }

/* Modal */
.amon-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: var(--space-8); }
.amon-modal { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-12); width: min(520px, 100%); max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg, 0 12px 40px rgba(0,0,0,.25)); }
.amon-modal__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); margin-bottom: var(--space-4); }
.amon-modal__head h3 { margin: 0; color: var(--color-text-strong); }
.amon-modal__close { background: none; border: none; color: var(--color-text-muted); cursor: pointer; font-size: 1.1rem; display: inline-flex; }
.amon-modal__close:hover { color: var(--color-danger); }
.amon-wl-list { list-style: none; margin: 0 0 var(--space-8); padding: 0; }
.amon-wl-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); padding: var(--space-5) 0; border-top: 1px solid var(--color-border); }
.amon-wl-list li:first-child { border-top: none; }

.amon-run-errors { margin-top: var(--space-4); }
.amon-run-errors ul, .amon-examined ul { margin: var(--space-2) 0 0; padding-left: var(--space-8); }
.amon-run-errors li { font-size: var(--text-sm, .85rem); color: var(--color-text-muted); margin-bottom: var(--space-2); word-break: break-word; }
.amon-examined { margin-top: var(--space-6); }
.amon-examined li { font-size: var(--text-sm, .85rem); color: var(--color-text-row); margin-bottom: var(--space-3); }

/* Riasztás-motor futás-progress */
.amon-progress { margin-top: var(--space-4); }
.amon-progress__bar { height: 8px; background: var(--color-surface-muted); border-radius: 999px; overflow: hidden; }
.amon-progress__bar span { display: block; height: 100%; background: var(--color-primary); border-radius: 999px; transition: width .4s ease; }

@media (max-width: 720px) {
  .amon-latest__row { grid-template-columns: 1fr; gap: var(--space-2); }
  .amon-toolbar { gap: var(--space-4); }
}

/* ============================================================================================
   Adlogic Ads Monitor — fázis-5 UI (riport-nézetek). Design-token vezérelt, az amon- réteg része;
   nincs per-app CSS. Kiegészíti a fázis-1 amon- paneljeit (a Klikkmániával közös prefix).
   ============================================================================================ */

/* Közös fejléc-vezérlő: ügyfél-választó + időszak-preset (spec §5.2) */
.amon-report-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-8); padding: var(--space-6) var(--space-8); background: var(--color-surface-subtle); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.amon-field-label { display: block; font-size: var(--text-sm, .82rem); color: var(--color-text-muted); margin-bottom: var(--space-2); }
.amon-client-pick { display: flex; flex-direction: column; min-width: 240px; }
.amon-client-pick input { padding: var(--space-4) var(--space-6); border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-text-strong); font: inherit; }
.amon-client-pick input:focus { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.amon-period-group { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.amon-period-group .amon-field-label { width: 100%; margin-bottom: var(--space-2); }
.amon-period-btn, .amon-toggle-btn { border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-row); font: inherit; font-size: var(--text-sm, .88rem); padding: var(--space-3) var(--space-6); border-radius: var(--radius-sm); cursor: pointer; }
.amon-period-btn:hover, .amon-toggle-btn:hover { border-color: var(--color-border-strong); color: var(--color-text-strong); }
.amon-period-btn.is-active, .amon-toggle-btn.is-active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

.amon-report-body { display: flex; flex-direction: column; gap: var(--space-8); }

/* Dashboard — stat-kártyák + TOP-táblák (spec §5.2) */
.amon-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.amon-stat { background: var(--color-surface-raised, var(--color-surface)); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-7) var(--space-8); box-shadow: var(--shadow); }
.amon-stat__label { font-size: var(--text-sm, .82rem); color: var(--color-text-muted); margin-bottom: var(--space-3); }
.amon-stat__value { font-size: 1.5rem; font-weight: 600; color: var(--color-text-strong); }
.amon-dash-tables { display: flex; flex-direction: column; gap: var(--space-8); }

/* Vezetői összefoglaló kártya */
.amon-summary__out { margin-top: var(--space-4); }
.amon-summary__text { color: var(--color-text-row); line-height: 1.6; }
.amon-summary__meta { margin-top: var(--space-4); font-size: var(--text-sm, .82rem); }

/* Prompt-szerkesztő */
.amon-chip-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-4); }
.amon-chip-row .amon-chip { border: 1px solid var(--color-border); background: var(--color-surface-inset, var(--color-surface-subtle)); font-family: var(--font-mono, monospace); font-size: var(--text-sm, .82rem); }
.amon-chip-row .amon-chip:hover { border-color: var(--color-primary); color: var(--color-primary); }
.amon-textarea { width: 100%; box-sizing: border-box; padding: var(--space-5) var(--space-6); border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-text-strong); font-family: var(--font-mono, monospace); font-size: var(--text-sm, .85rem); line-height: 1.5; resize: vertical; }
.amon-textarea:focus { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.amon-inline-msg { align-self: center; font-size: var(--text-sm, .85rem); }
.amon-sm { padding: var(--space-2) var(--space-5) !important; font-size: var(--text-sm, .82rem) !important; }

/* §3.6 téma-kártyák (bespoke, összecsukható) */
.amon-theme-card { border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); overflow: hidden; }
.amon-theme-card > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); padding: var(--space-5) var(--space-7); cursor: pointer; list-style: none; }
.amon-theme-card > summary::-webkit-details-marker { display: none; }
.amon-theme-name { font-weight: 600; color: var(--color-text-strong); }
.amon-theme-meta { font-size: var(--text-sm, .82rem); color: var(--color-text-muted); }
.amon-theme-inner { padding: 0 var(--space-7) var(--space-6); border-top: 1px solid var(--color-border); }
.amon-theme-toolbar { padding: var(--space-5) 0; }
.amon-theme-terms { display: flex; flex-direction: column; gap: var(--space-1); }
.amon-theme-term { display: flex; align-items: center; gap: var(--space-5); padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); cursor: pointer; }
.amon-theme-term:hover { background: var(--color-surface-hover, var(--color-surface-subtle)); }
.amon-term-txt { flex: 1 1 auto; color: var(--color-text-row); }
.amon-term-cost { color: var(--color-text-muted); font-variant-numeric: tabular-nums; }

/* §3.9 idővonal — táblázat/grafikon kapcsoló + reszponzív, cellát kitöltő sparkline */
.amon-tl-controls { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-bottom: var(--space-4); }
.amon-toggle { display: inline-flex; gap: var(--space-2); background: var(--color-surface-subtle); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-2); }
/* table-layout: fixed → a terméknév fix keskeny oszlop, a grafikon/érték a maradék helyet tölti ki (reszponzív) */
.amon-tl-table { width: 100%; table-layout: fixed; }
.amon-tl-table td, .amon-tl-table th { vertical-align: middle; }
.amon-tl-name { width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amon-spark-cell { padding: var(--space-2) var(--space-4); }
.amon-spark-wrap { position: relative; height: 34px; color: var(--color-primary); }
.amon-spark { display: block; width: 100%; height: 34px; }
.amon-spark-max, .amon-spark-min { position: absolute; right: 3px; font-size: .68rem; line-height: 1; color: var(--color-text-muted); font-variant-numeric: tabular-nums; background: var(--color-surface); padding: 0 2px; border-radius: 2px; pointer-events: none; }
.amon-spark-max { top: 0; }
.amon-spark-min { bottom: 0; }
@media (max-width: 700px) { .amon-tl-name { width: 120px; } }

/* Google Ads kapcsolat — becsukható szekció a Dashboardon */
.amon-details { border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-subtle); }
.amon-details > summary { padding: var(--space-5) var(--space-7); cursor: pointer; color: var(--color-text-row); font-size: var(--text-sm, .9rem); display: flex; align-items: center; gap: var(--space-4); list-style: none; }
.amon-details > summary::-webkit-details-marker { display: none; }
.amon-details > summary > i { color: var(--color-primary); }
.amon-details[open] > summary { border-bottom: 1px solid var(--color-border); }
.amon-details > div { padding: var(--space-6); }

/* Ügyfelek áttekintő kártyák */
.amon-client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-6); }
.amon-client-card { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); text-align: left; padding: var(--space-7) var(--space-8); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); cursor: pointer; box-shadow: var(--shadow); }
.amon-client-card:hover { border-color: var(--color-primary); }
.amon-client-card__name { font-weight: 600; color: var(--color-text-strong); }
.amon-client-card__id { font-size: var(--text-sm, .82rem); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.amon-client-card__go { margin-top: var(--space-3); font-size: var(--text-sm, .82rem); color: var(--color-primary); display: flex; align-items: center; gap: var(--space-2); }

.amon-research-meta p { margin: 0 0 var(--space-2); }

@media (max-width: 900px) {
  .amon-stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================================================
   Adlogic Ads Monitor — "Kampánymenedzsment feladatok" checklist (SPEC-adlogic-account-checklist-
   draft.md, A. fázis). Kategória-kártya + tétel-sor, design-token-vezérelt, az amon- réteg része;
   nincs per-app CSS. Az admin küszöb-mátrix a meglévő FF-TABLE elemneveket használja (lásd lent).
   ============================================================================================ */

.amon-task-list { display: flex; flex-direction: column; gap: var(--space-6); }

.amon-task-card { border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); overflow: hidden; }
.amon-task-card.is-gate-red { border-color: var(--color-danger); box-shadow: 0 0 0 1px var(--color-danger) inset; }
.amon-task-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); padding: var(--space-5) var(--space-7); cursor: pointer; }
.amon-task-card__head h3 { margin: 0; font-size: var(--text-md, 1rem); color: var(--color-text-strong); }
.amon-task-card__meta { font-size: var(--text-sm, .82rem); color: var(--color-text-muted); }
.amon-task-card__body { padding: 0 var(--space-7) var(--space-7); border-top: 1px solid var(--color-border); }
.amon-task-card.is-collapsed .amon-task-card__body { display: none; }

.amon-task-warning { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-6); border-radius: var(--radius-sm); background: var(--c-amber-tint); color: var(--color-warning); font-size: var(--text-sm, .85rem); margin-top: var(--space-6); }

.amon-task-items { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-6); }
.amon-task-item { display: flex; align-items: flex-start; gap: var(--space-5); padding: var(--space-4) var(--space-5); border-radius: var(--radius-sm); border-left: 3px solid var(--color-border); background: var(--color-surface-subtle); }
.amon-task-item__badge { flex: 0 0 auto; display: inline-flex; align-items: center; padding: 2px var(--space-5); border-radius: 999px; font-size: var(--text-xs); font-weight: var(--weight-semibold); white-space: nowrap; }
.amon-task-item__body { flex: 1 1 auto; min-width: 0; }
.amon-task-item__label { color: var(--color-text-strong); font-weight: 500; }
.amon-task-item__meta { font-size: var(--text-sm, .82rem); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.amon-task-item__todo { font-size: var(--text-sm, .85rem); color: var(--color-text-row); margin-top: var(--space-1); }
.amon-task-item__note { font-size: var(--text-sm, .78rem); color: var(--color-text-muted); margin-top: var(--space-1); font-style: italic; }

.amon-task-item--ok { border-left-color: var(--primary); }
.amon-task-item--ok .amon-task-item__badge { background: var(--c-green-tint); color: var(--c-green-700, var(--primary)); }
.amon-task-item--action { border-left-color: var(--color-danger); background: var(--c-red-tint); }
.amon-task-item--action .amon-task-item__badge { background: var(--color-danger); color: #fff; }
.amon-task-item--opportunity { border-left-color: var(--primary); }
.amon-task-item--opportunity .amon-task-item__badge { background: var(--primary); color: #fff; }
.amon-task-item--warn { border-left-color: var(--color-warning); background: var(--c-amber-tint); }
.amon-task-item--warn .amon-task-item__badge { background: var(--color-warning); color: #3a2a00; }
.amon-task-item--na { border-left-color: var(--color-border); opacity: .7; }
.amon-task-item--na .amon-task-item__badge { background: var(--color-border); color: var(--color-text-muted); }

.amon-task-table { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-6); }
.amon-task-table h4 { margin: 0; font-size: var(--text-sm, .88rem); color: var(--color-text-strong); }

/* Shopping riport ROAS-badge (javítási kör §F) — a meglévő Kampányfeladat-küszöb szerinti zöld/piros
   jelzés, a fenti .amon-task-item badge-mintáját követve (nincs új szín bevezetve). */
.amon-roas-badge { display: inline-flex; align-items: center; padding: 2px var(--space-4); border-radius: 999px; font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
.amon-roas-badge.amon-roas-over { background: var(--c-green-tint); color: var(--c-green-700, var(--primary)); }
.amon-roas-badge.amon-roas-under { background: var(--c-red-tint); color: var(--color-danger); }

/* ===== FF-TABLE — EGYSÉGES TÁBLÁZAT-RENDSZER · KEZDET =====================================
   Vizuális igazság: specs/platform/ff-table-referencia.html. A szabályzók (--ff-*) a fájl
   elején, a design-token réteg után élnek. Ez a szekció a platform EGYETLEN táblázat-rendszere —
   új táblázat csak ezekkel az elemnevekkel készülhet (SPEC-ff-table.md §7).
   ============================================================================================ */

/* 1. Keret */
.ff-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* 2. Nézetváltó fülek */
.ff-tabs {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-7) var(--space-8);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.ff-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ff-text);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.ff-tab:hover { border-color: var(--ff-text-faint); }
.ff-tab[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.ff-tab .ff-count {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 1px var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--color-surface-subtle);
  color: var(--color-text-subtle);
  font-variant-numeric: tabular-nums;
}
.ff-tab[aria-selected="true"] .ff-count { background: var(--ff-count-active-bg); color: var(--on-navy); }

/* 3. Eszköztár + gombok */
.ff-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
  padding: var(--space-6) var(--space-8);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.ff-search { position: relative; flex: 1 1 280px; max-width: 420px; }
.ff-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ff-text-faint); }
.ff-search input {
  width: 100%;
  padding: var(--space-5) var(--space-6) var(--space-5) 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--text-base);
  color: var(--ff-text);
  background: var(--panel);
}
.ff-search input::placeholder { color: var(--ff-text-faint); }
.ff-search input:focus { outline: 2px solid var(--green); outline-offset: -1px; border-color: var(--green); }
.ff-toolbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; }
.ff-rowcount { color: var(--color-text-subtle); font-size: var(--text-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ff-sep { width: 1px; height: 22px; background: var(--line); }

.ff-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ff-text);
  padding: var(--space-4) var(--space-7);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.ff-btn:hover { background: var(--color-surface-subtle); border-color: var(--ff-text-faint); }
.ff-btn svg { flex: none; }
.ff-btn.is-primary { background: var(--green-strong); border-color: var(--green-strong); color: var(--color-on-primary); font-weight: var(--weight-semibold); }
.ff-btn.is-primary:hover { background: var(--green); border-color: var(--green); }
.ff-btn.is-danger { color: var(--color-danger); border-color: var(--ff-danger-border); }
.ff-btn.is-danger:hover { background: var(--ff-danger-bg-hover); border-color: var(--color-danger); }
.ff-btn.is-quiet { border-color: transparent; background: transparent; color: var(--color-text-subtle); }
.ff-btn.is-quiet:hover { background: var(--color-surface-subtle); color: var(--ff-text); }
.ff-btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* .ff-btn sets its own `display`, which otherwise beats the UA [hidden] rule at equal specificity
   (author origin always wins over user-agent styles) — without this, a hidden .ff-btn still renders. */
.ff-btn[hidden] { display: none; }

/* 4. Kijelölés-sáv + futásállapot */
.ff-bulkbar {
  display: none;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
  padding: var(--space-5) var(--space-8);
  background: var(--color-primary-soft);
  border-bottom: 1px solid var(--ff-bulk-border);
}
.ff-bulkbar.is-on { display: flex; }
.ff-bulkbar .ff-selinfo { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--ff-bulk-text); }
.ff-bulkbar .ff-selinfo em { font-style: normal; font-variant-numeric: tabular-nums; }
.ff-bulk-actions { margin-left: auto; display: flex; gap: var(--space-4); flex-wrap: wrap; }
.ff-runstate {
  padding: var(--space-5) var(--space-8);
  border-bottom: 1px solid var(--line);
  background: var(--ff-runstate-bg);
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
  display: flex;
  gap: var(--space-9);
  flex-wrap: wrap;
}
.ff-runstate b { color: var(--ff-text); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }

/* 5. Táblázat */
.ff-scroll { overflow: auto; max-height: 520px; }
.ff-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--ff-font-size); }

.ff-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--ff-head-bg);
  color: var(--on-navy);
  text-align: left;
  vertical-align: top;
  padding: var(--ff-head-pad-y) var(--ff-cell-pad-x);
  font-weight: var(--weight-semibold);
  font-size: var(--ff-head-font-size);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-right: 1px solid var(--navy-line);
  border-bottom: 1px solid var(--navy-line);
}
.ff-table thead th:last-child { border-right: 0; }
.ff-th { display: flex; flex-direction: column; gap: var(--space-3); }
.ff-th-label { display: flex; align-items: center; gap: var(--space-3); line-height: 1.25; cursor: pointer; user-select: none; }
.ff-th-label:hover .ff-sort { opacity: 1; }
.ff-sort { opacity: 0.6; flex: none; transition: opacity 0.12s; }
.ff-th-label.is-sorted .ff-sort { opacity: 1; color: var(--green); }

.ff-filter { display: flex; }
.ff-filter input, .ff-filter select {
  width: 100%;
  min-width: 0;
  padding: 5px var(--space-4);
  border-radius: 5px;
  font: inherit;
  font-size: var(--text-sm);
  border: 1px solid var(--navy-line);
  background: var(--ff-filter-bg);
  color: var(--on-navy);
}
.ff-filter input::placeholder { color: var(--ff-filter-placeholder); }
.ff-filter input:focus, .ff-filter select:focus { outline: 2px solid var(--green); outline-offset: -1px; }
.ff-filter.is-range { gap: 5px; }

.ff-table tbody td {
  padding: var(--ff-cell-pad-y) var(--ff-cell-pad-x);
  border-bottom: 1px solid var(--ff-row-line);
  border-right: var(--ff-grid-width) solid var(--ff-grid-color);
  background: var(--panel);
  vertical-align: middle;
  color: var(--ff-text);
}
.ff-table tbody td:last-child { border-right: 0; }
.ff-table tbody tr:nth-child(even) td { background: var(--ff-zebra); }
.ff-table tbody tr:hover td { background: var(--ff-hover); }

/* Opcionális összegző sor (§H — `cfg.showSummaryRow`), a fejléc alá vizuálisan "lezáró" sáv. */
.ff-table tfoot td {
  padding: var(--ff-cell-pad-y) var(--ff-cell-pad-x);
  border-top: 2px solid var(--navy-line);
  border-right: var(--ff-grid-width) solid var(--ff-grid-color);
  background: var(--ff-zebra);
  color: var(--ff-text);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}
.ff-table tfoot td:last-child { border-right: 0; }
.ff-table tfoot .ff-num { text-align: right; }

.ff-num { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
th.ff-num .ff-th-label { justify-content: flex-end; }
.ff-unit { color: var(--ff-text-faint); font-size: 0.92em; margin-left: 2px; }
.ff-muted { color: var(--ff-text-faint); }
.ff-trunc { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
/* A referencia .ff-link-et <a>-ra szánta; több hívó <button>-re teszi (JS-kattintás, nincs navigáció).
   A böngésző alap <button> stílusa (keret/háttér/padding/betűtípus) enélkül átüt — ez adta az élesben
   látott "dobozos" cellát terméknév/link oszlopokon. Elem-típustól függetlenül nullázva. */
.ff-link {
  display: inline;
  background: none;
  border: none;
  border-bottom: 1px solid var(--ff-link-underline);
  border-radius: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  text-align: left;
  color: var(--navy);
  text-decoration: none;
  font-weight: var(--weight-medium);
  cursor: pointer;
}
.ff-link:hover { color: var(--green-strong); border-bottom-color: var(--green-strong); }

.ff-fix { position: sticky; z-index: 2; }
.ff-table thead th.ff-fix { z-index: 4; }
.ff-col-check { left: 0; width: 44px; text-align: center; }
.ff-col-name { left: 44px; box-shadow: 6px 0 8px -8px var(--c-overlay-soft); }
.ff-table tbody td.ff-fix { background: var(--panel); }
.ff-table tbody tr:nth-child(even) td.ff-fix { background: var(--ff-zebra); }
.ff-table tbody tr:hover td.ff-fix { background: var(--ff-hover); }

tr.is-flagged td { background: var(--color-primary-soft) !important; }
tr.is-flagged td.ff-fix { background: var(--ff-flag-bg-strong) !important; }
tr.is-flagged td:first-child { box-shadow: inset 3px 0 0 var(--green-strong); }
tr.is-selected td { background: var(--ff-select-bg) !important; }
tr.is-selected td.ff-fix { background: var(--ff-select-bg-strong) !important; }

.ff-check { width: 16px; height: 16px; accent-color: var(--green-strong); cursor: pointer; vertical-align: middle; }

.ff-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px var(--space-5);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1.6;
  white-space: nowrap;
}
.ff-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ff-badge.is-ok { background: var(--color-primary-soft); color: var(--green-soft-text); }
.ff-badge.is-wait { background: var(--c-amber-tint); color: var(--color-warning); }
.ff-badge.is-err { background: var(--color-danger-soft); color: var(--color-danger); }
.ff-badge.is-idle { background: var(--color-surface-subtle); color: var(--color-text-subtle); }

.ff-bar { display: flex; align-items: center; gap: var(--space-4); flex-direction: row-reverse; }
.ff-bar-track { flex: 1 1 54px; max-width: 64px; height: 5px; border-radius: var(--radius-pill); background: var(--line); }
.ff-bar-fill { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--green); }

.ff-tablefoot {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
  padding: var(--space-5) var(--space-8);
  border-top: 1px solid var(--line);
  background: var(--panel);
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}
.ff-pager { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }
.ff-pager button {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  font: inherit;
  cursor: pointer;
  color: var(--ff-text);
}
.ff-pager button[aria-current="true"] { background: var(--navy); border-color: var(--navy); color: var(--on-navy); font-weight: var(--weight-semibold); }
.ff-empty { padding: 44px var(--space-8); text-align: center; color: var(--color-text-subtle); }
.ff-empty strong { display: block; color: var(--ff-text); font-size: var(--text-md); margin-bottom: var(--space-4); }

/* Kinyitható sor (SPEC-dashboard-redesign.md §8, l. reports.js createTable `rowExpand`) — csak a
   `.ff-table--expandable` módosítót viselő táblákon aktív; a többi (nagy többség) FF-TABLE
   érintetlen marad. A sorcsíkozás itt EXPLICIT osztályból jön (nem `:nth-child`-ből), hogy egy
   kinyitott al-sor ne tolja el a párosítást a lentebbi adatsorokon — ezért ez a szabály a törzs
   `:nth-child` szabálya UTÁN áll a fájlban (azonos specificitásnál a forrás-sorrend dönt). */
.ff-table--expandable tbody tr.ff-datarow.ff-row-even td { background: var(--ff-zebra); }
.ff-table--expandable tbody tr.ff-datarow:hover td { background: var(--ff-hover); }
.ff-expand-col { width: 36px; text-align: center; }
.ff-expand-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--color-text-subtle);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ff-expand-btn:hover { background: var(--panel-muted); color: var(--ff-text); }
.ff-expand-btn i { transition: transform 0.15s ease; }
.ff-expand-btn.is-open i { transform: rotate(90deg); }
.ff-table--expandable tbody tr.ff-subrow td {
  background: var(--panel-muted);
  padding: var(--space-5) var(--space-6) var(--space-5) 44px;
  border-bottom: 1px solid var(--color-border);
}
.ff-subtable { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.ff-subtable th, .ff-subtable td { padding: var(--space-4) var(--space-5); text-align: left; }
.ff-subtable thead th { color: var(--color-text-subtle); font-weight: var(--weight-semibold); border-bottom: 1px solid var(--color-border); }
.ff-subtable tbody tr:not(:last-child) td { border-bottom: 1px solid var(--color-border); }
.ff-subempty { margin: 0; padding: var(--space-4) 0; color: var(--color-text-subtle); font-size: var(--text-sm); }
.ff-subnote { margin: 0; padding: var(--space-4) var(--space-8) 0; color: var(--color-text-subtle); font-size: var(--text-sm); }

/* --- DataGrid (app/static/datagrid.js) kiterjesztések --------------------------------------
   A referencia két fixált oszlopot (checkbox + név) fix 0/44px bal-offszettel mutat be; a
   megosztott DataGrid ezzel szemben tetszőleges számú/szélességű oszlopot fagyaszthat be, ezért
   a bal-offset és az oszlopszélesség JS-mért adat-változóként érkezik (--dg-w / --dg-left — a
   --sync-progress mintájára, adat, nem formázás). Az alábbi szabályok NEM új táblázat-osztályok,
   csak a meglévő .ff-fix / .ff-table mechanizmus általánosítása változó oszlopszámra — a
   kötelező elemnevek (.ff-fix, .ff-col-check, .is-edge) változatlanok. */
.ff-table thead th, .ff-table tbody td { width: var(--dg-w, auto); min-width: var(--dg-w, auto); max-width: var(--dg-w, auto); }
/* A fenti általános szabály --dg-w nélkül auto-ra esik vissza — ez a DataGridEN KÍVÜLI (kézzel épített)
   FF-TABLE checkbox-oszlopokat (PDS, admin-mátrixok, SocialMedia kijelölések stb.) is érintette: a
   --dg-w-t sosem állítják be, ezért a checkbox-oszlop a rendelkezésre álló hellyel arányosan
   kiszélesedett ("szükségtelenül széles" checkbox-oszlop + csúnya fejléc élesben). Nagyobb
   specificitású szabály garantálja a kötelező 44px-et FÜGGETLENÜL attól, hogy --dg-w be van-e állítva.*/
.ff-table thead th.ff-col-check, .ff-table tbody td.ff-col-check { width: 44px; min-width: 44px; max-width: 44px; }
.ff-fix { left: var(--dg-left, 0); }
.ff-fix.is-edge { box-shadow: 6px 0 8px -8px var(--c-overlay-soft); }
.ff-search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ff-text-faint); font-size: 15px; }
.ff-rowcount strong { color: var(--color-primary-hover); font-weight: var(--weight-semibold); }
.ff-filter select[data-dg-filter-op] { flex: 0 0 auto; width: auto; min-width: 84px; }
.ff-filter input:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== FF-TABLE · VÉGE ===================================================================== */

/* ============================================================================================
   === HELP — ügyfél-oldali funkcióismertető oldalak (app/static/help/*.html) ===
   Kizárólag `help-` prefixű osztályok; a design-token rétegen kívül nincs nyers hex/px.
   Nulla visszahatás az alkalmazás-képernyőkre — ez a szekció csak a /help oldalakon fut le.
   Forrás: specs/platform/SPEC-help-dokumentacio.md
   ============================================================================================ */

.help-page {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.help-section__inner {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 0 var(--space-12);
}

/* --- Nyitóblokk --- */

.help-hero {
  background: var(--navy);
  padding: var(--space-16) 0;
}

.help-hero__inner {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 0 var(--space-12);
}

.help-hero__eyebrow {
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
}

.help-hero__title {
  margin: 0 0 var(--space-6);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--on-navy);
}

.help-hero__subtitle {
  margin: 0 0 var(--space-10);
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
  color: var(--on-navy-muted);
}

.help-hero__intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-width: 68ch;
}

.help-hero__intro p {
  margin: 0;
  color: var(--on-navy-muted);
}

/* --- Szakasz-fejlécek (előnyök / tartalomjegyzék / funkciók) --- */

.help-benefits,
.help-toc,
.help-features {
  padding: var(--space-16) 0;
}

.help-toc {
  background: var(--color-surface-subtle-2);
}

.help-section__title {
  margin: 0 0 var(--space-12);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--navy);
}

/* --- Üzleti előnyök kártyarács --- */

.help-benefits__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-10);
}

.help-benefit-card {
  background: var(--color-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-10);
}

.help-benefit-card__title {
  margin: 0 0 var(--space-5);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--navy);
}

.help-benefit-card__text {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--muted);
}

/* --- Tartalomjegyzék --- */

.help-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6) var(--space-12);
}

.help-toc__list a {
  color: var(--color-primary-hover);
  font-weight: var(--weight-medium);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.help-toc__list a:hover {
  border-bottom-color: var(--color-primary-hover);
}

/* --- Funkcióleírás --- */

.help-feature {
  padding-block: var(--space-14);
  border-top: 1px solid var(--line);
}

.help-feature:first-of-type {
  border-top: none;
  padding-top: 0;
}

.help-feature__title {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin: 0 0 var(--space-8);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--navy);
}

.help-feature__title i {
  color: var(--color-primary);
  font-size: var(--text-2xl);
}

.help-feature__subtitle {
  margin: var(--space-10) 0 var(--space-5);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--navy);
}

.help-feature p {
  margin: 0 0 var(--space-6);
  max-width: 74ch;
}

.help-feature p:last-child {
  margin-bottom: 0;
}

/* --- Nyomtatás --- */

@media print {
  .help-hero {
    background: none;
    padding: 0 0 var(--space-10);
  }

  .help-hero__title,
  .help-hero__subtitle,
  .help-hero__intro p {
    color: #000;
  }

  .help-hero__eyebrow {
    color: #000;
  }

  .help-toc {
    display: none;
  }

  .help-benefit-card {
    box-shadow: none;
    border: 1px solid #999;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .help-feature {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .help-feature__title {
    break-after: avoid;
    page-break-after: avoid;
  }
}

/* WEBSHOP AUDIT (SPEC-webshop-audit-checklist.md) — admin checklist-tab + publikus /ingyenes-audit */

.ff-center {
  text-align: center;
}

.admin-wa-category {
  margin-bottom: 16px;
}

.admin-wa-category > summary {
  cursor: pointer;
  font-weight: 600;
  padding: 8px 4px;
}

.admin-wa-row-off td {
  color: var(--ff-text-faint);
}

.admin-wa-detail-row td {
  background: var(--c-neutral-100, #f4f7f9);
}

.admin-wa-detail-list {
  margin: 8px 0;
  padding-left: 20px;
  font-size: 0.9em;
}

.admin-wa-detail-list li {
  margin-bottom: 4px;
}

.webshop-audit-public {
  min-height: 100vh;
  display: flex;
}

.webshop-audit-public .login-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.webshop-audit-result {
  margin-top: 20px;
}

.webshop-audit-result-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border, var(--line));
}

.webshop-audit-status {
  font-weight: 600;
  margin-right: 8px;
}

.webshop-audit-status.is-pass { color: var(--color-primary); }
.webshop-audit-status.is-fail { color: var(--color-danger); }
.webshop-audit-status.is-error,
.webshop-audit-status.is-skipped { color: var(--ff-text-faint); }

/* ============================================================================================
   DASHBOARD V2 (feladat-csempés kezdőlap — specs/unas/SPEC-dashboard-redesign.md, Fázis 1)
   Ideiglenes előnézeti nézet (`dashboard.preview_v2` action, app/apps/unas/static/dashboard_v2.js).
   A prototípus (specs/unas/dashboard-egyben (2).html) 1:1 átvétele, a fenti meglévő tokenekre
   hivatkozva — nem vezet be új tokent. A `.cpt-row`/`.cpt-title`/`.freshness` ezen az oldalon
   kívül máshol nem használt, kizárólag ehhez a fejléc-sorhoz tartozó osztályok.
   ============================================================================================ */

/* --- Tartalom-fejléc sor: cím+dátum balra, frissesség-jelző jobbra (#app-heading innerHTML) --- */
.cpt-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); width: 100%; }
.cpt-title .date { font-size: var(--text-sm); font-weight: 400; color: var(--color-text-muted); margin-left: 10px; }
.freshness {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  padding: 5px 12px; font-size: var(--text-sm); color: var(--color-text-subtle);
}
.freshness .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-green-500); }

/* --- KPI-sáv (sötét horgony) --- */
.hero-band {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  background: var(--navy); padding: var(--space-12); margin-bottom: var(--space-12);
}
.hero-motif { position: absolute; right: -140px; top: -190px; pointer-events: none; }
.kpi-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }

.kpi {
  position: relative; background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: 0 10px 30px rgba(0, 0, 0, .24); overflow: hidden;
  padding: var(--space-9) var(--space-10) var(--space-10) calc(var(--space-10) + var(--space-3));
  --accent: var(--c-red-600); --tint: var(--c-red-tint); --strong: var(--c-red-600);
}
.kpi--clear { --accent: var(--c-green-600); --tint: var(--c-green-tint); --strong: var(--c-green-700); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--accent); }

.kpi-head { display: flex; align-items: center; gap: var(--space-7); margin-bottom: var(--space-8); }
.kpi-icon { flex: 0 0 auto; width: 44px; height: 44px; border-radius: var(--radius-md); display: inline-flex; align-items: center; justify-content: center; background: var(--tint); color: var(--strong); }
.kpi-label { font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); }
.kpi-when { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }
.kpi-value { font-size: var(--text-4xl); font-weight: var(--weight-bold); color: var(--navy); letter-spacing: -.02em; line-height: 1.1; }
.kpi-unit { font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--color-text-muted); margin-left: 6px; }
.delta { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--space-6); font-size: var(--text-base); font-weight: var(--weight-semibold); }
.delta--down { color: var(--c-red-600); }
.delta--up { color: var(--c-green-700); }
.delta--warn { color: var(--c-red-600); }
.delta .ref { font-weight: 400; color: var(--color-text-muted); font-size: var(--text-sm); }
.kpi-note { margin: var(--space-4) 0 0; font-size: var(--text-sm); color: var(--color-text-subtle); line-height: 1.5; }
.kpi-note b { font-weight: var(--weight-semibold); color: var(--color-text-strong); }
.kpi-note .up { color: var(--c-green-700); font-weight: var(--weight-semibold); }

/* --- Szekció --- */
.sec { margin-bottom: var(--space-12); }
.sec-h { display: flex; align-items: center; gap: var(--space-6); margin-bottom: var(--space-8); }
.sec-h h2 { margin: 0; font-size: var(--text-lg); font-weight: var(--weight-bold); color: var(--navy); }
.sec-h .line { flex: 1; height: 1px; background: var(--color-border); }
.sec-h .cnt { font-size: var(--text-sm); color: var(--color-text-muted); }

/* --- Csempe --- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--space-8); }
.tile {
  position: relative; display: flex; flex-direction: column;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden;
  padding: var(--space-10) var(--space-10) var(--space-9) calc(var(--space-10) + var(--space-3));
  /* alapértelmezés: VAN FELADAT (piros) */
  --accent: var(--c-red-600); --tint: var(--c-red-tint); --strong: var(--c-red-600);
}
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--accent); }
/* NINCS FELADAT (zöld) */
.tile--clear { --accent: var(--c-green-600); --tint: var(--c-green-tint); --strong: var(--c-green-700); background: #FBFDF8; }
/* NINCS ADAT (semleges navy, spec §6.4) — se nem piros, se nem zöld: a felhasználó nem hiheti,
   hogy rendben van, amiről nem tudunk semmit (pl. ad_spend, amíg nem futott költés-szinkron). */
.tile--nodata { --accent: var(--c-navy); --tint: rgba(16, 42, 61, 0.08); --strong: var(--c-navy); }

.tile-top { display: flex; align-items: flex-start; gap: var(--space-6); margin-bottom: var(--space-7); }
.tile-ico { flex: 0 0 auto; width: 38px; height: 38px; border-radius: var(--radius-md); background: var(--tint); color: var(--strong); display: grid; place-items: center; }
.tile-name { flex: 1 1 auto; min-width: 0; font-size: var(--text-lg); font-weight: var(--weight-bold); color: var(--navy); line-height: 1.3; }
.cadence {
  flex: 0 0 auto; display: inline-flex; align-items: center; padding: 3px var(--space-6); border-radius: var(--radius-pill);
  background: var(--tint); color: var(--strong);
  font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: .04em; white-space: nowrap;
}

.tile-desc { margin: 0; font-size: var(--text-base); color: var(--color-text-subtle); line-height: 1.6; }

.tile-kpi {
  display: flex; align-items: baseline; gap: var(--space-5);
  margin: var(--space-9) 0 0; padding: var(--space-7) var(--space-8);
  border-radius: var(--radius-md); background: var(--tint);
}
.tile-kpi .n { font-size: var(--text-3xl); font-weight: var(--weight-bold); color: var(--strong); line-height: 1; letter-spacing: -.02em; }
.tile-kpi .t { font-size: var(--text-sm); color: var(--strong); line-height: 1.4; }
.tile-kpi .tick { color: var(--c-green-600); flex: 0 0 auto; }

.tile-cta { margin-top: var(--space-9); }
.tile-cta .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-4); width: 100%;
  padding: 11px var(--space-9); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface); color: var(--color-text); font-family: inherit;
  font-size: var(--text-base); font-weight: var(--weight-semibold); cursor: pointer;
}
.tile-cta .btn:hover { background: var(--color-surface-subtle); border-color: var(--color-border-strong); }
.tile-cta .btn--go { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.tile-cta .btn--go:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.tile-cta .btn--quiet { color: var(--color-text-subtle); }
.tile-cta .btn svg { transition: transform .15s ease; }
.tile-cta .btn:hover svg { transform: translateX(2px); }

/* §6.5 kiugró-változás csempék: két egymás alatti CTA + halvány piros (negatív irány) gomb-változat
   — a negatív változások meglévő piros token-családjából, nem új szín. */
.tile-cta--stack { display: flex; flex-direction: column; gap: var(--space-4); }
.tile-cta .btn--neg { background: var(--c-red-50); border-color: var(--c-red-100); color: var(--c-red-600); }
.tile-cta .btn--neg:hover { background: var(--c-red-100); border-color: var(--c-red-100); color: var(--c-red-700); }

@media (max-width: 1200px) { .kpi-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .kpi-grid { grid-template-columns: 1fr; } }

/* --- Dashboard v2 csempe-lista képernyők (sold_out_list.js, incomplete_pdp_list.js, …) — közös
   elrendezés-váz minden "csempe → dedikált SPA-lista" képernyőhöz; a gombok (.ff-btn,
   .ghost-button) és a táblázat (DataGrid) a meglévő globális osztályokból jönnek. --- */
.dash-list-nav { margin-bottom: var(--space-8); }
.dash-list-title { margin: 0 0 var(--space-9); font-size: var(--text-2xl); font-weight: var(--weight-bold); color: var(--navy); }
.dash-list-actions { display: flex; flex-direction: column; gap: var(--space-6); margin-bottom: var(--space-10); }
.dash-list-actions p { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-6); color: var(--color-text-subtle); font-size: var(--text-base); line-height: 1.5; }
.dash-list-msg { min-height: 1.2em; color: var(--color-text-subtle); font-size: var(--text-sm); }

/* --- Kiugró-változás modál (swings_modal.js, spec §6.5) — a termék-modál vázára (.product-modal,
   .pm-header, .pm-body) épül, ezek csak a TOP 10 termék-blokk saját elemei. --- */
.swings-modal { max-width: 760px; }
.sw-list { display: flex; flex-direction: column; gap: var(--space-10); }
.sw-item { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-8) var(--space-10) var(--space-10); }
.sw-item-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-8); flex-wrap: wrap; margin-bottom: var(--space-6); }
.sw-item-title { display: flex; align-items: baseline; gap: var(--space-6); flex-wrap: wrap; min-width: 0; }
.sw-name {
  background: none; border: none; padding: 0; font: inherit; text-align: left; cursor: pointer;
  font-weight: var(--weight-semibold); color: var(--color-text-strong);
}
.sw-name:hover { color: var(--primary); text-decoration: underline; }
.sw-sku { color: var(--color-text-muted); font-size: 0.8rem; }
.sw-sum { font-size: 0.85rem; color: var(--color-text-muted); white-space: nowrap; }
.sw-sum strong { color: var(--color-text-strong); }
.sw-pct { font-weight: var(--weight-semibold); }
.sw-pct--down { color: var(--c-red-600); }
.sw-pct--up { color: var(--primary); }
.sw-chart-wrap { position: relative; height: 170px; width: 100%; }
.sw-empty { margin: 0; color: var(--color-text-muted); }

/* ===== HELP · VÉGE =========================================================================== */

/* =============================================================================================
   === CHANGELOG — ügyfél-nyelvű fejlesztési napló oldal (GET /changelog) ======================
   Kizárólag `changelog-` prefixű osztályok; a design-token rétegen kívül nincs nyers hex/px.
   Forrás-adat: changelog_entries tábla (seed: app/data/changelog_entries.json).
   ============================================================================================= */

.changelog-page {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.changelog-hero {
  background: var(--navy);
  padding: var(--space-12) 0;
}

.changelog-hero__inner {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 0 var(--space-12);
}

.changelog-hero__eyebrow {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
}

.changelog-hero__title {
  margin: 0;
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--on-navy);
}

.changelog-main {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: var(--space-12) var(--space-12) var(--space-16);
}

.changelog-day {
  padding: var(--space-8) 0;
  border-bottom: 1px solid var(--line);
}

.changelog-day:last-child {
  border-bottom: none;
}

.changelog-day__date {
  margin: 0 0 var(--space-6);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--navy);
}

.changelog-group__title {
  margin: var(--space-6) 0 var(--space-3);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-text-strong);
}

.changelog-list {
  margin: 0;
  padding-left: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.changelog-item::marker {
  color: var(--green);
}

.changelog-item__app {
  font-weight: var(--weight-semibold);
  color: var(--color-text-strong);
}

.changelog-empty {
  margin: 0;
  color: var(--color-text-muted);
}

@media print {
  .changelog-hero { background: none; padding: 0; }
  .changelog-hero__title { color: var(--color-text-strong); }
  .changelog-day { break-inside: avoid; page-break-inside: avoid; }
}

/* ===== CHANGELOG · VÉGE ====================================================================== */
