:root {
  --bg: #f6f7f9; --panel: #fff; --ink: #1c2430; --muted: #6b7684; --line: #e3e7ec;
  --accent: #1f5fa8; --accent-soft: #e8f0fa;
  --hi: #1e8e4e; --hi-soft: #e3f4ea; --mid: #b7791f; --mid-soft: #fdf3e1; --lo: #8a94a3; --lo-soft: #eef0f3;
  --danger: #c2412d; --danger-soft: #fbe9e6;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* fejléc */
.top { display: flex; align-items: center; gap: 28px; padding: 0 24px; height: 52px; background: #14202e; color: #fff; position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 650; letter-spacing: .2px; white-space: nowrap; }
.brand small { font-weight: 400; color: #9fb0c3; margin-left: 6px; }
.nav { display: flex; gap: 2px; flex: 1; }
.nav a { color: #c9d4e0; padding: 7px 12px; border-radius: 6px; font-weight: 500; }
.nav a:hover { background: #22324a; text-decoration: none; color: #fff; }
.nav a.on { background: #2b3f5c; color: #fff; }
.top .run-dot { font-size: 12px; color: #ffd27a; white-space: nowrap; }

main { padding: 20px 24px 60px; max-width: 1500px; margin: 0 auto; }
h1 { font-size: 20px; margin: 4px 0 16px; font-weight: 650; }
h2 { font-size: 15px; margin: 22px 0 10px; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* statisztika csempék */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat b { display: block; font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12px; }
.stat a { color: inherit; } .stat a:hover { text-decoration: none; } .stat:hover { border-color: #c8d2de; }

/* szűrők */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.filters input[type=search] { flex: 1 1 220px; min-width: 180px; }
input, select, textarea, button { font: inherit; }
input[type=search], input[type=number], select, textarea { border: 1px solid #cfd6de; border-radius: 6px; padding: 6px 8px; background: #fff; color: var(--ink); }
input[type=number] { width: 72px; }
label.chk { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.btn { border: 1px solid #cfd6de; background: #fff; color: var(--ink); border-radius: 6px; padding: 6px 12px; cursor: pointer; font-weight: 500; }
.btn:hover { border-color: #9fb0c3; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #184d89; }
.btn.danger { color: var(--danger); }
.seg { display: inline-flex; border: 1px solid #cfd6de; border-radius: 6px; overflow: hidden; }
.seg a { padding: 6px 12px; color: var(--ink); border-right: 1px solid #cfd6de; }
.seg a:last-child { border-right: 0; }
.seg a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg a:hover { text-decoration: none; background: #f1f4f8; }

/* táblázat */
table.list { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.list th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
table.list td { padding: 9px 10px; border-bottom: 1px solid #eef1f4; vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr:hover td { background: #fbfcfd; }
tr.st-elvetve td { opacity: .5; }
.t-title { font-weight: 600; color: var(--ink); }
.t-title:hover { color: var(--accent); }
.t-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.t-reason { font-size: 12.5px; color: #3c4756; margin-top: 4px; max-width: 760px; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.score { display: inline-block; min-width: 34px; text-align: center; font-weight: 700; border-radius: 6px; padding: 2px 6px; font-variant-numeric: tabular-nums; }
.score.hi { background: var(--hi-soft); color: var(--hi); }
.score.mid { background: var(--mid-soft); color: var(--mid); }
.score.lo { background: var(--lo-soft); color: var(--lo); }
.chip { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 99px; background: var(--lo-soft); color: #4a5563; white-space: nowrap; margin: 1px 2px 1px 0; }
.chip.cat-kozbeszerzes_hvac, .chip.cat-lakossagi_tamogatas { background: var(--hi-soft); color: var(--hi); }
.chip.cat-nyertes_kivitelezo { background: #ece6fb; color: #5b3fb0; }
.chip.cat-epuletenergetika, .chip.cat-kozbeszerzesi_terv, .chip.cat-nyertes_palyazat { background: var(--accent-soft); color: var(--accent); }
.dl-past { color: var(--muted); text-decoration: line-through; }
.dl-soon { color: var(--danger); font-weight: 600; }
.star { cursor: pointer; font-size: 17px; color: #c7ced8; background: none; border: 0; padding: 0 2px; line-height: 1; }
.star.on { color: #e3a008; }
select.status { padding: 3px 6px; font-size: 12.5px; }
select.status.s-lead { border-color: var(--hi); color: var(--hi); font-weight: 600; }
select.status.s-megnezve { color: var(--accent); }
select.status.s-elvetve { color: var(--muted); }

/* részletes nézet */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; }
@media (max-width: 1000px) { .detail { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; }
.card h2 { margin-top: 0; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.ai { border-left: 3px solid var(--accent); background: #f8fafd; padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 8px 0; }
.ai.action { border-left-color: var(--hi); background: #f6fbf8; }
pre.doc { white-space: pre-wrap; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 12px; max-height: 520px; overflow: auto; }
.statusbtns { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.statusbtns button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
textarea.notes { width: 100%; min-height: 130px; resize: vertical; }
ul.timeline { list-style: none; padding: 0; margin: 0; }
ul.timeline li { padding: 4px 0 4px 14px; border-left: 2px solid var(--line); position: relative; font-size: 13px; }
ul.timeline li::before { content: ""; position: absolute; left: -5px; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: #9fb0c3; }
ul.plain { margin: 0; padding-left: 18px; }

/* nyertesek */
details.firm { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
details.firm summary { cursor: pointer; padding: 11px 14px; display: flex; gap: 14px; align-items: center; list-style: none; }
details.firm summary::-webkit-details-marker { display: none; }
details.firm summary .name { font-weight: 600; flex: 1; }
details.firm[open] summary { border-bottom: 1px solid var(--line); }
details.firm .inner { padding: 8px 14px 12px; }

/* futtatás */
pre.log { background: #0f1722; color: #d6e2ee; font: 12px/1.5 ui-monospace, Menlo, monospace; border-radius: 8px; padding: 12px; height: 420px; overflow: auto; white-space: pre-wrap; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); background: var(--panel); border: 1px dashed #cfd6de; border-radius: 10px; }
.toast { position: fixed; bottom: 18px; right: 18px; background: #14202e; color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: .95; }

.chip.role-go { background: var(--hi); color: #fff; font-weight: 600; }
.chip.cat-nyitott_ajanlatkeres, .chip.cat-beszallitoi_lehetoseg { background: var(--hi-soft); color: var(--hi); font-weight: 600; }
.stat-main { border-color: var(--hi); background: var(--hi-soft); }
.stat-main b { color: var(--hi); }

.county-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.county { display: flex; align-items: baseline; gap: 5px; font-size: 13px; padding: 2px 0; cursor: pointer; }
.county span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.county small { color: var(--muted); font-size: 11px; white-space: nowrap; }

.detail.run-layout { grid-template-columns: minmax(0, 1fr) 470px; }
@media (max-width: 1100px) { .detail.run-layout { grid-template-columns: 1fr; } }
.county-grid > .county { min-width: 0; }

.county .dot, i.dot { color: var(--hi); font-style: normal; font-size: 10px; }

.chip.cat-tamogatasi_palyazat, .chip.cat-lezart_beszerzes { background: var(--lo-soft); color: var(--lo); }

.statusbox { margin-bottom: 10px; }
.st-line { margin-bottom: 6px; }
.bar { height: 8px; background: #e7ebf0; border-radius: 4px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); transition: width .5s; }
.bar > div.done { background: var(--hi); }
.bar > div.indet { background: repeating-linear-gradient(90deg, var(--accent) 0 30px, #7fa6d6 30px 60px); animation: slide 1s linear infinite; }
@keyframes slide { from { background-position: 0 0; } to { background-position: 60px 0; } }

.top .who { color: #c9d4e0; font-size: 13px; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.top .logout { color: #9fb0c3; font-size: 13px; }
.top .logout:hover { color: #fff; }

ol.rotq { margin: 0; padding-left: 22px; max-height: 260px; overflow: auto; }
ol.rotq li { padding: 1px 0; }
ol.rotq li.next { font-weight: 600; color: var(--hi); }
code { font-size: 12px; background: #f1f4f8; padding: 1px 4px; border-radius: 4px; }
