*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  color: #1a1a1a;
  background: #f4f6f8;
  min-height: 100vh;
}

/* --- Navigáció --- */
.navbar {
  background: #1565c0;
  color: #fff;
  padding: 0 1rem;
  height: 3.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.navbar-title { font-weight: 700; font-size: 1.05rem; flex: 1; white-space: nowrap; }
.nav-links { display: flex; gap: 0.25rem; }
.nav-link {
  color: rgba(255,255,255,.82);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 5px;
  font-size: 0.9rem;
  transition: background 0.12s;
}
.nav-link:hover { background: rgba(255,255,255,.18); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.22); color: #fff; font-weight: 600; }

/* --- Layout --- */
.container { max-width: 860px; margin: 0 auto; padding: 1.25rem 1rem; }

/* --- Kártyák --- */
.card {
  background: #fff;
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  margin-bottom: 1rem;
}
.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f0f0f0;
}

/* --- Badge-ek --- */
.badge {
  display: inline-block;
  border-radius: 4px;
  padding: 0.12rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-ok      { background: #e8f5e9; color: #2e7d32; }
.badge-down    { background: #ffebee; color: #c62828; }
.badge-pending { background: #fff8e1; color: #e65100; }
.badge-running { background: #e3f2fd; color: #1565c0; }
.badge-done    { background: #e8f5e9; color: #2e7d32; }
.badge-failed  { background: #ffebee; color: #c62828; }
.badge-cancelled { background: #f3e5f5; color: #6a1b9a; }

/* --- Gombok --- */
.btn {
  display: inline-block;
  padding: 0.48rem 1.1rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.12s, background 0.12s;
  line-height: 1.3;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary   { background: #1565c0; color: #fff; }
.btn-primary:hover:not(:disabled)   { background: #0d47a1; }
.btn-danger    { background: #c62828; color: #fff; }
.btn-danger:hover:not(:disabled)    { background: #b71c1c; }
.btn-secondary { background: #e0e0e0; color: #333; }
.btn-secondary:hover:not(:disabled) { background: #bdbdbd; }
.btn-sm { padding: 0.25rem 0.65rem; font-size: 0.82rem; }

/* --- Mappa-böngésző --- */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem;
  font-size: 0.88rem;
  margin-bottom: 0.7rem;
  color: #555;
}
.breadcrumb-link { color: #1565c0; cursor: pointer; text-decoration: underline; }
.breadcrumb-sep  { color: #bbb; }

.file-list { list-style: none; }
.file-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.48rem 0.4rem;
  border-radius: 5px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.1s;
}
.file-item:last-child { border-bottom: none; }
.file-item:hover { background: #f0f4ff; }
.file-item.no-hover { cursor: default; }
.file-item.no-hover:hover { background: none; }
.file-icon { font-size: 1rem; flex-shrink: 0; }
.file-name { flex: 1; font-size: 0.92rem; word-break: break-all; }
.file-meta { font-size: 0.78rem; color: #999; white-space: nowrap; }

/* --- Form elemek --- */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}
.form-group { display: flex; flex-direction: column; gap: 0.2rem; }
.form-label { font-size: 0.78rem; color: #666; font-weight: 600; }
.form-input {
  padding: 0.38rem 0.55rem;
  border: 1px solid #d0d0d0;
  border-radius: 5px;
  font-size: 0.9rem;
}
.form-input:focus { outline: none; border-color: #1565c0; box-shadow: 0 0 0 2px rgba(21,101,192,.15); }
.form-check { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; padding-bottom: 0.35rem; }
.form-check input[type=checkbox] { width: 1rem; height: 1rem; }

/* --- Progress --- */
.progress-wrap {
  background: #e0e0e0;
  border-radius: 4px;
  height: 7px;
  overflow: hidden;
  margin: 0.5rem 0;
}
.progress-bar {
  background: #1565c0;
  height: 100%;
  transition: width 0.4s ease;
}
.progress-text { font-size: 0.83rem; color: #666; }

/* --- Log terület --- */
.log-area {
  background: #141424;
  color: #ddd;
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  max-height: 180px;
  overflow-y: auto;
  margin-top: 0.6rem;
  line-height: 1.5;
}
.log-line { margin-bottom: 0.1rem; }
.log-ok  { color: #69f0ae; }
.log-err { color: #ff6e6e; }
.log-dim { color: #888; }

/* --- Értesítések --- */
.alert {
  padding: 0.65rem 0.9rem;
  border-radius: 6px;
  font-size: 0.88rem;
  border-left: 3px solid;
}
.alert-info    { background: #e3f2fd; color: #1565c0; border-color: #1565c0; }
.alert-success { background: #e8f5e9; color: #2e7d32; border-color: #2e7d32; }
.alert-error   { background: #ffebee; color: #c62828; border-color: #c62828; }
.alert-warning { background: #fff8e1; color: #e65100; border-color: #e65100; }

/* --- Job lista --- */
.job-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.42rem 0.25rem;
  border-bottom: 1px solid #f5f5f5;
  font-size: 0.88rem;
  flex-wrap: wrap;
}
.job-row:last-child { border-bottom: none; }
.job-id   { font-family: monospace; color: #aaa; font-size: 0.8rem; min-width: 2.5rem; }
.job-info { flex: 1; min-width: 0; }
.job-time { color: #bbb; font-size: 0.78rem; white-space: nowrap; }

/* --- Stat kártyák --- */
.stat-grid { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.stat-card {
  flex: 1;
  min-width: 120px;
  background: #f8f9fa;
  border-radius: 7px;
  padding: 0.75rem 1rem;
  text-align: center;
}
.stat-value { font-size: 1.5rem; font-weight: 700; color: #1565c0; }
.stat-label { font-size: 0.78rem; color: #888; margin-top: 0.1rem; }

/* --- Üres állapot --- */
.empty-state { color: #bbb; font-size: 0.88rem; padding: 0.5rem 0; }

/* --- Megosztott modal --- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.52);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }
/* .modal és .modal-box egyenértékű (admin.html visszafelé compat) */
.modal, .modal-box {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 4px 28px rgba(0,0,0,.2);
  padding: 0;
  min-width: 320px;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .95rem 1.25rem .75rem;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.modal-title { font-size: 1rem; font-weight: 700; color: #222; margin: 0; }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: #aaa;
  line-height: 1;
  padding: .2rem .35rem;
  border-radius: 4px;
  transition: color .12s;
}
.modal-close:hover { color: #444; }
.modal-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  padding: .75rem 1.25rem;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}
/* Nagyobb modal variáns */
.modal-lg { max-width: 720px; }

/* --- Footer --- */
body { padding-bottom: 2.5rem; }

.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  text-align: center;
  padding: .35rem 1rem;
  font-size: .78rem;
  color: #aaa;
  border-top: 1px solid #eee;
  background: #fff;
}
.footer-version-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .78rem;
  color: #1565c0;
  text-decoration: underline;
  padding: 0;
  font-family: inherit;
}
.footer-version-btn:hover { color: #0d47a1; }
.env-badge {
  display: inline-block;
  padding: .1rem .45rem;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
  margin-left: .4rem;
  vertical-align: middle;
}

/* Changelog modal: verzió-bejegyzések */
.changelog-entry { margin-bottom: 1.25rem; }
.changelog-version {
  font-weight: 700;
  font-size: .95rem;
  color: #1565c0;
}
.changelog-date {
  font-size: .78rem;
  color: #aaa;
  margin-left: .5rem;
}
.changelog-summary {
  font-size: .88rem;
  color: #444;
  margin: .2rem 0 .4rem;
  font-style: italic;
}
.changelog-body { font-size: .85rem; color: #555; }
.changelog-body ul { padding-left: 1.2rem; }
.changelog-body li { margin-bottom: .2rem; }
.changelog-sep { border: none; border-top: 1px solid #f0f0f0; margin: 1rem 0 0; }

/* --- Súgórendszer --- */

/* ? ikon a data-help elemeken */
.help-hint-icon {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .35;
  transition: opacity .15s;
  z-index: 10;
  padding: 0;
  font-size: .85rem;
  color: #5b6e85;
  font-weight: 700;
  font-family: system-ui, sans-serif;
}
.help-hint-icon:hover { opacity: .8; }
.help-hint-icon::after { content: "?"; }

/* Flash gomb a navbarban */
.btn-help-flash {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.12);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  flex-shrink: 0;
}
.btn-help-flash:hover { background: rgba(255,255,255,.25); }

/* Radar-pulzus animáció (flash gombra kattintáskor) */
@keyframes radarPulse {
  0%   {
    box-shadow: 0 0 0 0 rgba(245,158,11,.95);
    background: #f59e0b;
    color: #fff;
    transform: scale(1.25);
    opacity: 1;
  }
  55%  {
    box-shadow: 0 0 0 14px rgba(245,158,11,0);
    background: rgba(245,158,11,.12);
    color: #c97a05;
    transform: scale(1);
    opacity: 1;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245,158,11,0);
    background: none;
    color: #5b6e85;
    transform: scale(1);
    opacity: 1;
  }
}
.help-hint-icon.flashing {
  animation: radarPulse .75s ease-out 5;
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .help-hint-icon.flashing { animation: none; opacity: 1; background: #f59e0b; color: #fff; }
}

/* Súgó popover */
.help-popover {
  position: fixed;
  z-index: 300;
  background: #fff;
  border: 1px solid #dde;
  border-radius: 10px;
  box-shadow: 0 6px 32px rgba(0,0,0,.18);
  width: 340px;
  max-width: calc(100vw - 2rem);
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  font-size: .87rem;
}
.help-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem .9rem .55rem;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.help-popover-title {
  font-weight: 700;
  font-size: .88rem;
  color: #222;
}
.help-popover-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #aaa;
  padding: .1rem .3rem;
  border-radius: 3px;
}
.help-popover-close:hover { color: #444; }
.help-popover-body {
  padding: .75rem .9rem;
  overflow-y: auto;
  flex: 1;
  line-height: 1.6;
  color: #333;
}
.help-popover-body h2,
.help-popover-body h3 { font-size: .9rem; margin: .75rem 0 .35rem; color: #222; }
.help-popover-body p  { margin: 0 0 .5rem; }
.help-popover-body ul { padding-left: 1.1rem; margin-bottom: .5rem; }
.help-popover-body li { margin-bottom: .2rem; }
.help-popover-body table { border-collapse: collapse; width: 100%; margin-bottom: .5rem; font-size: .82rem; }
.help-popover-body th,
.help-popover-body td { border: 1px solid #e8e8e8; padding: .25rem .4rem; text-align: left; }
.help-popover-body th { background: #f8f9fa; font-weight: 600; }
.help-popover-body strong { font-weight: 700; }
.help-popover-body blockquote {
  border-left: 3px solid #1565c0;
  padding-left: .7rem;
  color: #555;
  margin: .5rem 0;
}
.help-popover-link {
  display: block;
  padding: .5rem .9rem;
  font-size: .8rem;
  color: #1565c0;
  text-decoration: none;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.help-popover-link:hover { text-decoration: underline; }

/* Súgóoldal (help.html) */
.help-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}
.help-content h1 { font-size: 1.5rem; margin-bottom: 1rem; color: #1a1a1a; }
.help-content h2 { font-size: 1.15rem; margin: 1.5rem 0 .6rem; color: #1565c0;
                   border-bottom: 1px solid #e8f0fe; padding-bottom: .3rem; }
.help-content h3 { font-size: 1rem; margin: 1rem 0 .4rem; color: #333; }
.help-content p  { line-height: 1.7; margin-bottom: .75rem; color: #333; }
.help-content ul,
.help-content ol { padding-left: 1.4rem; margin-bottom: .75rem; }
.help-content li { line-height: 1.6; margin-bottom: .25rem; }
.help-content table { border-collapse: collapse; width: 100%; margin-bottom: 1rem; }
.help-content th,
.help-content td { border: 1px solid #ddd; padding: .4rem .6rem; }
.help-content th { background: #f0f4ff; font-weight: 600; }
.help-content blockquote {
  border-left: 4px solid #1565c0;
  padding: .5rem .75rem;
  background: #f0f4ff;
  border-radius: 4px;
  margin: .75rem 0;
  color: #444;
}
.help-content code {
  background: #f4f4f4;
  padding: .1rem .3rem;
  border-radius: 3px;
  font-size: .88em;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.help-content pre code {
  display: block;
  padding: .7rem .9rem;
  overflow-x: auto;
  font-size: .85rem;
}
.help-content hr { border: none; border-top: 1px solid #eee; margin: 1.5rem 0; }

/* Tartalom-táblázat (TOC) gomb */
.help-toc-fab {
  position: fixed;
  bottom: 4rem;
  right: 1.25rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #1565c0;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
}
.help-toc-list {
  position: fixed;
  bottom: 7rem;
  right: 1.25rem;
  background: #fff;
  border: 1px solid #dde;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  z-index: 150;
  min-width: 200px;
  max-width: 300px;
  max-height: 60vh;
  overflow-y: auto;
  padding: .5rem 0;
  display: none;
}
.help-toc-list.open { display: block; }
.help-toc-item {
  display: block;
  padding: .35rem .85rem;
  font-size: .83rem;
  color: #1565c0;
  text-decoration: none;
}
.help-toc-item:hover { background: #f0f4ff; }
.help-toc-sub { padding-left: 1.5rem; font-size: .8rem; color: #555; }

/* Toast értesítések */
#toast-container {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}
.toast {
  background: #1a1a1a;
  color: #fff;
  padding: .6rem 1.1rem;
  border-radius: 6px;
  font-size: .88rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-info    { background: #1565c0; }
.toast-success { background: #2e7d32; }
.toast-warning { background: #e65100; }
.toast-error   { background: #c62828; }

/* --- Reszponzív --- */
@media (max-width: 600px) {
  .navbar-title  { font-size: 0.95rem; }
  .nav-link      { padding: 0.3rem 0.55rem; font-size: 0.82rem; }
  .container     { padding: 0.85rem 0.65rem; }
  .card          { padding: 0.9rem 0.9rem; }
  .stat-value    { font-size: 1.2rem; }
  .form-row      { gap: 0.5rem; }
  .help-popover  { width: calc(100vw - 2rem); }
  .modal, .modal-box { max-width: calc(100vw - 2rem); }
}
