/* ===== Startportál – kezelőfelület (a főoldal arculatával) ===== */
body.adm {
  --ink: #0B1F2A; --ink-2: #5B7280; --line: #E3EAEE; --paper: #F4F7F9; --mist: #E9EFF2;
  --amber: #FFB020; --orange: #E8562E; --side: clamp(14px, 3vw, 40px); --ease: cubic-bezier(.2, .7, .2, 1);
  --accent: #0B1F2A; --accent-2: #FFF1D2; --muted: #5B7280; --radius: 18px;
  --wave-a: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%201440%2080%22%20preserveAspectRatio%3D%22none%22%3E%3Cpath%20d%3D%22M0%2C46%20C180%2C78%20360%2C74%20540%2C52%20C720%2C30%20900%2C6%201080%2C14%20C1260%2C22%201350%2C48%201440%2C40%20L1440%2C80%20L0%2C80%20Z%22/%3E%3C/svg%3E");
  --wave-h: clamp(30px, 4vw, 60px);
  background: var(--paper); color: var(--ink); font-family: "Archivo", system-ui, sans-serif; font-size: 15px;
}
body.adm h1, body.adm h2 { font-family: "Anton", Impact, sans-serif; font-weight: 400; text-transform: uppercase; letter-spacing: .01em; }
body.adm h1 { font-size: clamp(26px, 2.4vw, 34px); }
body.adm h2 { font-size: 22px; }
body.adm h3 { font-weight: 700; font-size: 16px; }
body.adm a { color: var(--ink); }
body.adm .wrap { max-width: 1440px; padding-left: var(--side); padding-right: var(--side); }

