:root{
  --bg: rgb(25,25,25);
  --panel: rgb(45,45,45);
  --panel2: rgba(45,45,45,.65);
  --text: rgb(220,220,220);
  --muted: rgba(220,220,220,.72);
  --accent: rgb(163,211,156);
  --accent2: rgba(163,211,156,.15);
  --danger: #ff5d5d;
  --warn: #ffcc66;
  --ok: #59e3a2;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 14px;
  --stroke: rgba(220,220,220,.10);
  --stroke2: rgba(163,211,156,.22);
  --maxw: 1100px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

/* Admin pages: wider container */
body.admin{ --maxw: 1480px; }
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(163,211,156,.18), transparent 60%),
              radial-gradient(1000px 500px at 90% 0%, rgba(163,211,156,.10), transparent 55%),
              var(--bg);
  color:var(--text);
  font-family:var(--font);
}
a{color:inherit; text-decoration:none}
a:hover{color:var(--accent)}
.container{max-width:var(--maxw); margin:0 auto; padding:22px}
.topbar{
  position:sticky; top:0; z-index:10;
  background: rgba(25,25,25,.72);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--stroke);
}
.nav{
  display:flex; align-items:center; gap:12px;
  padding:14px 22px;
  max-width:var(--maxw);
  margin:0 auto;
}
.brand{
  display:flex; align-items:center; gap:12px;
  font-weight:800; letter-spacing:.3px;
}

.brand-badge{
  width:34px; height:34px;
  border-radius:10px;
  background: linear-gradient(135deg, rgba(163,211,156,.35), rgba(163,211,156,.05));
  border:1px solid var(--stroke2);
  display:grid; place-items:center;
  box-shadow: var(--shadow);
}
.brand small{display:block; font-weight:600; color:var(--muted); letter-spacing:.2px}
.navlinks{margin-left:auto; display:flex; gap:6px; flex-wrap:wrap}
.navlinks a{
  padding:9px 12px;
  border-radius:12px;
  border:1px solid transparent;
  color:var(--muted);
}
.navlinks a.active{
  color:var(--text);
  border-color:var(--stroke2);
  background: rgba(163,211,156,.08);
}
.navlinks a.btn{
  color:var(--bg);
  background: var(--accent);
  border-color: transparent;
  font-weight:700;
}
.navlinks a.btn:hover{filter:brightness(1.03); color:var(--bg)}
.hero{padding:34px 0 10px 0;}
.grid{display:grid; grid-template-columns: 1.2fr .8fr; gap:16px;}
@media (max-width: 980px){ .grid{grid-template-columns:1fr} }
.card{
  background: linear-gradient(180deg, rgba(45,45,45,.92), rgba(45,45,45,.75));
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.linkrow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 14px;
  border-radius: 12px;
  border:1px solid var(--stroke);
  background: rgba(25,25,25,.30);
}
.linkrow:hover{
  border-color: var(--stroke2);
  background: rgba(163,211,156,.06);
}
.card .hd{padding:16px 16px 0 16px;}
.card .hd h2{margin:0; font-size:18px}
.card .hd p{margin:7px 0 0 0; color:var(--muted); font-size:13px}
.card .bd{padding:16px}
hr.sep{border:none; border-top:1px solid var(--stroke); margin:14px 0;}
.kpi{
  display:flex; gap:12px; align-items:center; justify-content:space-between;
  padding:14px 16px;
  border-radius: 14px;
  border:1px solid var(--stroke);
  background: rgba(25,25,25,.35);
}
.kpi strong{font-size:22px}
.pill{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--stroke2);
  background: rgba(25,25,25,.30);
  color:var(--text);
  font-size:12px;
  font-weight:800;
}
.pill.ok{border-color: rgba(89,227,162,.35); background: rgba(89,227,162,.10)}
.pill.warn{border-color: rgba(255,204,102,.35); background: rgba(255,204,102,.08)}

