/* Rezsi - iPhone-elsodleges PWA.
   Sotet alap, mert a szamlalista nagy kontrasztu szamokbol all, es igy a
   hataridok szinkodolasa (zold/sarga/piros) jol elkulonul.

   Szinhasznalat: az IKONOK mind egyszinuek (currentColor, semleges tinta),
   sehol nincs emoji. Szint kizarolag ALLAPOT kap - hatarido-cimke, ertesites-
   szamlalo, elsodleges gomb. Igy a lista nyugodt marad, es ami szines, az
   tenyleg jelent valamit. */
:root {
  --bg: #0b1220;
  --surface: #131c2e;
  --surface-2: #1b2740;
  --line: #24314d;
  --line-soft: #1c2740;
  --ink: #eef2f9;
  --ink-2: #97a5c0;
  --ink-3: #6b7a99;
  --accent: #4a9df8;
  --ok: #34c98a;
  --warn: #f2b544;
  --bad: #f2685c;
  --radius: 16px;
  --radius-sm: 12px;
  --tap: 44px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent;
    scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  /* iPhone: a tartalom ne csusszon a notch/home indicator ala */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  min-height: 100dvh;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }

/* Minden ikon egyszinu, es a szoveg szinet orokli. */
.i { width: 20px; height: 20px; flex: none; display: block;
     stroke: currentColor; stroke-width: 1.75; stroke-linecap: round;
     stroke-linejoin: round; fill: none; }
.i-sm { width: 16px; height: 16px; }

/* ---------- belepes ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 28px 24px; }
.login-card { width: 100%; max-width: 320px; text-align: center; }
.logo { width: 62px; height: 62px; margin: 0 auto 20px; border-radius: 19px;
        background: var(--accent); color: #05121f; display: grid; place-items: center; }
.logo .i { width: 30px; height: 30px; stroke-width: 2; }
.login h1 { font-size: 27px; line-height: 1.15; margin: 0 0 8px; letter-spacing: -.022em; }
.login p { color: var(--ink-2); font-size: 14.5px; line-height: 1.5; margin: 0 0 30px; }
#gbtn { display: flex; justify-content: center; min-height: 44px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; margin: 14px 0 0; }

/* ---------- fejlec ---------- */
#topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center;
          gap: 8px; padding: 8px 12px 8px 14px; background: rgba(11,18,32,.8);
          backdrop-filter: saturate(150%) blur(14px);
          border-bottom: 1px solid var(--line-soft); }
.prop-switch { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px;
               background: none; border: 0; color: var(--ink); padding: 6px 0;
               font: 650 17px/1.25 inherit; letter-spacing: -.015em; text-align: left; }
.prop-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop-switch .i { width: 16px; height: 16px; stroke-width: 2.25; color: var(--ink-3); }
.icon-btn { background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
            width: 38px; height: 38px; border-radius: var(--radius-sm); flex: none;
            display: grid; place-items: center; }
.icon-btn:active { background: var(--surface-2); }

/* ---------- tartalom ---------- */
#main { padding: 16px 14px 104px; }

