/* ==========================================================================
   HUVAP - felulet
   Az INSIGHT sablon arculata: sotet fejlec, osszecsukhato vilagos oldalsav,
   feher kartyak. Vilagos es sotet tema, teljes mobil nezettel.
   ========================================================================== */

:root {
  --header-bg: #182036;
  --header-fg: #ffffff;
  --header-muted: #97a1ba;
  --header-line: #2a3350;
  --header-chip: #242e4a;

  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --border: #e6e9ee;
  --border-strong: #d5dae3;

  --text: #172033;
  --text-2: #5b6678;
  --text-3: #98a2b3;

  --accent: #2f6fed;
  --accent-soft: #ebf1fb;
  --brand: #e2452c;
  --brand-2: #b62d1f;
  --orange: #f0932b;
  --green: #22a06b;
  --purple: #8e44ad;
  --red: #d93a2b;

  --radius: 10px;
  --gap: 20px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);

  --scroll-thumb: #c4cad5;
  --scroll-thumb-hover: #a6aebd;
  --scroll-track: #eef0f4;

  /* Ettol a bongeszo sajat vezerloit (gorgetosav, datumvalaszto, legordulo
     nyila) is a temahoz igazitja - ez tobbet er, mint barmilyen szinezes. */
  color-scheme: light;

  --sidebar-w: 208px;
  --sidebar-w-collapsed: 62px;
  --header-h: 56px;
  --toolbar-h: 40px;
}

[data-theme="dark"] {
  --header-bg: #10162a;
  --header-line: #222c46;
  --header-chip: #1c2540;

  --bg: #0d1220;
  --surface: #151d31;
  --surface-2: #1a2337;
  --border: #26304a;
  --border-strong: #33405f;

  --text: #e7ecf5;
  --text-2: #a2adc2;
  --text-3: #74809a;

  --accent: #5b8def;
  --accent-soft: #1c2a48;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);

  --scroll-thumb: #39455f;
  --scroll-thumb-hover: #4c5a79;
  --scroll-track: #121929;

  color-scheme: dark;
}

/* ------------------------------------------------------- Gorgetosav ------ */
/*
   Ket szabvany letezik ra, ezert mindketto kell:
   - scrollbar-color / scrollbar-width: Firefox es ujabb Chrome
   - ::-webkit-scrollbar: Chrome, Edge, Safari (finomabb vezerles)
   A color-scheme fentebb amugy is sotetre valtja a nativ savot, ez csak
   csinositja: vekonyabb, lekerekitett, keret nelkuli.
*/

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 8px;
  /* Atlatszo keret + background-clip: igy a fogantyu keskenyebbnek latszik,
     de a kattintasi felulet marad kenyelmes - kis kepernyon ez szamit. */
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
  background-clip: content-box;
}

::-webkit-scrollbar-corner {
  background: var(--scroll-track);
}

/*
   BELSO gorgetheto teruletek (menu, tablazatok, hosszu listak).
   Itt a rendszer-sav aranytalanul vastag: egy 208 px szeles oldalsavban egy
   11 px-es csik es a szurke csatorna elviszi a figyelmet a menurol.
   Ezert: atlatszo palya (beleolvad a felutbe) + keskeny, halvany fogantyu,
   ami raviteskor erosodik. Mindig latszik valamennyire, hogy tudni lehessen,
   van meg lejjebb tartalom.
*/

.nav-scroll,
.table-wrap,
.map-stage,
.entity-grid,
.sensor-grid {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}

.nav-scroll::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.map-stage::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.nav-scroll::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.map-stage::-webkit-scrollbar-track {
  background: transparent;
}

.nav-scroll::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.map-stage::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  background-clip: content-box;
  border: 2px solid transparent;
  border-radius: 8px;
  opacity: .6;
}

/* Az oldalsav savja csak jelzesszeru, amig nem vagy rajta. */
.nav-scroll { scrollbar-color: var(--scroll-track) transparent; }
.nav-scroll::-webkit-scrollbar-thumb { background: var(--scroll-track); background-clip: content-box; }

.sidebar:hover .nav-scroll { scrollbar-color: var(--scroll-thumb) transparent; }

.sidebar:hover .nav-scroll::-webkit-scrollbar-thumb,
.nav-scroll::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover,
.map-stage::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
  background-clip: content-box;
}

/* Osszecsukott oldalsavnal a sav elvenne a helyet az ikonoktol. */
body.nav-collapsed .nav-scroll { scrollbar-width: none; }
body.nav-collapsed .nav-scroll::-webkit-scrollbar { width: 0; }

@media (prefers-reduced-motion: no-preference) {
  ::-webkit-scrollbar-thumb { transition: background .15s; }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* --------------------------------------------------------------- Fejlec -- */

.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: var(--header-bg);
  color: var(--header-fg);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 2px 6px rgba(226, 69, 44, .35);
}

.brand-text { min-width: 0; }

.brand-title {
  font-size: 23px;
  font-weight: 500;
  letter-spacing: .01em;
  line-height: 1.1;
  white-space: nowrap;
}

.brand-title span { color: var(--header-muted); font-weight: 300; }

.brand-sub {
  font-size: 11px;
  color: var(--header-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user { display: flex; align-items: center; gap: 9px; }

.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--header-chip);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  color: var(--header-muted);
  overflow: hidden;
}

.header-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; }

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 0;
  background: var(--header-chip);
  color: var(--header-fg);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .15s;
}

.icon-btn:hover { background: #32406a; }

.btn-signout {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--red);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-signout:hover { filter: brightness(1.08); }

/* -------------------------------------------------------------- Eszkoztar -- */

.toolbar {
  position: fixed;
  top: var(--header-h); left: 0; right: 0;
  height: var(--toolbar-h);
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.tool-btn {
  width: 30px; height: 30px;
  border: 0; background: transparent;
  color: var(--text-2);
  border-radius: 6px;
  display: grid; place-items: center;
  cursor: pointer;
}

.tool-btn:hover { background: var(--surface-2); color: var(--text); }

.lang-list { display: flex; align-items: center; gap: 5px; margin-left: 4px; }

.lang-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
}

.lang-pill:hover { background: var(--surface-2); }

.lang-pill.is-active {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
}

.flag { border-radius: 2px; display: block; }

.breadcrumb {
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -------------------------------------------------------------- Oldalsav -- */

.sidebar {
  position: fixed;
  top: calc(var(--header-h) + var(--toolbar-h));
  bottom: 0; left: 0;
  width: var(--sidebar-w);
  z-index: 30;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width .18s ease;
}

body.nav-collapsed .sidebar { width: var(--sidebar-w-collapsed); }

.nav-scroll { flex: 1; overflow-y: auto; padding-bottom: 8px; }

/* Munkakornyezet-valaszto az oldalsav tetejen (csak adminnak). */

.nav-customer {
  position: relative;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border);
}

.nav-customer select {
  width: 100%;
  padding: 7px 9px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
}

/* Ha egy konkret ugyfelre van szurve, lassek ranezesre. */
.nav-customer.is-filtered select {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-customer-mini { display: none; }

body.nav-collapsed .nav-customer { padding: 12px 0; text-align: center; }
body.nav-collapsed .nav-customer .nav-section { display: none; }
body.nav-collapsed .nav-customer select { display: none; }

body.nav-collapsed .nav-customer-mini {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 860px) {
  /* Mobilon az oldalsav teljes szeles, ott a legordulo fer ki. */
  body.nav-collapsed .nav-customer { padding: 14px 14px 12px; text-align: left; }
  body.nav-collapsed .nav-customer .nav-section { display: block; }
  body.nav-collapsed .nav-customer select { display: block; }
  body.nav-collapsed .nav-customer-mini { display: none; }
}

.nav-section {
  padding: 15px 18px 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}

body.nav-collapsed .nav-section {
  padding-left: 0;
  text-align: center;
  font-size: 0;
}

body.nav-collapsed .nav-section::after {
  content: "";
  display: block;
  height: 1px;
  margin: 8px 14px 0;
  background: var(--border);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 18px;
  color: var(--text-2);
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}

.nav-item svg { flex: 0 0 18px; }

.nav-item:hover { background: var(--accent-soft); color: var(--text); }

.nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
}

body.nav-collapsed .nav-item { justify-content: center; padding: 11px 0; }
body.nav-collapsed .nav-label { display: none; }

/* Osszecsukott allapotban a nev tooltipkent jelenik meg. */
body.nav-collapsed .nav-item::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 8px);
  padding: 5px 9px;
  background: var(--header-bg);
  color: #fff;
  font-size: 12px;
  border-radius: 5px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
  z-index: 50;
}

body.nav-collapsed .nav-item:hover::after { opacity: 1; }

.session-box {
  border-top: 1px solid var(--border);
  padding: 10px 14px 12px;
}

.session-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.session-time {
  margin-left: auto;
  font-family: "Consolas", "SF Mono", monospace;
  letter-spacing: 0;
  font-size: 11.5px;
  color: var(--text-2);
}

body.nav-collapsed .session-label,
body.nav-collapsed .session-time { display: none; }

.session-bar {
  margin-top: 7px;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}

.session-bar > i {
  display: block;
  height: 100%;
  background: var(--green);
  transition: width 1s linear;
}

.session-bar.is-low > i { background: var(--red); }

/* ----------------------------------------------------------------- Torzs -- */

.app-main {
  margin-left: var(--sidebar-w);
  padding: 22px 24px 40px;
  padding-top: calc(var(--header-h) + var(--toolbar-h) + 22px);
  transition: margin-left .18s ease;
  min-height: 100%;
}

body.nav-collapsed .app-main { margin-left: var(--sidebar-w-collapsed); }

.page-head { margin-bottom: 0; }

/*
   EGYSEGES TERKOZ a fo tartalom blokkjai kozott.
   Korabban minden elem sajat margot hozott (kartya 20, ertesites 16, es a
   kartya-kartya szabaly helyenkent duplazodott), ezert nehol osszeertek a
   dobozok, nehol tul nagy volt a hezag. Igy egyetlen helyen dol el.
*/
.app-main > * { margin-bottom: var(--gap); }
.app-main > *:last-child { margin-bottom: 0; }
.page-title { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.page-sub { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }

/* --------------------------------------------------------------- Sparkline -- */
.spark { display: block; overflow: visible; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--accent); }

/* ------------------------------------------------- Skeleton + beuszas ------- */
/* Ujrahasznalhato "toltodo" placeholder: tegyel .skeleton osztalyt egy dobozra. */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: 6px;
  color: transparent !important;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(150, 160, 180, .18), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* Tartalom finom beuszasa betolteskor - a "skeleton -> kesz" erzet. A terkep
   es a modalok kimaradnak (interaktiv / kulon rendered). */
