:root {
  --bg: #f6eeec; --surface: #fffaf9; --surface-2: #fbf3f1; --border: #ecdcd8; --text: #2a1a1c; --muted: #8a7072;
  --primary: #8a3a44; --primary-soft: #f6e4e3; --danger: #c8283a; --danger-soft: #fdebed; --warning: #b86e00;
  --warning-soft: #fff3df; --success: #2f7d55; --success-soft: #e6f4ec; --info: #6d5a8a; --info-soft: #f0ebf6;
  --rose: #c98a8f; --rose-2: #e7c4c1; --wine: #3a1a1f; --wine-2: #5a2a31;
  --side: #24100f; --side-text: #d9c3c1;
  --hero-a: #b9737b; --hero-b: #6b2c35; --hero-c: #2d1215; --hero-glow: rgba(255,214,210,.35); --shade-rgb: 58,26,31;
  --tile-a: #f6dcd8; --tile-b: #e2b7b3; --tile-c: #c9939a; --btile-a: #fbe9e6; --btile-b: #efcfcb; --btile-c: #d9a7a7; --btile-rgb: 90,42,49;
  --side-a: #2d1416; --side-b: #1c0c0d; --accent-rgb: 201,138,143; --primary-rgb: 138,58,68;
  --ai-a: #c98a8f; --ai-b: #8a3a44; --ai-c: #4a1c22; --aihd-a: #b9737b; --aihd-b: #5a2a31;
  --login-a: #c98a8f; --login-b: #7a2f3a; --login-c: #24100f;
  --logo-a: #c25f6c; --logo-b: #7a2f3a; --logo-w1: #fbe8e5; --logo-w2: #efcfcb; --radius: 20px; --shadow: 0 1px 2px rgba(var(--shade-rgb),.05), 0 10px 30px rgba(var(--shade-rgb),.07);
  --sans: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: var(--sans);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--sans); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.15; font-family: var(--sans); font-weight: 600; letter-spacing: -.02em; }
h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 16px; }

/* --- Domio márka: hero, üveg kártyák, 3D házak --- */
.hero { position: relative; overflow: hidden; border-radius: 28px; padding: 28px 32px; color: #fff; margin-bottom: 18px; min-height: 230px;
  background: radial-gradient(120% 140% at 85% 20%, var(--hero-a) 0%, var(--hero-b) 38%, var(--hero-c) 100%); box-shadow: 0 20px 50px rgba(var(--shade-rgb),.25); }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 60% at 75% 55%, var(--hero-glow), transparent 70%); pointer-events: none; }
