/* ================= Agent console ================= */
body.is-admin { background: #F4F0E9; }
.adm { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.adm-side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px;
  padding: 24px 16px; background: #1C1A17; color: #D9D1C5;
}
.adm-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px; color: var(--paper); }
.adm-brand .logo { font-size: 22px; }
.adm-badge { font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: #BFB5A6; }
.adm-nav { display: grid; gap: 2px; }
.adm-nav a { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 12px; font-weight: 500; color: #B9AF9F; transition: all 0.2s; }
.adm-nav a svg { width: 18px; height: 18px; }
.adm-nav a:hover { color: var(--paper); background: rgba(255, 255, 255, 0.05); }
.adm-nav a.on { color: var(--ink); background: var(--paper); font-weight: 600; }
.adm-nav em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.adm-side-foot { margin-top: auto; display: grid; gap: 12px; }
.adm-public { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); font-size: 13px; color: #D9D1C5; }
.adm-public svg { width: 16px; height: 16px; }
.adm-public:hover { border-color: rgba(255,255,255,0.3); color: #fff; }
.adm-user { display: grid; grid-template-columns: 36px 1fr 36px; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); }
.adm-user b { display: block; color: var(--paper); font-size: 13px; }
.adm-user span { font-size: 11px; color: #9C9384; }
.adm-user .icon-btn { width: 32px; height: 32px; background: transparent; border-color: rgba(255,255,255,0.1); color: #BFB5A6; }
.adm-user .icon-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #B8956A, #8A6A3F); color: #fff; font-weight: 700; font-size: 12px; letter-spacing: 0.04em; flex: none; }
.avatar.sm { width: 32px; height: 32px; font-size: 11px; }

.adm-main { min-width: 0; padding: 28px 36px 60px; }
.adm-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 24px; }
.adm-top-l { min-width: 0; }
.adm-top h1 { font-size: 34px; line-height: 1.1; }
.adm-top-r { display: flex; gap: 8px; }
.adm-crumbs { display: flex; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.adm-crumbs a:hover { color: var(--ink); }
.adm-crumbs span { color: var(--sand-3); }

.card { background: #fff; border: 1px solid #ECE5DA; border-radius: 18px; padding: 22px; box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head h3 { font-size: 15px; font-weight: 700; }

.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 20px; background: #EAE3D8; border-radius: 14px; width: max-content; max-width: 100%; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; font-weight: 600; font-size: 13px; color: var(--muted); white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.tabs em { font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: rgba(28,26,23,0.07); }
.tab-body { display: grid; gap: 18px; }

/* KPIs */
.kpi-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.kpi { background: #fff; border: 1px solid #ECE5DA; border-radius: 18px; padding: 18px 20px; display: grid; gap: 4px; box-shadow: var(--shadow-sm); }
.kpi span { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi b { font-weight: 400; font-size: 32px; line-height: 1.1; }
.kpi small { font-size: 12px; color: var(--muted); }
.kpi-accent { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.kpi-accent span, .kpi-accent small { color: #B9AF9F; }
.kpi-row.compact .kpi { padding: 14px 18px; }
.kpi-row.compact .kpi b { font-size: 24px; }

.dash { display: grid; gap: 18px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; }
.dash-projects { display: grid; }
.dp-row { display: grid; grid-template-columns: 56px minmax(0, 1.1fr) minmax(0, 1.3fr) 70px; gap: 16px; align-items: center; padding: 12px 8px; border-radius: 12px; }
.dp-row + .dp-row { border-top: 1px solid #F1EBE1; }
.dp-row:hover { background: #FAF7F2; }
.dp-img { width: 56px; height: 44px; border-radius: 10px; overflow: hidden; background: #EFE9DF; }
.dp-img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.5); }
.dp-main { display: grid; min-width: 0; }
.dp-main span, .dp-bar span, .dp-val span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-bar { display: grid; gap: 6px; }
.dp-val { text-align: right; display: grid; }
.stack { display: flex; height: 8px; border-radius: 8px; overflow: hidden; background: #EFE9DF; gap: 2px; }
.stack i { display: block; height: 100%; }
.stack i:first-child { border-radius: 8px 0 0 8px; }
.stack i:last-child { border-radius: 0 8px 8px 0; }
.stack.sm { height: 5px; margin-top: 6px; }
.legend { display: flex; gap: 16px; margin-top: 14px; padding: 0 8px; font-size: 11px; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; }
.lead-list { display: grid; }
.lead-item { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; padding: 12px 6px; border-radius: 12px; }
.lead-item + .lead-item { border-top: 1px solid #F1EBE1; }
.lead-item:hover { background: #FAF7F2; }
.lead-item b { font-size: 13px; }
.lead-item span { display: block; font-size: 11.5px; color: var(--muted); }
.lead-item p { font-size: 12px; color: var(--ink-2); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lead-meta { display: grid; justify-items: end; align-content: start; gap: 6px; }
.lead-meta small { font-size: 11px; color: var(--faint); white-space: nowrap; }
.tips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.tip-step { display: flex; gap: 12px; }
.tip-step em { font-style: normal; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: #7A5B33; font-weight: 700; font-size: 12px; }
.tip-step b { display: block; font-size: 13px; }
.tip-step span { font-size: 12px; color: var(--muted); }

/* Projects grid */
.toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.pg-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #ECE5DA; border-radius: 18px; overflow: hidden; transition: all 0.25s var(--ease); box-shadow: var(--shadow-sm); text-align: left; }
.pg-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #D9CEBE; }
.pg-img { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(#EAE4DA, #F3EEE6); overflow: hidden; }
.pg-img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.25); transition: transform 0.6s var(--ease); }
.pg-card:hover .pg-img img { transform: scale(1.32); }
.pg-img .pill { position: absolute; left: 12px; top: 12px; }
.pg-img .pg-warn { left: auto; right: 12px; }
.pg-body { padding: 16px 18px 18px; display: grid; gap: 4px; }
.pg-body h3 { font-size: 22px; }
.pg-loc { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.pg-loc svg { width: 14px; height: 14px; }
.pg-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 12px; padding-top: 12px; border-top: 1px solid #F1EBE1; }
.pg-stats b { display: block; font-size: 15px; }
.pg-stats span { font-size: 11px; color: var(--muted); }
.pg-new { align-items: center; justify-content: center; gap: 8px; min-height: 300px; border-style: dashed; border-width: 1.5px; background: transparent; box-shadow: none; color: var(--muted); }
.pg-new svg { width: 28px; height: 28px; padding: 6px; border-radius: 50%; background: #fff; border: 1px solid var(--line); box-sizing: content-box; }
.pg-new b { color: var(--ink); font-size: 15px; }
.pg-new span { font-size: 12px; }
.pg-new:hover { background: #fff; color: var(--ink); }

/* Forms */
.edit-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.save-bar { grid-column: 1 / -1; position: sticky; bottom: 16px; display: flex; justify-content: flex-end; align-items: center; gap: 16px; padding: 12px 12px 12px 22px; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px); border: 1px solid #ECE5DA; border-radius: 16px; box-shadow: var(--shadow); z-index: 10; }
.save-bar .muted { margin-right: auto; font-size: 12px; }
.loc-map { height: 320px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.danger { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 18px; padding: 16px; border-radius: 14px; border: 1px solid rgba(180, 83, 63, 0.2); background: #FCF6F4; }
.danger b { display: block; font-size: 13px; }
.danger span { font-size: 12px; color: var(--muted); }
.fieldset { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 16px; margin: 0; }
.fieldset legend { padding: 0 6px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--ink); }
.notes { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--ink-2); line-height: 1.55; }

/* Buildings */
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.b-cards { display: grid; gap: 10px; }
.b-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) 90px auto; gap: 16px; align-items: center; padding: 14px; border: 1px solid #ECE5DA; border-radius: 14px; transition: all 0.2s; }
.b-card:hover { border-color: var(--ink-2); box-shadow: var(--shadow-sm); }
.b-code { width: 44px; height: 44px; border-radius: 12px; background: var(--sand); display: grid; place-items: center; font-size: 20px; }
.b-card:hover .b-code { background: var(--ink); color: var(--paper); }
.b-main { display: grid; min-width: 0; }
.b-main span { font-size: 12px; color: var(--muted); }
.b-num { text-align: right; }
.b-num b { display: block; font-size: 18px; }
.b-num span { font-size: 11px; color: var(--muted); }
.b-actions { display: flex; gap: 6px; align-items: center; }


/* Table */
.table-card { padding: 0; overflow: hidden; }
.table-tools { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #F1EBE1; flex-wrap: wrap; }
.table-tools .spacer { flex: 1; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; background: #FBF9F5; border-bottom: 1px solid #F1EBE1; white-space: nowrap; }
.table td { padding: 10px 16px; border-bottom: 1px solid #F4EFE7; vertical-align: middle; }
.table tbody tr:hover td { background: #FCFAF6; }
.table .r { text-align: right; }
.table .nowrap { white-space: nowrap; }
.table td.empty { text-align: center; padding: 48px; color: var(--muted); }
.table td.empty svg { width: 28px; height: 28px; }
.cell-input { width: 110px; height: 32px; border: 1px solid transparent; border-radius: 8px; background: transparent; text-align: right; padding: 0 8px; font-weight: 600; }
.cell-input:hover { border-color: var(--line); background: #fff; }
.cell-input:focus { outline: none; border-color: var(--ink-2); background: #fff; }
.status-select { appearance: none; height: 28px; padding: 0 26px 0 12px; border-radius: 999px; border: 0; font-size: 12px; font-weight: 700; cursor: pointer; background: #EEE url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
.s-available { background-color: #E3EFE5; color: #356B45; }
.s-reserved { background-color: #F6ECD5; color: #8D6A1F; }
.s-sold { background-color: #F3E1DC; color: #933F2E; }
.l-new { background-color: var(--ink); color: var(--paper); }
.l-contacted { background-color: #E4ECF2; color: #3D5A72; }
.l-closed { background-color: #EEE9E1; color: var(--muted); }
.mapped { font-size: 12px; color: var(--green); font-weight: 600; }
.mapped.none { color: var(--amber); }
.icon-btn.sm { width: 32px; height: 32px; border-color: transparent; background: transparent; }
.icon-btn.sm:hover { border-color: var(--line); background: #fff; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.contact { display: flex; gap: 12px; align-items: center; }
.contact b, .contact a, .contact span { display: block; }
.contact a, .contact span, .table .sub { font-size: 12px; color: var(--muted); }
.table .sub { display: block; }
.contact a:hover { color: var(--accent); }
.leads-table .msg { max-width: 340px; color: var(--ink-2); }

.apt-form { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; }
.fp-box { display: grid; gap: 10px; align-content: start; }
.fp-img { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 8px; }
.fp-img img { width: 100%; aspect-ratio: 880 / 700; object-fit: contain; }
.fp-actions { display: flex; gap: 8px; align-items: center; }
.apt-form-foot { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; }

.settings { display: grid; gap: 18px; max-width: 760px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; }
.setting-row + .setting-row { border-top: 1px solid #F1EBE1; }
.setting-row b { display: block; }
.setting-row span { font-size: 12px; color: var(--muted); }

/* ================= Polygon editor ================= */
.pe-card { padding: 0; overflow: hidden; }
.pe { display: grid; grid-template-columns: 132px minmax(0, 1fr) 300px; height: max(560px, calc(100vh - 300px)); }
.pe-views { display: grid; align-content: start; gap: 10px; padding: 14px; border-right: 1px solid #F1EBE1; background: #FBF9F5; overflow: auto; }
.pe-thumb { position: relative; display: grid; gap: 6px; padding: 6px; border-radius: 12px; border: 1px solid transparent; text-align: left; }
.pe-thumb:hover { background: #fff; border-color: var(--line); }
.pe-thumb.on { background: #fff; border-color: var(--ink); box-shadow: var(--shadow-sm); }
.pe-thumb-img { aspect-ratio: 16/10; border-radius: 8px; overflow: hidden; background: linear-gradient(#EAE4DA, #F3EEE6); }
.pe-thumb-img img { width: 100%; height: 100%; object-fit: cover; }
.pe-thumb-img.none { background: repeating-linear-gradient(45deg, #F1EBE1 0 6px, #F7F3EC 6px 12px); }
.pe-thumb-img.none img { display: none; }
.pe-thumb span { font-size: 11px; font-weight: 700; color: var(--ink-2); }
.pe-thumb em { position: absolute; top: 10px; right: 10px; font-style: normal; font-size: 10px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: var(--paper); display: grid; place-items: center; }
.pe-main { display: flex; flex-direction: column; min-width: 0; }
.pe-toolbar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-bottom: 1px solid #F1EBE1; }
.seg { display: inline-flex; padding: 3px; background: #F1EBE1; border-radius: 12px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 9px; font-size: 12px; font-weight: 700; color: var(--muted); }
.seg button svg { width: 15px; height: 15px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.pe-hint { flex: 1; font-size: 12px; color: var(--muted); min-width: 0; }
.pe-hint b { color: var(--ink); }
kbd { font-family: var(--sans); font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line); }
.pe-tools { display: flex; gap: 6px; }
.pe-canvas { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; background: linear-gradient(#EAE4DA, #F3EEE6 55%, #E9E1D4); }
.pe-frame { position: relative; user-select: none; touch-action: none; }
.pe-frame img { width: 100%; height: 100%; display: block; -webkit-user-drag: none; pointer-events: none; }
.pe-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pe-svg polygon { vector-effect: non-scaling-stroke; cursor: move; transition: fill 0.15s; }
.pe-svg polygon:hover { filter: brightness(1.15); }
.pe-frame.drawing, .pe-frame.drawing .pe-svg polygon { cursor: crosshair; }
.pe-draft { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 6 4; pointer-events: none; }
.pe-overlay { position: absolute; inset: 0; pointer-events: none; }
.pe-handle, .pe-dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,0.25); }
.pe-handle { pointer-events: auto; cursor: grab; }
.pe-handle:hover { transform: scale(1.3); }
.pe-dot.first { width: 16px; height: 16px; margin: -8px 0 0 -8px; background: var(--accent); border-color: #fff; }
.pe-tag { position: absolute; transform: translate(-50%, -50%); font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: rgba(28, 26, 23, 0.78); color: #fff; white-space: nowrap; }
.pe-tag.warn { background: var(--amber); }
.pe-tag.sel { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.pe-side { border-left: 1px solid #F1EBE1; display: flex; flex-direction: column; min-height: 0; }
.pe-side-sec { padding: 14px; display: flex; flex-direction: column; min-height: 0; gap: 10px; }
.pe-side-sec:first-child { flex: 1.2; border-bottom: 1px solid #F1EBE1; }
.pe-side-sec:last-child { flex: 1; }
.pe-side-title { display: flex; justify-content: space-between; align-items: center; }
.pe-side-title b { font-size: 13px; }
.pe-side-title span { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #F1EBE1; }
.pe-list, .pe-targets { overflow: auto; display: grid; gap: 6px; align-content: start; }
.pe-row { display: grid; grid-template-columns: 10px 1fr 32px; gap: 8px; align-items: center; padding: 6px 6px 6px 10px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }
.pe-row:hover { background: #FBF9F5; }
.pe-row.sel { border-color: var(--ink); background: #fff; }
.pe-row i { width: 10px; height: 10px; border-radius: 3px; }
.pe-row .select { width: 100%; }
.pe-row .icon-btn { width: 30px; height: 30px; border: 0; background: transparent; }
.pe-row .icon-btn:hover { color: var(--red); }
.pe-row .icon-btn svg { width: 15px; height: 15px; }
.pe-targets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pe-target { display: grid; grid-template-columns: 8px 1fr; column-gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); text-align: left; background: #fff; transition: all 0.15s; }
.pe-target i { width: 8px; height: 8px; border-radius: 50%; grid-row: span 2; }
.pe-target b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pe-target span { font-size: 10.5px; color: var(--muted); grid-column: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pe-target:hover { border-color: var(--ink-2); }
.pe-target.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pe-target.on span { color: #B9AF9F; }

.pe-toolbar.disabled .seg, .pe-toolbar.disabled .pe-tools, .pe-toolbar.disabled .pe-hint { opacity: 0.35; pointer-events: none; }
.pe-thumb-add { width: 100%; height: 100%; display: grid; place-items: center; color: var(--faint); background: repeating-linear-gradient(45deg, #F1EBE1 0 6px, #F7F3EC 6px 12px); }
.pe-thumb-add svg { width: 18px; height: 18px; }
.pe-thumb:hover .pe-thumb-add { color: var(--ink); }

/* empty view: drop zone */
.pe-drop {
  width: min(460px, calc(100% - 48px)); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 36px 28px 28px; border-radius: 20px; border: 1.5px dashed #CFC3B1; background: rgba(255, 255, 255, 0.55);
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.pe-drop:hover { border-color: var(--ink-2); background: rgba(255, 255, 255, 0.85); }
.pe-drop-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 8px; }
.pe-drop-ico svg { width: 24px; height: 24px; }
.pe-drop b { font-size: 16px; color: var(--ink); }
.pe-drop-text { font-size: 13px; color: var(--muted); }
.pe-drop-btn { margin-top: 12px; }
.pe-drop-extra { margin-top: 2px; }
.pe-drop small { margin-top: 10px; font-size: 11px; color: var(--faint); }
.pe-dropping { position: absolute; inset: 12px; z-index: 5; border-radius: 18px; border: 2px dashed var(--ink); background: rgba(251, 248, 243, 0.92); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; pointer-events: none; }
.pe-dropping svg { width: 28px; height: 28px; }
.pe-canvas.dragging .pe-dropping { display: flex; }

.pe-none { grid-column: 1 / -1; margin: 0; font-size: 12px; line-height: 1.55; color: var(--muted); padding: 10px 12px; border-radius: 10px; background: #FBF9F5; }
.pe-none b { color: var(--ink); font-weight: 700; }
.pe-new { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1.5px dashed #CFC3B1; text-align: left; transition: all 0.15s; }
.pe-new > svg { width: 30px; height: 30px; padding: 7px; border-radius: 9px; background: var(--ink); color: var(--paper); flex: none; }
.pe-new b { display: block; font-size: 13px; }
.pe-new small { display: block; font-size: 11px; color: var(--muted); }
.pe-new:hover { border-color: var(--ink); background: #FBF9F5; }
.pe-new.on { border-style: solid; border-color: var(--ink); background: var(--ink); color: var(--paper); }
.pe-new.on > svg { background: var(--accent); }
.pe-new.on small { color: #B9AF9F; }
.pe-side-title.sub { margin-top: 6px; }
.pe-side-title.sub b { font-size: 12px; color: var(--muted); font-weight: 600; }

.steps-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 16px 20px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step em { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--ink); color: var(--paper); font-weight: 700; font-size: 12px; }
.step b { display: block; font-size: 13px; }
.step span { font-size: 12px; color: var(--muted); }
.form-error { color: var(--red); font-size: 13px; font-weight: 600; }
.fp-note { font-size: 12px; }

/* missing images */
.noimg img { display: none; }
.noimg-ico { display: none; }
.noimg .noimg-ico { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); background: linear-gradient(#EAE4DA, #F3EEE6); }
.noimg .noimg-ico svg { width: 30px; height: 30px; }
.login-mark { display: none; color: rgba(251,248,243,0.85); width: 160px; height: 160px; }
.login-mark svg { width: 100%; height: 100%; }
.login-img.noimg .login-mark { display: block; }

/* ================= Login ================= */
.login { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; background: #F4F0E9; }
.login-art { position: relative; margin: 16px; border-radius: 28px; overflow: hidden; background: linear-gradient(160deg, #2A2622, #1C1A17); color: var(--paper); padding: 36px; display: flex; flex-direction: column; }
.login-img { flex: 1; display: grid; place-items: center; min-height: 0; }
.login-img img { width: 112%; max-width: none; filter: drop-shadow(0 40px 60px rgba(0,0,0,0.45)); opacity: 0.96; }
.login-quote h2 { font-size: clamp(26px, 2.6vw, 38px); line-height: 1.15; font-weight: 300; }
.login-quote p { color: #B9AF9F; margin-top: 12px; max-width: 460px; }
.login-form-wrap { display: grid; place-items: center; padding: 32px; }
.login-form { width: min(400px, 100%); display: grid; gap: 16px; }
.login-form h1 { font-size: 40px; margin-top: -6px; }
.login-form > .muted { margin-top: -10px; margin-bottom: 8px; }
.login-err { color: var(--red); font-size: 13px; font-weight: 600; }
.login-demo { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 12px; color: #6A5030; }
.login-demo svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.login-form .btn-quiet { justify-self: center; }

/* ================= Responsive ================= */
@media (max-width: 1280px) {
  .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pe { grid-template-columns: 110px minmax(0, 1fr) 250px; }
  .tips { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1080px) {
  .dash-grid, .edit-grid, .split, .apt-form { grid-template-columns: 1fr; }
  .pe { grid-template-columns: 1fr; height: auto; }
  .pe-views { grid-template-columns: repeat(4, 1fr); border-right: 0; border-bottom: 1px solid #F1EBE1; }
  .pe-canvas { height: 56vh; }
  .pe-side { border-left: 0; border-top: 1px solid #F1EBE1; max-height: 520px; }
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 300px; }
}
@media (max-width: 760px) {
  .adm { grid-template-columns: 1fr; }
  .adm-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; }
  .adm-nav { display: flex; overflow-x: auto; order: 3; width: 100%; }
  .adm-nav a span { display: none; }
  .adm-side-foot { margin: 0 0 0 auto; }
  .adm-public, .adm-user > div:nth-child(2) { display: none; }
  .adm-user { grid-template-columns: 36px 36px; padding: 0; background: none; }
  .adm-main { padding: 20px 16px 48px; }
  .adm-top { flex-direction: column; align-items: flex-start; }
  .adm-top h1 { font-size: 28px; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tips, .grid4 { grid-template-columns: repeat(2, 1fr); }
  .dp-row { grid-template-columns: 48px 1fr; }
  .dp-bar, .dp-val { grid-column: 2; text-align: left; }
  .b-card { grid-template-columns: 44px 1fr; }
  .b-num, .b-actions { grid-column: 2; text-align: left; }
    .toolbar .input-icon, .table-tools .input-icon { width: 100% !important; }
  .pe-toolbar { flex-wrap: wrap; }
  .pe-hint { order: 3; flex-basis: 100%; }
  .login-art { display: none; }
}

/* ================= Publishing ================= */
.pub { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.pub-status { display: grid; justify-items: end; gap: 2px; margin-right: 6px; }
.pub-status small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.pub-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; vertical-align: middle; }
.pub-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pub-draft { background: #EEE9E1; color: var(--muted); }
.pub-published { background: #E3EFE5; color: #356B45; }
.pub-published i { box-shadow: 0 0 0 3px rgba(78, 138, 94, 0.2); }
.pub-changed { background: #F6ECD5; color: #8D6A1F; }
.pg-img .pub-pill { position: absolute; left: 12px; top: 12px; }
.dp-main .pub-pill { height: 18px; font-size: 9.5px; padding: 0 7px; margin-left: 6px; }
@media (max-width: 760px) { .pub-status { justify-items: start; } .pub { justify-content: flex-start; flex-wrap: wrap; } }

/* apartment photo gallery (editor) */
.gal-edit { grid-column: 1 / -1; display: grid; gap: 10px; padding-top: 4px; border-top: 1px solid var(--line); padding-top: 18px; }
.gal-edit-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.gal-edit-head small { font-size: 12px; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; border-radius: 14px; transition: background 0.2s; }
.gal-grid.dropping { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: 4px; }
.gal-grid.busy { opacity: 0.6; pointer-events: none; }
.gal-tile { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: #EFE9DF; cursor: grab; border: 1px solid var(--line); }
.gal-tile:active { cursor: grabbing; }
.gal-tile img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.gal-cover { position: absolute; left: 6px; top: 6px; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--ink); color: var(--paper); }
.gal-rm { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(28, 26, 23, 0.7); color: #fff; opacity: 0; transition: opacity 0.15s; }
.gal-rm svg { width: 13px; height: 13px; }
.gal-tile:hover .gal-rm, .gal-rm:focus-visible { opacity: 1; }
@media (hover: none) { .gal-rm { opacity: 1; } }
.gal-add { aspect-ratio: 4 / 3; border-radius: 12px; border: 1.5px dashed #CFC3B1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; color: var(--muted); text-align: center; transition: all 0.15s; }
.gal-add svg { width: 20px; height: 20px; margin-bottom: 4px; }
.gal-add span { font-size: 12px; font-weight: 700; color: var(--ink); }
.gal-add small { font-size: 10.5px; }
.gal-add:hover { border-color: var(--ink-2); background: #fff; }

/* linked pricing */
.price-box { grid-column: 1 / -1; display: grid; gap: 10px; }
.price-calc { display: grid; grid-template-columns: 1fr auto 1fr auto 1.2fr; gap: 10px; align-items: end; }
.price-calc .op { height: 42px; display: grid; place-items: center; font-size: 18px; color: var(--muted); }
.input-unit { position: relative; }
.input-unit .input { padding-right: 38px; }
.input-unit i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 13px; color: var(--muted); pointer-events: none; }
.price-hint { font-size: 11.5px; }
.vat-check { padding: 12px 14px; }
.cell-input.sm { width: 84px; }
.vat-cell { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.vat-cell input { width: 15px; height: 15px; accent-color: var(--ink); }
@media (max-width: 560px) { .price-calc { grid-template-columns: 1fr; } .price-calc .op { display: none; } }

.steps-list { padding-left: 20px; margin-bottom: 8px; }
.steps-list code, .setting-row code { font-size: 12px; padding: 1px 6px; border-radius: 6px; background: #F1EBE1; }
.setting-warn { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 8px 0 4px; border-radius: 12px; background: #F6ECD5; color: #6A5030; font-size: 12.5px; }
.setting-warn svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