@media (prefers-reduced-motion: no-preference) {
  .card:not(.map-card), .stat {
    animation: contentIn .38s cubic-bezier(.22, .61, .36, 1) both;
  }
  .stat-grid .stat:nth-child(2) { animation-delay: .05s; }
  .stat-grid .stat:nth-child(3) { animation-delay: .10s; }
  .stat-grid .stat:nth-child(4) { animation-delay: .15s; }
  .stat-grid .stat:nth-child(5) { animation-delay: .20s; }
  .stat-grid .stat:nth-child(6) { animation-delay: .25s; }
}
@keyframes contentIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------- Terkep idogep (replay) -- */
.map-timemachine { display: inline-flex; align-items: center; gap: 8px; }
.map-timemachine .tm-range { width: 150px; max-width: 34vw; accent-color: var(--accent); cursor: pointer; }
.map-timemachine .tm-play {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: 0 0 26px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text-2); cursor: pointer;
}
.map-timemachine .tm-play:hover { color: var(--accent); border-color: var(--accent); }
.map-timemachine .tm-time { font-size: 12px; color: var(--text-2); min-width: 74px; }
.map-timemachine.is-replaying .tm-time { color: var(--accent); font-weight: 600; }

/* ------------------------------------------- Ugyfelek attekinto terkepe ---- */
.cust-map { height: 380px; border-radius: var(--radius); overflow: hidden; z-index: 0; }
.cust-pin { position: relative; }

/* Akinek van alaprajza, annak a jeloloje kattinthato - ez latszodjon is. */
.cust-pin.is-link { cursor: pointer; }
.cust-pin.is-link:hover .cust-pin-dot { transform: scale(1.25); }
.cust-pin.is-link:hover .cust-pin-badge { background: var(--accent); color: #fff; }

@media (prefers-reduced-motion: no-preference) {
  .cust-pin.is-link .cust-pin-dot,
  .cust-pin.is-link .cust-pin-badge { transition: transform .12s ease, background .12s ease, color .12s ease; }
}
.cust-pin-dot {
  position: absolute; left: -6px; top: -6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}
.cust-pin-badge {
  position: absolute; left: 0; top: -26px; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
  padding: 3px 7px; border-radius: 9px; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.cust-pin-badge::after {
  content: ''; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%);
  border: 4px solid transparent; border-top-color: var(--accent); border-bottom: 0;
}

/* -------------------------------------------------------- Modal (dialog) -- */
dialog.modal {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(9, 13, 24, .35);
  overflow: hidden;
}
dialog.modal::backdrop { background: rgba(9, 13, 24, .5); }
dialog.modal .modal-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
dialog.modal .modal-head b { display: inline-flex; align-items: center; gap: 7px; }
dialog.modal .modal-body {
  padding: 16px;
  max-height: calc(100vh - 80px - 56px);
  overflow-y: auto;
}

.card {
  position: relative;   /* a toltes-sav (.is-refreshing) ehhez igazodik */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}

/* Hatterben futo lekerdezes: vekony mozgo sav a kartya tetejen.
   Szandekosan nem takar semmit - a mar meglevo ertekek olvashatok maradnak,
   csak az latszik, hogy frissebb adat uton van. */
.card.is-refreshing::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent, var(--accent), transparent) 0 0 / 40% 100% no-repeat,
    var(--accent-soft);
  animation: card-loading 1.3s ease-in-out infinite;
}

@keyframes card-loading {
  0%   { background-position: -45% 0; }
  100% { background-position: 145% 0; }
}

@media (prefers-reduced-motion: reduce) {
  /* Mozgas nelkul is latszodjon, hogy tolt: egyszinu sav. */
  .card.is-refreshing::before { animation: none; background: var(--accent-soft); }
}


.card-title {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
}

.card-title svg { color: var(--brand); }

/* Hero */

/* Fele-fele: a szoveg es a kep egyutt adja ki a teljes szelesseget. */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: var(--gap);
}

.hero-title {
  margin: 0 0 14px;
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.hero-title span { color: var(--orange); }

.hero-text { margin: 0 0 16px; color: var(--text-2); max-width: 62ch; }

.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }

.feature-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); }
.feature-list svg { color: var(--brand); flex: 0 0 16px; margin-top: 3px; }

.hero-art {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  /* Semleges hatter: csak addig latszik, amig a kep betolt. */
  background: var(--surface-2);
  display: grid;
  place-items: center;
  min-height: 220px;
}

/* Abszolut pozicioval a kep pontosan a kartya magassagat veszi fel, es nem
   nyujtja meg a sort - igy a szoveges kartyaval mindig egyforma magas. */
.hero-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Tobb kep eseten egymason ulnek, es csak a megjelolt latszik. Egy kepnel a
   .is-slideshow sem kerul ki, tehat ott semmi nem valtozik. */
.hero-art.is-slideshow img { opacity: 0; }
.hero-art.is-slideshow img.is-on { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .hero-art.is-slideshow img { transition: opacity 1.1s ease-in-out; }
}

/* Statisztika kartyak */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--gap);
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.stat.c-orange { border-left-color: var(--orange); }
.stat.c-green  { border-left-color: var(--green); }
.stat.c-purple { border-left-color: var(--purple); }
.stat.c-red    { border-left-color: var(--red); }

.stat-value { font-size: 29px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }

.stat-label {
  display: flex; align-items: center; gap: 7px;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.stat.c-blue   .stat-label svg { color: var(--accent); }
.stat.c-orange .stat-label svg { color: var(--orange); }
.stat.c-green  .stat-label svg { color: var(--green); }
.stat.c-purple .stat-label svg { color: var(--purple); }
.stat.c-red    .stat-label svg { color: var(--red); }

/* Esedekes karbantartas a listaban: a szin onmagaban is elmondja, mi surgos.
   Nem csak a badge-et festjuk, hanem az egesz sort - igy gorgetes kozben is
   kiugrik, nem kell oszlopot keresni hozza. */
.is-overdue td   { background: rgba(217, 45, 32, .07); }
.is-soon-due td  { background: rgba(247, 144, 9, .09); }

[data-theme="dark"] .is-overdue td  { background: rgba(217, 45, 32, .16); }
[data-theme="dark"] .is-soon-due td { background: rgba(247, 144, 9, .16); }

.is-overdue td:first-child  { box-shadow: inset 3px 0 0 var(--red); }
.is-soon-due td:first-child { box-shadow: inset 3px 0 0 var(--orange); }

/* Semleges csempe: a szam nem a mostani allapotot irja le (elavult feltoltes),
   ezert nem zoldell - kulonben ellentmondana a lap figyelmeztetesenek. */
.stat.c-mute { border-left-color: var(--border-strong); opacity: .72; }
.stat.c-mute .stat-label svg { color: var(--text-3); }

/* Kattinthato allapot-csempe (pl. DynDNS): ugyanugy nez ki, mint a tobbi. */
a.stat { display: block; text-decoration: none; color: inherit; }
a.stat:hover { border-color: var(--accent); border-left-color: var(--accent); }
a.stat .stat-label svg:last-child { margin-left: auto; opacity: .7; }

/* --------------------------------------------------------------- Elemek --- */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.btn:hover { background: var(--surface-2); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover { filter: brightness(1.07); background: var(--accent); }

.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.07); background: var(--red); }

.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-sm { padding: 5px 10px; font-size: 12px; }

label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }

input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-row { margin-bottom: 14px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:hover { background: var(--surface-2); }

.table-wrap { overflow-x: auto; }

/* Rendezheto fejlecek */

table.sortable th[data-sort] {
  cursor: pointer;
  user-select: none;
  padding-right: 20px;
  position: relative;
}

table.sortable th[data-sort]:hover { color: var(--text); }

table.sortable th[data-sort]::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 50%;
  margin-top: -2px;
  border: 4px solid transparent;
  border-bottom-color: var(--border-strong);
  opacity: 0;
}

table.sortable th[data-sort]:hover::after { opacity: .6; }

table.sortable th.sort-active { color: var(--accent); }

table.sortable th.sort-active::after {
  opacity: 1;
  border-bottom-color: var(--accent);
}

table.sortable th.sort-active.sort-desc::after {
  margin-top: -6px;
  border-bottom-color: transparent;
  border-top-color: var(--accent);
}

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.badge.ok      { background: rgba(34, 160, 107, .12); color: var(--green);  border-color: rgba(34, 160, 107, .3); }
.badge.warn    { background: rgba(240, 147, 43, .12); color: #b9701a;       border-color: rgba(240, 147, 43, .3); }
.badge.danger  { background: rgba(217, 58, 43, .12);  color: var(--red);    border-color: rgba(217, 58, 43, .3); }
.badge.info    { background: var(--accent-soft);      color: var(--accent); border-color: rgba(47, 111, 237, .25); }

/* Toltes-jelzes: az oldal azonnal megjelenik, az elo adat kesobb erkezik. */

.badge.is-checking {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(47, 111, 237, .25);
}

.live-stamp { display: inline-flex; align-items: center; gap: 6px; }

/* Kereso a kartya fejlecben */
.table-search {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-3);
}

.table-search:focus-within { border-color: var(--accent); color: var(--accent); }

.table-search input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  width: 210px;
}

.table-search input::placeholder { color: var(--text-3); font-weight: 500; }

/* A fejlec szamlaloja: hany sor latszik eppen. */
.row-count {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 700px) {
  .table-search { margin-left: 0 !important; width: 100%; }
  .table-search input { width: 100%; }
}

/* A porgo csak akkor latszik, amikor tenylegesen fut egy lekerdezes. Igy a
   Frissites gombnak van lathato hatasa akkor is, ha a valasz 16 masodperc. */
.live-stamp .spinner { display: none; }
.live-stamp.is-loading .spinner { display: inline-block; }

.spinner {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  animation: tmw-spin .7s linear infinite;
  flex: 0 0 11px;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
}

/* Adatforras cimke a listakban - inverz (kitoltott) hatterrel, hogy a ket
   forrastipus egy pillantassal megkulonboztetheto legyen. */
.src-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 10px;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.5;
  white-space: nowrap;
}

.src-tag.mqtt { background: var(--orange); }
.src-tag.json { background: var(--green); }

.src-name {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-2);
}

[hidden] { display: none !important; }

/* Felderitett, meg fel nem vett eszkozok brokerenkent */

.scan-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface-2);
}

.scan-block + .scan-block { margin-top: 10px; }

.scan-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  font-size: 13px;
}

/* Megnyitas uj ablakban a listakbol */

.row-open {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-3);
  display: grid;
  place-items: center;
}

.row-open:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
}

/* Alegysegek szama a listaban (adatgyujto termosztatjai, MQTT entitasok) */
.unit-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
}

.unit-count b { color: var(--text); font-weight: 700; }
.unit-count svg { color: var(--text-3); }

/* Masolhato ertek (Device ID, token, vegpont) */

.copy-value {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
}

.copy-value .mono { word-break: break-all; }

.copy-value button { flex: 0 0 auto; padding: 4px 7px; }

.copy-value.is-copied button {
  border-color: var(--green);
  color: var(--green);
}

/* Rovid visszajelzes, hogy tenyleg a vagolapra kerult. */
.copy-value.is-copied::after {
  content: "✓";
  color: var(--green);
  font-weight: 700;
  font-size: 12px;
}

.muted { color: var(--text-3); }
.mono { font-family: "Consolas", "SF Mono", monospace; font-size: 12.5px; }

.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  border: 1px solid;
}

