:root{
  --bg:#0b1220;
  --card:#111b2e;
  --muted:#94a3b8;
  --text:#e5e7eb;
  --accent:#22c55e;
  --danger:#ef4444;
  --line:rgba(148,163,184,.18);
}

*{ box-sizing:border-box; }
html, body { height: 100%; }

/* A böngészőnek jelezzük, hogy sötét UI-t használunk */
html{ color-scheme: dark; }

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  min-height:100vh;

  background:
    radial-gradient(1200px 700px at 20% -10%, rgba(34,197,94,.18), transparent 60%),
    radial-gradient(900px 600px at 110% 10%, rgba(59,130,246,.14), transparent 55%),
    linear-gradient(180deg, #070b14 0%, #0b1220 60%, #0b1220 100%);
  background-attachment: fixed;
  background-repeat:no-repeat;
  background-size:cover;
}

.wrap{max-width:920px; margin:0 auto; padding:16px;}

.topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin:8px 0 14px;
}
.topbarLeft{ min-width:0; }
.topbarRight{
  display:flex;
  gap:10px;
  align-items:flex-start;
  flex-wrap:wrap;
  justify-content:flex-end;
}

h1{margin:0; font-size:20px;}

.sub{margin:6px 0 0; color:var(--muted); font-size:13px; line-height:1.35;}
.sub div{ margin-top:4px; }

.grid{
  display:grid;
  gap:12px;
  grid-template-columns: 1fr;
}
@media (min-width: 860px){
  .grid{ grid-template-columns: 1.1fr .9fr; }
}

.card{
  background: rgba(17,27,46,.78);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 14px 40px rgba(0,0,0,.35);
  backdrop-filter: blur(10px);
}
.card h2{margin:0 0 10px; font-size:16px;}

label{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin:10px 0 6px;
}

input, select{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--text);
  outline:none;
  font-size:15px;
}
input:focus, select:focus{ border-color:rgba(34,197,94,.6); }

.row3{
  display:grid;
  gap:10px;
  grid-template-columns: 1fr 1fr 1fr;
}
/* mobilon ne törje szét */
@media (max-width: 640px){
  .row3{ grid-template-columns: 1fr; }
}

.btns{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

button{
  transition: transform .06s ease, background .2s ease, border-color .2s ease;
  border:0;
  border-radius:12px;
  padding:11px 12px;
  font-size:14px;
  cursor:pointer;
  color:var(--text);
  background:rgba(255,255,255,.06);
  border:1px solid var(--line);
}
button:hover{
  transform: translateY(-1px);
  border-color: rgba(148,163,184,.35);
}
button.primary{
  background:rgba(34,197,94,.18);
  border-color:rgba(34,197,94,.45);
}
button.primary:hover{ border-color: rgba(34,197,94,.65); }

button.danger{
  background:rgba(239,68,68,.14);
  border-color:rgba(239,68,68,.35);
}
button:active{transform:translateY(1px);}

.hint{color:var(--muted); font-size:12px; margin-top:10px; line-height:1.35;}

.totals{
  display:grid;
  gap:8px;
  padding:12px;
  border-radius:14px;
  background:rgba(255,255,255,.03);
  border:1px dashed var(--line);
}
.totals .line{display:flex; justify-content:space-between; gap:8px; color:var(--muted);}
.totals .big{color:var(--text); font-weight:700; font-size:16px;}

.list{display:grid; gap:10px; margin-top:10px;}
.item{
  padding:12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
}
.itemTop{display:flex; justify-content:space-between; gap:10px; align-items:center;}
.name{font-weight:700;}
.meta{color:var(--muted); font-size:12px; margin-top:6px; line-height:1.35;}
.actions{display:flex; gap:8px;}

.chip{
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--line);
  color:var(--muted);
  font-size:12px;
  background:rgba(255,255,255,.02);
  margin-right:6px;
  margin-top:6px;
}

.toast{
  position:fixed;
  left:50%;
  bottom:16px;
  transform:translateX(-50%);
  background:rgba(0,0,0,.65);
  border:1px solid rgba(255,255,255,.14);
  color:#fff;
  padding:10px 12px;
  border-radius:999px;
  font-size:13px;
  opacity:0;
  pointer-events:none;
  transition:opacity .2s;
}
.toast.show{opacity:1;}

.empty{color:var(--muted); font-size:13px; margin-top:10px;}

.footer{
  max-width:920px;
  margin:18px auto 10px;
  padding:0 16px;
  color:var(--muted);
  font-size:12px;
  text-align:center;
  opacity:.9;
}