.hero h1 { font-size: 40px; font-weight: 500; margin: 6px 0 4px; color: #fff; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: 11px; opacity: .75; }
.hero .sub { opacity: .8; }
.hero .house { position: absolute; right: 2%; bottom: -6%; width: 42%; max-width: 460px; height: 115%; pointer-events: none; }
.hero .house svg { width: 100%; height: 100%; filter: drop-shadow(0 30px 30px rgba(0,0,0,.35)); }
.hero-content { position: relative; z-index: 1; max-width: 58%; }
.glass { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 18px; padding: 12px 16px; color: #fff; }
.glass .l { font-size: 11px; opacity: .8; text-transform: uppercase; letter-spacing: .08em; } .glass .v { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.glass-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero .btn { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.35); }
.hero .btn:hover { background: rgba(255,255,255,.24); }
.hero .btn.light { background: #fff; color: var(--wine); border-color: #fff; }
.house-tile { background: radial-gradient(90% 90% at 70% 30%, var(--tile-a), var(--tile-b) 55%, var(--tile-c)); border-radius: 18px; height: 170px; display: grid; place-items: center; overflow: hidden; margin: -6px -6px 12px; }
.house-tile svg { height: 150px; width: auto; filter: drop-shadow(0 14px 14px rgba(var(--btile-rgb),.3)); transition: transform .4s ease; }
.bcard:hover .house-tile svg { transform: translateY(-6px) scale(1.04); }
.house-mini { width: 22px; height: 22px; flex: none; display: inline-grid; place-items: center; } .house-mini svg { width: 22px; height: 22px; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero .house .h3d, .login-hero .house .h3d { animation: floaty 7s ease-in-out infinite; }
.login-hero .house .h3d img { filter: drop-shadow(0 40px 40px rgba(0,0,0,.45)); }
.kpi .v { font-family: var(--serif); font-weight: 600; }

/* albetét személyei */
.persons { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.person { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-2); }
.person.contact { border-color: #e2b9b6; background: #fdf1ef; box-shadow: inset 3px 0 var(--primary); }
.person-av { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 600; color: #fff; background: linear-gradient(135deg, var(--rose), var(--primary)); }

/* logó + ikonok */
.logo-full { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark { flex: none; filter: drop-shadow(0 4px 8px rgba(0,0,0,.25)); }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-word { font-family: var(--sans); font-weight: 700; font-size: 1.15em; letter-spacing: -.02em; }
.logo-sub { font-size: 8.5px; letter-spacing: .32em; text-transform: uppercase; opacity: .7; margin-top: 5px; font-weight: 500; }
.side .brand { font-size: 21px !important; padding: 6px 10px 18px; }
.login-hero .brand { font-size: 30px !important; }
.login-hero .logo-sub { font-size: 11px; }
.ico { width: 1.35em; height: 1.35em; flex: none; vertical-align: -.32em; overflow: visible; }
.ico-w { display: inline-flex; margin-right: .2em; }
.side a .ico { width: 22px; height: 22px; }
.side a .ico-w { margin-right: 0; }
.tabs a .ico { width: 18px; height: 18px; }
h1 .ico { width: 1.1em; height: 1.1em; } h2 .ico, h3 .ico { width: 1.2em; height: 1.2em; }
.btn .ico { width: 1.25em; height: 1.25em; }
.btn.primary .ico, .btn.ai .ico, .hero .btn .ico { filter: drop-shadow(0 0 1px rgba(255,255,255,.6)); }
.alert .ico-w { margin-right: .35em; }

/* 3D ház helyőrző (SVG tartalék -> renderelt kép) */
.h3d { display: block; width: 100%; height: 100%; }
.h3d > svg, .h3d > img { width: 100%; height: 100%; object-fit: contain; display: block; }
.h3d.ready > img { animation: h3din .6s ease; }
@keyframes h3din { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.house-mini .h3d > img { object-fit: contain; }
.hero-slim { min-height: 0; padding: 26px 30px; }
.hero-slim h1 { font-size: 34px; }

/* négyzetes társasház-csempék, amelyekből kiemelkedik a 3D ház */
.btiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 340px)); gap: 130px 28px; padding-top: 140px; margin-bottom: 28px; }
.btile { position: relative; aspect-ratio: 1 / 1; border-radius: 30px; cursor: pointer; outline: none;
  background: radial-gradient(120% 90% at 50% 0%, var(--btile-a) 0%, var(--btile-b) 45%, var(--btile-c) 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 18px 40px rgba(var(--btile-rgb),.18); transition: transform .35s ease, box-shadow .35s ease; }
.btile::after { content: ""; position: absolute; left: 12%; right: 12%; top: 34%; height: 18%; border-radius: 50%; background: radial-gradient(closest-side, rgba(var(--btile-rgb),.22), transparent); pointer-events: none; }
.btile .h3d { position: absolute; left: 50%; bottom: 31%; width: 112%; height: 112%; transform: translateX(-50%); z-index: 1; transition: transform .45s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.btile .h3d img, .btile .h3d svg { object-position: center bottom; filter: drop-shadow(0 22px 22px rgba(var(--btile-rgb),.28)); }
.btile:hover, .btile:focus-visible { transform: translateY(-4px); box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 28px 60px rgba(var(--btile-rgb),.28); }
.btile:hover .h3d, .btile:focus-visible .h3d { transform: translateX(-50%) translateY(-12px) scale(1.05); }
.btile-info { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2; padding: 12px 14px; border-radius: 20px;
  background: rgba(255,255,255,.62); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,.7); }
.btile-name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btile-addr { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btile-stats { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; margin-top: 6px; }
.btile-badge { position: absolute; top: 14px; right: 14px; z-index: 3; background: var(--danger); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.btile-new { display: grid; place-items: center; text-align: center; background: transparent; border: 2px dashed #e0c2bf; box-shadow: none; color: var(--primary); font-weight: 600; }
.btile-new::after { display: none; }
.btile-new .plus { font-size: 44px; font-weight: 300; line-height: 1; margin-bottom: 4px; }
.hero .house .h3d img { filter: drop-shadow(0 30px 30px rgba(0,0,0,.35)); }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.red { color: var(--danger); font-weight: 600; } .green { color: var(--success); font-weight: 600; }

/* layout */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 16px; padding: 4px 10px 16px; }
.brand .logo { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--rose), var(--primary)); display: grid; place-items: center; }
.brand { font-family: var(--serif); font-size: 22px !important; font-weight: 600; letter-spacing: .01em; }
.side .sect { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .55; padding: 14px 10px 4px; }
.side a { color: var(--side-text); padding: 8px 10px; border-radius: 8px; display: flex; align-items: center; gap: 10px; }
.side a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side a.active { background: linear-gradient(90deg, rgba(var(--accent-rgb),.32), rgba(var(--accent-rgb),.08)); color: #fff; }
.side { background: linear-gradient(180deg, var(--side-a) 0%, var(--side-b) 100%) !important; }
.side a .cnt { margin-left: auto; background: var(--danger); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; }
.side .foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.main { padding: 24px 28px 90px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.topbar h1 { margin: 0; }
.topbar .sp { flex: 1; }
.btn.menu-btn { display: none; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h h2, .card-h h3 { margin: 0; } .card-h .sp { flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); } .g5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.kpi { padding: 14px 16px; } .kpi .l { color: var(--muted); font-size: 12px; } .kpi .v { font-size: 22px; font-weight: 700; margin-top: 2px; }
.kpi.danger { background: var(--danger-soft); border-color: #f6c4c9; } .kpi.danger .v { color: var(--danger); }
.section-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 12px; font-size: 17px; font-weight: 700; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 8px 16px; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: #c5ccdc; background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; } .btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); } .btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.sm { padding: 4px 9px; font-size: 12px; } .btn.ghost { border-color: transparent; background: transparent; }
.btn.ai { background: linear-gradient(135deg, var(--ai-a), var(--ai-b) 60%, var(--ai-c)); color: #fff; border: 0; }
.btn:disabled { opacity: .55; cursor: default; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
label.f { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
label.f > input, label.f > select, label.f > textarea { margin-top: 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
input[type=checkbox], input[type=radio] { width: auto; margin: 0 6px 0 0; }
textarea { min-height: 90px; resize: vertical; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 14px; }
.fgrid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 4px; margin: 6px 0; cursor: pointer; }

/* tables */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr.debt td { background: var(--danger-soft); }
tr.debt td:first-child { box-shadow: inset 3px 0 var(--danger); }
tr.child td { background: var(--surface-2); font-size: 13px; }
tr.child.debt td { background: var(--danger-soft); }
tr:hover td { background: #fbeeec; }
.hero .houses { position: absolute; right: 1%; bottom: -4%; height: 112%; width: 48%; display: flex; align-items: flex-end; justify-content: flex-end; gap: 0; pointer-events: none; }
.hero .houses svg { height: 100%; width: auto; max-width: 60%; margin-left: -12%; filter: drop-shadow(0 26px 26px rgba(0,0,0,.35)); animation: floaty 8s ease-in-out infinite; }
.hero .houses svg:nth-child(2) { height: 80%; animation-delay: -2s; } .hero .houses svg:nth-child(3) { height: 65%; animation-delay: -4s; }

/* badges */
.badge { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: #f6c4c9; }
.badge.warning { background: var(--warning-soft); color: var(--warning); border-color: #f4dca8; }
.badge.success { background: var(--success-soft); color: var(--success); border-color: #b8e5ca; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: #b5e1f2; }
.badge.primary { background: var(--primary-soft); color: var(--primary); border-color: #c6d4fc; }

/* alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 8px; cursor: pointer; }
.alert.danger { background: var(--danger-soft); border-color: #f6c4c9; color: #8f1520; }
.alert.warning { background: var(--warning-soft); border-color: #f4dca8; color: #7a4c00; }
.alert.info { background: var(--info-soft); border-color: #b5e1f2; color: #064f6b; }
.debt-banner { background: var(--danger); color: #fff; border-radius: var(--radius); padding: 16px 18px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.debt-banner .v { font-size: 26px; font-weight: 800; }
.ok-banner { background: var(--success-soft); color: var(--success); border: 1px solid #b8e5ca; border-radius: var(--radius); padding: 16px 18px; }
.ok-banner .v { font-size: 22px; font-weight: 800; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs a.active { color: var(--primary); border-color: var(--primary); }
.tabs a:hover { color: var(--text); }

/* building cards */
.bcard { cursor: pointer; transition: transform .1s; } .bcard:hover { transform: translateY(-2px); border-color: #c6d4fc; }
.bcard .stats { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }

/* notes */
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.note { border-radius: 10px; padding: 10px 12px 8px; min-height: 120px; display: flex; flex-direction: column; border: 1px solid rgba(0,0,0,.06); }
.note textarea { background: transparent; border: 0; padding: 0; min-height: 80px; flex: 1; resize: none; }
.note textarea:focus { outline: none; }
.note .nb { display: flex; gap: 4px; align-items: center; font-size: 11px; color: rgba(0,0,0,.5); }
.note .nb .sp { flex: 1; }
.note.yellow { background: #fff6c7; } .note.pink { background: #ffe1ea; } .note.green { background: #ddf6e3; } .note.blue { background: #e0ecff; } .note.purple { background: #ece3ff; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); cursor: pointer; display: inline-block; }

/* board */
.board-wrap { overflow: auto; border: 1px dashed var(--border); border-radius: 10px; background: radial-gradient(#dfe4ee 1px, transparent 1px) 0 0 / 18px 18px, var(--surface-2); }
.board-wrap.connecting { outline: 2px solid var(--primary); }
svg.board { display: block; user-select: none; }
svg.board .node { cursor: grab; } svg.board .node.sel rect.bg { stroke: var(--primary); stroke-width: 2.5; }
svg.board .edge { cursor: pointer; } svg.board .edge:hover path.vis { stroke: var(--danger); }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.kcol.over { outline: 2px dashed var(--primary); }
.kcol h3 { display: flex; justify-content: space-between; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.kcard .t { font-weight: 600; margin-bottom: 4px; }
.kcard.p-sürgős { box-shadow: inset 3px 0 var(--danger), var(--shadow); } .kcard.p-magas { box-shadow: inset 3px 0 var(--warning), var(--shadow); }

/* damages */
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); cursor: zoom-in; }
.photos-lg img { max-width: 100%; max-height: 340px; border-radius: 10px; margin: 0 8px 8px 0; }
.comments { max-height: 260px; overflow-y: auto; background: var(--surface-2); border-radius: 10px; padding: 10px; }
.cm { margin-bottom: 8px; } .cm .a { font-size: 12px; font-weight: 600; } .cm .b { white-space: pre-wrap; }

/* charts */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.bars .m { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.bars .pair { display: flex; align-items: flex-end; gap: 3px; height: 130px; }
.bars .b { width: 14px; border-radius: 4px 4px 0 0; }
.bars .inc { background: #34b46f; } .bars .exp { background: #e5606b; }
.hbar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; } .hbar > div { height: 100%; background: var(--primary); }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(15,22,40,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; width: 560px; max-width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: 860px; }
.modal-h { display: flex; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); } .modal-h h2 { margin: 0; flex: 1; }
.modal-b { padding: 18px; } .modal-f { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.cred { background: var(--surface-2); border: 1px dashed var(--border); border-radius: 10px; padding: 12px; font-family: ui-monospace, Consolas, monospace; font-size: 15px; }

/* toast */
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #1b2333; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 90vw; }
.toast.err { background: var(--danger); }

/* AI */
.ai-fab { position: fixed; right: 22px; bottom: 22px; z-index: 40; border-radius: 30px; padding: 12px 18px; box-shadow: 0 10px 28px rgba(var(--primary-rgb),.4); font-weight: 600; }
.ai-panel { position: fixed; right: 22px; bottom: 22px; width: 420px; max-width: calc(100vw - 32px); height: 620px; max-height: calc(100vh - 44px); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.22); z-index: 45; display: flex; flex-direction: column; }
.ai-panel .hd { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; background: linear-gradient(135deg, var(--aihd-a), var(--aihd-b)); color: #fff; border-radius: 16px 16px 0 0; }
.ai-panel .hd .sp { flex: 1; } .ai-panel .hd .btn { color: #fff; }
.ai-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { padding: 9px 12px; border-radius: 12px; max-width: 88%; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.assistant ul { margin: 4px 0; padding-left: 18px; }
.msg .tools { font-size: 11px; color: var(--muted); margin-top: 4px; }
.ai-input { border-top: 1px solid var(--border); padding: 10px; display: flex; gap: 8px; }
.ai-input textarea { min-height: 42px; height: 42px; max-height: 120px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 5px 10px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); cursor: pointer; border: 0; font: inherit; font-size: 12px; }
.typing { color: var(--muted); font-style: italic; }
.ai-out { white-space: normal; background: #f6f4ff; border: 1px solid #ddd5ff; border-radius: 10px; padding: 12px; margin-top: 10px; }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.2fr 1fr; background: var(--bg); }
.login-hero { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(120% 120% at 80% 30%, var(--login-a) 0%, var(--login-b) 40%, var(--login-c) 100%); }
.login-hero h1 { font-size: 54px; font-weight: 500; color: #fff; line-height: 1.05; margin: 0; max-width: 520px; }
.login-hero .house { position: absolute; right: -10%; bottom: -2%; width: 62%; height: 62%; opacity: .97; }
.login-hero .house svg { width: 100%; height: 100%; filter: drop-shadow(0 40px 40px rgba(0,0,0,.4)); }
.login-hero .brand { color: #fff; position: relative; z-index: 1; padding: 0; }
.login-hero .glass { position: relative; z-index: 1; max-width: 300px; }
.login-form { display: grid; place-items: center; padding: 24px; }
.login .card { width: 440px; max-width: 100%; padding: 30px 34px; }
.auth-tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; border: 0; background: transparent; padding: 9px 12px; border-radius: 999px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.auth-tabs button.on { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(var(--primary-rgb),.3); }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login-hero { min-height: 340px; padding: 28px; } .login-hero h1 { font-size: 36px; } .hero .house { opacity: .35; width: 70%; } .hero-content { max-width: 100%; } }

.empty { text-align: center; color: var(--muted); padding: 24px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; } .kv div:nth-child(odd) { color: var(--muted); }
.toggle-row { display: grid; grid-template-columns: 200px 1fr 130px; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }

/* calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 4px; }
.cal-h { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px; }
.cal-cell { min-height: 96px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 4px; overflow: hidden; }
.cal-cell.empty-cell { background: transparent; border-color: transparent; }
.cal-cell.today { border: 2px solid var(--primary); background: var(--primary-soft); }
.cal-d { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.cal-chip { font-size: 11px; line-height: 1.3; padding: 2px 5px; margin-bottom: 2px; border-radius: 4px; background: color-mix(in srgb, var(--c) 14%, white); border-left: 3px solid var(--c); color: #1b2333; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.done { opacity: .5; text-decoration: line-through; }
details.help summary { cursor: pointer; font-size: 15px; }

/* print (éves elszámolás) */
@media print {
  .side, .tabs, .topbar, .ai-fab, .ai-panel, .no-print, .btns, #toast-root { display: none !important; }
  .shell { display: block; } .main { padding: 0; } body { background: #fff; }
  .card { box-shadow: none; border: 0; padding: 0; } .print-doc h2 { margin-top: 18px; font-size: 15px; }
  td, th { padding: 4px 6px; }
}

@media (max-width: 1100px) { .g4, .g5 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: -270px; width: 260px; z-index: 60; transition: left .2s; }
  .side.open { left: 0; }
  .btn.menu-btn { display: inline-flex; }
  .main { padding: 16px 16px 90px; }
  .g2, .g3, .g4, .g5, .kanban, .fgrid { grid-template-columns: 1fr; }
  .toggle-row { grid-template-columns: 1fr; }
  .cal-cell { min-height: 60px; } .cal-chip { font-size: 9px; padding: 1px 3px; }
  .ai-panel { right: 8px; bottom: 8px; height: calc(100vh - 16px); }
}

/* --- választható témák (Beállítások → Megjelenés); az alap a fenti rózsa téma --- */
html[data-theme="ocean"] { --bg: #eef3f6; --surface: #fbfdfe; --surface-2: #f2f7fa; --border: #d8e4ec; --text: #14232e; --muted: #66798a; --primary: #1f5f8b; --primary-soft: #e2eef7; --rose: #6fa3c7; --rose-2: #bcd6e8; --wine: #10283a; --wine-2: #1d4560; --side: #0c1c28; --side-text: #c3d4e0; --hero-a: #6fa3c7; --hero-b: #1f4e70; --hero-c: #0b1d2b; --hero-glow: rgba(210,232,255,.35); --shade-rgb: 16,38,56; --tile-a: #e3eff7; --tile-b: #b9d3e6; --tile-c: #8fb5d1; --btile-a: #edf5fb; --btile-b: #cfe2f0; --btile-c: #a5c6de; --btile-rgb: 20,52,78; --side-a: #10263a; --side-b: #08141f; --accent-rgb: 111,163,199; --primary-rgb: 31,95,139; --ai-a: #6fa3c7; --ai-b: #1f5f8b; --ai-c: #0f2f47; --aihd-a: #4f8ab3; --aihd-b: #1d4560; --login-a: #6fa3c7; --login-b: #1f4e70; --login-c: #0c1c28; --logo-a: #4f8ab3; --logo-b: #1d4560; --logo-w1: #eaf3fa; --logo-w2: #cfe2f0; }
html[data-theme="erdo"] { --bg: #eef3ee; --surface: #fbfdfa; --surface-2: #f1f6f0; --border: #d7e3d5; --text: #172418; --muted: #687a69; --primary: #2f6b45; --primary-soft: #e2f0e6; --rose: #86b496; --rose-2: #c6dfcd; --wine: #14301f; --wine-2: #24503a; --side: #0f1f15; --side-text: #c9dccd; --success: #1f7a6b; --success-soft: #e0f3ef; --hero-a: #86b496; --hero-b: #2c5e3f; --hero-c: #0f2416; --hero-glow: rgba(220,245,225,.35); --shade-rgb: 20,48,30; --tile-a: #e2efe4; --tile-b: #bcd8c3; --tile-c: #93bda0; --btile-a: #edf6ef; --btile-b: #cfe4d4; --btile-c: #a8cbb2; --btile-rgb: 24,64,40; --side-a: #132a1c; --side-b: #0a170f; --accent-rgb: 134,180,150; --primary-rgb: 47,107,69; --ai-a: #86b496; --ai-b: #2f6b45; --ai-c: #163a24; --aihd-a: #5e9a73; --aihd-b: #24503a; --login-a: #86b496; --login-b: #2c5e3f; --login-c: #0f1f15; --logo-a: #5e9a73; --logo-b: #24503a; --logo-w1: #eef7f0; --logo-w2: #cfe4d4; }
html[data-theme="levendula"] { --bg: #f2eff7; --surface: #fdfbff; --surface-2: #f5f1fa; --border: #e1d9ec; --text: #221a2e; --muted: #7a6f8a; --primary: #5e3d8f; --primary-soft: #ece4f7; --rose: #a68cc9; --rose-2: #d6c8ea; --wine: #26183a; --wine-2: #3f2a5e; --side: #1a1027; --side-text: #d6cbe6; --info: #2f6a8a; --info-soft: #e4f0f6; --hero-a: #a68cc9; --hero-b: #4b2f73; --hero-c: #1c1129; --hero-glow: rgba(235,220,255,.35); --shade-rgb: 38,24,58; --tile-a: #eee6f7; --tile-b: #d3c3e8; --tile-c: #b39fd3; --btile-a: #f4effb; --btile-b: #e0d4ef; --btile-c: #c3b0de; --btile-rgb: 60,40,90; --side-a: #221535; --side-b: #130b1d; --accent-rgb: 166,140,201; --primary-rgb: 94,61,143; --ai-a: #a68cc9; --ai-b: #5e3d8f; --ai-c: #2e1c47; --aihd-a: #8a6bb5; --aihd-b: #3f2a5e; --login-a: #a68cc9; --login-b: #4b2f73; --login-c: #1a1027; --logo-a: #8a6bb5; --logo-b: #3f2a5e; --logo-w1: #f6f1fc; --logo-w2: #e0d4ef; }
html[data-theme="grafit"] { --bg: #f1f2f4; --surface: #fdfdfe; --surface-2: #f5f6f8; --border: #dfe2e7; --text: #1b1f26; --muted: #6c7380; --primary: #3a4a63; --primary-soft: #e6eaf0; --rose: #8c99ad; --rose-2: #cbd2dc; --wine: #1c2330; --wine-2: #2f3a4d; --side: #15191f; --side-text: #c9ced6; --hero-a: #8c99ad; --hero-b: #34425a; --hero-c: #12161d; --hero-glow: rgba(225,232,245,.3); --shade-rgb: 27,33,43; --tile-a: #e9ecf1; --tile-b: #cbd2dc; --tile-c: #a7b2c2; --btile-a: #f1f3f6; --btile-b: #dbe0e7; --btile-c: #b9c2cf; --btile-rgb: 40,48,62; --side-a: #1c222b; --side-b: #0f1217; --accent-rgb: 140,153,173; --primary-rgb: 58,74,99; --ai-a: #8c99ad; --ai-b: #3a4a63; --ai-c: #1c2330; --aihd-a: #6b7a92; --aihd-b: #2f3a4d; --login-a: #8c99ad; --login-b: #34425a; --login-c: #15191f; --logo-a: #6b7a92; --logo-b: #2f3a4d; --logo-w1: #f3f5f8; --logo-w2: #dbe0e7; }

/* témaválasztó */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.theme-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px; border: 2px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; font: inherit; color: var(--text); position: relative; text-align: left; }
.theme-opt .sw { width: 100%; height: 46px; border-radius: 10px; }
.theme-opt .sw2 { position: absolute; right: 16px; top: 16px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; }
.theme-opt:hover { border-color: var(--rose); }
.theme-opt.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.side .foot .legal { font-size: 11px; opacity: .7; margin-top: 6px; }
.side .foot .legal a { display: inline; padding: 0; border-radius: 0; }

/* --- Éjszaka (sötét) téma --- */
html[data-theme="ejszaka"] {
  color-scheme: dark;
  --bg: #14161c; --surface: #1d2028; --surface-2: #252934; --border: #333846; --text: #e6e8ee; --muted: #9aa2b4;
  --primary: #6474ec; --primary-soft: #262c4d; --danger: #ff6b7a; --danger-soft: #3a1f26; --warning: #f0b24a;
  --warning-soft: #3a2e1a; --success: #4cc38a; --success-soft: #17302a; --info: #b39cf0; --info-soft: #2c2640;
  --rose: #7d8ce0; --rose-2: #3b4470; --wine: #1d2235; --wine-2: #2a3150; --side: #0d0f14; --side-text: #b8bfcf;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  --hero-a: #4a5aa8; --hero-b: #252d5a; --hero-c: #0f1222; --hero-glow: rgba(140,160,255,.22); --shade-rgb: 0,0,0;
  --tile-a: #2a3050; --tile-b: #222842; --tile-c: #1a1f35; --btile-a: #2b3047; --btile-b: #21263b; --btile-c: #181c2c; --btile-rgb: 0,0,0;
  --side-a: #11141c; --side-b: #0a0c11; --accent-rgb: 139,156,247; --primary-rgb: 100,116,236;
  --ai-a: #7d8ce0; --ai-b: #4a5ad0; --ai-c: #232a5a; --aihd-a: #4a5aa8; --aihd-b: #252d5a;
  --login-a: #4a5aa8; --login-b: #252d5a; --login-c: #0d0f14;
  --logo-a: #8b9cf7; --logo-b: #4453a8; --logo-w1: #e6e9ff; --logo-w2: #c4cbf5;
}
html[data-theme="ejszaka"] input, html[data-theme="ejszaka"] select, html[data-theme="ejszaka"] textarea { background: var(--surface-2); }
html[data-theme="ejszaka"] tr:hover td { background: var(--surface-2); }
html[data-theme="ejszaka"] .btn:hover { border-color: var(--muted); }
html[data-theme="ejszaka"] .badge, html[data-theme="ejszaka"] .alert, html[data-theme="ejszaka"] .kpi.danger,
html[data-theme="ejszaka"] .ok-banner { border-color: color-mix(in srgb, currentColor 30%, transparent); }
html[data-theme="ejszaka"] .alert.danger { color: #ffb3bb; } html[data-theme="ejszaka"] .alert.warning { color: #f6cf8a; }
html[data-theme="ejszaka"] .alert.info { color: #cdbff7; }
html[data-theme="ejszaka"] .person.contact { border-color: var(--border); background: var(--surface-2); }
html[data-theme="ejszaka"] .btile-new { border-color: var(--border); }
html[data-theme="ejszaka"] .bcard:hover { border-color: var(--rose-2); }
html[data-theme="ejszaka"] .note.yellow { background: #3b3519; } html[data-theme="ejszaka"] .note.pink { background: #3d2430; }
html[data-theme="ejszaka"] .note.green { background: #1d3526; } html[data-theme="ejszaka"] .note.blue { background: #1e2b44; }
html[data-theme="ejszaka"] .note.purple { background: #2c2444; }
html[data-theme="ejszaka"] .board-wrap { background: radial-gradient(#2c3140 1px, transparent 1px) 0 0 / 18px 18px, var(--surface-2); }
html[data-theme="ejszaka"] .board-wrap rect.bg { fill: var(--surface); stroke: var(--border); }
html[data-theme="ejszaka"] .board-wrap text { fill: var(--muted); }
html[data-theme="ejszaka"] .board-wrap text[font-weight="700"] { fill: var(--text); }
html[data-theme="ejszaka"] .ai-out { background: #1f2236; border-color: #34395a; }
html[data-theme="ejszaka"] .cal-chip { background: color-mix(in srgb, var(--c) 22%, var(--surface)); color: var(--text); }
html[data-theme="ejszaka"] .toast { background: #2a2f3d; border: 1px solid var(--border); }
html[data-theme="ejszaka"] [style*="border-color:#f6c4c9"] { border-color: #5a2a33 !important; }
html[data-theme="ejszaka"] .hero .btn.light { color: #1d2235; }
@media print { html[data-theme="ejszaka"] { color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #f5f6f8; --border: #dfe2e7; --text: #1b1f26; --muted: #5c6370; } }
html[data-theme="ejszaka"] .btile-info { background: rgba(29,32,40,.72); border-color: rgba(255,255,255,.08); }
html[data-theme="ejszaka"] .btile, html[data-theme="ejszaka"] .btile:hover { box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 18px 40px rgba(0,0,0,.35); }