.alert.error   { background: rgba(217, 58, 43, .08);  border-color: rgba(217, 58, 43, .3);  color: var(--red); }
.alert.success { background: rgba(34, 160, 107, .08); border-color: rgba(34, 160, 107, .3); color: var(--green); }
.alert.info    { background: var(--accent-soft);      border-color: rgba(47, 111, 237, .25); color: var(--accent); }
.alert.warn    { background: rgba(240, 147, 43, .08); border-color: rgba(240, 147, 43, .3);  color: #b9701a; }

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-3);
}

.empty svg { color: var(--border-strong); margin-bottom: 10px; }

/* Entitas csempek az eszkoz reszleteinel */

.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.entity {
  position: relative;   /* a forras-jelzo (.src-flag) ehhez igazodik */
  /* Oszlopos elrendezes, hogy a vezerlosor a csempe aljara kerulhessen: a nev
     egy vagy ket soros is lehet, es ettol eddig fel-le ugralt a gomb. */
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface-2);
  /* Racs-elem: min-width nelkul a hosszu tartalom szelesebbre nyomna a
     csempet a sajat oszlopanal, es atlogna a szomszedba. */
  min-width: 0;
}

.entity-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
  /* Hely a jobb felso R/L jelzonek, hogy a hosszu nev ne fusson ala. */
  padding-right: 22px;
  overflow-wrap: anywhere;
}

/* Honnan jott az ertek? R = a broker tarolojabol (retained), L = eloben
   kaptuk el. A firmware-atallas alatt ez azonnal megmutatja, melyik topic
   publikal meg mindig retained nelkul. */
.src-flag {
  position: absolute;
  top: 10px; right: 10px;
  width: 17px; height: 17px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  cursor: help;
}
.src-flag.is-retained { background: var(--accent); color: #fff; }
.src-flag.is-live     { background: var(--green);  color: #fff; }

/* Harmadik allapot: nem erkezett ertek. Enelkul a hianyzo jelzo ugy nezne ki,
   mintha a felulet romlott volna el - pedig ez a valos allapot. */
.src-flag.is-none {
  background: transparent;
  color: var(--text-3);
  border: 1px dashed var(--border-strong);
}

/* A szenzor neve egyben link a sajat HACCP elozmenyere. Diszkret: csak
   ravitelkor emelkedik ki, hogy a csempe olvashato maradjon. */
.entity-haccp {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
}
.entity-haccp svg { opacity: .45; flex: 0 0 auto; }
.entity-haccp:hover { color: var(--accent); }
.entity-haccp:hover svg { opacity: 1; }

.entity-value {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
  /* Szoveges allapot (pl. "temperature_reached") szokoz nelkul nem tudna
     megtorni, es kilogna a csempebol. */
  overflow-wrap: anywhere;
}
.entity-value small { font-size: 13px; font-weight: 600; color: var(--text-2); margin-left: 3px; }

/* Adatgyujto szenzorkartyai */

.sensor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.sensor-card {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px 11px;
  background: var(--surface-2);
}

.sensor-card.is-alarm {
  border-color: rgba(217, 58, 43, .55);
  background: rgba(217, 58, 43, .07);
}

.sensor-card.is-offline { opacity: .55; }

.sensor-head {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 8px;
}

.relay {
  color: var(--text-3);
  opacity: .45;
  display: inline-flex;
}

/* Aktiv rele: kiemelt szin, hogy egy pillantassal latszodjon mi jar. */
.relay.on { color: var(--accent); opacity: 1; }

.sensor-meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sensor-meta .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
}

.sensor-meta .dot.on { background: var(--green); }

.sensor-meta .fav { color: var(--orange); display: inline-flex; }

.sensor-meta .addr {
  font-family: "Consolas", "SF Mono", monospace;
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: .02em;
}

.sensor-name {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sensor-row + .sensor-row { margin-top: 5px; }

.sensor-label { font-size: 11px; color: var(--text-3); }

.sensor-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.15;
}

.sensor-value small {
  font-size: 11px;
  font-weight: 600;
  margin-left: 2px;
  color: var(--text-3);
}

.sensor-value.cold { color: #2f8fed; }
.sensor-value.warm { color: var(--green); }
.sensor-value.na   { color: var(--text-3); }

.sensor-card.is-alarm .sensor-value.cold,
.sensor-card.is-alarm .sensor-value.warm { color: var(--red); }

.sensor-params {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 9px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
  font-size: 10.5px;
  color: var(--text-3);
  font-family: "Consolas", "SF Mono", monospace;
}

.sensor-params b { color: var(--text-2); font-weight: 600; }

.sensor-alarm {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  font-size: 11px;
  color: var(--red);
}

/* Beallithato ertek (number / select) az entitas-csempen */

.value-set,
.value-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  /* A maradek helyet a vezerlosor FOLE tesszuk, igy az mindig a csempe aljan
     all - fuggetlenul attol, hogy a nev egy vagy ket sorba tordelt. */
  margin-top: auto;
  padding-top: 9px;
}

.value-input {
  flex: 1 1 70px;
  min-width: 0;
  padding: 5px 8px;
  font-size: 13px;
  border-radius: 6px;
}

.value-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  flex: 0 0 auto;
}

/* EP353 konfiguracio: ugyanazok a csempek, mint az elo ertekeknel (.entity),
   szekciokent osszecsukhato csoportokban. */
.cfg-section { margin-bottom: 14px; }
.cfg-section > summary {
  cursor: pointer;
  padding: 6px 0 10px;
  font-weight: 700;
  display: flex;
  gap: 8px;
  align-items: center;
}
.cfg-section > summary span { font-weight: 500; font-size: 12px; }
.cfg-tile.is-changed { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cfg-raw {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 0 4px;
  margin-left: 4px;
  border-radius: 3px;
  border: 1px solid var(--border-strong);
  color: var(--text-3);
  vertical-align: 1px;
  cursor: help;
}
.cfg-check { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); }
.cfg-check input { width: auto; }

/* "Always show diagnostics" kapcsolo a csempek folott. */
.diag-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.diag-toggle input { width: auto; }
.diag-toggle .muted { font-weight: 400; font-size: 12px; }

/* Terminal-ablak a jobb gombos Set-hez. Fix meretu: a bal oldalt teljes
   magassagban egy 100 px szeles kep tolti ki, mellette jobbra a fejlec es a
   gorgetheto naplo. Keret nincs (kulonben a kep mellett balra kilatszana),
   az ablakot az arnyek es a lekerekites hatarolja. Szinek: az oldal temaja. */
