:root, html {
  --bg:#0b1220; --panel:#121a2b; --text:#e9eefc; --muted:#a9b3c9;
  --accent:#4ea1ff; --ok:#22c55e; --warn:#f59e0b; --err:#ef4444; --border:#1e2a44; --link:#4ea1ff;
}
:root.light, html.light {
  --bg:#f6f7fb; --panel:#fff; --text:#0b1220; --muted:#475569;
  --accent:#2563eb; --ok:#16a34a; --warn:#d97706; --err:#dc2626; --border:#e5e7eb; --link:#2563eb;
}

*{ box-sizing:border-box }
body{ margin:0; font:14px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,'Helvetica Neue',Arial,sans-serif; background:var(--bg); color:var(--text); }

/* ===== HEADER ===== */
header{
  position:sticky; top:0; z-index:10;
  display:flex; flex-direction:column; gap:10px;
  padding:12px 16px; border-bottom:1px solid var(--border);
  background:var(--bg);
}
header .row{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
header h1{ margin:0; font-size:18px; }

/* ===== NAV ===== */
nav.topnav{
  display:flex; align-items:center; justify-content:space-between;
  gap:16px; white-space:nowrap;  /* desktopon ne törjön */
  overflow:visible; z-index:20;
}
.topnav-left, .topnav-right{
  display:flex; align-items:center; gap:12px; white-space:nowrap;
}
nav a{ color:var(--accent); text-decoration:none; }
nav a.active{ font-weight:700; text-decoration:underline; }

/* „Napló törlése” – link stílus */
.inline-form{ display:inline; margin:0; }
.linkbtn{
  background:none; border:none; padding:0; margin:0;
  color:var(--link); text-decoration:underline; cursor:pointer; font:inherit; line-height:1;
}

/* ===== LAYOUT ===== */
.container{ max-width:1200px; margin:20px auto; padding:0 16px; }
.grid{ display:grid; grid-template-columns:380px 1fr; gap:20px; align-items:start; }
.grid>.card{ align-self:start; align-self:flex-start; }
@media(max-width:980px){ .grid{ grid-template-columns:1fr; } }

.card{ background:var(--panel); border:1px solid var(--border); border-radius:10px; padding:16px; }
.card h2{ margin:0 0 12px; font-size:16px; }

label{ display:block; margin:10px 0 6px; color:var(--muted); font-size:12px; }
input[type='text'],input[type='password'],textarea,select{
  width:100%; background:var(--panel); border:1px solid var(--border);
  color:var(--text); border-radius:8px; padding:10px 12px; outline:none;
}
select option{
  background:var(--panel); color:var(--text);
}
textarea{ min-height:140px; resize:vertical; }

.row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.muted{ color:var(--muted); font-size:12px; }

.btn{ border:1px solid transparent; background:var(--accent); color:#fff; padding:10px 14px; border-radius:8px; cursor:pointer; font-weight:600; }
.btn.secondary{ background:transparent; border-color:var(--border); color:var(--text); }
.btn.small{ padding:6px 10px; font-weight:500; }

/* ===== TABLE ===== */
.table-wrap{ overflow:auto; border:1px solid var(--border); border-radius:10px; }
table{ width:100%; border-collapse:collapse; font-size:13px; }
th,td{ padding:10px 12px; border-bottom:1px solid var(--border); vertical-align:top; }
th{ text-align:left; white-space:nowrap; position:sticky; top:0; z-index:1; background:rgba(255,255,255,.02); }
tr:hover td{ background:rgba(255,255,255,.03); }
pre{ margin:0; white-space:pre-wrap; word-wrap:break-word; }

/* ===== FLASH ===== */
.flash{ margin:10px 0; padding:10px 12px; border-radius:8px; }
.flash.ok{ background:rgba(34,197,94,.15); border:1px solid rgba(34,197,94,.4); }
.flash.err{ background:rgba(239,68,68,.15); border:1px solid rgba(239,68,68,.4); }

/* ===== LED ===== */
.led{ display:inline-flex; align-items:center; gap:6px; padding:4px 8px; border-radius:999px; border:1px solid var(--border); font-size:12px; }
.led i{ display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--warn); }
.led.ok i{ background:var(--ok); }
.led.err i{ background:var(--err); }

/* ===== DROPDOWN ===== */
.dropdown{ position:relative; display:inline-block; }
.dropbtn{
  background:transparent; border:1px solid var(--border); color:var(--text);
  padding:6px 10px; border-radius:8px; cursor:pointer; font:inherit; line-height:1;
}

/* FŐ JAVÍTÁS: a menü MINDIG a gomb bal széléhez igazodjon, közvetlen alá. 
   !important-tal felülírjuk bármely más CSS-t (pl. hk.css) */
.dropdown-content{
  position:absolute;
  top:calc(100% + 6px) !important;
  left:0 !important;
  right:auto !important;

  min-width:200px; max-width:min(320px, 90vw);
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:10px;
  box-shadow:0 12px 24px rgba(0,0,0,.3);
  padding:6px;
  z-index:9999;

  opacity:0; visibility:hidden; transform:translateY(4px);
  transition:opacity .12s ease, transform .12s ease, visibility 0s linear .12s;
}
.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content{
  opacity:1; visibility:visible; transform:translateY(0);
  transition:opacity .12s ease, transform .12s ease, visibility 0s;
}

/* menüpontok */
.dropdown-content form{ margin:0; }
.dropdown-content .menuitem,
.dropdown-content a.menuitem{
  display:block; width:100%; text-align:left;
  background:none; border:0; color:var(--text);
  padding:10px 12px; border-radius:8px; cursor:pointer; font:inherit; text-decoration:none;
}
.dropdown-content .menuitem:hover{ background:rgba(0,0,0,.08); }
.dropdown-content .menuitem.active{ font-weight:600; text-decoration:underline; }

/* ===== MOBIL ===== */
@media (max-width: 900px){
  nav.topnav{ flex-wrap:wrap; white-space:normal; }  /* mobilon törhet */
  .topnav-left, .topnav-right{ flex-wrap:wrap; }
  /* mobilon is a gombhoz igazítjuk, marad left:0 */
}
