/* Lotes & Mapa — front-end lot manager ([lotes_gestion]).
 * Everything is scoped under .lm-mgr. Elementor / theme reset.css styles buttons and inputs
 * globally at equal specificity, so interactive controls use !important on the properties that
 * matter (see learnings: same pattern as the public filter/contact buttons). */

.lm-mgr {
	--lmm-blue:   #255699;
	--lmm-gold:   #CD9A4D;
	--lmm-cream:  #FFF9EA;
	--lmm-ink:    #3D351F;
	--lmm-muted:  #7A6F55;
	--lmm-line:   #EADFC6;
	--lmm-line-2: #E3D6B8;
	--lmm-tint:   #F6EEDB;
	--lmm-ok:     #15803d;
	--lmm-err:    #b42318;
	--lmm-sticky-top: 0px;
	/* --lmm-disp / --lmm-res / --lmm-ven are injected from Settings → status colors. */
	color: var(--lmm-ink);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	box-sizing: border-box;
}
.lm-mgr *, .lm-mgr *::before, .lm-mgr *::after { box-sizing: border-box; }
.admin-bar .lm-mgr { --lmm-sticky-top: 32px; }
@media (max-width: 782px) { .admin-bar .lm-mgr { --lmm-sticky-top: 46px; } }

.lm-mgr button,
.lm-mgr input,
.lm-mgr textarea {
	font-family: inherit !important;
	letter-spacing: normal !important;
	text-transform: none !important;
}
.lm-mgr [hidden] { display: none !important; }

/* ---------- App shell ---------- */
.lm-mgr-app { max-width: 1120px; margin: 0 auto; padding: 8px 0 48px; }

.lm-mgr-head {
	display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
	flex-wrap: wrap; padding: 0 0 16px;
}
.lm-mgr .lm-mgr-title { margin: 0 !important; font-size: 26px !important; font-weight: 500 !important; color: var(--lmm-blue) !important; line-height: 1.2 !important; }
.lm-mgr-summary { margin: 4px 0 0; font-size: 13px; color: var(--lmm-muted); }
.lm-mgr-summary b { font-weight: 600; color: var(--lmm-ink); }
.lm-mgr-user { display: flex; gap: 14px; align-items: center; font-size: 13px; color: var(--lmm-muted); }
.lm-mgr-user a { color: var(--lmm-blue) !important; text-decoration: none !important; }
.lm-mgr-user a:hover { text-decoration: underline !important; }

/* ---------- Toolbar (sticky) ---------- */
.lm-mgr-toolbar {
	position: sticky; top: var(--lmm-sticky-top); z-index: 20;
	background: var(--lmm-cream);
	border: 1px solid var(--lmm-line);
	border-radius: 14px;
	padding: 12px;
	display: grid; gap: 10px;
	grid-template-columns: minmax(220px, 1fr) auto;
	grid-template-areas: "search status" "manz manz";
	margin-bottom: 18px;
}
.lm-mgr-search {
	grid-area: search;
	display: flex; align-items: center; gap: 8px;
	background: #fff; border: 1px solid var(--lmm-line-2); border-radius: 10px;
	padding: 0 12px; height: 40px; color: var(--lmm-muted);
}
.lm-mgr-search:focus-within { border-color: var(--lmm-blue); box-shadow: 0 0 0 3px rgba(37, 86, 153, .12); }
.lm-mgr .lm-mgr-search input {
	flex: 1; min-width: 0; height: 38px !important; border: 0 !important; outline: 0 !important;
	background: transparent !important; box-shadow: none !important; padding: 0 !important;
	font-size: 15px !important; color: var(--lmm-ink) !important;
}
.lm-mgr-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.lm-mgr-chips[data-statuses] { grid-area: status; justify-content: flex-end; }
.lm-mgr-chips[data-manzanas] { grid-area: manz; }