/* osszegzo kartya */
.sum { background: linear-gradient(180deg, var(--surface) 0%, #111a2b 100%);
       border: 1px solid var(--line); border-radius: var(--radius);
       padding: 18px; margin-bottom: 22px; }
.sum .label { color: var(--ink-2); font-size: 12px; font-weight: 600;
              letter-spacing: .05em; text-transform: uppercase; }
.sum .value { font-size: 34px; font-weight: 700; letter-spacing: -.03em;
              line-height: 1.1; margin-top: 8px; }
.sum .meta { color: var(--ink-2); font-size: 13.5px; margin-top: 8px;
             display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sum .meta .dot { width: 3px; height: 3px; border-radius: 50%;
                  background: var(--ink-3); flex: none; }

/* szakaszcim - a felette levo blokktol elvalik, a sajat kartyajahoz kozel all */
.sec { color: var(--ink-3); font-size: 11.5px; font-weight: 650; letter-spacing: .07em;
       text-transform: uppercase; margin: 26px 4px 9px; display: flex;
       align-items: baseline; justify-content: space-between; gap: 10px; }
.sec:first-child { margin-top: 4px; }
.sec .n { font-weight: 600; letter-spacing: .04em; }

.card { background: var(--surface); border: 1px solid var(--line);
        border-radius: var(--radius); overflow: hidden; }
.card-pad { padding: 16px; }

/* SOR.
   A szovegoszlop blokk-elrendezesu (flex column) - kulonben a cim es az alcim
   inline spankent EGY SORBA folyna, szokoz nelkul. Ez volt a hiba. */
.row { display: flex; align-items: center; gap: 13px; padding: 12px 14px;
       min-height: 60px; border: 0; border-bottom: 1px solid var(--line-soft);
       text-align: left; width: 100%; background: none; color: inherit;
       font: inherit; }
.row:last-child { border-bottom: 0; }
.row.tap:active { background: var(--surface-2); }
.row .ico { width: 36px; height: 36px; border-radius: 11px; flex: none;
            display: grid; place-items: center; background: var(--surface-2);
            color: var(--ink-2); }
.row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row .t { display: block; font-weight: 600; font-size: 15px; line-height: 1.3;
          overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
          color: var(--ink-2); font-size: 13px; line-height: 1.35; }
.row .s .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .amt { font-weight: 700; font-size: 15px; white-space: nowrap;
            letter-spacing: -.01em; flex: none; }
.row .chev { color: var(--ink-3); flex: none; }
.row.paid .t, .row.paid .amt { color: var(--ink-3); text-decoration: line-through; }
.row.paid .ico { color: var(--ink-3); }

/* hatarido-cimke: az egyetlen helye a szinnek a listaban */
.due { display: inline-flex; align-items: center; font-size: 12px; padding: 3px 9px;
       border-radius: 999px; font-weight: 650; letter-spacing: -.005em; flex: none; }
.due.ok { background: rgba(52,201,138,.13); color: var(--ok); }
.due.soon { background: rgba(242,181,68,.14); color: var(--warn); }
.due.late { background: rgba(242,104,92,.15); color: var(--bad); }
.due.done { background: var(--surface-2); color: var(--ink-3); }

/* ures allapot */
.empty { text-align: center; color: var(--ink-2); padding: 54px 24px 44px; }
.empty .big { width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 17px;
              background: var(--surface); border: 1px solid var(--line);
              display: grid; place-items: center; color: var(--ink-3); }
.empty .big .i { width: 24px; height: 24px; }
.empty h3 { font-size: 16px; font-weight: 650; color: var(--ink); margin: 0 0 6px;
            letter-spacing: -.01em; }
.empty p { margin: 0 auto; font-size: 14px; line-height: 1.5; max-width: 264px; }
.empty .btn { max-width: 260px; margin: 22px auto 0; }

/* ---------- also sav ---------- */
#tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex;
        background: rgba(11,18,32,.9); backdrop-filter: saturate(150%) blur(14px);
        border-top: 1px solid var(--line-soft);
        padding-bottom: env(safe-area-inset-bottom); }
#tabs button { flex: 1; background: none; border: 0; color: var(--ink-3);
               padding: 8px 0 6px; display: flex; flex-direction: column;
               align-items: center; gap: 4px; font: 550 10.5px/1 inherit;
               letter-spacing: .01em; position: relative; }
#tabs button.active { color: var(--accent); }
#tabs .badge { position: absolute; top: 3px; left: 50%; margin-left: 6px;
               min-width: 17px; height: 17px; border-radius: 9px; background: var(--bad);
               color: #fff; font: 700 10px/17px inherit; font-style: normal;
               text-align: center; padding: 0 4px;
               box-shadow: 0 0 0 2px var(--bg); }

/* ---------- lebego gomb ---------- */
.fab { position: fixed; right: 16px; z-index: 21;
       bottom: calc(74px + env(safe-area-inset-bottom));
       width: 54px; height: 54px; border-radius: 18px; border: 0;
       background: var(--accent); color: #05121f; display: grid; place-items: center;
       box-shadow: 0 6px 20px rgba(74,157,248,.32); transition: transform .12s ease; }
.fab .i { width: 24px; height: 24px; stroke-width: 2.5; }
.fab:active { transform: scale(.93); }

/* ---------- also lap (sheet) ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(3,7,15,.6);
         display: flex; align-items: flex-end; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0 } }
.sheet-card { width: 100%; max-height: 90dvh; overflow-y: auto;
              background: var(--surface); border-top: 1px solid var(--line);
              border-radius: 22px 22px 0 0;
              padding: 6px 18px calc(24px + env(safe-area-inset-bottom));
              animation: up .24s cubic-bezier(.32,.72,0,1); }
@keyframes up { from { transform: translateY(26px) } }
.grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line);
        margin: 8px auto 16px; }
.sheet h2 { font-size: 21px; line-height: 1.25; margin: 0; letter-spacing: -.02em; }
.sheet .hint { color: var(--ink-2); font-size: 13.5px; line-height: 1.5; margin: 6px 0 0; }
.sheet .hint b { color: var(--ink); font-weight: 650; }
/* a fejlec es az elso tartalmi elem kozott mindig ugyanakkora a koz */
.sheet h2 + .card, .sheet .hint + .card, .sheet .amt-big + .card,
.sheet h2 + .field, .sheet .hint + .field, .sheet h2 + .steps { margin-top: 18px; }
.amt-big { display: flex; align-items: center; gap: 10px; margin-top: 12px;
           font-size: 25px; font-weight: 700; letter-spacing: -.025em; }