.badge{
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--stroke2);
  background: rgba(163,211,156,.10);
  color:var(--text);
  font-size:12px;
}
.list{display:flex; flex-direction:column; gap:10px}
.item{
  padding:14px 14px;
  border-radius: 3px;
  border:1px solid var(--stroke);
  background: rgba(25,25,25,.30);
}
.item h3{margin:0; font-size:15px}
.item .meta{margin-top:6px; color:var(--muted); font-size:12px; display:flex; gap:10px; flex-wrap:wrap}
.item .body{margin-top:10px; color:var(--text); font-size:13px; line-height:1.5; white-space:pre-wrap}
.btnrow{display:flex; gap:10px; flex-wrap:wrap}
button, .button{
  appearance:none;
  border:none;
  border-radius: 14px;
  padding:10px 12px;
  background: rgba(163,211,156,.10);
  border:1px solid var(--stroke2);
  color:var(--text);
  cursor:pointer;
  font-weight:700;
}
button.primary, .button.primary{background: var(--accent); color: var(--bg); border-color: transparent;}
button.danger, .button.danger{background: rgba(255,93,93,.12); border-color: rgba(255,93,93,.35);}
button:hover, .button:hover{filter:brightness(1.05)}
input, textarea, select{
  width:100%;
  background: rgba(25,25,25,.30);
  border:1px solid var(--stroke);
  border-radius: 14px;
  padding:10px 12px;
  color: var(--text);
  outline:none;
}
label{display:block; font-size:12px; color:var(--muted); margin:12px 0 6px}
.formrow{display:grid; grid-template-columns:1fr 1fr; gap:12px}
@media (max-width: 700px){ .formrow{grid-template-columns:1fr} }
.flash{
  padding:12px 14px; border-radius:14px; border:1px solid var(--stroke);
  margin:12px 0;
  background: rgba(25,25,25,.35);
}
.flash.ok{border-color: rgba(89,227,162,.35); background: rgba(89,227,162,.08)}
.flash.err{border-color: rgba(255,93,93,.35); background: rgba(255,93,93,.08)}
.flash.warn{border-color: rgba(255,204,102,.35); background: rgba(255,204,102,.08)}
.footer{
  margin-top:26px;
  color:var(--muted);
  font-size:12px;
  padding:18px 0 30px 0;
}
.footer a{color:var(--muted)}
.footer a:hover{color:var(--accent)}


/* --- Media for news/changelog --- */
.postbox{
  padding:14px;
  border:1px solid var(--stroke2);
  border-radius:14px;
  background: rgba(12, 14, 16, 0.55);
  margin-bottom:12px;
}
.mediaimg{
  width:100%;
  height:auto;
  display:block;
  border-radius:14px;
  border:1px solid var(--stroke2);
  margin:10px 0;
}
.videowrap{
  position:relative;
  width:100%;
  padding-top:56.25%;
  border-radius:14px;
  border:1px solid var(--stroke2);
  overflow:hidden;
  margin:10px 0;
  background: rgba(0,0,0,0.25);
}
.videowrap iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
}

/* --- Admin layout tweaks --- */
.admin-page .card{ overflow:visible; }
.admin-page .section-title{ margin-top:18px; }
.admin-page .tablewrap{ overflow:auto; border-radius:14px; }
.admin-page table.table{ width:100%; table-layout:fixed; }
.admin-page table.table td, .admin-page table.table th{ vertical-align:top; }
.admin-page table.table th{ position:sticky; top:0; background:rgba(18,20,18,.96); z-index:1; }
.admin-page form.inline{ display:flex; flex-direction:column; gap:8px; min-width:220px; }
.admin-page form.inline input[type=text],
.admin-page form.inline textarea{ width:100%; }
.admin-page .btn{ white-space:nowrap; }
.admin-page .muted.small{ display:block; margin-top:4px; }


/* === Admin panel layout improvements === */
body.admin .container{ max-width: 1700px; }
@media (max-width: 1600px){ body.admin .container{ max-width: 92vw; } }

body.admin .table{ border-collapse: separate; border-spacing: 0 8px; }
body.admin .table tbody tr{ background: rgba(255,255,255,.035); }
body.admin .table tbody tr:nth-child(even){ background: rgba(255,255,255,.055); }
body.admin .table tbody tr td,
body.admin .table tbody tr th{
  padding-top: 10px; padding-bottom: 10px;
}
body.admin .table tbody tr td:first-child,
body.admin .table tbody tr th:first-child{
  border-top-left-radius: 10px; border-bottom-left-radius: 10px;
}
body.admin .table tbody tr td:last-child,
body.admin .table tbody tr th:last-child{
  border-top-right-radius: 10px; border-bottom-right-radius: 10px;
}