.lm-mgr .lm-mgr-chip {
	display: inline-flex !important; align-items: center !important; gap: 6px !important;
	height: 32px !important; padding: 0 12px !important; margin: 0 !important;
	border-radius: 999px !important;
	border: 1px solid var(--lmm-line-2) !important;
	background: #fff !important; color: var(--lmm-muted) !important;
	font-size: 13px !important; font-weight: 400 !important; line-height: 1 !important;
	cursor: pointer; box-shadow: none !important; white-space: nowrap;
	transition: background .15s, color .15s, border-color .15s;
}
.lm-mgr .lm-mgr-chip:hover { border-color: var(--lmm-gold) !important; color: var(--lmm-ink) !important; }
.lm-mgr .lm-mgr-chip.is-on { background: var(--lmm-blue) !important; border-color: var(--lmm-blue) !important; color: #fff !important; }
.lm-mgr .lm-mgr-chip .n { font-size: 12px; opacity: .75; }
/* Expand / collapse all — quiet text button on its own line above the groups. */
.lm-mgr-groupbar { display: flex; justify-content: flex-end; height: 28px; margin: -10px 0 2px; }
.lm-mgr .lm-mgr-toggle-all {
	display: inline-flex !important; align-items: center !important; gap: 5px !important;
	margin: 0 !important; padding: 0 2px !important; height: 28px !important;
	background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
	color: var(--lmm-blue) !important; font-size: 13px !important; font-weight: 400 !important; line-height: 1 !important;
	cursor: pointer; white-space: nowrap;
}
.lm-mgr .lm-mgr-toggle-all:hover { text-decoration: underline !important; }
.lm-mgr .lm-mgr-toggle-all:focus-visible { outline: 2px solid var(--lmm-blue) !important; outline-offset: 2px !important; }

.lm-mgr-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }

@media (max-width: 720px) {
	.lm-mgr-toolbar { grid-template-columns: 1fr; grid-template-areas: "search" "manz" "status"; }
	.lm-mgr-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; }
	.lm-mgr-chips::-webkit-scrollbar { display: none; }
	.lm-mgr-chips[data-statuses] { justify-content: flex-start; }
}

/* ---------- Manzana groups ---------- */
.lm-mgr-group { margin-bottom: 18px; }
.lm-mgr .lm-mgr-ghead {
	display: flex !important; width: 100% !important; align-items: center !important; justify-content: space-between !important;
	gap: 12px; padding: 8px 2px !important; margin: 0 0 8px !important;
	background: transparent !important; border: 0 !important; border-bottom: 1px solid var(--lmm-line) !important;
	border-radius: 0 !important; box-shadow: none !important; cursor: pointer;
	color: var(--lmm-ink) !important; text-align: left;
}
.lm-mgr-ghead-title { font-size: 17px; font-weight: 500; color: var(--lmm-blue); }
.lm-mgr-ghead-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--lmm-muted); }
.lm-mgr-ghead-meta span { display: inline-flex; align-items: center; gap: 5px; }
.lm-mgr-chev { transition: transform .2s; }
.lm-mgr-group.is-collapsed .lm-mgr-chev { transform: rotate(-90deg); }
.lm-mgr-group.is-collapsed .lm-mgr-grid { display: none; }

.lm-mgr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }

/* ---------- Card ---------- */
.lm-mgr-card {
	background: #fff; border: 1px solid var(--lmm-line); border-radius: 12px;
	padding: 12px 12px 10px;
	transition: border-color .15s, box-shadow .15s;
}
.lm-mgr-card:hover { border-color: var(--lmm-line-2); box-shadow: 0 2px 8px rgba(61, 53, 31, .06); }
.lm-mgr-card.is-open { border-color: var(--lmm-gold); box-shadow: 0 0 0 2px rgba(205, 154, 77, .25); }
.lm-mgr-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.lm-mgr-num { font-size: 17px; font-weight: 600; color: var(--lmm-blue); }
.lm-mgr-facts { font-size: 12px; color: var(--lmm-muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm-mgr-facts .noprice { font-style: italic; }

/* Fixed-height slot: status control and inline confirm swap here without moving anything. */
.lm-mgr-slot { height: 34px; }

.lm-mgr-seg { display: flex; height: 34px; border: 1px solid var(--lmm-line-2); border-radius: 9px; overflow: hidden; background: #fff; }
.lm-mgr .lm-mgr-seg button {
	flex: 1 1 0 !important; min-width: 0 !important;
	display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 5px !important;
	height: 32px !important; margin: 0 !important; padding: 0 4px !important;
	border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
	background: transparent !important; color: var(--lmm-muted) !important;
	font-size: 12.5px !important; font-weight: 400 !important; line-height: 1 !important;
	cursor: pointer; white-space: nowrap;
	transition: background .18s, color .18s;
}
.lm-mgr .lm-mgr-seg button + button { border-left: 1px solid #EFE5CE !important; }
.lm-mgr .lm-mgr-seg button:hover:not(.is-on) { background: var(--lmm-cream) !important; color: var(--lmm-ink) !important; }
.lm-mgr .lm-mgr-seg button.is-on { color: #fff !important; font-weight: 500 !important; }
.lm-mgr .lm-mgr-seg button.is-on[data-s="disponible"] { background: var(--lmm-disp) !important; }
.lm-mgr .lm-mgr-seg button.is-on[data-s="reservado"]  { background: var(--lmm-res) !important; }
.lm-mgr .lm-mgr-seg button.is-on[data-s="vendido"]    { background: var(--lmm-ven) !important; }
.lm-mgr .lm-mgr-seg button.is-on .lm-mgr-dot { background: #fff !important; }
.lm-mgr .lm-mgr-seg button:focus-visible { outline: 2px solid var(--lmm-blue) !important; outline-offset: -2px !important; }
.lm-mgr .lm-mgr-seg.is-busy button { cursor: progress; }

.lm-mgr-confirm {
	display: flex; align-items: center; gap: 6px; height: 34px;
	background: #FBEFD9; border: 1px solid #F0DDB8; border-radius: 9px; padding: 0 4px 0 10px;
	font-size: 12.5px; color: var(--lmm-ink);
}
.lm-mgr-confirm span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm-mgr .lm-mgr-confirm button {
	height: 26px !important; padding: 0 10px !important; margin: 0 !important;
	border-radius: 6px !important; border: 1px solid #D9C9A6 !important;
	background: #fff !important; color: var(--lmm-ink) !important;
	font-size: 12px !important; font-weight: 400 !important; line-height: 1 !important;
	box-shadow: none !important; cursor: pointer; white-space: nowrap;
}
.lm-mgr .lm-mgr-confirm button.yes { background: var(--lmm-ink) !important; border-color: var(--lmm-ink) !important; color: var(--lmm-cream) !important; }

/* Footer: fixed height so feedback never pushes anything down. */
.lm-mgr-foot { display: flex; justify-content: space-between; align-items: center; height: 20px; margin-top: 8px; font-size: 12px; gap: 8px; }
.lm-mgr .lm-mgr-edit {
	display: inline-flex !important; align-items: center !important; gap: 5px !important;
	padding: 0 !important; margin: 0 !important; height: 20px !important;
	background: none !important; border: 0 !important; box-shadow: none !important;
	color: var(--lmm-blue) !important; font-size: 12px !important; font-weight: 400 !important; cursor: pointer;
}
.lm-mgr .lm-mgr-edit:hover { text-decoration: underline !important; }
.lm-mgr-has-note { color: var(--lmm-gold); display: inline-flex; margin-left: 4px; }

.lm-mgr-fb { font-size: 12px; white-space: nowrap; opacity: 0; transition: opacity .3s; display: inline-flex; align-items: center; gap: 4px; }
.lm-mgr-fb.show { opacity: 1; }
.lm-mgr-fb.ok   { color: var(--lmm-ok); }
.lm-mgr-fb.busy { color: var(--lmm-muted); }
.lm-mgr-fb.err  { color: var(--lmm-err); }
.lm-mgr-fb a { color: inherit !important; text-decoration: underline !important; }

.lm-mgr-empty { text-align: center; color: var(--lmm-muted); padding: 40px 0; font-size: 14px; }

/* ---------- Edit panel (side panel on desktop, bottom sheet on mobile) ---------- */
.lm-mgr-scrim { position: fixed; inset: 0; background: rgba(61, 53, 31, .28); z-index: 99998; }
.lm-mgr-panel {
	position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100vw);
	background: #fff; z-index: 99999;
	border-left: 1px solid var(--lmm-line);
	box-shadow: -12px 0 32px rgba(61, 53, 31, .12);
	transform: translateX(105%); transition: transform .25s ease;
	display: flex; flex-direction: column;
	visibility: hidden;
}
.lm-mgr-panel.is-open { transform: none; visibility: visible; }
.admin-bar .lm-mgr-panel { top: 32px; }
.lm-mgr-panel-head {
	display: flex; align-items: center; gap: 10px;
	padding: 14px 16px; border-bottom: 1px solid var(--lmm-line); background: var(--lmm-cream);
}
.lm-mgr .lm-mgr-panel-head h3 { margin: 0 !important; flex: 1; font-size: 19px !important; font-weight: 600 !important; color: var(--lmm-blue) !important; line-height: 1.2 !important; }
.lm-mgr .lm-mgr-close {
	width: 34px !important; height: 34px !important; padding: 0 !important; margin: 0 !important;
	display: inline-flex !important; align-items: center !important; justify-content: center !important;
	border-radius: 8px !important; border: 1px solid var(--lmm-line-2) !important;
	background: #fff !important; color: var(--lmm-ink) !important; box-shadow: none !important; cursor: pointer;
}
.lm-mgr-panel-body { padding: 16px; overflow-y: auto; flex: 1; }
.lm-mgr-panel-meta { margin: 0 0 14px; font-size: 13px; color: var(--lmm-muted); }
.lm-mgr-flabel, .lm-mgr-field > span { display: block; font-size: 12.5px; color: var(--lmm-muted); margin: 0 0 6px; }
.lm-mgr-field > span em { font-style: normal; color: #A99D80; }
.lm-mgr-panel-body .lm-mgr-slot { margin-bottom: 16px; }
.lm-mgr-field { display: block; margin: 0 0 16px; }
.lm-mgr .lm-mgr-field input,
.lm-mgr .lm-mgr-field textarea {
	display: block; width: 100% !important; margin: 0 !important;
	border: 1px solid var(--lmm-line-2) !important; border-radius: 9px !important;
	background: #fff !important; color: var(--lmm-ink) !important; box-shadow: none !important;
	font-size: 15px !important; line-height: 1.45 !important; padding: 9px 11px !important;
	min-height: 0 !important;
}
.lm-mgr .lm-mgr-field input { height: 42px !important; }
.lm-mgr .lm-mgr-field textarea { resize: vertical; }
.lm-mgr .lm-mgr-field input:focus,
.lm-mgr .lm-mgr-field textarea:focus { border-color: var(--lmm-blue) !important; outline: 0 !important; box-shadow: 0 0 0 3px rgba(37, 86, 153, .12) !important; }
.lm-mgr-field small { display: block; min-height: 18px; margin-top: 5px; font-size: 12px; color: var(--lmm-muted); }
.lm-mgr-panel-tip { margin: 4px 0 0; font-size: 12px; color: #A99D80; }

@media (max-width: 640px) {
	.lm-mgr-panel, .admin-bar .lm-mgr-panel {
		top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 88vh;
		border-left: 0; border-top: 1px solid var(--lmm-line); border-radius: 16px 16px 0 0;
		transform: translateY(105%); box-shadow: 0 -12px 32px rgba(61, 53, 31, .14);
	}
	.lm-mgr-panel-head { border-radius: 16px 16px 0 0; }
	.lm-mgr-grid { grid-template-columns: 1fr; }
}

/* ---------- Login ---------- */
.lm-mgr-login-wrap { display: flex; justify-content: center; padding: 48px 16px; }
.lm-mgr-login {
	width: 100%; max-width: 380px; background: #fff;
	border: 1px solid var(--lmm-line); border-radius: 16px;
	padding: 28px 24px 24px; text-align: center;
	box-shadow: 0 10px 30px rgba(61, 53, 31, .08);
}
.lm-mgr-login-icon {
	width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 12px;
	display: flex; align-items: center; justify-content: center;
	background: var(--lmm-cream); color: var(--lmm-gold); border: 1px solid var(--lmm-line);
}
.lm-mgr .lm-mgr-login-title { margin: 0 !important; font-size: 22px !important; font-weight: 500 !important; color: var(--lmm-blue) !important; }
.lm-mgr-login-sub { margin: 4px 0 20px; font-size: 13px; color: var(--lmm-muted); }
.lm-mgr-login .lm-mgr-field { text-align: left; }
.lm-mgr-login-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; margin: -4px 0 6px; }
.lm-mgr-login-row a { color: var(--lmm-blue) !important; text-decoration: none !important; }
.lm-mgr-check { display: inline-flex; align-items: center; gap: 6px; color: var(--lmm-muted); cursor: pointer; }
.lm-mgr .lm-mgr-check input { width: 16px !important; height: 16px !important; margin: 0 !important; accent-color: var(--lmm-blue); }
.lm-mgr-login-error { min-height: 20px; margin: 4px 0 8px; font-size: 13px; color: var(--lmm-err); text-align: left; }
.lm-mgr .lm-mgr-btn-primary {
	display: inline-flex !important; align-items: center !important; justify-content: center !important;
	width: 100% !important; height: 44px !important; margin: 0 !important; padding: 0 16px !important;
	border: 0 !important; border-radius: 10px !important; box-shadow: none !important;
	background: var(--lmm-blue) !important; color: #fff !important;
	font-size: 15px !important; font-weight: 500 !important; line-height: 1 !important;
	text-decoration: none !important; cursor: pointer;
}
.lm-mgr .lm-mgr-btn-primary:hover { background: #1d4680 !important; }
.lm-mgr .lm-mgr-btn-primary[aria-busy="true"] { opacity: .7; cursor: progress; }

@media (prefers-reduced-motion: reduce) {
	.lm-mgr *, .lm-mgr *::before, .lm-mgr *::after { transition: none !important; }
}