/* VD Proposal — admin UI */
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, sans-serif; background: #f1f5f9; color: #0f172a; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Topbar */
.topbar { display: flex; align-items: center; justify-content: space-between;
  background: #0f172a; color: #fff; padding: 14px 28px; }
.brand { color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }

/* Proposal Director logó (jel + szókép, currentColor szókép) */
.pd-logo { display: inline-flex; align-items: center; gap: 10px; line-height: 1; }
.pd-mark { width: 34px; height: 34px; flex: 0 0 auto; }
.pd-word { font-weight: 800; font-size: 1.18rem; letter-spacing: -.02em; color: currentColor; white-space: nowrap; }
.pd-word2 { font-weight: 600; opacity: .8; margin-left: .32em; }
.nav-right { display: flex; align-items: center; gap: 16px; font-size: .9rem; }
.tenant { color: #cbd5e1; }
.logout { color: #94a3b8; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 24px 60px; }

/* Oldal-fejléc: cím balra, akciók jobbra */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 4px 0 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .ph-actions { display: flex; gap: 10px; align-items: center; }
.btn-new { background: #2563eb; color: #fff; border: 0; padding: 10px 18px; border-radius: 9px; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.btn-new:hover { background: #1d4ed8; }
.btn-new.secondary { background: #fff; color: #2563eb; border: 1px solid #bfdbfe; }
.btn-new.secondary:hover { background: #eff6ff; }

/* Eszköztár: kereső + szűrő a lista fölött */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .search { flex: 1; min-width: 200px; max-width: 380px; }
.toolbar select { width: auto; min-width: 150px; }
.toolbar .count { color: #94a3b8; font-size: .85rem; margin-left: auto; }

/* Lenyíló létrehozó-panel */
.collapse { margin-bottom: 20px; }
.collapse[hidden] { display: none; }

/* Üres-állapot a kártyában */
.empty-state { text-align: center; color: #94a3b8; padding: 30px 10px; }
tr.norow td { text-align: center; color: #94a3b8; padding: 22px; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: #e2e8f0; color: #475569; text-transform: capitalize; }
.badge-active, .badge-trialing, .badge-accepted { background: #dcfce7; color: #15803d; }
.badge-sent, .badge-viewed { background: #dbeafe; color: #1d4ed8; }
.badge-draft { background: #f1f5f9; color: #64748b; }
.badge-canceled, .badge-expired, .badge-past_due, .badge-rejected { background: #fee2e2; color: #b91c1c; }

/* Cards */
.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 22px 24px; margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(15,23,42,.04); }
.card h2 { margin: 0 0 16px; font-size: 1.05rem; color: #0f172a; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

/* Forms */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; font-size: .82rem; font-weight: 600; color: #475569; gap: 5px; }
input, textarea, select { font: inherit; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 9px; width: 100%; }
input:focus, textarea:focus { outline: 2px solid #2563eb; border-color: #2563eb; }
textarea { resize: vertical; font-family: inherit; }
.row-form { display: flex; gap: 10px; }
.row-form input { flex: 1; }
.hint { font-size: .78rem; color: #94a3b8; margin: 4px 0 0; }
.hint code, .public-link code, .mono { font-family: ui-monospace, "Cascadia Code", monospace; }

/* Buttons */
button { cursor: pointer; font: inherit; }
.btn-primary { background: #2563eb; color: #fff; border: 0; padding: 11px 20px; border-radius: 9px; font-weight: 600; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #0f172a; color: #fff; border: 0; padding: 10px 18px; border-radius: 9px; font-weight: 600; align-self: flex-start; }
.btn-send { background: #16a34a; color: #fff; border: 0; padding: 11px 20px; border-radius: 9px; font-weight: 700; }
.btn-send:hover { background: #15803d; }
.btn-sm { display: inline-block; padding: 6px 12px; border-radius: 7px; background: #eff6ff; font-size: .82rem; font-weight: 600; }
.btn-sm.ghost { background: #f1f5f9; color: #475569; }
.btn-del { background: #fee2e2; color: #b91c1c; border: 0; width: 28px; height: 28px; border-radius: 7px; font-weight: 700; }

/* Tables */
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: #94a3b8; padding: 8px 10px; border-bottom: 2px solid #e2e8f0; }
table.list td { padding: 12px 10px; border-bottom: 1px solid #f1f5f9; }
table.list .r { text-align: right; }
table.list tfoot td { border: 0; padding: 6px 10px; color: #475569; }
table.list tfoot .total td { font-weight: 800; font-size: 1.1rem; color: #0f172a; border-top: 2px solid #e2e8f0; }
.empty { color: #94a3b8; }

.sub-card .sub-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #f1f5f9; font-size: .92rem; }
.sub-row span { color: #64748b; }

/* Proposal head */
.back { display: inline-block; margin-bottom: 14px; color: #64748b; }
.phead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 6px; }
.phead h1 { margin: 4px 0 8px; font-size: 1.6rem; }
.doc-kind { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #2563eb; background: #eff6ff; padding: 2px 8px; border-radius: 6px; margin-right: 8px; }
.doc-kind.contract { color: #7c3aed; background: #f3e8ff; }
.phead-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.phead-actions form { margin: 0; }
.phead-actions .btn-sm, .phead-actions .btn-send { white-space: nowrap; }

/* Havi kimutatás-grafikon (dashboard) */
.chart-card .bars { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding: 8px 4px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; }
.chart-bar { width: 100%; max-width: 48px; background: linear-gradient(180deg, #3b82f6, #2563eb); border-radius: 8px 8px 0 0; min-height: 3px; transition: height .3s; }
.chart-bar.empty { background: #e2e8f0; }
.chart-val { font-size: .72rem; font-weight: 700; color: #0f172a; white-space: nowrap; }
.chart-lbl { font-size: .72rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .3px; }
.public-link { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 9px; padding: 10px 14px; margin-bottom: 12px; font-size: .85rem; color: #475569; word-break: break-all; }
.status-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-bottom: 16px; }
.status-form { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .85rem; color: #475569; }
.status-form select { padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 8px; }
.link-note { font-size: .85rem; color: #475569; }
.accepted-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 14px 18px; margin-bottom: 20px; color: #15803d; }
.accepted-cta form { margin: 0; }
.item-form { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.item-form input { flex: 1; min-width: 90px; }
.item-form input.narrow { flex: 0 0 80px; }

/* Auth */
.auth-card { max-width: 400px; margin: 8vh auto; background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 36px 32px; box-shadow: 0 10px 40px rgba(15,23,42,.08); }
.auth-logo { text-align: center; font-size: 1.6rem; font-weight: 800; margin: 0 0 4px; }
.auth-logo .pd-logo { justify-content: center; }
.auth-logo .pd-mark { width: 42px; height: 42px; }
.auth-logo .pd-word { font-size: 1.55rem; }
.auth-sub { text-align: center; color: #64748b; margin: 0 0 24px; }
.auth-card .btn-primary { width: 100%; margin-top: 6px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: .9rem; color: #64748b; }
.alert { background: #fee2e2; color: #b91c1c; padding: 10px 14px; border-radius: 9px; margin-bottom: 16px; font-size: .88rem; }
.alert.ok { background: #dcfce7; color: #15803d; }

/* Nav links */
.navlink { color: #cbd5e1; font-weight: 600; padding: 4px 2px; border-bottom: 2px solid transparent; }
.navlink:hover { color: #fff; text-decoration: none; }
.navlink.active { color: #fff; border-bottom-color: #38bdf8; }

/* Helpers */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mt { margin-top: 12px; }
.nowrap { white-space: nowrap; }
.muted-p { color: #64748b; margin: 0 0 18px; }
h1 { font-size: 1.7rem; margin: 4px 0 6px; }

/* Analytics */
.stats { display: flex; gap: 28px; margin-bottom: 14px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat span { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: #94a3b8; }
.stat strong { font-size: 1.15rem; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: .85rem; color: #64748b; }
.timeline li { padding: 5px 0; border-bottom: 1px solid #f1f5f9; }
.ev { display: inline-block; min-width: 74px; padding: 2px 8px; border-radius: 6px; font-size: .72rem; font-weight: 700; text-transform: uppercase; background: #e2e8f0; color: #475569; margin-right: 8px; }
.ev-opened { background: #dbeafe; color: #1d4ed8; } .ev-accepted { background: #dcfce7; color: #15803d; }
.ev-sent { background: #ede9fe; color: #6d28d9; } .ev-created { background: #f1f5f9; color: #64748b; }

/* Blocks */
.block-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #f1f5f9; }
.block-type { font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; font-weight: 700; }
.block-ctl { display: flex; gap: 6px; }
.block-ctl form { margin: 0; }
.btn-icon { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 7px; padding: 5px 9px; font-size: .8rem; color: #475569; }
.btn-icon:hover { background: #e2e8f0; }
.group { margin-bottom: 18px; padding: 14px; background: #f8fafc; border-radius: 10px; }
.group-head { display: flex; justify-content: space-between; align-items: center; }
.group-head h3 { margin: 0 0 8px; font-size: .98rem; color: #0f172a; }

/* Edit table inputs */
table.list.edit td { padding: 6px 6px; }
table.list.edit input { padding: 7px 8px; }
.w60 { width: 60px; } .w70 { width: 78px; } .w110 { width: 110px; }
td.opts { font-size: .72rem; }
td.opts label { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; color: #64748b; cursor: pointer; }
td.opts input[type=checkbox] { width: 14px; height: 14px; }

.item-form select.prod-pick { flex: 0 0 150px; }

/* Tétel-szerkesztő (egysoros, reszponzív — a név zsugorodik, a számmezők kompaktak) */
.item-edit, .item-add { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.item-add { background: #f8fafc; border-style: dashed; }
.ie-line { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.ie-name { flex: 0 1 240px; min-width: 150px; font-weight: 600; }
.ie-f { display: flex; flex-direction: column; gap: 3px; }
.ie-f span { font-size: .66rem; text-transform: uppercase; letter-spacing: .3px; color: #94a3b8; font-weight: 600; white-space: nowrap; }
.ie-f input { width: 130px; }
.ie-f.sm input { width: 78px; }
.ie-f.net { min-width: 100px; align-items: flex-end; }
.ie-f.net strong { font-size: 1rem; padding: 8px 0; white-space: nowrap; }
.ie-desc { width: 100%; margin: 10px 0 0; resize: none; overflow: hidden; min-height: 40px; font-size: .9rem; color: #475569; line-height: 1.5; }
.ie-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 8px; }
.ie-opts .kedv { display: flex; align-items: center; gap: 6px; font-size: .7rem; text-transform: uppercase; color: #94a3b8; font-weight: 600; }
.ie-opts .kedv input { width: 64px; }
.ie-opts .chk { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: #475569; cursor: pointer; }
.ie-opts .chk input { width: 16px; height: 16px; }
.del-inline { display: inline-block; margin: 0 0 0 6px; vertical-align: middle; }
.btn-secondary.sm, .btn-primary.sm { padding: 9px 14px; font-size: .85rem; }
.prod-pick { padding: 9px 10px; border: 1px solid #cbd5e1; border-radius: 9px; flex: 0 0 120px; }
.qtitle { display: flex; gap: 8px; margin-bottom: 14px; }
.qtitle input { flex: 1; font-weight: 600; }
.grp-rename { display: flex; gap: 6px; align-items: center; margin: 0; flex: 1; }
.grp-rename input { font-weight: 700; font-size: .98rem; border: 1px solid transparent; background: transparent; padding: 4px 6px; border-radius: 6px; color: #0f172a; }
.grp-rename input:hover, .grp-rename input:focus { border-color: #cbd5e1; background: #fff; }
.totals-bar { display: flex; gap: 24px; justify-content: flex-end; padding-top: 12px; border-top: 2px solid #e2e8f0; margin-top: 12px; color: #475569; }
.totals-bar .grand strong { font-size: 1.15rem; color: #0f172a; }
.rtotals { display: flex; flex-wrap: wrap; gap: 14px; justify-content: flex-end; margin-top: 16px; }
.rtotal-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px 18px; min-width: 210px; }
.rtotal-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: #94a3b8; font-weight: 700; margin-bottom: 8px; }
.rtotal-row { display: flex; justify-content: space-between; gap: 20px; padding: 3px 0; color: #475569; font-size: .9rem; }
.rtotal-row.grand { font-weight: 800; color: #0f172a; border-top: 1px solid #e2e8f0; margin-top: 6px; padding-top: 8px; font-size: 1.05rem; }
.ie-f select { padding: 8px 6px; border: 1px solid #cbd5e1; border-radius: 8px; }
.ie-opts .kedv select { padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 8px; font-weight: 400; }

/* Rich text */
.rt-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.rt-toolbar button { background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 6px; padding: 4px 10px; }
.rt-toolbar button:hover { background: #e2e8f0; }
.rt-edit { min-height: 90px; border: 1px solid #cbd5e1; border-radius: 9px; padding: 10px 12px; background: #fff; }
.rt-edit:focus { outline: 2px solid #2563eb; }
.rt-edit:empty::before { content: attr(data-ph); color: #94a3b8; }
.rt-edit { overflow-wrap: break-word; word-break: break-word; }
.rt-edit a { color: #2563eb; }
.rt-edit * { max-width: 100%; }
/* Paraméter-chip (merge-mező) — nem szerkeszthető atom, hogy ne lehessen elrontani */
.ph { display: inline-block; background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe;
  border-radius: 6px; padding: 0 6px; font-size: .9em; font-weight: 600; line-height: 1.5;
  white-space: nowrap; user-select: none; }
.rt-pbtn { font-weight: 600; }
/* Paraméter-menü (a Paraméterek gomb alatt) */
.rt-params { position: absolute; z-index: 1200; width: 270px; max-height: 60vh; overflow-y: auto;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 12px 32px -10px rgba(15,23,42,.25);
  padding: 6px; }
.rt-pcat { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: #64748b; padding: 10px 10px 4px; }
.rt-pitem { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 7px;
  padding: 7px 10px; font-size: .92rem; color: #0f172a; cursor: pointer; }
.rt-pitem:hover { background: #eff6ff; color: #1d4ed8; }
/* Pasztált (Word/külső) negatív margók és behúzások semlegesítése — ne lógjon ki a keretből */
.rt-edit p, .rt-edit li, .rt-edit div, .rt-edit ul, .rt-edit ol, .rt-edit h1, .rt-edit h2, .rt-edit h3, .rt-edit h4 {
  margin-left: 0 !important; margin-right: 0 !important; text-indent: 0 !important;
}
.rt-edit ul, .rt-edit ol { padding-left: 24px; margin: 6px 0; }
.rt-edit mark { background: #fde68a; }
.hi-ico { background: #fde68a; border-radius: 3px; padding: 0 4px; font-weight: 700; }
/* Betűszín-gomb + paletta */
.rt-cbtn { font-weight: 700; }
.rt-cA { border-bottom: 3px solid #e11d48; padding-bottom: 1px; }
.rt-palette { position: absolute; z-index: 80; background: #fff; border: 1px solid #cbd5e1; border-radius: 12px; box-shadow: 0 12px 34px rgba(15,23,42,.18); padding: 12px; }
.rt-palette[hidden] { display: none; }
.rt-sw-grid { display: grid; grid-template-columns: repeat(6, 24px); gap: 7px; }
.rt-sw { width: 24px; height: 24px; border-radius: 6px; border: 1px solid rgba(15,23,42,.12); cursor: pointer; padding: 0; }
.rt-sw:hover { transform: scale(1.12); }
.rt-more { margin-top: 10px; width: 100%; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 8px; padding: 7px; cursor: pointer; font-size: .82rem; color: #475569; }
.rt-more:hover { background: #e2e8f0; }

/* Tétel-leírás rich-szerkesztő */
.ie-desc-wrap { margin: 12px 0 0; }
.ie-desc-h { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .3px; color: #94a3b8; font-weight: 600; margin-bottom: 6px; }
.rt-mini { margin-bottom: 5px; }
.rt-mini button { padding: 3px 8px; font-size: .82rem; }
.ie-desc-edit { min-height: 44px; font-size: .92rem; color: #334155; line-height: 1.5; }
.ie-desc-edit:empty::before { content: attr(data-ph); color: #94a3b8; }

/* Tétel olvasó-mód (alapból ez látszik, ✎-vel szerkesztheted) */
.item-read .ir-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ir-name { flex: 1; min-width: 180px; font-weight: 600; color: #0f172a; font-size: 1rem; }
.ir-tag { display: inline-block; margin-left: 8px; font-size: .64rem; text-transform: uppercase; letter-spacing: .4px; padding: 1px 7px; border-radius: 999px; font-weight: 700; vertical-align: middle; }
.ir-tag.opt { background: #eff6ff; color: #2563eb; }
.ir-tag.cyc { background: #f3e8ff; color: #7c3aed; }
.ir-vals { display: flex; gap: 22px; }
.ir-vals span { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; white-space: nowrap; }
.ir-vals b { font-weight: 700; color: #0f172a; font-size: .95rem; }
.ir-vals i { font-style: normal; font-size: .62rem; text-transform: uppercase; letter-spacing: .4px; color: #94a3b8; }
.ir-vals .net b { color: #2563eb; }
.ir-edit { white-space: nowrap; cursor: pointer; }
.ir-desc { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e2e8f0; color: #475569; font-size: .92rem; line-height: 1.55; }
.ir-desc p { margin: 0 0 8px; } .ir-desc p:last-child { margin-bottom: 0; }
.ir-desc ul, .ir-desc ol { padding-left: 22px; margin: 6px 0; }
.ir-desc a { color: #2563eb; text-decoration: underline; }
.ir-desc mark { background: #fde68a; padding: 0 2px; border-radius: 2px; }
.ir-desc strong { color: #0f172a; }
.rt-sep { width: 1px; height: 22px; background: #cbd5e1; margin: 0 4px; }
.rt-edit .content-columns { display: grid; gap: 16px; margin: 10px 0; }
.rt-edit .content-columns[data-layout="1-1"] { grid-template-columns: 1fr 1fr; }
.rt-edit .content-columns[data-layout="2-1"] { grid-template-columns: 2fr 1fr; }
.rt-edit .content-columns[data-layout="1-2"] { grid-template-columns: 1fr 2fr; }
.rt-edit .content-columns[data-layout="1-1-1"] { grid-template-columns: 1fr 1fr 1fr; }
.rt-edit .content-column { border: 1px dashed #cbd5e1; border-radius: 6px; padding: 6px 8px; }
.snippet { color: #64748b; font-size: .85rem; }

.signed-info { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 9px; padding: 10px 14px; font-size: .88rem; color: #15803d; }
.signed-info code { background: #dcfce7; padding: 1px 6px; border-radius: 5px; font-size: .8rem; }
.add-block-btns { display: flex; gap: 10px; }
.add-block-btns form { margin: 0; }
.logo-prev { max-height: 60px; max-width: 200px; margin-top: 10px; display: block; }

/* KPI statisztika */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 720px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(15,23,42,.04); }
.kpi span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: #94a3b8; margin-bottom: 6px; }
.kpi strong { font-size: clamp(1.1rem, 1.7vw, 1.5rem); color: #0f172a; white-space: nowrap; }
.kpi.green strong { color: #15803d; }
.expiring h2 { color: #b45309; }
.rowlink { cursor: pointer; }
.rowlink:hover td { background: #f8fafc; }

/* Droposal-szerű lista: fülek + dátum/visszaszámláló-chip + felelős-avatar */
.ltabs { display: flex; gap: 2px; border-bottom: 2px solid #e2e8f0; margin-bottom: 14px; flex-wrap: wrap; }
.ltab { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -2px; padding: 9px 16px; font-weight: 600; color: #64748b; cursor: pointer; font-size: .9rem; }
.ltab:hover { color: #0f172a; }
.ltab.active { color: #2563eb; border-bottom-color: #2563eb; }
.dlist td { vertical-align: middle; }
.dlist .c-date { display: flex; align-items: center; gap: 9px; }
.lchip { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 10px; background: #f1f5f9; line-height: 1; flex: 0 0 auto; }
.lc-m { font-size: .6rem; text-transform: uppercase; color: #94a3b8; font-weight: 700; letter-spacing: .3px; }
.lc-d { font-size: 1.15rem; font-weight: 800; color: #0f172a; margin-top: 2px; }
.lcount { font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.lcount.g, .lcount.ok { background: #dcfce7; color: #15803d; }
.lcount.y { background: #fef9c3; color: #a16207; }
.lcount.r { background: #fee2e2; color: #b91c1c; }
.dl-name { font-weight: 600; color: #0f172a; }
.dl-sub { font-size: .76rem; color: #94a3b8; margin-top: 2px; }
.lavatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: #2563eb; color: #fff; font-size: .78rem; font-weight: 700; }
.muted { color: #cbd5e1; }

/* ---- Mobil (≤640px) ---- */
@media (max-width: 640px) {
  .wrap { padding: 18px 14px 50px; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; gap: 8px 12px; }
  .nav-right { width: 100%; flex-wrap: wrap; gap: 8px 14px; font-size: .85rem; }
  .two-col, .addr-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .toolbar .search { max-width: none; }
  .toolbar .count { margin-left: 0; }

  /* Általános listák: ne törjék szét az oldalt — vízszintes görgetés */
  table.list:not(.dlist) { display: block; overflow-x: auto; white-space: nowrap; }

  /* Ajánlat/szerződés lista: kártyásra bontva */
  .dlist thead { display: none; }
  .dlist tbody tr { display: block; padding: 14px 2px; border-bottom: 1px solid #eef2f7; }
  .dlist td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  .dlist td.c-date { justify-content: flex-start; gap: 8px; margin-bottom: 4px; }
  .dlist td:nth-child(2) { display: block; text-align: left; margin-bottom: 6px; }
  .dlist td:nth-child(3)::before { content: 'Ügyfél'; color: #94a3b8; font-weight: 600; }
  .dlist td:nth-child(4)::before { content: 'Felelős'; color: #94a3b8; font-weight: 600; }
  .dlist td:nth-child(5)::before { content: 'Összeg'; color: #94a3b8; font-weight: 600; }
  .dlist td:nth-child(6)::before { content: 'Státusz'; color: #94a3b8; font-weight: 600; }
  .dlist td:nth-child(7) { justify-content: flex-end; padding-top: 10px; }

  /* Tétel olvasó-mód: az ár-oszlopok törjenek tördelve */
  .item-read .ir-head { gap: 8px; }
  .ir-vals { flex-wrap: wrap; gap: 6px 16px; }

  /* Tétel-szerkesztő: a mezők egymás alá */
  .ie-name { flex: 1 1 100%; }
  .ie-f input, .ie-f.sm input { width: 100%; }
}
.statusbars { display: flex; flex-direction: column; gap: 10px; }
.sbar-row { display: flex; align-items: center; gap: 12px; }
.sbar-label { flex: 0 0 120px; }
.sbar-track { flex: 1; height: 10px; background: #f1f5f9; border-radius: 6px; overflow: hidden; }
.sbar-fill { height: 100%; background: #2563eb; border-radius: 6px; min-width: 2px; }
.sbar-count { flex: 0 0 32px; text-align: right; font-weight: 700; color: #0f172a; }
.expiring-list { list-style: none; padding: 0; margin: 0; }
.expiring-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.expiring-list .days { color: #b45309; font-size: .85rem; font-weight: 600; }

/* Cég-lekérdezés (VIES) */
.lookup-row { display: flex; gap: 8px; margin-top: 5px; }
.lookup-row input { flex: 1; }
.btn-lookup { white-space: nowrap; background: #0f172a; color: #fff; border: 0; border-radius: 9px; padding: 0 14px; font-weight: 600; cursor: pointer; font-size: .85rem; }
.btn-lookup:hover { background: #1e293b; }
.lookup-msg { display: block; font-size: .8rem; margin: 6px 0 2px; min-height: 1em; color: #64748b; }
.lookup-msg.ok { color: #15803d; } .lookup-msg.err { color: #b91c1c; }
.addr-grid { display: grid; grid-template-columns: 120px 1fr; gap: 12px; }

/* Brand szín-vezérlő: swatch + hex + gyors-paletta */
.bcolor { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.bcolor-pick { width: 48px; height: 40px; padding: 0; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; cursor: pointer; flex: 0 0 auto; }
.bcolor-pick::-webkit-color-swatch-wrapper { padding: 4px; }
.bcolor-pick::-webkit-color-swatch { border: none; border-radius: 6px; }
.bcolor-pick::-moz-color-swatch { border: none; border-radius: 6px; }
.bcolor-hex { flex: 1; font-family: ui-monospace, "Cascadia Code", monospace; text-transform: lowercase; }
.bcolor-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.bcp { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(15,23,42,.12); cursor: pointer; padding: 0; transition: transform .08s; }
.bcp:hover { transform: scale(1.15); }

/* Ügyfél-választó + CRM */
.current-client { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 9px; padding: 8px 12px; font-size: .9rem; color: #075985; margin: 0 0 14px; }
select { font: inherit; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 9px; width: 100%; background: #fff; }
.btn-link { background: none; border: none; color: #2563eb; font-weight: 600; cursor: pointer; padding: 8px 0; font-size: .9rem; }
.btn-link:hover { text-decoration: underline; }
.newclient { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 14px; margin-top: 8px; }
.client-card .client-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.client-meta { color: #64748b; font-size: .85rem; margin-top: 4px; }
.contacts-h { font-size: .95rem; color: #475569; margin: 16px 0 8px; }
.contact-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.contact-add input { flex: 1; min-width: 120px; }
.contact-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid #f1f5f9; }
.contact-edit { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; margin: 0; }
.contact-edit input { flex: 1; min-width: 110px; }
.contact-row .del-inline { display: inline-block; margin: 0 0 0 6px; vertical-align: middle; }

/* Ügyfél-lista kártyák */
.client-list { display: flex; flex-direction: column; gap: 8px; }
.client-tile { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 12px; text-decoration: none; color: inherit; transition: background .1s, border-color .1s; }
.client-tile:hover { background: #f8fafc; border-color: #cbd5e1; text-decoration: none; }
.ct-avatar, .dh-avatar { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; background: #0f172a; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; text-transform: uppercase; }
.ct-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ct-body strong { color: #0f172a; }
.ct-meta { font-size: .82rem; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-counts { font-size: .78rem; color: #64748b; margin-top: 2px; }
.ct-arrow { color: #cbd5e1; font-size: 1.2rem; }

/* Részletoldal fejléc + fülek */
.detail-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.dh-avatar { width: 56px; height: 56px; font-size: 1.4rem; }
.detail-head h1 { margin: 0; }
.dh-sub { color: #64748b; font-size: .9rem; }
.dh-del { margin-left: auto; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid #e2e8f0; margin-bottom: 20px; flex-wrap: wrap; }
.tab { background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; padding: 10px 16px; cursor: pointer; font-weight: 600; color: #64748b; font-size: .92rem; }
.tab.active { color: #2563eb; border-bottom-color: #2563eb; }
.note-form { display: flex; gap: 8px; margin-bottom: 16px; }
.note-form input { flex: 1; }
.tl-meta { font-size: .76rem; color: #94a3b8; margin: 2px 0 0 82px; }
.ev-note { background: #fef3c7; color: #b45309; }