/* Footer linkek: ne legyen default kék/lila */
.footer{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footerLinks a{
  color: inherit;          /* örökölje a footer szövegszínt */
  text-decoration: none;
  opacity: 0.9;
}

.footerLinks a:visited{
  color: inherit;          /* ne legyen lila látogatott link */
}

.footerLinks a:hover{
  opacity: 1;
  text-decoration: underline;
}

.footerLinks .sep{
  opacity: 0.5;
  margin: 0 10px;
}

/* Explain */
.explain{
  margin-top:10px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,.02);
  padding:10px 12px;
}
.explain summary{
  cursor:pointer;
  color:var(--muted);
  font-size:13px;
  list-style:none;
  user-select:none;
}
.explain summary::-webkit-details-marker{ display:none; }
.explain[open] summary{ color:var(--text); font-weight:700; }
.explainBody{ margin-top:10px; }
.explainBody div{ margin-top:4px; }

/* Checkbox sorok */
.optline{
  display:flex;
  align-items:center;
  gap:10px;
  margin:12px 0 0;
  color:var(--muted);
  font-size:13px;
  line-height:1.25;
}
.optline input[type="checkbox"]{
  width:18px;
  height:18px;
  margin:0;
  flex:0 0 18px;
}

.checkline{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:8px;
  color:var(--muted);
  font-size:13px;
}
.checkline input[type="checkbox"]{
  width:16px;
  height:16px;
  margin:0;
  flex:0 0 16px;
}

.toggleBox{ display:none; margin-top:10px; }

/* Ajtó/ablak sorok */
.openings{
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  border-radius:14px;
  padding:10px;
}
.openHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.openTitle{ font-weight:800; }
.openHint{
  margin-top:8px;
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}

.openGrid{
  display:grid;
  grid-template-columns: 70px 1fr 1fr 42px;
  gap:8px;
  align-items:center;
  margin-top:10px;
}
@media (max-width: 420px){
  .openGrid{ grid-template-columns: 60px 1fr 1fr 42px; }
}
.openGridHead{
  color:var(--muted);
  font-size:12px;
  margin-top:8px;
}
.openGridList{ margin-top:6px; }

.openRow input{
  padding:10px 10px;
  font-size:14px;
}
.delBtn{
  width:42px;
  height:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
  background:rgba(239,68,68,.12);
  border:1px solid rgba(239,68,68,.25);
}
.delBtn:hover{ border-color: rgba(239,68,68,.45); }

.miniBtn{
  padding:8px 10px;
  border-radius:12px;
  font-size:13px;
}

/* Header mini selects */
.miniRow{ display:flex; align-items:center; gap:8px; }
.miniLabel{ margin:0; font-size:12px; color:var(--muted); white-space:nowrap; }
.miniSelect{
  width:auto;
  padding:8px 10px;
  font-size:13px;
  border-radius:12px;
}

/* ✅ FIX: a nyelv/pénznem legördülő stílus (korábban hibás volt) */
select,
.miniSelect{
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* a lenyíló lista elemei */
select option{
  background: var(--card);
  color: var(--text);
}

/* kijelölt elem */
select option:checked{
  background: var(--card);
  color: var(--text);
}

/* PWA banner */
.installBanner{
  display:none;
  position:fixed;
  left:12px;
  right:12px;
  bottom:78px;
  z-index:9999;
}
.installCard{
  background:rgba(17,27,46,.95);
  border:1px solid rgba(148,163,184,.22);
  border-radius:16px;
  padding:12px;
  box-shadow:0 10px 30px rgba(0,0,0,.35);
}
.installRow{
  display:flex;
  gap:10px;
  align-items:flex-start;
  justify-content:space-between;
}
.installTitle{ font-weight:700; margin-bottom:4px; }
.installSub{ color:var(--muted); font-size:13px; line-height:1.35; }
.installBtns{
  display:flex;
  gap:8px;
  flex-shrink:0;
}
.installBtns button{ padding:10px 12px; border-radius:12px; }
.installHint{
  display:none;
  margin-top:10px;
  color:var(--muted);
  font-size:13px;
}

@media print {
  body { background:#fff !important; color:#000 !important; }
  .wrap { max-width:none; padding:0; }

  .topbarRight,
  #installBanner,
  .toast,
  .footer,
  details.explain { display:none !important; }

  main.grid > section.card { display:none !important; }

  main.grid { grid-template-columns:1fr !important; }
  main.grid > aside.card{
    border:0 !important;
    box-shadow:none !important;
    background:#fff !important;
    color:#000 !important;
  }

  .actions, button, .btns { display:none !important; }

  .totals{
    border:1px solid #ccc !important;
    background:#fff !important;
  }
  .totals .line, .totals .big { color:#000 !important; }
}

/* Mobilon is jelenjen meg a Nyomtatás gomb */



/* segéd */
.mt10{ margin-top:10px; }
.mt12{ margin-top:12px; }
.mt16{ margin-top:16px; }