/* kulcs-ertek sor: cimke balra halvanyan, ertek jobbra - a ketto kozott
   fix, nagy koz, hogy sose erjenek ossze */
dl { margin: 0; }
.kv { display: flex; align-items: baseline; justify-content: space-between;
      gap: 18px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--ink-2); font-size: 13.5px; flex: none; }
.kv dd { margin: 0; font-weight: 600; font-size: 14px; text-align: right;
         min-width: 0; overflow-wrap: anywhere; }

/* ---------- urlapok ---------- */
/* A cimke es a mezoje EGY blokk (.field): igy ket mezo soha nem csuszik ossze,
   es a mezok kozott mindenhol ugyanakkora a koz. */
.field { margin-top: 16px; }
.field:first-child { margin-top: 0; }
label { display: block; font-size: 13px; font-weight: 550; color: var(--ink-2);
        margin: 0 0 7px; letter-spacing: .005em; }
label .opt { color: var(--ink-3); font-weight: 400; }
input, select, textarea {
  width: 100%; min-height: var(--tap); padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  font: 400 16px inherit; /* 16px: iOS ne zoomoljon a fokuszra */
  appearance: none; -webkit-appearance: none;
}
/* sajat legordulo-nyil (a natv iOS-nyilat az appearance:none levette) */
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2397a5c0' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 13px center;
  background-size: 16px; padding-right: 40px;
}
/* fotovalaszto: a natv vezerlot elrejtjuk, a cimke lesz a gomb */
.filepick { position: relative; }
.filepick input[type=file] { position: absolute; width: 1px; height: 1px;
                             opacity: 0; pointer-events: none; }
.filebtn { display: flex; align-items: center; gap: 10px; margin: 0;
           min-height: var(--tap); padding: 11px 13px; border-radius: var(--radius-sm);
           border: 1px dashed var(--line); background: var(--surface-2);
           color: var(--ink-2); font-size: 14px; font-weight: 500; cursor: pointer; }
.filebtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filebtn.has { border-style: solid; border-color: var(--accent); color: var(--ink); }
.filebtn:active { background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,157,248,.16);
}
.help { color: var(--ink-3); font-size: 12.5px; line-height: 1.45; margin: 7px 0 0; }

.btn { width: 100%; min-height: 50px; padding: 14px; border-radius: 14px; border: 0;
       margin-top: 22px; background: var(--accent); color: #05121f;
       font: 650 16px inherit; display: inline-flex; align-items: center;
       justify-content: center; gap: 8px; letter-spacing: -.01em; }
.btn .i { width: 18px; height: 18px; stroke-width: 2.25; }
.btn.sec { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line);
           margin-top: 10px; }
.btn.danger { background: var(--surface-2); color: var(--bad);
              border: 1px solid var(--line); margin-top: 10px; }
.btn:active { opacity: .8; }

/* ---------- tovabbitasi cim ---------- */
.addr { display: flex; align-items: center; gap: 10px; background: var(--surface-2);
        border: 1px solid var(--line); border-radius: var(--radius-sm);
        padding: 11px 11px 11px 14px; margin: 14px 0 0; }
.addr code { flex: 1; min-width: 0;
             font: 600 14px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
             color: var(--accent); word-break: break-all; }
.addr .icon-btn { width: 36px; height: 36px; background: var(--surface); }

.note { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0;
        padding: 11px 13px; border-radius: var(--radius-sm);
        background: rgba(242,181,68,.09); border: 1px solid rgba(242,181,68,.22);
        color: var(--warn); font-size: 13px; line-height: 1.45; }
.note .i { width: 17px; height: 17px; margin-top: 1px; }

.steps { counter-reset: s; padding: 0; margin: 18px 0 0; list-style: none; }
.steps li { counter-increment: s; position: relative; padding: 0 0 0 32px;
            color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.steps li + li { margin-top: 11px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0;
                    width: 22px; height: 22px; border-radius: 50%;
                    background: var(--surface-2); border: 1px solid var(--line);
                    color: var(--ink-2); font: 650 11px/20px inherit; text-align: center; }
.steps b { color: var(--ink); font-weight: 650; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
         bottom: calc(96px + env(safe-area-inset-bottom));
         background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 13px;
         font: 650 14px inherit; max-width: 86vw; text-align: center;
         box-shadow: 0 8px 24px rgba(0,0,0,.35); animation: up .2s ease-out; }
