:root {
  --bg: #f4f6f7; --card: #fff; --text: #1d2a2f; --muted: #67777d; --line: #d7dfe2;
  --brand: #1f6f78; --brand-soft: #e6f2f3; --accent: #d63c45; --ok: #1f8a4c; --warn: #d9822b;
  --radius: 10px; font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; }
a { color: var(--brand); }
h1 { font-size: 1.5rem; margin: .2rem 0 .8rem; }
h2 { font-size: 1.1rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .err { color: var(--accent); }

.topbar { display: flex; align-items: center; gap: 1.5rem; padding: .7rem 1.5rem; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); font-size: 1.15rem; }
.brand span { font-weight: 400; color: var(--muted); font-size: .9rem; }
.topbar nav { display: flex; gap: .3rem; flex: 1; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; color: var(--text); padding: .45rem .8rem; border-radius: 8px; }
.topbar nav a.active, .topbar nav a:hover { background: var(--brand-soft); color: var(--brand); }
.who { display: flex; gap: .8rem; align-items: center; }
.who form { margin: 0; }

.counters { display: flex; gap: 1rem; padding: .7rem 1.5rem; background: var(--brand); flex-wrap: wrap; }
.counter { color: #fff; text-decoration: none; background: rgba(255,255,255,.12); padding: .35rem .9rem; border-radius: 999px; }
.counter b { font-size: 1.15rem; margin-right: .25rem; }
.counter.new b { color: #b9f5cf; } .counter.price b { color: #ffd49e; }
.counter.removed b { color: #e5e7eb; }

.container { max-width: 1100px; margin: 1.5rem auto; padding: 0 16px; }
.container.wide { max-width: 1500px; }
.auth { max-width: 440px; margin: 3rem auto; padding: 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.narrow { max-width: 440px; margin: 0 auto; }

label { display: block; margin-bottom: .8rem; font-weight: 500; }
input, select { font: inherit; width: 100%; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-top: .3rem; color: var(--text); }
input:focus, select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.btn { font: inherit; display: inline-block; cursor: pointer; padding: .55rem 1rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--accent); }
.btn.ghost { border-color: transparent; }
.btn.small { padding: .3rem .6rem; font-size: .85rem; }
.btn.wide { width: 100%; }
button.link { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }

.flash { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; background: #e8f6ee; border: 1px solid #b7e2c6; }
.flash.error { background: #fdecec; border-color: #f2b8bb; }
.flash.warn { background: #fff4e5; border-color: #f5d2a6; }

/* preferințe */
.searchbar { display: grid; grid-template-columns: auto 220px 1fr; gap: .6rem; margin-bottom: 1.3rem; }
.searchbar input, .searchbar select { margin: 0; height: 48px; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; height: 48px; }
.segmented label { margin: 0; }
.segmented input { display: none; }
.segmented span { display: flex; align-items: center; height: 100%; padding: 0 1.2rem; cursor: pointer; font-weight: 400; }
.segmented input:checked + span { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.filters-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem 1.4rem; }
.field .lbl { display: block; margin-bottom: .35rem; font-weight: 500; }
.field input, .field select { margin-top: 0; }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.range > *:first-child, .range > *:first-child input, .range > select:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.range > *:last-child, .range > *:last-child input, .range > select:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.unit { position: relative; } .unit em { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-style: normal; font-size: .85rem; pointer-events: none; }
.chips { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.chips label { margin: 0; flex: 1; text-align: center; border-left: 1px solid var(--line); }
.chips label:first-child { border-left: 0; flex: 2; }
.chips input { display: none; }
.chips span { display: block; padding: .65rem .4rem; cursor: pointer; font-weight: 400; }
.chips input:checked + span { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.chips.mini { display: inline-flex; vertical-align: middle; } .chips.mini label:first-child { flex: 1; } .chips.mini span { padding: .45rem .7rem; }
.multiselect { position: relative; }
.multiselect summary { list-style: none; border: 1px solid var(--line); border-radius: 8px; padding: .65rem .8rem; cursor: pointer; background: #fff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.multiselect summary::after { content: "⌄"; float: right; color: var(--brand); }
.multiselect .ms-panel { position: absolute; z-index: 10; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; width: 100%; box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; margin: .3rem 0; }
.check input { width: auto; margin: 0; }
.advanced { margin-top: 1.3rem; } .advanced summary { cursor: pointer; color: var(--brand); }
.form-actions { display: flex; gap: 1.5rem; align-items: center; justify-content: flex-end; margin-top: 1.4rem; flex-wrap: wrap; }
.form-actions .check { margin: 0; }

/* listă */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; } .actions form { margin: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: flex-end; margin: .8rem 0; padding: 1rem; }
.toolbar label { margin: 0; font-size: .85rem; }
.toolbar input, .toolbar select { padding: .45rem .6rem; }
.toolbar .range input { width: 90px; }
.toolbar input[name=q] { width: 200px; }
.tagfilter { display: flex; gap: .4rem; align-items: center; } .tagfilter .lbl { font-size: .85rem; font-weight: 500; }
.tag-toggle { margin: 0; } .tag-toggle input { display: none; }
.tag-toggle span { display: inline-block; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; font-weight: 400; }
.tag-toggle input:checked + span { color: #fff; border-color: transparent; }
.tag-toggle.t-new input:checked + span { background: var(--ok); }
.tag-toggle.t-watching input:checked + span { background: var(--brand); }
.tag-toggle.t-price input:checked + span { background: var(--warn); }
.tag-toggle.t-removed input:checked + span { background: #6b7280; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f9fbfb; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); position: sticky; top: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
.apts td.img { width: 170px; } .apts img, .noimg { width: 160px; height: 112px; object-fit: cover; border-radius: 8px; display: block; background: #e9eef0; }
.noimg { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; }
.apts td.title { min-width: 320px; max-width: 520px; }
.apts .t { font-weight: 600; text-decoration: none; color: var(--text); } .apts .t:hover { color: var(--brand); text-decoration: underline; }
.apts .desc { font-size: .88rem; margin: .3rem 0; color: #3b4a50; }
.apts .price b { font-size: 1.05rem; }
.oldprice { text-decoration: line-through; color: var(--muted); font-size: .85rem; }
.apts tr.status-do_not_offer { opacity: .55; }
.apts tr.status-keep { background: #fbfdf5; }
.tag { display: inline-block; font-size: .78rem; padding: .15rem .55rem; border-radius: 999px; color: #fff; margin: 0 .2rem .3rem 0; }
.tag.t-new { background: var(--ok); } .tag.t-watching { background: var(--brand); } .tag.t-price { background: var(--warn); }
.tag.t-removed { background: #6b7280; }
tr.is-removed .title a.t { text-decoration: line-through; text-decoration-color: #9ca3af; }
.acts { min-width: 170px; } .acts > * { margin-bottom: .35rem; }
.status-group { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.status-group .st { font: inherit; font-size: .82rem; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: .35rem .6rem; cursor: pointer; }
.status-group .st:last-child { border-bottom: 0; }
.status-group .st.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.btn.watch.on { background: var(--brand-soft); color: var(--brand); }
.comments summary { cursor: pointer; font-size: .85rem; color: var(--brand); margin-top: .3rem; }
.comments ul { padding-left: 1rem; margin: .4rem 0; font-size: .88rem; }
.add-comment { display: flex; gap: .4rem; } .add-comment input { margin: 0; padding: .35rem .6rem; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem; }

.simple td, .simple th { font-size: .9rem; }
.simple tr.pending { background: #fff8ec; }
.pill { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; background: #eef1f2; }
.pill.ok, .pill.approved { background: #e3f4ea; color: var(--ok); }
.pill.error, .pill.rejected, .pill.disabled { background: #fdecec; color: var(--accent); }
.pill.pending, .pill.running { background: #fff1de; color: var(--warn); }
.acts-inline { display: flex; gap: .3rem; flex-wrap: wrap; } .acts-inline form { margin: 0; }

#map { height: 72vh; border-radius: var(--radius); border: 1px solid var(--line); }
.popup img { width: 220px; height: 130px; object-fit: cover; border-radius: 6px; display: block; margin-bottom: .4rem; }

.toast { position: fixed; bottom: 1.2rem; right: 1.2rem; background: #1d2a2f; color: #fff; padding: .7rem 1rem; border-radius: 8px; opacity: 0; transition: opacity .2s; z-index: 1000; }
.toast.show { opacity: 1; }

@media (max-width: 900px) {
  .filters-grid { grid-template-columns: 1fr; }
  .searchbar { grid-template-columns: 1fr; }
  .topbar { padding: .6rem 16px; gap: .6rem; }
  .counters { padding: .6rem 16px; }
}

/* selector de locații */
.searchbar { grid-template-columns: auto 200px 1fr; align-items: start; }
.locpicker { position: relative; }
.lp-box { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; min-height: 48px; border: 1px solid var(--line); border-radius: 8px; padding: .35rem 2.2rem .35rem .5rem; background: #fff; cursor: text; position: relative; }
.lp-box:focus-within { border-color: var(--brand); outline: 2px solid var(--brand-soft); }
.lp-chips { display: contents; }
.lp-chip { display: inline-flex; align-items: center; gap: .3rem; background: #e9eef0; border-radius: 999px; padding: .3rem .4rem .3rem .75rem; font-size: .9rem; }
.lp-chip small { color: var(--muted); font-size: .75rem; }
.lp-chip button { border: 0; background: none; cursor: pointer; font-size: .8rem; color: var(--text); padding: 0 .2rem; }
.lp-input { flex: 1; min-width: 180px; border: 0 !important; outline: 0 !important; margin: 0; padding: .4rem; height: auto !important; }
.lp-clear { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--brand); font-size: 1.1rem; cursor: pointer; }
.lp-panel { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 28px rgba(0,0,0,.12); max-height: 430px; display: flex; flex-direction: column; }
.lp-head { padding: .7rem .9rem; font-weight: 600; background: #f3f6f7; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.lp-list { overflow-y: auto; }
.lp-row { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #eef2f3; padding-right: .6rem; }
.lp-row.sel { background: var(--brand-soft); }
.lp-row label { display: flex; align-items: center; gap: .7rem; margin: 0; padding: .5rem 0; flex: 1; cursor: pointer; font-weight: 400; }
.lp-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.lp-row input[data-inparent] { opacity: .5; }
.lp-row span { display: flex; flex-direction: column; }
.lp-row b { font-weight: 500; }
.lp-row small { color: var(--muted); font-size: .78rem; }
.lp-exp { border: 0; background: none; font-size: 1.1rem; color: var(--brand); cursor: pointer; padding: .3rem .6rem; }
.lp-empty { padding: .8rem; color: var(--muted); }
.lp-add { padding: .7rem .9rem; display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; background: #fafcfc; }
.lp-help { margin: -.6rem 0 1.2rem; }
.lp-panel[hidden] { display: none; }

.apts .address { font-size: .9rem; margin: .35rem 0 .2rem; }
.apts .final b { font-size: 1.05rem; color: var(--brand); }
.vat { display: inline-block; font-size: .72rem; padding: .1rem .45rem; border-radius: 999px; margin-top: .2rem; white-space: nowrap; }
.vat-plus { background: #fff1de; color: #a5560c; }
.vat-included { background: #e3f4ea; color: var(--ok); }
.vat-exempt { background: #eef1f2; color: var(--muted); }
.unknown { display: inline-block; font-size: .72rem; padding: .1rem .45rem; border-radius: 999px; background: #fff1de; color: #a5560c; white-space: nowrap; }
.edited { color: #a5560c; font-size: .8rem; margin-left: .2rem; cursor: help; }
details.edit-item { margin-top: .3rem; }
details.edit-item summary { cursor: pointer; font-size: .85rem; color: var(--muted); }
.edit-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .4rem .6rem; margin-top: .4rem; padding: .5rem; border: 1px solid #e3e6e8; border-radius: 6px; background: #fafbfb; }
.edit-form p, .edit-form > div { grid-column: 1 / -1; margin: 0; }
.edit-form label { display: flex; flex-direction: column; font-size: .78rem; gap: .15rem; }
.edit-form input, .edit-form select { font-size: .85rem; padding: .25rem .35rem; }
.market-switch { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.market-switch button { border: 0; background: #fff; padding: .35rem .7rem; cursor: pointer; font: inherit; font-size: .88rem; color: var(--muted); }
.market-switch button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.price-note { font-size: .72rem; color: var(--muted); }

/* vânzător, ștergere în masă, trimitere către alt utilizator */
.seller { margin: .25rem 0; }
.seller-badge { display: inline-block; font-size: .78rem; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.seller-badge.s-proprietar { background: #e8f6ee; border-color: #b7e2c6; color: #17623a; }
.seller-badge.s-agentie { background: #eef1fb; border-color: #c9d2f0; color: #34449a; }
.seller-badge.s-dezvoltator { background: #fff4e5; border-color: #f5d2a6; color: #8a4f0e; }
.list-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .4rem 0 .6rem; flex-wrap: wrap; }
.list-bar form { margin: 0; }
.share-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .6rem .9rem; margin-bottom: .6rem; border: 1px solid var(--brand); }
.share-bar label { display: flex; align-items: center; gap: .4rem; margin: 0; }
.share-bar select, .share-bar input { margin: 0; padding: .3rem .5rem; width: auto; }
.apts th.sel, .apts td.sel { width: 2rem; text-align: center; }
.apts tr.selected { background: var(--brand-soft); }
.badge { display: inline-block; min-width: 1.2rem; padding: 0 .35rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: .75rem; text-align: center; }
.flash.info { background: var(--brand-soft); border-color: #b9dadd; }
.card.share { margin-bottom: .8rem; } .card.share.pending { border-left: 4px solid var(--warn); }
.share-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.share-head .actions { display: flex; gap: .4rem; } .share-head form { margin: 0; }
.share-msg { font-style: italic; margin: .5rem 0; }
.share-items { margin: .5rem 0 0; padding-left: 1.1rem; font-size: .9rem; } .share-items li { margin-bottom: .25rem; }
.pill.partial { background: #fff1de; color: var(--warn); }
.job-info p { margin: .3rem 0; }
.simple.inner { margin-top: .4rem; } .jobs details summary { cursor: pointer; color: var(--brand); }

/* ajutor */
.help { max-width: 860px; }
.help .lead { font-size: 1.05rem; }
.help h2 { margin-top: 2rem; padding-top: .5rem; border-top: 1px solid var(--line); font-size: 1.3rem; }
.help h3 { margin-top: 1.4rem; font-size: 1.05rem; }
.help li { margin-bottom: .35rem; line-height: 1.5; }
.help code { background: var(--brand-soft); padding: 0 .3rem; border-radius: 4px; }
.help-toc ol { margin: .4rem 0 0; } .help-toc ol ol { margin-top: .2rem; font-size: .92rem; }
.faq { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .9rem; margin-bottom: .5rem; }
.faq summary { cursor: pointer; font-weight: 600; } .faq[open] summary { color: var(--brand); }
.faq p, .faq ul { margin: .5rem 0 .2rem; }
