/* ── BigBlue – Stíluslap ──────────────────────────────────── */
:root {
  --bg:        #0f172a;
  --surface:   #1e293b;
  --surface2:  #273449;
  --border:    #334155;
  --accent:    #3b82f6;
  --accent-h:  #2563eb;
  --green:     #22c55e;
  --red:       #ef4444;
  --yellow:    #f59e0b;
  --text:      #f1f5f9;
  --text-muted:#94a3b8;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
  --font:      'Inter', system-ui, sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

/* ── Layout ─────────────────────────────────────────────────── */
#app { display: flex; flex-direction: column; min-height: 100dvh; }

.page { display: none; flex: 1; flex-direction: column; }
.page.active { display: flex; }

/* ── TopBar ─────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  min-height: 56px;
}
.topbar h1 { font-size: 18px; font-weight: 700; }
.topbar-back { background: none; border: none; color: var(--accent); font-size: 15px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.topbar-back:hover { background: var(--surface2); }

/* ── Bottom nav ─────────────────────────────────────────────── */
.bottom-nav {
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  position: sticky; bottom: 0; z-index: 100;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 10px 4px 12px;
  background: none; border: none; color: var(--text-muted);
  font-size: 11px; cursor: pointer; transition: color .15s;
  gap: 3px;
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn.active { color: var(--accent); }

/* ── Kártyák ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.card:last-child { margin-bottom: 0; }

.card-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}

/* ── Avatar ─────────────────────────────────────────────────── */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0;
}
.avatar.lg { width: 48px; height: 48px; font-size: 18px; }

/* ── Chip / Badge ───────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.chip.green  { background: rgba(34,197,94,.15);  color: var(--green); }
.chip.red    { background: rgba(239,68,68,.15);   color: var(--red); }
.chip.blue   { background: rgba(59,130,246,.15); color: var(--accent); }
.chip.yellow { background: rgba(245,158,11,.15); color: var(--yellow); }

/* ── Gomb ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: none; transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-h); }
.btn.ghost { background: var(--surface2); color: var(--text); }
.btn.ghost:hover { background: var(--border); }
.btn.danger { background: rgba(239,68,68,.15); color: var(--red); }
.btn.danger:hover { background: rgba(239,68,68,.25); }
.btn.full { width: 100%; }
.btn.sm { padding: 6px 12px; font-size: 13px; }

/* ── FAB (Floating Action Button) ───────────────────────────── */
.fab {
  position: fixed; bottom: 80px; right: 20px; z-index: 200;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none;
  font-size: 28px; cursor: pointer; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .1s;
}
.fab:hover { background: var(--accent-h); }
.fab:active { transform: scale(.93); }

/* ── Form elemek ────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--text); font-size: 15px; font-family: inherit;
  outline: none; transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { min-height: 80px; resize: vertical; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  align-items: flex-end; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-width: 600px;
  padding: 20px 20px 32px;
  max-height: 90dvh;
  overflow-y: auto;
}
.modal h2 { font-size: 18px; margin-bottom: 16px; }
.modal-close {
  position: absolute; right: 16px; top: 12px;
  background: none; border: none; color: var(--text-muted);
  font-size: 22px; cursor: pointer; line-height: 1;
}

/* ── Tartalom terület ───────────────────────────────────────── */
.content { flex: 1; overflow-y: auto; padding: 16px; }

/* ── Lista ──────────────────────────────────────────────────── */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }

/* ── Tab sáv ────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 4px; padding: 12px 16px 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.tab-btn {
  flex: 1; padding: 8px; background: none; border: none;
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s; text-align: center;
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Kategória ikon ─────────────────────────────────────────── */
.cat-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  background: var(--surface2);
}

/* ── Auth oldal ─────────────────────────────────────────────── */
.auth-box {
  max-width: 420px; margin: auto; padding: 32px 20px;
  display: flex; flex-direction: column; gap: 0;
}
.auth-logo {
  text-align: center; margin-bottom: 32px;
}
.auth-logo .logo-text {
  font-size: 36px; font-weight: 800; color: var(--accent);
}
.auth-logo .logo-sub { color: var(--text-muted); font-size: 14px; }

/* ── Toast ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  z-index: 999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--surface2); color: var(--text);
  padding: 12px 20px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); font-size: 14px;
  box-shadow: var(--shadow); animation: slideUp .25s ease;
  pointer-events: auto; max-width: 340px; text-align: center;
}
.toast.error { border-color: var(--red); color: var(--red); }
.toast.success { border-color: var(--green); color: var(--green); }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Egyenleg összefoglaló ───────────────────────────────────── */
.balance-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.balance-row:last-child { border-bottom: none; }
.balance-amount { margin-left: auto; text-align: right; }
.balance-amount .huf { font-weight: 700; font-size: 16px; }
.balance-amount .eur { font-size: 13px; color: var(--text-muted); }
.balance-amount.pos .huf { color: var(--green); }
.balance-amount.neg .huf { color: var(--red); }

/* ── Debt kártya ────────────────────────────────────────────── */
.debt-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.debt-item:last-child { border-bottom: none; }
.debt-arrow { color: var(--text-muted); }

/* ── Esemény info kártya ─────────────────────────────────────── */
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.info-card .info-type-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); font-weight: 700; margin-bottom: 4px;
}
.info-card .info-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.info-card .info-content { color: var(--text-muted); font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.info-card .info-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ── Split lista ────────────────────────────────────────────── */
.split-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.split-row input[type="number"] { flex: 1; }
.split-row .split-name { width: 120px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Meghívó kód ─────────────────────────────────────────────── */
.invite-box {
  background: var(--surface2); border: 1px dashed var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
}
.invite-code {
  font-family: monospace; font-size: 18px; font-weight: 700;
  letter-spacing: .12em; color: var(--accent); flex: 1;
}

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Safe area iOS ──────────────────────────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav { padding-bottom: env(safe-area-inset-bottom); }
}

@media (min-width: 600px) {
  .modal { border-radius: var(--radius); margin: auto; margin-bottom: 40px; }
  .modal-overlay { align-items: center; }
}