dialog.term-modal {
  width: min(820px, calc(100vw - 32px));
  height: min(480px, calc(100vh - 80px));
  max-height: none;
  border: 0;
}
dialog.term-modal[open] { display: flex; }
.term-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
}
.term-art { background: var(--surface-2); overflow: hidden; }
.term-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.term-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.term-body {
  flex: 1 1 auto;
  margin: 0;
  padding: 12px 14px;
  min-height: 0;
  overflow-y: auto;
  background: var(--surface);
  color: var(--text);
  font: 12.5px/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.term-body .term-head  { font-weight: 700; margin-bottom: 4px; }
.term-body .term-dim   { color: var(--text-3); }
.term-body .term-ok    { color: var(--green); font-weight: 700; }
.term-body .term-error { color: var(--red); }

/* ---------------------------------------------------- HACCP naplo ------- */

.haccp-chart-wrap {
  width: 100%;
  overflow-x: auto;
}

/* Aranyos meretezes: a magassag a szelessegbol adodik, igy a feliratok
   nem nyulnak el. A viewBox 1600x300, tehat kb. 5,3:1 arany. */
.haccp-chart {
  display: block;
  width: 100%;
  height: auto;
  max-height: 340px;
}

.haccp-chart .grid  { stroke: var(--border); stroke-width: 1.5; }
.haccp-chart .line  { fill: none; stroke: var(--accent); stroke-width: 2.5;
                      stroke-linejoin: round; stroke-linecap: round; }
.haccp-chart .alarm { fill: var(--red); }
.haccp-chart .tick  { fill: var(--text-3); font-size: 15px;
                      font-family: "Segoe UI", Roboto, Arial, sans-serif; }

.month-print {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}

/* ------------------------------------------- Nyomtathato havi naplo ----- */
/*
   Onallo lap: a HACCP dokumentaciot papiron kell tudni bemutatni. Keperynon
   is olvashato, de a nyomtatasi keprol van tervezve - ezert feher hatter,
   fekete szoveg es keretezett tablazat, temafuggetlenul.
*/

.print-page {
  background: #fff;
  color: #111;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

.print-sheet {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.print-sheet h1 {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 16px;
}

.print-actions { display: flex; gap: 8px; margin-bottom: 18px; }

.print-meta {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
  font-size: 12.5px;
}

.print-meta th,
.print-meta td {
  border: 1px solid #bbb;
  padding: 6px 9px;
  text-align: left;
  color: #111;
}

.print-meta th { background: #f2f2f2; width: 110px; font-weight: 600; }

.print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.print-table th,
.print-table td {
  border: 1px solid #bbb;
  padding: 5px 7px;
  text-align: right;
  color: #111;
  /* Egy adat = egy sor. Nyomtatasban a tordelt cella olvashatatlanna teszi a
     tablazatot, ezert inkabb suritunk. */
  white-space: nowrap;
}

.print-table th:first-child,
.print-table td:first-child { text-align: left; }

.print-table thead th,
.print-table tfoot th { background: #f2f2f2; font-weight: 600; text-align: right; }
.print-table thead th:first-child,
.print-table tfoot th:first-child { text-align: left; }

/* A riasztasos nap kiemelese - nyomtatasban is lathato marad. */
.print-table tr.has-alarm td { background: #fdeceb; font-weight: 600; }

/* Muszakkezdesi oszlopok: ezek a naplo lenyege, ezert kiemeltek. */
.print-table td.shift { font-weight: 600; }
.print-table td.shift small { font-weight: 400; color: #666; margin-left: 3px; font-size: 10px; }
.print-table td.shift.is-alarm { color: #b42318; }

.print-note { font-size: 11px; color: #555; margin: 10px 0 0; }

.print-table .sign { width: 130px; }

.print-sign {
  display: flex;
  gap: 40px;
  align-items: flex-end;
  margin-top: 34px;
  font-size: 11.5px;
  color: #333;
}

.print-sign .line {
  display: block;
  width: 190px;
  border-bottom: 1px solid #333;
  margin-bottom: 5px;
}

.print-generated { margin-left: auto; text-align: right; color: #666; }

@media print {
  .print-actions { display: none; }
  .print-sheet   { max-width: none; padding: 0; }
  .print-table tr { page-break-inside: avoid; }
  .print-table thead { display: table-header-group; }
  @page { margin: 14mm; }
}

/* Alaprajz + pinnek */

/* Az alaprajz kartyaja: a kep a lenyeg, ezert szuk keret es keskeny fejlec. */
.map-card { padding: 14px; }

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.map-toolbar .heat-legend { margin: 0; }
.map-toolbar-actions { margin-left: auto; display: flex; gap: 6px; }

@media (max-width: 620px) {
  .map-toolbar-actions { margin-left: 0; }
}

.map-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
}

/* Megnyitaskor toltse ki a kepernyot, de ne logjon tul rajta.
   A magassagot a KEPRE tesszuk, nem a keretre: igy a .map-stage egyutt szukul
   vele, es a szazalekban pozicionalt jelolok pontosan a helyukon maradnak. */
.map-stage img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: calc(100vh - 210px);
  max-height: calc(100dvh - 210px);
  min-height: 220px;
  margin: 0 auto;
}

/* Sotet mod: a szin nelkuli vonalrajzot negativba forditjuk, mint a CAD
   programok sotet temaja. Kulon kapcsolo nem kell - a tema valtoja allitja a
   data-theme attributumot, es ez azonnal atvalt vele.
   A hue-rotate visszaforgatja azt a keves szint, ami egy tervrajzon meg lehet:
   enelkul a kek vonal narancs lenne.
   A szures CSAK a kepre vonatkozik: a jelolok es a hofoltok erintetlenek. */
[data-theme="dark"] .map-stage.can-invert img {
  filter: invert(1) hue-rotate(180deg);
  transition: filter .2s ease;
}

/* Lebego ertesites az oldal aljan - nem tolja lejjebb a tartalmat. */

.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border-radius: 9px;
  border: 1px solid;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(9, 13, 24, .3);
  font-size: 13.5px;
  cursor: pointer;
  animation: toast-in .22s ease;
}

.toast.success { border-color: rgba(34, 160, 107, .45); color: var(--green); }
.toast.error   { border-color: rgba(217, 58, 43, .45);  color: var(--red); }
.toast.warn    { border-color: rgba(240, 147, 43, .5);  color: #b9701a; }
.toast.info    { border-color: var(--border-strong);    color: var(--text-2); }

/* A csempe visszajelzese a muvelet eletciklusarol.
   Harom allapot, mert ennel tobb mar nem hordozna informaciot:
     kek  = elkuldve, varunk az eszkozre (allapot, amig el nem dol)
     zold = az eszkoz visszaigazolta (villanas)
     piros = elutasitva vagy nem valaszolt (villanas)
   A lebego uzenet ettol fuggetlenul megmarad - ez csak megmutatja, HOL. */

.entity.is-pending {
  background: rgba(91, 141, 239, .14);
  border-color: rgba(91, 141, 239, .5);
  animation: tile-pending 1.5s ease-in-out infinite;
}

/* Amig az eszkoz visszaigazolasara varunk, atlatszo fatyol ul a csempen egy
   porgo jelzovel. Az ertek atsejlik alatta - szandekosan: latszik, hogy MI
   volt eddig, csak azt nem lehet kozben elpiszkalni. */
.entity.is-pending::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, .55);
  z-index: 2;
}

[data-theme="dark"] .entity.is-pending::before { background: rgba(16, 22, 42, .55); }

.entity.is-pending::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  border-right-color: transparent;
  z-index: 3;
  animation: tmw-spin .7s linear infinite;
}

/* A vezerlok nem kattinthatok, amig fut a visszaigazolas. */
.entity.is-pending .value-set,
.entity.is-pending button { pointer-events: none; }

@keyframes tile-pending {
  50% {
    background: rgba(91, 141, 239, .24);
    border-color: rgba(91, 141, 239, .75);
  }
}

.entity.is-ok {
  animation: tile-ok 1.8s ease;
}

.entity.is-error {
  animation: tile-error 1.8s ease;
}

@keyframes tile-ok {
  0% {
    background: rgba(91, 141, 239, .2);
    border-color: rgba(91, 141, 239, .6);
  }
  12%, 34% {
    background: rgba(34, 160, 107, .3);
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(34, 160, 107, .2);
  }
  100% {
    background: var(--surface-2);
    border-color: var(--border);
    box-shadow: none;
  }
}

@keyframes tile-error {
  0%, 22% {
    background: rgba(217, 58, 43, .32);
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(217, 58, 43, .2);
  }
  100% {
    background: var(--surface-2);
    border-color: var(--border);
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .entity.is-pending { animation: none; }
  /* Mozgascsokkentett modban a fatyol marad, a porgo all. */
  .entity.is-pending::after { animation: none; border-right-color: var(--accent); opacity: .5; }
  .entity.is-ok      { animation: none; border-color: var(--green); }
  .entity.is-error   { animation: none; border-color: var(--red); }
}

.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
}

@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
}

/* A pin maga egy pont; a buborek es a hofolt koré rendezodik.
   A --heat valtozot a szerver (vagy elo frissiteskor a JS) allitja be a
   homerseklet alapjan: kek a hideg, piros a meleg. */

.map-pin {
  position: absolute;
  width: 0;
  height: 0;
  cursor: grab;
  touch-action: none;
  --heat: hsl(220, 8%, 60%);
}

.map-pin.is-dragging { cursor: grabbing; z-index: 20; }

/* Kifele elhalvanyulo szines kor - ez adja a hoterkep hatast. */
.heat-halo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 132px;
  height: 132px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle closest-side, var(--heat) 0%, transparent 78%);
  opacity: .5;
  pointer-events: none;
  transition: background .4s ease;
}

.map-pin.is-dragging .heat-halo { opacity: .28; }

.pin-bubble {
  position: absolute;
  left: 50%;
  bottom: 13px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface);
  border: 1.5px solid var(--heat);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  white-space: nowrap;
}

.pin-bubble small { font-size: 9.5px; font-weight: 600; color: var(--text-3); }

.pin-label {
  position: absolute;
  left: 50%;
  top: 13px;
  transform: translateX(-50%);
  max-width: 130px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 22, 42, .82);
  color: #fff;
  font-size: 10.5px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.pin-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--heat);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .45);
  transition: background .4s ease;
}

.map-pin.is-offline .pin-bubble,
.map-pin.is-offline .pin-dot { opacity: .45; }

.map-pin.is-alarm .pin-bubble {
  border-color: var(--red);
  animation: tmw-pulse 1.4s ease-in-out infinite;
}

@keyframes tmw-pulse {
  50% { box-shadow: 0 0 0 6px rgba(217, 58, 43, .28); }
}

@media (prefers-reduced-motion: reduce) {
  .map-pin.is-alarm .pin-bubble { animation: none; }
}

/* Zarolt jelolo: nem mozdithato, es ez latszik is rajta. */
.map-pin.is-locked { cursor: default; }

.map-pin.is-locked .pin-dot {
  border-style: dashed;
  border-color: rgba(255, 255, 255, .85);
}

/* Jobb gombos helyi menu a jelolokon */

.pin-menu {
  position: absolute;
  z-index: 30;
  min-width: 152px;
  padding: 5px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(9, 13, 24, .32);
}

.pin-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.pin-menu button:hover:not(:disabled) { background: var(--surface-2); }
.pin-menu button:disabled { opacity: .38; cursor: default; }
.pin-menu button.is-danger { color: var(--red); }
.pin-menu button.is-danger:hover:not(:disabled) { background: rgba(217, 58, 43, .1); }

/* Tervezett, meg nem elerheto menupont */

/* Csoport-menu: a fomenu HELYETT jelenik meg, ugyanazokkal a .nav-item
   elemekkel - igy a sorkoz es a betutipus automatikusan azonos. */
.nav-back {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--text-2);
}

.nav-back:hover { background: var(--surface-2); color: var(--text); }

.nav-caret {
  margin-left: auto;
  display: inline-flex;
  color: var(--text-3);
  transform: rotate(90deg);
}

body.nav-collapsed .nav-caret { display: none; }

.nav-item.is-soon {
  cursor: default;
  opacity: .62;
}

.nav-item.is-soon:hover { background: transparent; color: var(--text-2); }

/* Letezo, de nem elerheto menupont: latszik, mit tud a rendszer, de nem
   kattinthato. Halvanyabb, mint a "soon", mert az meg nem is letezik. */
.nav-item.is-locked {
  cursor: not-allowed;
  opacity: .45;
}

.nav-item.is-locked:hover { background: transparent; color: var(--text-2); }

.lock-tag {
  margin-left: auto;
  display: inline-flex;
  color: var(--text-3);
}

body.nav-collapsed .lock-tag { display: none; }

/* Inverz cimke: kitoltott hatter, vilagos szoveg - igy a halvanyitott
   menupont mellett is jol olvashato marad. */
.soon-tag {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 9.5px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.35;
}

body.nav-collapsed .soon-tag {
  position: absolute;
  top: 4px;
  right: 6px;
  margin: 0;
  padding: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  font-size: 0;
}

/* Pin felvetele */

.pin-add {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.pin-add > div { flex: 1 1 190px; min-width: 0; }
.pin-add label { margin-bottom: 4px; }

/* Szinskala jelmagyarazat */

/* Szinskala az eszkoztarban, a gomboktol balra.
   A dobozmodell szandekosan azonos a .btn-sm-mel (12px betu, 5/10 belso ter,
   1px keret), igy pontosan ugyanolyan magas es ugyanott kezdodik felul. */
.map-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2);
  white-space: nowrap;
}

.map-legend b { font-weight: 600; color: var(--text-3); }

.map-legend i {
  flex: 0 0 116px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg,
    hsl(250, 82%, 52%) 0%,
    hsl(205, 82%, 52%) 42%,
    hsl(180, 82%, 52%) 55%,
    hsl(110, 82%, 52%) 68%,
    hsl(45, 82%, 52%) 82%,
    hsl(0, 82%, 52%) 100%);
}

@media (max-width: 620px) {
  .map-legend b { display: none; }
  .map-legend i { flex-basis: 74px; }
}

.heat-legend {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--text-2);
}

/* A szinstopok pontosan a heat_hue() tartomanyait kovetik (-25 .. +35 C). */
.heat-legend i {
  flex: 0 1 190px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg,
    hsl(250, 82%, 52%) 0%,
    hsl(205, 82%, 52%) 42%,
    hsl(180, 82%, 52%) 55%,
    hsl(110, 82%, 52%) 68%,
    hsl(45, 82%, 52%) 82%,
    hsl(0, 82%, 52%) 100%);
}

.heat-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-weight: 700;
  --heat: hsl(220, 8%, 60%);
}

.heat-chip i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--heat);
  align-self: center;
}

.heat-chip small { font-size: 10px; font-weight: 600; color: var(--text-3); }

/* Belepes - ket hasab: balra az urlap, jobbra a kep.
   A hatteret a tema adja, nem fix sotet szin. */

.login-page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.login-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.login-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: var(--surface);
}

.login-form { width: 100%; max-width: 390px; }

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.login-brand .brand-title { color: var(--text); font-size: 22px; }
.login-brand .brand-title span { color: var(--text-3); }

.login-art {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
}

.login-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.login-note {
  display: flex;
  gap: 9px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-2);
}

.login-note svg { flex: 0 0 15px; margin-top: 2px; color: var(--accent); }
.login-note a { color: var(--accent); font-weight: 600; word-break: break-word; }

.login-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-3);
}

.login-company b { color: var(--text-2); font-weight: 600; }
.login-support { text-align: right; }
.login-support a { color: var(--accent); }