/* Fejléc + sötét sáv hullámmal */
body.adm header.top { background: var(--ink); position: sticky; top: 0; z-index: 30; }
body.adm header.top .wrap { padding-top: 12px; padding-bottom: 12px; }
body.adm header.top .brand { font-family: "Anton", Impact, sans-serif !important; font-size: 22px !important; letter-spacing: .05em; text-transform: uppercase; }
body.adm header.top .brand span { color: var(--amber); }
body.adm header.top .brand small { font-family: "Archivo", sans-serif; font-size: 12px; letter-spacing: .14em; color: #9FB6C2; margin-left: 8px; vertical-align: middle; }
body.adm header.top nav { gap: 4px; margin-left: 12px; }
body.adm header.top nav a { color: #C6D6DD; font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: 99px; transition: background .2s, color .2s; }
body.adm header.top nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
body.adm header.top nav a.on { background: var(--amber); color: var(--ink); }
body.adm header.top .user { color: #9FB6C2; }
body.adm header.top .user a { color: #fff !important; }
body.adm .band { position: relative; height: 70px; background: var(--ink); }
body.adm .band::after { content: ""; position: absolute; left: 0; right: 0; top: calc(100% - 1px); height: var(--wave-h); background: var(--ink); transform: scaleY(-1);
  -webkit-mask: var(--wave-a) 0 0 / 100% 100% no-repeat; mask: var(--wave-a) 0 0 / 100% 100% no-repeat; }
body.adm main.wrap { position: relative; z-index: 1; margin-top: -58px; padding-bottom: 60px; }
/* A lap címsora a sötét sávon */
body.adm #view > .row:first-child h1, body.adm #view > .row:first-child > .muted { color: #fff; }
body.adm #view > .row:first-child { margin-bottom: 30px !important; min-height: 44px; }
body.adm #view > .row:first-child a:not(.btn) { color: #C6D6DD; }
body.adm #view > .row:first-child button:not(.primary), body.adm #view > .row:first-child .btn:not(.primary) { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.25); }

/* Kártyák */
body.adm .card { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(11,31,42,.04), 0 10px 30px rgba(11,31,42,.06); padding: 18px 20px; }
body.adm a.card { transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; }
body.adm a.card:hover { transform: translateY(-3px); border-color: #C9D6DC; box-shadow: 0 18px 40px rgba(11,31,42,.12); }
body.adm .prop-band { height: 5px; margin: -18px -20px 14px; border-radius: 18px 18px 0 0; }
body.adm .grid { gap: 18px; }

/* Gombok */
body.adm button, body.adm .btn { border-radius: 12px; border-color: #C9D6DC; font-weight: 600; transition: background .2s, border-color .2s, color .2s, transform .15s; }
body.adm button:hover, body.adm .btn:hover { border-color: var(--ink); }
body.adm button:active, body.adm .btn:active { transform: scale(.98); }
body.adm button.primary, body.adm .btn.primary { background: var(--amber); border-color: var(--amber); color: var(--ink); }
body.adm button.primary:hover, body.adm .btn.primary:hover { background: var(--orange); border-color: var(--orange); color: #fff; filter: none; }
body.adm button.danger { color: #B3261E; }
body.adm button.danger:hover { border-color: #B3261E; background: #FBE9E7; }
body.adm button.sm, body.adm .btn.sm { border-radius: 10px; }

/* Űrlapok */
body.adm input, body.adm select, body.adm textarea { border-radius: 12px; border-color: #C9D6DC; padding: 9px 12px; transition: border-color .2s, box-shadow .2s; }
body.adm input:focus, body.adm select:focus, body.adm textarea:focus { outline: 0; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255,176,32,.25); }
body.adm label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 4px; }
body.adm .check { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; color: var(--ink); }
body.adm .switch input:checked + span { background: var(--amber); }

/* Táblázatok */
body.adm table { border-collapse: separate; border-spacing: 0; }
body.adm th { font-size: 11px; letter-spacing: .1em; color: var(--ink-2); background: #F7FAFB; border-bottom: 1px solid var(--line); padding: 10px; }
body.adm th:first-child { border-top-left-radius: 12px; } body.adm th:last-child { border-top-right-radius: 12px; }
body.adm td { padding: 12px 10px; border-bottom: 1px solid var(--line); }
body.adm tbody tr { transition: background .15s; }
body.adm tbody tr:hover { background: #FAFCFD; }

/* Címkék, jelzők */
body.adm .badge { padding: 3px 10px; font-size: 12px; }
body.adm .badge.confirmed { background: #E6EEF2; color: var(--ink); }
body.adm .badge.pending, body.adm .badge.warn { background: #FFF1D2; color: #8A5A00; }
body.adm .dot.ok { box-shadow: 0 0 0 3px rgba(46,125,79,.18); }
body.adm .dot.error { box-shadow: 0 0 0 3px rgba(179,38,30,.18); }

/* Fülek */
body.adm .tabs { border-bottom: 0; gap: 6px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 99px; width: max-content; max-width: 100%; }
body.adm .tabs button { border: 0; border-radius: 99px; padding: 8px 16px; color: var(--ink-2); }
body.adm .tabs button.on { background: var(--ink); color: #fff; border: 0; }
body.adm .pe-head { background: var(--paper); top: 64px; padding: 10px 0; }
body.adm .pe-tabs button { border-radius: 99px; }
body.adm .pe-tabs button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
body.adm .sec { background: #F7FAFB; }

/* Eszközcsempék */
body.adm .dev .big { font-family: "Anton", Impact, sans-serif; font-weight: 400; font-size: 36px; letter-spacing: 0; }
body.adm .dev.k-heat_pump .big { color: var(--orange); }
body.adm .dev.k-jacuzzi .big { color: #1F8FB8; }

/* Párbeszédablak */
body.adm dialog { border-radius: 22px; box-shadow: 0 30px 80px rgba(11,31,42,.3); overflow: hidden; }
body.adm dialog::backdrop { background: rgba(11,31,42,.55); backdrop-filter: blur(3px); }
body.adm dialog .dlg-head { background: var(--ink); color: #fff; border-bottom: 0; padding: 16px 20px; }
body.adm dialog .dlg-head h2 { color: #fff; font-size: 22px; }
body.adm dialog .dlg-head button { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; }
body.adm dialog .dlg-foot { background: #F7FAFB; }

/* Belépés */
body.adm .center-box { margin-top: 30px; border-radius: 22px; padding: 26px; }
body.adm .center-box h2 { font-size: 26px; }
body.adm .center-box button.primary { width: 100%; justify-content: center; min-height: 48px; }

/* Napló, kódok */
body.adm code { background: #EEF3F6; border-radius: 6px; }
body.adm .log div { border-bottom-color: var(--line); }

/* Megjelenés */
@media (prefers-reduced-motion: no-preference) {
  body.adm #view > * { animation: adm-in .5s var(--ease) both; }
  body.adm #view > *:nth-child(2) { animation-delay: .05s; } body.adm #view > *:nth-child(3) { animation-delay: .1s; }
}
@keyframes adm-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
  body.adm header.top nav { margin-left: 0; }
  body.adm .pe-head { top: 0; position: static; }
}
body.adm input[type="color"] { padding: 4px; height: 42px; cursor: pointer; }
body.adm .tabs button { white-space: nowrap; flex: none; }
@media (max-width: 640px) {
  body.adm header.top { position: static; }
  body.adm .band { height: 120px; }
  body.adm main.wrap { margin-top: -108px; }
  body.adm #view > .row:first-child { row-gap: 4px; }
  body.adm #view > .row:first-child > .muted { width: 100%; font-size: 13px; }
}

/* Világosabb kék fejléc és sáv (a főoldali okosotthon-blokk derengéses hatásához igazítva) */
body.adm { --top: #15384A; }
body.adm header.top, body.adm .band, body.adm .band::after { background: var(--top); }
body.adm header.top nav a { color: #D3E1E7; }
body.adm header.top .brand small, body.adm header.top .user { color: #B3C8D2; }
body.adm dialog .dlg-head { background: var(--top); }

/* ---------- Sötét / világos mód ---------- */
.theme-tg { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0 !important; border-radius: 50% !important; background: rgba(255,255,255,.08) !important; border: 1px solid rgba(255,255,255,.22) !important; color: #fff !important; margin-left: 10px; }
.theme-tg:hover { background: rgba(255,255,255,.16) !important; }
.theme-tg svg { width: 18px; height: 18px; }
.theme-tg .sun { display: none; }
html.dark .theme-tg .sun { display: block; } html.dark .theme-tg .moon { display: none; }
body.adm header.top .user { display: inline-flex; align-items: center; }

html.dark { color-scheme: dark; }
html.dark body.adm { --paper: #0B1820; --line: #22394A; --mist: #1A2E39; --muted: #93A9B4; --ink-2: #93A9B4; --card: #12232D; --top: #0F2A38;
  background: var(--paper); color: #E2EBEF; }
html.dark body.adm a { color: #E2EBEF; }
html.dark body.adm .muted, html.dark body.adm .kv dt, html.dark body.adm label { color: var(--muted); }
html.dark body.adm .check { color: #E2EBEF; }
html.dark body.adm .card, html.dark body.adm .center-box { background: var(--card); border-color: var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px rgba(0,0,0,.25); }
html.dark body.adm a.card:hover { border-color: #3A5566; box-shadow: 0 18px 40px rgba(0,0,0,.4); }
html.dark body.adm input, html.dark body.adm select, html.dark body.adm textarea { background: #0E1D26; border-color: #2A4454; color: #E2EBEF; }
html.dark body.adm button, html.dark body.adm .btn { background: #12232D; border-color: #2A4454; color: #E2EBEF; }
html.dark body.adm button:hover, html.dark body.adm .btn:hover { border-color: #6F8A97; }
html.dark body.adm button.primary, html.dark body.adm .btn.primary { background: var(--amber); border-color: var(--amber); color: #0B1F2A; }
html.dark body.adm button.primary:hover, html.dark body.adm .btn.primary:hover { background: var(--orange); border-color: var(--orange); color: #fff; }
html.dark body.adm button.danger { color: #FF8A80; }
html.dark body.adm button.danger:hover { background: #3A1C1C; border-color: #FF8A80; }
html.dark body.adm th { background: #172B36; color: var(--muted); border-bottom-color: var(--line); }
html.dark body.adm td { border-bottom-color: var(--line); }
html.dark body.adm tbody tr:hover { background: #152833; }
html.dark body.adm .tabs { background: var(--card); border-color: var(--line); }
html.dark body.adm .tabs button { background: transparent; color: var(--muted); }
html.dark body.adm .tabs button.on, html.dark body.adm .pe-tabs button.on { background: var(--amber); border-color: var(--amber); color: #0B1F2A; }
html.dark body.adm .pe-head { background: var(--paper); }
html.dark body.adm .sec, html.dark body.adm dialog .dlg-foot { background: #172B36; }
html.dark body.adm dialog { background: var(--card); color: #E2EBEF; }
html.dark body.adm dialog .dlg-head { background: var(--top); }
html.dark body.adm code { background: #1A2E39; color: #E2EBEF; }
html.dark body.adm .badge { background: #22394A; color: #D5E1E7; }
html.dark body.adm .badge.ok, html.dark body.adm .badge.active { background: #163A29; color: #7FD6A1; }
html.dark body.adm .badge.pending, html.dark body.adm .badge.warn { background: #3A2E12; color: #FFC85A; }
html.dark body.adm .badge.cancelled, html.dark body.adm .badge.error { background: #3A1C1C; color: #FF8A80; }
html.dark body.adm .msg.info { background: #1A2E39; color: #CFE0E8; }
html.dark body.adm .msg.ok { background: #163A29; color: #7FD6A1; }
html.dark body.adm .msg.err { background: #3A1C1C; color: #FF8A80; }
html.dark body.adm .switch span { background: #2A4454; }
html.dark body.adm .log div { border-bottom-color: var(--line); }
html.dark body.adm .img-grid figure, html.dark body.adm .lox-list { background: #0E1D26; border-color: var(--line); }
html.dark body.adm .dev.k-energy_meter .big { color: #B49CFF; }
html.dark body.adm .chart text { fill: var(--muted); }
html.dark body.adm .chart { color: #E2EBEF; }
body.adm header.top .user.hidden + .theme-tg { margin-left: auto; }
html.dark body.adm .switch input:checked + span { background: var(--amber); }

/* Súgó */
body.adm .adm-faq-list { display: flex; flex-direction: column; gap: 8px; }
body.adm .adm-faq { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); transition: border-color .2s; }
body.adm .adm-faq[open] { border-color: #C9D6DC; }
body.adm .adm-faq summary { list-style: none; cursor: pointer; padding: 14px 48px 14px 16px; font-weight: 700; position: relative; }
body.adm .adm-faq summary::-webkit-details-marker { display: none; }
body.adm .adm-faq summary::after { content: "+"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; background: var(--mist); text-align: center; line-height: 24px; font-weight: 700; transition: transform .3s, background .2s; }
body.adm .adm-faq[open] summary::after { transform: translateY(-50%) rotate(45deg); background: var(--amber); color: #0B1F2A; }
body.adm .adm-faq p { margin: 0; padding: 0 16px 16px; line-height: 1.6; }
html.dark body.adm .adm-faq { background: #0E1D26; border-color: var(--line); }

/* ===== Meleg homok paletta (világos mód) + finom szemcsés textúra ===== */
html:not(.dark) body.adm { --paper: #F3ECE1; --line: #E6DCCD; --mist: #EDE4D6; --card: #FAF6EF; background: var(--paper); }
html:not(.dark) body.adm .card, html:not(.dark) body.adm .center-box, html:not(.dark) body.adm .tabs,
html:not(.dark) body.adm button:not(.primary):not(.theme-tg), html:not(.dark) body.adm .btn:not(.primary), html:not(.dark) body.adm dialog { background-color: var(--card); }
html:not(.dark) body.adm .tabs button:not(.on) { background: transparent; }
html:not(.dark) body.adm .tabs button.on, html:not(.dark) body.adm .pe-tabs button.on { background: var(--ink); }
html:not(.dark) body.adm input, html:not(.dark) body.adm select, html:not(.dark) body.adm textarea { background: #FFFDF9; border-color: #DCCFBD; }
html:not(.dark) body.adm th, html:not(.dark) body.adm .sec, html:not(.dark) body.adm dialog .dlg-foot { background: #F1E9DC; }
html:not(.dark) body.adm tbody tr:hover { background: #F6EFE4; }
html:not(.dark) body.adm .pe-head { background: var(--paper); }
html:not(.dark) body.adm .adm-faq { background: var(--paper); }
html:not(.dark) body.adm code { background: #EDE4D6; }
html:not(.dark) body.adm .img-grid figure { background: #EFE7DA; }
body.adm::before { content: ""; position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* Logó jel */
body.adm header.top .brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
body.adm .logo-mark { width: 32px; height: 32px; border-radius: 8px; display: block; flex: none; }
body.adm header.top .brand small { margin-left: 2px; }
body.adm header.top .brand { gap: 0; }
body.adm header.top .brand .logo-mark { margin-right: 10px; }
body.adm header.top .brand small { margin-left: 10px !important; }
