/* ALTA arculat (2026.10.): a style.css és az app.css fölé töltődik. Világos, levegős felület: halványszürke háttér, nagy lekerekítésű
   fehér kártyák lágy árnyékkal, pill-menü, nagy számok; akcentus: fekete (fő gomb, aktív menü), lila (bevétel / fő adatsor), sárga (kiadás / kiemelés). */
:root {
  color-scheme: light; /* tartalék, ha a böngésző az 'only' kulcsszót nem ismeri */
  color-scheme: only light; /* a böngésző automatikus sötétítése ne fordítsa halványszürkére a betűket */
  --bg: #eef0f3;
  --card: #ffffff;
  --soft: #f5f6f8;
  --text: #15171c;
  --muted: #80868f;
  --line: #eceef2;
  --primary: #15171c;
  --accent: #5b3df5;
  --accent-soft: #eeeaff;
  --yellow: #f5c518;
  --yellow-soft: #fff6d1;
  --in: #5b3df5;
  --in-bg: #eeeaff;
  --out: #e8590c;
  --out-bg: #fff0e6;
  --ok: #2f9e44;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 30px rgba(16, 24, 40, .06);
}
/* sötét módú telefonon (Firefox) az űrlapelemek a rendszer világos betűszínét kapnák fehér háttéren: legyen kifejezett szín és háttér */
input, select, textarea, button { color: var(--text); }
input, select, textarea { background-color: #fff; }
::placeholder { color: #6b717a; opacity: 1; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; letter-spacing: -.005em; }
a { color: var(--accent); }
h1 { font-size: 2rem; font-weight: 750; letter-spacing: -.02em; }
h2 { font-size: 1.08rem; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: .98rem; font-weight: 650; }
#app { max-width: calc(1500px + 2 * clamp(12px, 2.5vw, 36px)); margin: 0 auto; padding: 18px clamp(12px, 2.5vw, 36px) 56px; }

/* ---- fejléc: logó + pill-menü + ikonok */
.bar { background: transparent !important; box-shadow: none !important; border: 0 !important; padding: 4px 0 !important; margin-bottom: 1.4rem; }
.bar > div:first-child { display: flex; align-items: center; gap: .6rem; }
.bar .who { font-weight: 650; }
.bar > .row { background: #fff; border-radius: 999px; padding: 5px; gap: 2px !important; box-shadow: var(--shadow); align-items: center; }
.bar .navlink { padding: .42rem .95rem; border-radius: 999px; color: #3b3f46; text-decoration: none; font-weight: 520; font-size: .92rem; transition: background .15s; }
.bar .navlink:hover { background: var(--soft); }
.bar .navlink.active { background: var(--text); color: #fff; }
.bar .btn.small { border-radius: 999px; border: 0; background: var(--soft); }
.bar select.gproj { border-radius: 999px; border: 0; background: var(--soft); height: 2.1rem; }
.bar select.gproj.on { background: var(--yellow-soft); }
.tenant-name { background: var(--text) !important; color: #fff; border-radius: 12px !important; padding: .3rem .65rem !important; letter-spacing: .08em; font-size: .8rem !important; }

/* ---- kártyák */
.card { background: var(--card); border: 0; border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card .card { box-shadow: none; background: var(--soft); }
details.card > summary { cursor: pointer; }
.page-head { margin: .3rem 0 1.2rem; }
.page-head h1 .sub, .page-head .sub { font-size: 1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.alert { border: 0; border-radius: 14px; }
.alert.ok { background: #e9f8ee; color: #135c2a; }
.alert.err { background: #fff0f0; color: #a51d1d; }
.alert.warn { background: var(--yellow-soft); color: #6b5300; }

/* ---- csempék: nagy számok */
.tiles { gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tile { min-width: 0; }
.tile { border: 0 !important; border-radius: 18px; padding: 16px 18px; background: #fff; box-shadow: var(--shadow); border-left: 0 !important; }
.card .tile { background: var(--soft); box-shadow: none; }
.tile small, .tile span { color: var(--muted); font-size: .8rem; }
.tile strong { font-size: clamp(1.05rem, 1.35vw, 1.4rem); overflow-wrap: anywhere; font-weight: 750; letter-spacing: -.02em; }
.tile.in strong { color: var(--accent); }
.tile.out strong { color: var(--out); }
.tile.warn { background: var(--yellow-soft) !important; }

/* ---- gombok, mezők, kapcsolók */
.btn { border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 550; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--text); border-color: var(--text); color: #fff; }
.btn.primary:hover { background: #2b2e36; filter: none; }
.btn.danger { border-color: #ffc9c9; }
input, select, textarea { border-radius: 12px; border: 1px solid #e1e4ea; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.segmented { border: 0 !important; background: var(--soft); border-radius: 999px !important; padding: 4px; gap: 2px; }
.segmented .seg { border: 0 !important; border-radius: 999px; padding: .38rem .9rem; background: transparent; }
.segmented .seg.on { background: var(--yellow) !important; color: var(--text) !important; font-weight: 650; }
.pill { background: var(--soft); border-radius: 999px; }
.pill.ok { background: #e9f8ee; color: var(--ok); }
.pill.warn { background: var(--yellow-soft); color: #7a5d00; }
.pill.off { background: #fff0f0; color: #c92a2a; }
.pill.jc { background: var(--accent-soft); color: var(--accent); }

/* ---- táblázatok */
table.data th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); background: transparent; }
table.data td { border-bottom: 1px solid var(--line); }
table.data tbody tr:hover td { background: #fafbfc; }
table.data tr:last-child td { border-bottom: 0; }

/* ---- ablakok, belépés */
.modal { border-radius: 26px !important; box-shadow: 0 30px 80px rgba(16, 24, 40, .25) !important; }
.login-box { border-radius: 28px; padding: 32px; margin-top: 8vh; }
.login-box .brand { color: var(--text) !important; }

/* ---- dashboard elemei */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 28px; margin: .2rem 0 1.6rem; }
.kpi small { display: block; color: var(--muted); font-size: .82rem; margin-bottom: .15rem; }
.kpi .v { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.kpi strong { font-size: 1.85rem; font-weight: 760; letter-spacing: -.03em; line-height: 1.1; }
.kpi .tag { background: #fff; border-radius: 999px; padding: .1rem .55rem; font-size: .75rem; color: #444; box-shadow: var(--shadow); white-space: nowrap; }
.kpi .tag.bad { background: #fff0f0; color: #c92a2a; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; }
.dash-grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.dash-grid > .card, .dash-grid3 > .card { margin: 0; }
.dash-grid + .dash-grid3, .dash-grid3 + .dash-grid, .dash-grid + .card, .dash-grid3 + .card { margin-top: 18px; }
@media (max-width: 980px) { .dash-grid { grid-template-columns: 1fr; } }
.card-cap { color: var(--muted); font-size: .78rem; margin: 0; }
.card-title { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; margin-bottom: .6rem; }
.card-title h2 { margin: .1rem 0 0; }
.card-title .go { width: 2.1rem; height: 2.1rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--soft); text-decoration: none; color: var(--text); font-size: 1rem; flex: none; }
.legend2 { display: flex; gap: 1rem; font-size: .82rem; color: #444; margin: .2rem 0 .4rem; flex-wrap: wrap; }
.legend2 i { display: inline-block; width: .65rem; height: .65rem; border-radius: 999px; margin-right: .35rem; vertical-align: -.02rem; }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .grid { stroke: #eef0f3; }
svg.chart .lbl { fill: #9aa0a8; font-size: 11px; }
svg.chart .s1 { stroke: var(--accent); fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
svg.chart .s2 { stroke: var(--yellow); fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
svg.chart .a1 { fill: url(#gA1); } svg.chart .a2 { fill: url(#gA2); }
svg.chart .dot { fill: #fff; stroke-width: 2.5; }
.bigbars { display: flex; align-items: flex-end; gap: 12px; height: 190px; margin-top: .6rem; }
.bigbars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; height: 100%; }
.bigbars .col { border-radius: 16px 16px 10px 10px; min-height: 8px; }
.bigbars .nm { font-size: .78rem; color: #444; margin-bottom: .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bigbars .pc { font-size: .78rem; color: var(--muted); margin-top: .35rem; text-align: center; }
.big-number { font-size: 2.6rem; font-weight: 780; letter-spacing: -.04em; line-height: 1; text-align: right; }
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .lab { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring .lab strong { font-size: 1.6rem; font-weight: 780; letter-spacing: -.03em; }
.ring .lab small { color: var(--muted); font-size: .75rem; }
.rings { display: flex; gap: 22px; flex-wrap: wrap; justify-content: space-around; }
.proj-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.proj-row:last-child { border-bottom: 0; }
.proj-row .prog-bar { height: .5rem; }
.prog-bar { background: var(--soft) !important; }
.prog-bar > span { background: var(--accent) !important; }
.prog.docs .prog-bar > span { background: var(--ok) !important; } .prog.tasks .prog-bar > span { background: var(--yellow) !important; } .prog.time .prog-bar > span { background: #b8bdc6 !important; }
ul.task-list li { border-bottom-color: var(--line); }
.now-card { border-left: 0 !important; background: linear-gradient(135deg, #fff 0%, #fff 60%, var(--yellow-soft) 100%); }
.doc-card { border-radius: 16px; background: #fff; }
.money-group > summary .money-row strong { font-weight: 650; }
.bell-panel { border-radius: 20px !important; }
.btn.bell .badge { background: #e8590c; }
.navlink .cnt { background: var(--yellow); color: var(--text); }
[hidden] { display: none !important; } /* a régi input-stílus (display:block) ne írja felül */

/* fejléc: felül márka + felhasználói menü (balra), projektválasztó + csengő (jobbra); alatta a menü */
.bar { display: block !important; }
.bar-top { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .7rem; }
.bar-left, .bar-right { display: flex; align-items: center; gap: .6rem; }
.bar > .row { display: inline-flex; flex-wrap: wrap; }
.user-wrap { position: relative; }
.user-btn { border: 0; background: transparent; font: inherit; cursor: pointer; padding: .3rem .5rem; border-radius: 12px; }
.user-btn:hover { background: #fff; }
.user-panel { position: absolute; left: 0; top: calc(100% + 6px); z-index: 60; min-width: 230px; padding: 8px !important; border-radius: 18px !important; box-shadow: 0 12px 32px rgba(16,24,40,.16) !important; display: flex; flex-direction: column; }
.um-item { display: block; text-align: left; padding: .5rem .75rem; border-radius: 10px; text-decoration: none; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.um-item:hover, .um-item.active { background: var(--soft); }
.bar-right .bell-panel { right: 0; left: auto; }

/* kétfaktoros belépés: beállítás */
.totp-steps { padding-left: 1.2rem; line-height: 1.5; }
.totp-steps li { margin: .5rem 0; }
.totp-qr { margin: .6rem 0; }
.totp-qr canvas.qr { width: 180px; height: 180px; image-rendering: pixelated; border-radius: 8px; display: block; }
input.totp-code { width: 9rem; font-size: 1.2rem; letter-spacing: .15em; text-align: center; }

/* pályázói felület: menü-ikonok csak telefonon; asztalin a teljes felirat */
.portal-nav .ni, .portal-nav .ns { display: none; }

/* pályázói felület – telefon (≤ 640 px): alsó menüsáv, egy oszlop, tördelt sorok, nagyobb érintési felületek */
@media (max-width: 640px) {
  body.is-portal #app { padding: 10px 12px calc(84px + env(safe-area-inset-bottom)); }
  body.is-portal .bar { margin-bottom: .6rem; }
  body.is-portal .bar-top { margin-bottom: 0; flex-wrap: nowrap; }
  body.is-portal .bar .tenant-name { display: none; }
  body.is-portal .user-btn .muted { display: none; }
  body.is-portal .bar > .portal-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid !important; grid-template-columns: repeat(6, 1fr);
    border-radius: 18px 18px 0 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); gap: 0 !important; box-shadow: 0 -4px 18px rgba(0, 0, 0, .08);
  }
  body.is-portal .portal-nav .navlink { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .35rem .1rem; border-radius: 12px; font-size: .68rem; min-width: 0; }
  body.is-portal .portal-nav .ni { display: block; font-size: 1.25rem; line-height: 1.2; }
  body.is-portal .portal-nav .nl { display: none; }
  body.is-portal .portal-nav .ns { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  body.is-portal .portal-nav .navlink.active { background: var(--soft); color: var(--text); font-weight: 700; }
  body.is-portal .portal-nav .cnt { position: absolute; top: 0; right: 14%; font-size: .62rem; min-width: 1.05rem; padding: 0 .25rem; }
  body.is-portal .bell-panel, body.is-portal .user-panel { position: fixed; top: calc(58px + env(safe-area-inset-top)); left: 10px; right: 10px; width: auto; max-width: none; max-height: calc(100vh - 160px); overflow-y: auto; z-index: 60; }
  body.is-portal .page-head { display: block; }
  body.is-portal .page-head h1 { font-size: 1.6rem; }
  body.is-portal .page-head h1 .sub { display: block; font-size: .9rem; margin-top: .15rem; }
  body.is-portal .head-actions { margin-top: .5rem; }
  body.is-portal .kpis { grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  body.is-portal .kpi strong { font-size: 1.45rem; }
  body.is-portal .dash-grid, body.is-portal .dash-grid3 { grid-template-columns: minmax(0, 1fr); }
  body.is-portal .card { padding: 14px; min-width: 0; }
  body.is-portal ul.task-list li { flex-wrap: wrap; row-gap: .25rem; }
  body.is-portal ul.task-list li .grow { flex: 1 1 calc(100% - 2rem); min-width: 0; }
  body.is-portal ul.task-list li .btn { margin-left: auto; }
  body.is-portal .btn, body.is-portal .btn.small { min-height: 38px; }
  body.is-portal table.data { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  body.is-portal .rings { gap: 12px; }
  body.is-portal .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  body.is-portal .tile { padding: 12px 14px; }
  body.is-portal .tile strong { font-size: 1.08rem; }
  /* határidők: soronként kártya (ikon | szöveg / dátum, ki, állapot) */
  body.is-portal table.data.events { display: block; overflow: visible; }
  body.is-portal table.events tbody { display: block; }
  body.is-portal table.events tr { display: grid; grid-template-columns: 1.6rem auto 1fr auto; grid-template-areas: "ic tx tx tx" "ic dt wh st"; column-gap: .5rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
  body.is-portal table.events td { display: block; border: 0; padding: 0; background: transparent !important; }
  body.is-portal table.events tr.late { background: #fff0f0; border-radius: 8px; padding-left: .3rem; padding-right: .3rem; }
  body.is-portal table.events td:nth-child(1) { grid-area: dt; color: var(--muted); }
  body.is-portal table.events td:nth-child(2) { grid-area: ic; }
  body.is-portal table.events td:nth-child(3) { grid-area: tx; }
  body.is-portal table.events td:nth-child(4) { grid-area: wh; }
  body.is-portal table.events td:nth-child(5) { grid-area: st; text-align: right; }
  body.is-portal input, body.is-portal select, body.is-portal textarea { font-size: 16px; } /* iOS: ne nagyítson be a mezőre lépéskor */
}

/* telefonon / kis tableten (≤ 900 px, fekvő telefon is) a halvány szürke szövegek majdnem feketék, hogy napfényben is olvashatók legyenek */
@media (max-width: 900px), (pointer: coarse) {
  :root { --text: #0b0d10; --muted: #353a42; }
  body { color: var(--text); }
  .muted, .small.muted, .card-cap, .kpi small, .tile small, .tile span, .page-head .sub, table.sched tr.terv td:not(:first-child) { color: var(--muted) !important; }
}

/* frissítés-jelző sáv (új verzió élesben; assets/app.js checkVersion) */
.update-bar { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 200; background: var(--text); color: #fff; padding: .55rem .6rem .55rem 1rem; border-radius: 999px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); display: flex; align-items: center; gap: .6rem; font-size: .92rem; max-width: calc(100vw - 20px); }
.update-bar .btn.primary { background: var(--yellow); color: var(--text); border-color: var(--yellow); }
.um-ver { padding: .35rem .7rem 0; border-top: 1px solid var(--line); margin-top: .3rem; font-size: .75rem; }

/* projektváros */
.city-card { padding: 16px 18px 12px; }
.city-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.city-head h2 { margin: 0; }
.city-tools { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.city-stats { font-size: .82rem; color: var(--muted); margin-right: .3rem; }
.city-stage { position: relative; border-radius: 16px; overflow: hidden; background: #e9eef7; }
.city-stage.night { background: #0b1026; }
.city-canvas { display: block; width: 100%; height: 100%; touch-action: manipulation; }
.city-tip { position: absolute; z-index: 5; min-width: 190px; max-width: 240px; background: rgba(255, 255, 255, .97); color: #15171c; border-radius: 12px; padding: .55rem .7rem; box-shadow: 0 10px 28px rgba(0, 0, 0, .22); font-size: .84rem; line-height: 1.45; pointer-events: none; }
.city-tip strong { display: block; font-size: .92rem; }
.city-tip .bad { color: #d92d20; font-weight: 650; }
.city-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .6rem; color: var(--muted); }
.city-legend .lg { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }
.city-legend .lg.pal { background: #6d4cff; } .city-legend .lg.prj { background: #13a39a; } .city-legend .lg.glass { background: #d6e2f6; border: 1px solid #b7c6e2; }
.city-legend .lg.over { background: #ff5a4f; } .city-legend .lg.lit { background: #ffd34d; } .city-legend .lg.red { background: #ff3b30; }
.city-card:fullscreen { display: flex; flex-direction: column; border-radius: 0; padding: 14px 18px; }
.city-card:fullscreen .city-stage { flex: 1; height: auto !important; }
@media (max-width: 640px) { .city-tools .city-stats { display: none; } }

/* ---- ALTA jel és szómárka */
.alta-mark { display: block; border-radius: 10px; flex: none; }
.alta-mark.big { width: 56px; height: 56px; border-radius: 16px; box-shadow: 0 8px 22px rgba(91, 61, 245, .28); }
.login-box .brand { display: flex; align-items: center; gap: .8rem; letter-spacing: 0 !important; margin-bottom: .6rem; }
.alta-word { font-size: 2rem; font-weight: 800; letter-spacing: -.04em; text-transform: lowercase; }
.tenant-name { letter-spacing: .04em !important; }
.alta-word.sm { font-size: 1.35rem; }

/* ALTA jel CSS-ből: azokon a telepítéseken, ahol a felület még a régi (nincs .alta-mark kép), a jel a feliratok elé kerül */
.login-box .brand:not(:has(.alta-mark))::before { content: ''; width: 52px; height: 52px; border-radius: 15px; background: url('logo.svg') center / cover; box-shadow: 0 8px 22px rgba(91, 61, 245, .28); flex: none; }
.bar:not(:has(.alta-mark)) .tenant-name::before { content: ''; display: inline-block; width: 22px; height: 22px; margin-right: .5rem; vertical-align: middle; border-radius: 7px; background: url('logo.svg') center / cover; }