body.admin .btnrow{
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
body.admin .btnrow form{ margin: 0; }
body.admin .btnrow .btn{ min-width: 110px; }

/* wrap long cells (Indok / Leírás) */
body.admin td.wrap{
  max-width: 520px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.inv-grid{
  display:grid;
  grid-template-columns:repeat(10, 62px); /* 7 oszlop */
  gap:10px;
  align-content:start;
}

.inv-slot{
  width:62px;
  height:62px;
  border-radius:12px;
  border:1px solid var(--stroke2);
  background:rgba(0,0,0,.22);
  display:grid;
  place-items:center;
  overflow:hidden;
}

.inv-slot.inv-empty{
  background:rgba(0,0,0,.12);
}

.inv-icon{
  width:54px;
  height:54px;
  object-fit:contain;
  image-rendering:auto;
  user-select:none;
  pointer-events:none;
}

/* ===== Admin tabs ===== */
.tabs{
  display:flex;
  gap:10px;
  padding:12px;
  margin:12px 0 16px;
  border:1px solid rgba(255,255,255,.06);
  border-radius:14px;
  background:rgba(0,0,0,.10);
  backdrop-filter: blur(10px);
}
.tabs .tab{
  appearance:none;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.06);
  color:rgba(255,255,255,.85);
  padding:10px 14px;
  border-radius:12px;
  font-weight:700;
  cursor:pointer;
  transition:.15s ease;
}
.tabs .tab:hover{ background:rgba(255,255,255,.08); }
.tabs .tab.active{
  background:rgba(163,211,156,.22);
  border-color:rgba(163,211,156,.35);
  color:#eaf6ee;
}
.tabpanes .tabpane{ display:none; }
.tabpanes .tabpane.active{ display:block; }

a.primary{
  display:inline-block;
  border-radius:14px;
  padding:10px 12px;
  background: var(--accent);
  color: var(--bg);
  font-weight:700;
}

/* TOPBAR LOGO FIX */
.nav .brand-logo{
  width: 50px !important;
  height: 50px !important;
  max-width: 50px !important;
  max-height: 50px !important;
  object-fit: contain !important;
  display: block !important;
  flex: 0 0 50px !important;
}
.item .meta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  line-height:1.4;
}
.item .meta span{
  white-space:nowrap;
}
@media (max-width: 700px){
  .item .meta span{ white-space:normal; }
}
/* jármű header pill-ek */
.veh-head{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  margin:0;
}

.pill b{ font-weight:900; }

/* piros pill (impounded) */
.pill.danger{
  border-color: rgba(255,93,93,.35);
  background: rgba(255,93,93,.12);
  color: #ffdede;
}

.vhead{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  margin-bottom:8px;
}
.vhead{ margin-bottom: 2px; }
.vpill{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--stroke2);
  background: rgba(25,25,25,.30);
  color:var(--text);
  font-size:12px;
  font-weight: 900;
  letter-spacing: .2px;
}
.vpill.danger{
  border-color: rgba(255,93,93,.35);
  background: rgba(255,93,93,.12);
  color: #ffdede;
}
/* pill header alatt legyen hely */
.vhead-sep{
  height: 8px; /* ez adja a "kihagyott sort" */
}

/* ha a pill-en belül van <b>, az is legyen tényleg vastag */
.vpill b{
  font-weight: 900;
}

/* ===== Mobile header ===== */
.navtoggle{
  display:none;
  margin-left:auto;
  background: rgba(25,25,25,.25);
  border:1px solid var(--stroke2);
  color:var(--text);
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
  font-weight:900;
}
.navtoggle-ico{ font-size:16px; line-height:1; }

.navlinkswrap{ margin-left:auto; } /* desktopon a linkek jobbra */

@media (max-width: 860px){
  .navlinkswrap{ display:none; }
  body.nav-open .navlinkswrap{ display:block; }
}

@media (max-width: 860px){
  .nav{ flex-wrap:wrap; gap:10px; }

  /* logo kisebb mobilon */
  .nav .brand-logo{
    width:34px !important;
    height:34px !important;
    flex:0 0 34px !important;
  }
  .brand{ gap:10px; }
  .brand > div > div{ font-size:14px; line-height:1.1; }

  /* hamburger megjelenik */
  .navtoggle{ display:inline-flex; align-items:center; justify-content:center; }

  /* a linkek külön sorban, lenyílva */
  .navlinkswrap{
    width:100%;
    margin-left:0;
    display:none;
  }
  body.nav-open .navlinkswrap{ display:block; }

  .navlinks{
    width:100%;
    margin-left:0;
    display:flex;
    flex-direction:column;
    gap:6px;
    padding:8px 0 2px;
  }
  .navlinks a{
    width:100%;
    border:1px solid var(--stroke);
    background: rgba(25,25,25,.22);
    border-radius:12px;
    padding:10px 12px;
  }
  .navlinks a.btn{
    text-align:center;
  }
}
@media (max-width: 860px){
  .nav{ position:relative; }

  /* A menü gomb legyen a legfelső rétegen */
  .navtoggle{
    position:relative;
    z-index:50;
    pointer-events:auto;
  }

  /* Zárt állapotban a menü NE fogjon kattintást */
  .navlinkswrap{
    display:none !important;
    width:100%;
  }
  body.nav-open .navlinkswrap{
    display:block !important;
  }
}
.topbar{ z-index: 1000; }