@media (max-width: 900px) {
  /* Mobilon a kep egy keskeny savva zsugorodik az urlap fole. */
  .login-split { grid-template-columns: 1fr; }
  .login-art { order: -1; min-height: 170px; }
  .login-pane { padding: 28px 20px 36px; }
  .login-footer { flex-direction: column; gap: 12px; }
  .login-support { text-align: left; }
}

/* ------------------------------------------- Firmware flasheles (flash) --- */

.fw-grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.1fr);
  gap: var(--gap);
  align-items: stretch;
}

/* Egyforma magas kartyak: a legmagasabb szabja meg a sort. Hogy az alacsonyabb
   kartyak alja ne legyen ures lyuk, a zaro megjegyzest lenyomjuk az aljara. */
.fw-grid > .card { display: flex; flex-direction: column; }

.fw-grid > .card > .muted:last-child,
.fw-grid > .card > .fw-hardware:last-child { margin-top: auto; }

/* Az ajanlott panel kepe. A kartyak egyforma magasak, ezert a kep kitolti a
   maradek helyet - contain-nel, tehat az arany megmarad es semmi nem vagodik
   le; a ket oldalt maradó sav a kartya sajat hattere. */
.fw-photo {
  margin: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.fw-photo img {
  display: block;
  width: 100%;
  flex: 1;
  min-height: 140px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.fw-photo figcaption {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-2);
}

.fw-hardware {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2);
}
.fw-hardware strong { color: var(--text); }

.fw-name { font-size: 15px; font-weight: 650; margin: 0 0 12px; }

/* Modvalaszto: ket kattinthato kartya radiogombbal. A veszelyes valasztas
   (teljes telepites) piros keretet kap, ha ki van valasztva. */
.fw-modes { display: grid; gap: 10px; margin: 0 0 16px; }

.fw-mode {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.fw-mode:hover { border-color: var(--border-strong); }
.fw-mode input { margin-top: 2px; flex: 0 0 auto; width: 15px; height: 15px; }
.fw-mode:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.fw-mode.is-destructive:has(input:checked) {
  border-color: rgba(217, 58, 43, .55);
  background: rgba(217, 58, 43, .07);
}
.fw-mode.is-disabled { opacity: .5; cursor: not-allowed; }

.fw-mode-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fw-mode-title { font-weight: 650; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.fw-mode-sub { font-size: 12.5px; color: var(--text-2); }
.fw-mode-facts { font-size: 11px; color: var(--text-3); word-break: break-all; }

.fw-tag {
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(34, 160, 107, .14);
  color: var(--green);
}

.fw-check.is-disabled { opacity: .45; cursor: not-allowed; }

.fw-path { font-size: 12px; opacity: .85; margin-top: 4px; word-break: break-all; }

.fw-listing {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .06);
  font-size: 11.5px;
  line-height: 1.7;
}
.fw-listing-head { font-weight: 600; margin-bottom: 4px; opacity: .8; }
.fw-listing .mono { word-break: break-all; }

/* A kartyan beluli ertesites (a .alert magatol nem hoz margot). */
#fwAlert:not([hidden]) { margin-bottom: 12px; white-space: pre-line; }

.fw-facts th {
  width: 42%;
  text-align: left;
  font-weight: 500;
  color: var(--text-3);
  padding: 5px 0;
  font-size: 12.5px;
}
.fw-facts td { padding: 5px 0; font-size: 13px; }

.fw-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.fw-label { color: var(--text-2); font-size: 12.5px; }
.fw-row .mono { margin-left: auto; font-size: 13px; font-weight: 600; }

.fw-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.fw-check input { width: 15px; height: 15px; flex: 0 0 auto; }

.fw-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.fw-progress { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

.fw-bar {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.fw-bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .15s linear;
}
.fw-bar-text { font-size: 12px; color: var(--text-2); min-width: 92px; text-align: right; }

/* A naplo mindket temaban sotet marad: ez egy terminal-kimenet, es a szeme
   is ugy keresi. A szinek a szokasos konzol-jelentessel birnak. */
.fw-log {
  height: 260px;
  overflow-y: auto;
  padding: 12px 14px;
  border-radius: 8px;
  background: #0f1626;
  border: 1px solid #212c46;
  font-size: 12px;
  line-height: 1.65;
  color: #c8d2e6;
  white-space: pre-wrap;
  word-break: break-word;
}
.fw-line.is-ok    { color: #6ee7a8; }
.fw-line.is-error { color: #ff8b7c; }
.fw-line.is-esp   { color: #8b98b4; }

.fw-log:empty::after {
  content: attr(data-empty);
  color: #5a6683;
}

/* --------------------------------------------------------------- Mobil --- */

.nav-backdrop { display: none; }

@media (max-width: 1400px) {
  /* Harom oszlop mar szuk: a kep a Firmware kartya melle kerul, a flasheles
     pedig ala. */
  .fw-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
}

@media (max-width: 1100px) {
  .fw-grid { grid-template-columns: 1fr; }

  /* Egy oszlopban a kartya nem nyulik, a kep viszont a teljes szelesseget
     megkapna - igy elnyomna az oldalt. Visszaadjuk neki a sajat aranyat, es
     kozepre tesszuk, hogy a keret a kepet olelje, ne egy ures savot. */
  .fw-photo img { flex: none; max-width: 420px; height: auto; margin: 0 auto; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { min-height: 170px; }
}

@media (max-width: 860px) {
  .brand-sub, .header-name { display: none; }
  .brand-title { font-size: 19px; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
    width: var(--sidebar-w);
    box-shadow: 4px 0 20px rgba(0, 0, 0, .18);
  }

  /* Mobilon a hamburger nyitja rea az oldalsavot, nem osszecsukja. */
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-collapsed .sidebar { width: var(--sidebar-w); }

  .app-main,
  body.nav-collapsed .app-main { margin-left: 0; }

  body.nav-open .nav-backdrop {
    display: block;
    position: fixed;
    inset: calc(var(--header-h) + var(--toolbar-h)) 0 0 0;
    background: rgba(9, 13, 24, .45);
    z-index: 29;
  }

  body.nav-collapsed .nav-item { justify-content: flex-start; padding: 9px 18px; }
  body.nav-collapsed .nav-label { display: inline; }
  body.nav-collapsed .nav-section { padding-left: 18px; text-align: left; font-size: 10.5px; }
  body.nav-collapsed .nav-section::after { display: none; }
  body.nav-collapsed .session-label,
  body.nav-collapsed .session-time { display: block; }
}

@media (max-width: 620px) {
  .app-main { padding-left: 14px; padding-right: 14px; }
  .fw-actions .btn { flex: 1 1 100%; justify-content: center; }
  .breadcrumb { display: none; }
  .btn-signout span { display: none; }
  .btn-signout { padding: 7px 9px; }
  .lang-pill span { display: none; }
  .lang-pill { padding: 5px 7px; }
}

/* --- HUVAP logo ------------------------------------------------------------ */
.logo-img { display: block; height: 30px; width: auto; }
.brand-title .logo-img { height: 25px; margin: 1px 0 4px; }
.login-brand .brand-title .logo-img { height: 40px; margin-bottom: 4px; }
.hero-title .logo-img { height: 54px; margin: 4px 0 6px; }
.logo-on-dark { display: none; }
[data-theme="dark"] .logo-on-light { display: none; }
[data-theme="dark"] .logo-on-dark { display: block; }
@media (max-width: 620px) { .brand-title .logo-img { height: 24px; } }

/* --- Control Panel ---------------------------------------------------------- */
.btn-lg { padding: 11px 20px; font-size: 15px; border-radius: 12px; }

.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.panel-tools { display: flex; gap: 10px; }
.panel-tools .btn { min-height: 44px; padding: 0 16px; }

.panel-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.panel-tile {
  --heat: hsl(220, 8%, 60%);
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 16px 16px 14px; min-height: 300px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 24px -18px rgba(16, 24, 40, .35);
  transition: border-color .3s, box-shadow .3s, opacity .3s;
}
.panel-tile::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--heat) 14%, transparent), transparent 70%);
}
.pt-head { position: relative; display: flex; align-items: flex-start; gap: 10px; }
.pt-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 18%, transparent); }
.panel-tile.is-offline .pt-dot { background: var(--text-3); box-shadow: none; }
.pt-names { min-width: 0; flex: 1; }
.pt-title { font-weight: 700; font-size: 15.5px; line-height: 1.25; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-sub { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-edit {
  flex: none; width: 44px; height: 44px; margin: -6px -6px 0 0; border-radius: 12px;
  display: grid; place-items: center; cursor: pointer;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.pt-edit:hover, .pt-edit:focus-visible { color: var(--text); border-color: var(--heat); }

.pt-ring { position: relative; display: block; width: 168px; height: 168px; margin: 10px auto 6px; color: inherit; text-decoration: none; }
.pt-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pt-track { fill: none; stroke: var(--surface-2); stroke-width: 11; }
.pt-arc { fill: none; stroke: var(--heat); stroke-width: 11; stroke-linecap: round; transition: stroke-dasharray .8s ease, stroke .5s; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--heat) 45%, transparent)); }
.pt-value { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; padding-top: 62px; gap: 3px; }
.pt-value b { font-size: 36px; font-weight: 800; letter-spacing: -1px; color: var(--text); font-variant-numeric: tabular-nums; }
.pt-value small { font-size: 14px; color: var(--text-3); font-weight: 600; }

.pt-extras { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.pt-extras li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 6px 10px; border-radius: 9px; background: var(--surface-2); }
.pt-extras li span { color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-extras li b { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-extras small { color: var(--text-3); font-weight: 500; }

.pt-alarm { margin-top: 10px; align-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.panel-tile.is-alarm { border-color: var(--red); animation: pt-pulse 1.8s ease-in-out infinite; }
@keyframes pt-pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--red) 25%, transparent); } }
.panel-tile.is-offline .pt-ring, .panel-tile.is-offline .pt-extras { opacity: .45; filter: grayscale(.7); }
@media (prefers-reduced-motion: reduce) { .panel-tile.is-alarm { animation: none; } .pt-arc { transition: none; } }

dialog.panel-modal { width: min(860px, calc(100vw - 24px)); }
dialog.panel-modal .modal-head .btn { min-height: 38px; }
.panel-entities { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.panel-entities .value-input { min-height: 44px; font-size: 16px; }
.panel-entities .btn { min-height: 44px; }
.pe-range { margin-top: 6px; font-size: 12px; color: var(--text-3); }

/* Tablet / telefon: ket oszlop, kisebb gyuru. */
@media (max-width: 620px) {
  .panel-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .panel-tile { min-height: 0; padding: 12px; }
  .pt-ring { width: 132px; height: 132px; }
  .pt-value { padding-top: 48px; }
  .pt-value b { font-size: 28px; }
}

.panel-tile { cursor: pointer; }
.panel-tile:hover { border-color: color-mix(in srgb, var(--heat) 60%, var(--border)); }
.panel-tile:focus-visible { outline: 3px solid var(--heat); outline-offset: 2px; }
.pt-edit { pointer-events: none; }
.pm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--green); margin-right: 4px; }
.pm-dot.is-off { background: var(--text-3); }
.pm-summary {
  display: flex; align-items: center; gap: 22px; padding: 16px 18px; margin-bottom: 18px; border-radius: 14px;
  background: color-mix(in srgb, var(--heat) 10%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--heat) 35%, var(--border));
}
.pm-big b { font-size: 44px; font-weight: 800; letter-spacing: -1px; color: var(--text); font-variant-numeric: tabular-nums; }
.pm-big small { font-size: 16px; color: var(--text-3); margin-left: 4px; font-weight: 600; }
.pm-meta { display: grid; gap: 2px; font-size: 14px; }
.pm-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pm-title { font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--text-3); margin: 18px 0 8px; }
.pm-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.pm-cell { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; }
.pm-cell span { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-cell b { color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pm-cell small { color: var(--text-3); font-weight: 500; }
.pm-relays { display: flex; flex-wrap: wrap; gap: 8px; }
.pm-relay { padding: 6px 12px; border-radius: 999px; font-size: 13px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3); }
.pm-relay.is-on { background: color-mix(in srgb, var(--green) 16%, var(--surface)); border-color: var(--green); color: var(--text); font-weight: 600; }

.hero-cta { margin-top: 18px; }
@media (max-width: 620px) { .hero-cta { width: 100%; justify-content: center; } }
.pt-remote { --heat: hsl(205, 82%, 52%); }
.pt-globe { display: grid; place-items: center; height: 120px; color: var(--heat); opacity: .85; margin-top: 10px; }
.pt-ip { text-align: center; font-size: 22px; font-weight: 800; color: var(--text); margin: 0 0 10px; letter-spacing: -.3px; }
.pm-remote-form { display: grid; grid-template-columns: 110px 1fr 140px auto; gap: 10px; align-items: end; margin-top: 16px; }
.pm-remote-form label { display: grid; gap: 4px; font-size: 12.5px; color: var(--text-3); }
.pm-remote-form input, .pm-remote-form select { min-height: 44px; }
.pm-remote-form .btn { min-height: 44px; }
@media (max-width: 620px) { .pm-remote-form { grid-template-columns: 1fr 1fr; } }

/* --- Verziotortenet --------------------------------------------------------- */
.session-version { display: block; margin-top: 8px; font-size: 11.5px; color: var(--text-3); text-decoration: none; font-family: ui-monospace, Menlo, Consolas, monospace; }
.session-version:hover { color: var(--text); }
body.nav-collapsed .session-version { display: none; }
.vh-list { display: grid; gap: 14px; }
/* Teljes szelesseg, fix magassag: negy sor (fejlec, cim, ket sor kivonat). */
.vh-item {
  --vh-h: 124px;
  display: grid; grid-template-columns: 1fr; height: var(--vh-h); overflow: hidden; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.vh-item:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -16px rgba(16, 24, 40, .45); }
.vh-item:focus-visible { outline: 3px solid var(--blue, #2f6fed); outline-offset: 2px; }
.vh-item.is-current { border-left-color: var(--green); }
.vh-art { position: relative; background: var(--vh-blue, #2563c9); display: flex; justify-content: center; padding-top: 12px; }
.vh-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vh-sym {
  position: relative; width: 46px; height: 46px; border-radius: 10px;
  display: grid; place-items: center; font-weight: 800; font-size: 20px; color: #fff; line-height: 1;
  background: rgba(13, 23, 38, .6); border: 1px solid rgba(255, 255, 255, .35); backdrop-filter: blur(4px);
}
.vh-sym small { position: absolute; top: 3px; left: 5px; font-size: 9px; font-weight: 600; opacity: .8; }
.vh-body { padding: 12px 18px; min-width: 0; display: grid; grid-template-rows: auto auto 1fr; line-height: 1.5; font-size: 14px; }
.vh-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vh-ver { font-size: 16px; font-weight: 800; color: var(--text); }
.vh-name { font-weight: 700; color: var(--orange); letter-spacing: .3px; }
.vh-date { margin-left: auto; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.vh-title { font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vh-teaser { color: var(--text-3); overflow: hidden; max-height: 3em; align-self: start; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 620px) {
  .vh-item { --vh-h: 132px; }
  .vh-date { display: none; }
}
dialog.vh-modal { width: min(760px, calc(100vw - 24px)); padding: 0; overflow: hidden; }
.vh-modal-art { aspect-ratio: 3 / 1; overflow: hidden; }
.vh-modal-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vh-items { margin: 0; padding-left: 20px; color: var(--text-2); line-height: 1.6; }
.vh-items li { margin: 6px 0; }

/* --- Eszkozkiosztas ----------------------------------------------------------- */
.as-tree { display: grid; gap: 8px; }
.as-cust { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; background: var(--surface-2); }
.as-cust.is-orphan { border-color: var(--red); }
.as-cust summary { cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; list-style: none; }
.as-cust summary::-webkit-details-marker { display: none; }
.as-cust summary::before { content: "▸"; color: var(--text-3); transition: transform .15s; }
.as-cust[open] summary::before { transform: rotate(90deg); }
.as-src { font-size: 12px; color: var(--text-3); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); }
.as-group { margin-top: 10px; }
.as-group-title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px; }
.as-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.as-chip { font-size: 13px; padding: 4px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.as-chip:hover { border-color: var(--text-3); }
.as-table select, .as-table input[type="text"] { min-height: 36px; width: 100%; min-width: 160px; }
.as-table td:last-child { display: flex; align-items: center; gap: 6px; }
.as-open { color: var(--text-3); flex: none; }
.as-table tr.is-new td { background: color-mix(in srgb, var(--orange) 7%, transparent); }
.as-table tr.is-changed td { background: color-mix(in srgb, #2f6fed 9%, transparent); }
.as-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.as-bulk { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; }
.as-bulk select { min-height: 36px; }

/* modal-center: minden modal pontosan a kepernyo kozepen (a globalis margin-reset ne tolja el). */
dialog.modal[open] { position: fixed; inset: 0; margin: auto; height: fit-content; max-height: calc(100vh - 40px); }
dialog.modal .modal-body { max-height: calc(100vh - 40px - 56px); }
dialog.vh-modal[open] { overflow-y: auto; }

dialog.fw-history-modal { width: min(920px, calc(100vw - 24px)); padding: 0; overflow: hidden; }

/* MQTT-hozzaferes: magyarazo dobozok */
.mqa-help, .mqa-guide { background: var(--bg-soft, rgba(37,99,201,.07)); border: 1px solid var(--border, rgba(127,127,127,.25)); border-left: 4px solid #2563c9; border-radius: 8px; padding: 12px 14px; margin: 0 0 16px; font-size: 13.5px; line-height: 1.55; }
.mqa-help p, .mqa-guide p { margin: 6px 0; }
.mqa-help ol, .mqa-guide ol { margin: 6px 0 6px 20px; padding: 0; }
.mqa-help li, .mqa-guide li { margin: 3px 0; }
.mqa-warn { font-weight: 600; }
.mqa-guide { margin-top: 16px; margin-bottom: 0; }

/* Tavoli naplo */
.rl-table td { vertical-align: top; }
.rl-data { word-break: break-word; font-size: 12.5px; }
.rl-pill { display: inline-block; padding: 2px 9px; border-radius: 5px; font-size: 12px; font-weight: 700; letter-spacing: .3px; text-decoration: none; border: 1px solid transparent; }
.rl-pill-boot { background: rgba(255,92,158,.16); color: #e0357c; border-color: rgba(255,92,158,.4); }
.rl-pill-hb   { background: rgba(124,138,168,.16); color: #6c7a98; border-color: rgba(124,138,168,.3); }
.rl-pill-ok   { background: rgba(52,211,153,.16); color: #14946a; border-color: rgba(52,211,153,.4); }
.rl-pill-warn { background: rgba(245,158,11,.16); color: #b87400; border-color: rgba(245,158,11,.45); }
.rl-pill-bad  { background: rgba(239,68,68,.16); color: #d63a3a; border-color: rgba(239,68,68,.45); }
.rl-pill-info { background: rgba(34,150,211,.14); color: #1b7fb0; border-color: rgba(34,150,211,.35); }
tr.rl-boot { background: rgba(255,92,158,.06); }
tr.rl-bad  { background: rgba(239,68,68,.06); }
tr.rl-warn { background: rgba(245,158,11,.05); }
tr.rl-hb .rl-data { opacity: .7; }
.rl-txt-warn { color: #b87400; font-weight: 600; }
.rl-txt-bad  { color: #d63a3a; font-weight: 700; }
tr.is-selected { box-shadow: inset 3px 0 0 #2563c9; background: rgba(37,99,201,.07); }

/* --- Masolas vagolapra ikon ---------------------------------------------------- */
.copy-inline { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; vertical-align: middle; }
.copy-inline .mono { word-break: break-all; }
.copy-btn {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0;
  border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text-3);
  cursor: pointer; vertical-align: middle; transition: color .15s, border-color .15s, background .15s;
}
.copy-btn:hover, .copy-btn:focus-visible { color: var(--text); border-color: var(--text-3); }
.copy-btn.is-copied { color: var(--green); border-color: var(--green); background: color-mix(in srgb, var(--green) 10%, var(--surface)); }
@media (pointer: coarse) { .copy-btn { width: 34px; height: 34px; } }
.mqa-json-head { display: flex; align-items: center; gap: 8px; margin-top: 8px; }

/* --- Control Panel: hetszegmenses szamok, a szondasor nem log ki --------------- */
.panel-tile { min-width: 0; }
.pt-extras, .pt-extras li { min-width: 0; }
.pt-extras li span { flex: 1 1 auto; min-width: 0; }
.pt-extras li b { flex: none; }
.s7-wrap { display: inline-flex; align-items: flex-end; gap: 3px; height: 40px; }
.s7 { height: 100%; width: auto; }
.s7 polygon { fill: currentColor; opacity: .08; }
.s7 polygon.on { opacity: 1; }
.s7-dot { margin: 0 -1px; }
.s7-dot circle { fill: currentColor; }
.pt-value { align-items: center; padding-top: 0; }
.pt-value b { line-height: 1; display: inline-flex; }
.pt-value small { align-self: flex-end; margin-bottom: 2px; }
@media (max-width: 620px) { .s7-wrap { height: 30px; gap: 2px; } }
/* A gyuru SVG-forgatasa ne vonatkozzon a szamjegyekre. */
.pt-ring svg.s7 { width: auto; height: 100%; transform: none; }
.pt-value small { align-self: center; margin: 16px 0 0 2px; }
.s7 polygon { stroke: currentColor; stroke-width: .7; stroke-linejoin: round; }
.s7 polygon:not(.on) { stroke-opacity: 0; }

/* Gyujto csempe: a gyuru az online egysegek aranyat mutatja. */
.pt-gateway .pt-value small { font-size: 18px; font-weight: 700; }
.pt-gateway .pt-extras li b { font-size: 12.5px; font-weight: 600; }
.pt-gwicon { display: grid; place-items: center; height: 64px; margin: 14px 0 10px; color: var(--heat); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--heat) 40%, transparent)); }

/* --- Folytonos hoterkep az alaprajzon ------------------------------------------ */
.heat-canvas { position: absolute; display: none; pointer-events: none; image-rendering: auto; mix-blend-mode: multiply; filter: blur(6px) saturate(1.15); }
.map-stage.heat-on .heat-canvas { display: block; }
[data-theme="dark"] .heat-canvas { mix-blend-mode: screen; opacity: .85; }
.map-stage.heat-on .map-pin::before { opacity: 0; }   /* a jelolok sajat hofoltja ne duplazzon */
.heat-toggle.is-active { background: var(--blue, #2f6fed); border-color: var(--blue, #2f6fed); color: #fff; }

/* -------------------------------------------------- Regiszter profilok -- */
.rp-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.rp-persona { display: flex; gap: 14px; align-items: center; flex: 1 1 420px; min-width: 0; }
.rp-avatar { width: 72px; height: 72px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 4px 14px rgba(27, 63, 148, .35); }
.rp-avatar-sm { width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto; }
.rp-avatar-ph { display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2f6fed, #1b3f94); color: #fff; font-weight: 700; }
.rp-persona-name { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.rp-persona-role { font-size: 12.5px; }
.rp-persona-text { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-2); max-width: 640px; }
.rp-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rp-list td { vertical-align: middle; }
.rp-editor { margin-top: 0; }
.rp-ed-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rp-ed-actions { margin-left: auto; display: flex; gap: 6px; }
#rpSave.is-dirty { box-shadow: 0 0 0 3px rgba(47, 111, 237, .25); }
.rp-sec-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); margin: 6px 0 8px; }
.rp-help { font-size: 12px; margin-top: 3px; }
.rp-check { display: flex !important; align-items: center; gap: 8px; cursor: pointer; min-height: 38px; }
.rp-check input { width: auto !important; }
.rp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 14px 0 12px; flex-wrap: wrap; }
.rp-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; font: inherit; font-weight: 600; color: var(--text-2); cursor: pointer; margin-bottom: -1px; }
.rp-tab.is-on { color: var(--accent); border-bottom-color: var(--accent); }
.rp-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.rp-toolbar input[type=search] { flex: 1 1 240px; max-width: 360px; }
.rp-toolbar select { width: auto; max-width: 240px; }
.rp-count, .rp-stars { font-size: 12.5px; }
.rp-stars { margin-left: auto; }
.rp-ptable-wrap { max-height: 70vh; overflow: auto; }
.rp-ptable { font-size: 13px; }
.rp-ptable th { position: sticky; top: 0; background: var(--surface); z-index: 1; white-space: nowrap; }
.rp-ptable td { padding: 3px 4px; vertical-align: middle; }
.rp-ptable input, .rp-ptable select { padding: 4px 6px; min-height: 30px; font-size: 13px; }
.rp-ptable input[type=checkbox] { width: auto; min-height: 0; }
.rp-w-reg { width: 82px; } .rp-w-code { width: 78px; } .rp-w-desc { min-width: 220px; width: 100%; }
.rp-w-unit { width: 58px; } .rp-w-num { width: 72px; } .rp-w-opts { min-width: 320px; }
.rp-ptable tr.rp-danger td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.rp-row-btns { white-space: nowrap; }
.rp-row-btns .btn { padding: 2px 7px; min-height: 28px; }
.rp-adv-row td { background: var(--surface-2); }
.rp-adv { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 12.5px; padding: 4px 0; }
.rp-adv label { display: flex; align-items: center; gap: 6px; margin: 0; }
.rp-adv select { width: auto; }
.rp-raw { width: 100%; font-size: 12px; line-height: 1.45; }
.rp-draft { margin-bottom: 10px; }
.rp-hist-list { margin: 6px 0 0 18px; padding: 0; font-size: 12.5px; columns: 2; }
.rp-modal { width: min(760px, calc(100vw - 24px)); }
.rp-research-out { margin-top: 14px; }
.rp-research-out .alert { margin: 10px 0; }
.rp-small { font-size: 12px; margin-bottom: 8px; }
.rp-kv { font-size: 13px; margin: 4px 0; }
.rp-notes { font-size: 13px; line-height: 1.55; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.rp-draft-sum { margin: 10px 0; font-size: 13.5px; }
.rp-sources { font-size: 12.5px; margin-top: 12px; }
.rp-sources ol { margin: 4px 0 0 18px; padding: 0; }
.rp-sources a { word-break: break-all; }
.rp-working { display: inline-flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; }
.rp-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: rp-spin .8s linear infinite; }
@keyframes rp-spin { to { transform: rotate(360deg); } }
dialog.rp-chat-modal[open] { display: flex; flex-direction: column; width: min(820px, calc(100vw - 24px)); height: min(760px, calc(100vh - 40px)); max-height: calc(100vh - 40px); }
.rp-chat-modal .modal-head { gap: 8px; }
.rp-chat-log { flex: 1 1 auto; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.rp-msg { display: flex; gap: 8px; align-items: flex-start; max-width: 92%; }
.rp-msg-user { align-self: flex-end; }
.rp-msg-user .rp-bubble { background: var(--accent); color: #fff; border-color: transparent; }
.rp-bubble { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; font-size: 13.5px; line-height: 1.55; min-width: 0; overflow-wrap: anywhere; }
.rp-bubble ul, .rp-bubble ol { margin: 4px 0 4px 18px; padding: 0; }
.rp-bubble code { font-size: 12px; background: rgba(127, 127, 127, .15); padding: 1px 4px; border-radius: 4px; }
.rp-code { max-height: 260px; overflow: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px; font-size: 11.5px; margin: 6px 0; }
.rp-code code { background: none; padding: 0; }
.rp-md-h { font-weight: 700; margin: 6px 0 2px; }
.rp-chat-open { margin-top: 8px; }
.rp-chat-form { border-top: 1px solid var(--border); padding: 10px 16px 14px; background: var(--surface); }
.rp-chat-ctx { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 6px; cursor: pointer; }
.rp-chat-ctx input { width: auto; }
.rp-chat-row { display: flex; gap: 8px; align-items: flex-end; }
.rp-chat-row textarea { flex: 1; resize: none; }
.rp-tools { font-size: 11.5px; margin-top: 6px; }

/* ------------------------------------------------------------ Pascal (AI) -- */
.pc-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 14px; }
.pc-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; font-weight: 600; color: var(--text-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pc-tab.is-on { color: var(--accent); border-bottom-color: var(--accent); }
.pc-wrap { display: grid; grid-template-columns: 270px minmax(0, 1fr); height: calc(100vh - 190px); min-height: 480px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.pc-side { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-right: 1px solid var(--border); background: var(--surface-2); min-height: 0; }
.pc-new { justify-content: center; }
.pc-search { width: 100%; }
.pc-list { flex: 1 1 auto; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.pc-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin: 12px 6px 4px; }
.pc-item { display: block; padding: 7px 9px; border-radius: 7px; color: var(--text); text-decoration: none; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-item:hover { background: var(--accent-soft); }
.pc-item.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pc-empty { font-size: 12.5px; padding: 10px 6px; }
.pc-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pc-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); min-width: 0; }
.pc-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-head-actions { margin-left: auto; display: flex; gap: 6px; flex: 0 0 auto; }
.pc-side-toggle { display: none; }
.pc-log { flex: 1 1 auto; }
.pc-form { flex: 0 0 auto; }
.pc-foot { font-size: 11.5px; margin-top: 6px; }
.pc-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-left: 38px; }
.pc-copy { background: none; border: 0; color: inherit; cursor: pointer; padding: 0 2px; font-size: 13px; }
.pc-md-table { font-size: 12.5px; margin: 6px 0; }
.pc-md-table td { padding: 4px 8px; border-bottom: 1px solid var(--border); }
.pc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.pc-card-wide { grid-column: span 2; }
.pc-big { font-size: 34px; font-weight: 800; line-height: 1.1; margin: 4px 0; }
.pc-mid { font-size: 22px; font-weight: 700; }
.pc-small { font-size: 12px; margin-top: 4px; }
.pc-bar { position: relative; height: 10px; border-radius: 6px; background: var(--border); margin: 10px 0 6px; overflow: visible; }
.pc-bar span { display: block; height: 100%; border-radius: 6px; }
.pc-bar-ok { background: var(--green); } .pc-bar-warn { background: #f0932b; } .pc-bar-danger { background: var(--red); }
.pc-bar i { position: absolute; top: -3px; width: 2px; height: 16px; background: var(--text-2); }
.pc-chart { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 6px; }
.pc-col { flex: 1 1 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.pc-col span { width: 100%; min-height: 1px; background: var(--accent); border-radius: 3px 3px 0 0; }
.pc-col em { font-style: normal; font-size: 10px; color: var(--text-3); margin-top: 3px; }
.pc-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.pc-grid2 > .card, #pcUsage > .card { margin-bottom: 14px; }
@media (max-width: 760px) {
  .pc-wrap { grid-template-columns: 1fr; height: calc(100vh - 160px); position: relative; }
  .pc-side { display: none; position: absolute; z-index: 5; width: min(300px, 85vw); height: calc(100vh - 160px); box-shadow: var(--shadow); }
  body.pc-side-open .pc-side { display: flex; }
  .pc-side-toggle { display: inline-flex; }
  .pc-card-wide { grid-column: auto; }
}
.pc-item small { display: block; font-size: 11px; color: var(--text-3); font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.pc-pub-dot { color: var(--green); font-size: 9px; margin-right: 5px; vertical-align: 1px; }
.pc-owner { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-by { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 4px; font-weight: 700; }
.pc-ini { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 700; flex: 0 0 auto; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .7); }
.pc-you { font-weight: 400; opacity: .8; }
.pc-pub-note { font-size: 12px; text-align: center; padding: 6px 10px; border: 1px dashed var(--border-strong); border-radius: 8px; }
#pcShare.is-on { color: var(--green); border-color: rgba(34, 160, 107, .4); }

/* Control Panel: adatforras-cimke az allapotjelzo alatt (JSON zold, MQTT kek) */
.pt-led { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: none; }
.pt-src { font-size: 8.5px; font-weight: 800; letter-spacing: .04em; line-height: 1; padding: 2px 3px; border-radius: 3px; }
.pt-src-json { color: #1f9d63; background: rgba(34, 160, 107, .13); }
.pt-src-mqtt { color: #2f6fed; background: rgba(47, 111, 237, .13); }
[data-theme="dark"] .pt-src-json { color: #4fd08f; }
[data-theme="dark"] .pt-src-mqtt { color: #7fa6f5; }

/* Control Panel: szures adatforrasra */
.pf-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.pf-btn { min-height: 38px; padding: 0 14px; border: 0; background: transparent; color: var(--text-2); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.pf-btn + .pf-btn { border-left: 1px solid var(--border-strong); }
.pf-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.pf-btn.pf-json[aria-pressed="true"] { background: rgba(34, 160, 107, .14); color: #1f9d63; }
.pf-btn.pf-mqtt[aria-pressed="true"] { background: rgba(47, 111, 237, .14); color: #2f6fed; }
[data-theme="dark"] .pf-btn.pf-json[aria-pressed="true"] { color: #4fd08f; }
[data-theme="dark"] .pf-btn.pf-mqtt[aria-pressed="true"] { color: #7fa6f5; }
.panel-tile[hidden] { display: none !important; }

/* ------------------------------------------------------- Rendszerterkep -- */
.sm-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; max-width: 100%; box-sizing: border-box; }
.sm-filter { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin: 0; }
.sm-filter select { width: auto; min-width: 200px; }
.sm-check input { width: auto; }
.sm-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.sm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sm-l { display: inline-block; width: 26px; height: 0; border-top: 3px dashed; }
.sm-l-mqtt { border-color: #3b82f6; } .sm-l-json { border-color: #22c55e; } .sm-l-web { border-color: #14b8a6; }
.sm-l-bad { border-top-style: solid; border-color: #ef4444; box-shadow: 0 0 6px #ef4444; } .sm-l-unknown { border-color: var(--text-3); }
.sm-ts { margin-left: auto; font-size: 12px; }
.sm-card { position: relative; padding: 18px; max-width: 100%; box-sizing: border-box; overflow: hidden; }
.sm-wrap { position: relative; min-width: 0; }
.sm-root { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 30px; min-width: 0; }
.sm-lines { position: absolute; left: 0; top: 0; width: 100%; z-index: 2; pointer-events: none; overflow: visible; }
.sm-row { display: flex; justify-content: center; }
/* oszlopok: brókerenkent / webtarhelyenkent egy, alattuk az adatgyujtok */
.sm-cols { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 22px; align-items: start; }
@media (max-width: 1100px) { .sm-cols { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); } }
.sm-col { display: flex; flex-direction: column; align-items: stretch; min-width: 0; padding: 0 14px; }
.sm-col > .sm-up { align-self: center; }
.sm-col-count { text-align: center; font-size: 11.5px; margin: 6px 0 4px; }
.sm-gws { display: flex; flex-direction: column; gap: 26px; padding-top: 24px; }
.sm-extra { color: var(--text-3) !important; }
.sm-gw { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 10px 18px 12px; box-shadow: var(--shadow); }
.sm-gw.is-bad { border-color: rgba(239, 68, 68, .5); }
.sm-gw-head { align-self: center; }
.sm-gw-meta { font-size: 11.5px; margin: 4px 0 0; text-align: center; }
.sm-bad-txt { color: #ef4444; font-weight: 700; }
.sm-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px 12px; padding-top: 24px; }
.sm-chips .sm-chip { width: 168px; box-sizing: border-box; }
.sm-box { position: relative; display: flex; align-items: center; gap: 8px; width: 250px; max-width: 100%; min-height: 46px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); border: 1.5px solid var(--border-strong); color: var(--text); box-sizing: border-box; outline: none; }
.sm-box:hover, .sm-box:focus, .sm-chip:hover, .sm-chip:focus { border-color: var(--accent); }
.sm-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.sm-txt b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-txt small { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--text-3); }
.sm-n-ok .sm-dot { background: #22c55e; }
.sm-n-alarm .sm-dot { background: #f59e0b; }
.sm-n-bad .sm-dot { background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.sm-box.sm-n-alarm { border-color: #f59e0b; }
.sm-box.sm-n-bad { border-color: #ef4444; animation: sm-pulse 1.6s ease-in-out infinite; }
.sm-k-server, .sm-k-client { background: var(--accent-soft); }
.sm-src { position: absolute; top: 4px; right: 7px; font-style: normal; font-size: 8.5px; font-weight: 800; letter-spacing: .04em; }
.sm-src-json { color: #1f9d63; } .sm-src-mqtt { color: #2f6fed; }
[data-theme="dark"] .sm-src-json { color: #4fd08f; } [data-theme="dark"] .sm-src-mqtt { color: #7fa6f5; }
/* eszkoz-csempe: a keret a kapcsolat - mukodo: mozgo szaggatott, halott: izzo piros */
.sm-chip { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 30px; padding: 4px 8px; border-radius: 8px; background: var(--surface-2); font-size: 11.5px; outline: none;
  border: 1.5px solid var(--border-strong); }
.sm-chip-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.sm-chip-val { flex: none; font-variant-numeric: tabular-nums; color: var(--text-2); }
.sm-chip.sm-n-bad { border-color: #ef4444; box-shadow: 0 0 10px rgba(239, 68, 68, .55); animation: sm-pulse 1.6s ease-in-out infinite; }
.sm-chip.sm-n-alarm { border-color: #f59e0b; }
.sm-e { fill: none; stroke-width: 2.4; stroke-linejoin: round; }
.sm-e-ok { stroke-dasharray: 8 7; animation: sm-flow 1.1s linear infinite; }
.sm-e-ok.sm-p-mqtt { stroke: #3b82f6; } .sm-e-ok.sm-p-json { stroke: #22c55e; } .sm-e-ok.sm-p-web, .sm-e-ok.sm-p-bus { stroke: #14b8a6; }
.sm-e-bad { stroke: #ef4444; stroke-width: 2.2; animation: sm-pulse-line 1.6s ease-in-out infinite; }
.sm-e-halo { fill: none; stroke: #ef4444; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; opacity: .12; animation: sm-halo 1.6s ease-in-out infinite; }
@keyframes sm-halo { 0%, 100% { opacity: .14; } 50% { opacity: .04; } }
.sm-e-unknown { stroke: var(--text-3); stroke-dasharray: 3 6; opacity: .7; }
.sm-e-alarm { stroke: #f59e0b; stroke-dasharray: 8 7; animation: sm-flow 1.1s linear infinite; }
@keyframes sm-flow { to { stroke-dashoffset: 30; } }
@keyframes sm-pulse-line { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes sm-pulse { 0%, 100% { box-shadow: 0 0 0 1px rgba(239, 68, 68, .35), 0 0 12px rgba(239, 68, 68, .5); } 50% { box-shadow: 0 0 0 1px rgba(239, 68, 68, .15), 0 0 3px rgba(239, 68, 68, .2); } }
.sm-empty { text-align: center; padding: 20px; }
.sm-tip { position: fixed; z-index: 1000; width: 280px; padding: 10px 12px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.5; pointer-events: none; }
.sm-tip-st { font-weight: 700; margin: 2px 0 4px; }
.sm-tip-ok { color: #1f9d63; } .sm-tip-bad { color: #ef4444; } .sm-tip-alarm { color: #d97706; } .sm-tip-unknown { color: var(--text-3); }
@media (prefers-reduced-motion: reduce) { .sm-e-ok, .sm-e-bad, .sm-e-halo, .sm-e-alarm, .sm-box.sm-n-bad, .sm-chip { animation: none !important; } }
.sm-gw.has-bad .sm-gw-head .sm-extra { color: #ef4444 !important; font-weight: 700; }

/* Eszkozlista: telephely-szuro */
tr.site-hidden { display: none !important; }
.site-filter { position: relative; }
.site-filter > summary { list-style: none; cursor: pointer; max-width: 260px; }
.site-filter > summary::-webkit-details-marker { display: none; }
.site-filter > summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: 0; }
.site-filter-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 240px; max-height: 360px; overflow-y: auto; padding: 8px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow); text-transform: none; letter-spacing: 0; font-weight: 500; }
.site-filter-menu label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.site-filter-menu label:hover { background: var(--accent-soft); }
.site-filter-menu input { width: auto; margin: 0; }
.brand-title a { display: inline-block; line-height: 0; }

/* Rendezheto / oszloponkent szurheto tablazat (assets/tablefilter.js) */
th.st-th { white-space: nowrap; }
.st-head { display: inline-flex; align-items: center; gap: 2px; }
.st-sort { display: inline-flex; align-items: center; gap: 5px; padding: 2px 4px; margin: -2px 0 -2px -4px; border: 0; border-radius: 5px; background: none; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.st-sort:hover { background: var(--accent-soft); }
.st-arrow { font-style: normal; font-size: 9px; line-height: 1; opacity: .4; letter-spacing: -1px; }
th.is-sorted .st-arrow { opacity: 1; color: var(--accent); font-size: 10px; letter-spacing: 0; }
.st-filter-btn { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--text-3); cursor: pointer; opacity: .55; }
.st-filter-btn:hover, th:hover .st-filter-btn { opacity: 1; background: var(--accent-soft); }
th.is-filtered .st-filter-btn { opacity: 1; color: #fff; background: var(--accent); }
.st-menu { position: fixed; z-index: 1000; width: 260px; padding: 8px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow); font-size: 13px; }
.st-menu-q { width: 100%; box-sizing: border-box; margin-bottom: 6px; }
.st-menu-acts { display: flex; gap: 6px; margin-bottom: 6px; }
.st-menu-acts button { flex: 1; padding: 4px 6px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.st-menu-list { max-height: 300px; overflow-y: auto; }
.st-menu-list label { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.st-menu-list label:hover { background: var(--accent-soft); }
.st-menu-list label[hidden] { display: none; }
.st-menu-list input { width: auto; margin: 0; flex: none; }
.st-menu-list span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-menu-list small { color: var(--text-3); font-variant-numeric: tabular-nums; }

/* Regiszter-kutatas: fajlok */
.rp-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px; border: 1.5px dashed var(--border-strong); border-radius: 10px; background: var(--surface-2); text-align: center; font-size: 13px; cursor: pointer; }
.rp-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.rp-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.rp-drop small { font-size: 11.5px; }
.rp-files { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rp-files li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 4px 6px 4px 10px; border: 1px solid var(--border); border-radius: 8px; }
.rp-files li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Control Panel: telephely-szuro a forras-valto mellett */
.pf-site { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 4px 0 10px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text-2); margin: 0; }
.pf-site select { width: auto; max-width: 240px; min-height: 34px; border: 0; background: transparent; color: var(--text); font-weight: 600; font-size: 13px; padding: 0 4px; }

/* Control Panel: haromfazisu mero a gyuru helyett */
.pt-phases { display: flex; flex-direction: column; gap: 8px; justify-content: center; min-height: 150px; padding: 6px 4px; }
.pt-ph { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid hsl(150, 70%, 45%); }
.pt-ph.is-bad { border-left-color: hsl(38, 90%, 52%); }
.panel-tile.is-offline .pt-ph { border-left-color: var(--text-3); }
.pt-ph-n { font-weight: 800; font-size: 14px; color: var(--text-2); }
.pt-ph-v { display: inline-flex; align-items: baseline; gap: 4px; font-size: 26px; line-height: 1; color: var(--text); }
.pt-ph-v small { font-size: 12px; color: var(--text-3); }
.pt-ph-a { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text-2); }
.pt-phases { padding-top: 22px; }
.panel-tile { position: relative; }
.pt-addr { position: absolute; right: 12px; bottom: 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; color: var(--text-3); opacity: .55; font-variant-numeric: tabular-nums; pointer-events: none; }
.panel-tile { padding-bottom: 26px; }
