/* ════════════════════════════════════════════
   FRONTEND — shortcode
════════════════════════════════════════════ */
.lgjm-frontend-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0;
  border-radius: var(--lgjm-radius-lg, 12px);
  overflow: hidden;
  border: 0.5px solid var(--lgjm-border, rgba(0,0,0,.1));
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  align-items: stretch; /* ambas columnas misma altura */
}
@media (max-width: 700px) {
  .lgjm-frontend-wrap { grid-template-columns: 1fr; }
  .lgjm-frontend-list { max-height: 300px; }
}

.lgjm-frontend-map { position: relative; z-index: 0; }
.lgjm-frontend-map #lgjm-map { height: 100% !important; border-radius: 0; border: none; box-shadow: none; }

/* Panel lateral — ocupa todo el alto del grid */
.lgjm-frontend-list {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 0.5px solid var(--lgjm-border, rgba(0,0,0,.1));
  overflow: hidden;
  /* El alto lo marca el mapa via align-items:stretch */
  min-height: 0;
  height: 540px
}

.lgjm-frontend-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 0.5px solid var(--lgjm-border, rgba(0,0,0,.1));
  background: #fafafa;
  flex-shrink: 0;
}
.lgjm-frontend-count-label {
  font-size: 12px;
  font-weight: 600;
  color: #6e6e73;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.lgjm-frontend-count-badge {
  background: #0071e3;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* Listado */
#lgjm-frontend-items {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.15) transparent;
}

.lgjm-fe-empty {
  text-align: center;
  padding: 32px 16px;
  font-size: 13px;
  color: #aeaeb2;
}

/* Ítem */
.lgjm-fe-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 0.5px solid rgba(0,0,0,.06);
  cursor: pointer;
  transition: background .12s;
  position: relative;
}
.lgjm-fe-item:last-child { border-bottom: none; }
.lgjm-fe-item:hover      { background: #f5f5f7; }
.lgjm-fe-item.lgjm-fe-active { background: #edf4ff; }
.lgjm-fe-item.lgjm-fe-active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #0071e3;
  border-radius: 0 2px 2px 0;
}

.lgjm-fe-color {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.lgjm-fe-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lgjm-fe-name {
  font-size: 12px;
  font-weight: 600;
  color: #1d1d1f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lgjm-fe-row {
  font-size: 11px;
  color: #6e6e73;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lgjm-fe-row a {
  color: #0071e3;
  text-decoration: none;
}
.lgjm-fe-row a:hover { text-decoration: underline; }

/* Botón centrar */
.lgjm-fe-locate {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0.5px solid rgba(0,0,0,.12);
  background: #f5f5f7;
  color: #6e6e73;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  margin-top: 2px;
	display: none;
}
.lgjm-fe-locate:hover {
  background: #0071e3;
  color: #fff;
  border-color: transparent;
}

/* ── Variables ─────────────────────────────────── */
:root {
  --lgjm-radius-sm:  8px;
  --lgjm-radius-md:  12px;
  --lgjm-radius-lg:  16px;
  --lgjm-accent:     #0071e3;
  --lgjm-accent-h:   #0077ed;
  --lgjm-surface:    #ffffff;
  --lgjm-surface-2:  #f5f5f7;
  --lgjm-border:     rgba(0,0,0,.1);
  --lgjm-border-s:   rgba(0,0,0,.18);
  --lgjm-text:       #1d1d1f;
  --lgjm-text-2:     #6e6e73;
  --lgjm-text-3:     #aeaeb2;
  --lgjm-danger:     #ff3b30;
  --lgjm-success:    #34c759;
  --lgjm-font:       -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
}

/* ── Utilidad ──────────────────────────────────── */
.lgjm-hidden { display: none !important; }

/* ── Wrap principal ───────────────────────────── */
.lgjm-wrap {
  font-family: var(--lgjm-font);
  color: var(--lgjm-text);
}
.lgjm-wrap h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.3px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.lgjm-wrap h1 .dashicons { color: var(--lgjm-accent); font-size: 22px; }

/* ── Toolbar ───────────────────────────────────── */
.lgjm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--lgjm-surface);
  border-radius: var(--lgjm-radius-md);
  border: 0.5px solid var(--lgjm-border);
}

/* Botones toolbar — estilo Apple pill */
.lgjm-toolbar .button,
.lgjm-toolbar .button-primary {
  font-family: var(--lgjm-font) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border-radius: 20px !important;
  padding: 5px 14px !important;
  height: auto !important;
  line-height: 1.5 !important;
  border: 0.5px solid var(--lgjm-border-s) !important;
  background: var(--lgjm-surface-2) !important;
  color: var(--lgjm-text) !important;
  box-shadow: none !important;
  transition: background .15s !important;
}
.lgjm-toolbar .button:hover {
  background: #e8e8ed !important;
}
.lgjm-toolbar .button-primary {
  background: var(--lgjm-accent) !important;
  color: #fff !important;
  border-color: transparent !important;
}
.lgjm-toolbar .button-primary:hover {
  background: var(--lgjm-accent-h) !important;
}

.lgjm-search {
  margin-left: auto;
  padding: 6px 14px 6px 34px;
  border: 0.5px solid var(--lgjm-border-s);
  border-radius: 20px;
  background: var(--lgjm-surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23aeaeb2' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") no-repeat 12px center;
  font-family: var(--lgjm-font);
  font-size: 13px;
  color: var(--lgjm-text);
  outline: none;
  min-width: 200px;
  transition: border-color .15s, box-shadow .15s;
}
.lgjm-search:focus {
  border-color: var(--lgjm-accent);
  box-shadow: 0 0 0 3px rgba(0,113,227,.15);
}

/* ── Layout mapa + lista ───────────────────────── */
.lgjm-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 960px) { .lgjm-layout { grid-template-columns: 1fr; } }

/* ── Mapa ──────────────────────────────────────── */
.lgjm-map-col {}
#lgjm-map {
  height: 540px;
  border-radius: var(--lgjm-radius-lg);
  border: 0.5px solid var(--lgjm-border);
  overflow: hidden;
  z-index: 0;
}
.lgjm-hint { margin: 8px 0 0; font-size: 12px; color: var(--lgjm-text-3); }

/* ── Panel lista ───────────────────────────────── */
.lgjm-list-col {
    overflow: auto;
	    max-height: 540px;
}
.lgjm-list-col h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--lgjm-text-2);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 10px 4px;
}

#lgjm-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--lgjm-border-s) transparent;
}
.lgjm-empty {
  text-align: center;
  padding: 40px 0;
  font-size: 13px;
  color: var(--lgjm-text-3);
}

/* ── Tarjeta ───────────────────────────────────── */
.lgjm-card {
  background: var(--lgjm-surface);
  border: 0.5px solid var(--lgjm-border);
  border-radius: var(--lgjm-radius-md);
  overflow: hidden;
  transition: box-shadow .2s, transform .15s;
	height: fit-content;
}
.lgjm-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  transform: translateY(-1px);
}

.lgjm-card-header {
  padding: 12px 14px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--lgjm-surface-2);
  border-bottom: 0.5px solid var(--lgjm-border);
}
.lgjm-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--lgjm-text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lgjm-badge {
  display: inline-flex;
  align-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.lgjm-card-info {
  padding: 10px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.lgjm-card-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--lgjm-text-2);
  line-height: 1.5;
}
.lgjm-card-icon {
  flex-shrink: 0;
  width: 16px;
  font-size: 12px;
  text-align: center;
  margin-top: 1px;
}
.lgjm-card-row a {
  color: var(--lgjm-accent);
  text-decoration: none;
}
.lgjm-card-row a:hover { text-decoration: underline; }

.lgjm-card-actions {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  border-top: 0.5px solid var(--lgjm-border);
}
.lgjm-card-actions button {
  font-family: var(--lgjm-font);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  border: 0.5px solid var(--lgjm-border-s);
  background: var(--lgjm-surface-2);
  color: var(--lgjm-text-2);
  cursor: pointer;
  transition: all .15s;
}
.lgjm-card-actions button:hover {
  background: var(--lgjm-accent);
  color: #fff;
  border-color: transparent;
}
.lgjm-btn-delete:hover { background: var(--lgjm-danger) !important; }

/* ── Modal overlay ─────────────────────────────── */
.lgjm-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lgjm-modal-box {
  background: var(--lgjm-surface);
  border-radius: var(--lgjm-radius-lg);
  border: 0.5px solid var(--lgjm-border);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.2);
}

.lgjm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 0.5px solid var(--lgjm-border);
  position: sticky;
  top: 0;
  background: var(--lgjm-surface);
  border-radius: var(--lgjm-radius-lg) var(--lgjm-radius-lg) 0 0;
  z-index: 1;
}
.lgjm-modal-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--lgjm-text);
}
.lgjm-modal-close {
  background: var(--lgjm-surface-2);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  color: var(--lgjm-text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.lgjm-modal-close:hover { background: #e0e0e5; }

/* ── Campos del formulario ─────────────────────── */
.lgjm-field-group {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lgjm-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--lgjm-border);
}
.lgjm-field:last-child { border-bottom: none; }
.lgjm-field-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}
.lgjm-field-inner {
  flex: 1;
  min-width: 0;
}
.lgjm-field-inner label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--lgjm-text-3);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.lgjm-field-inner input,
.lgjm-field-inner textarea {
  width: 100%;
  border: none;
  outline: none;
  font-family: var(--lgjm-font);
  font-size: 14px;
  color: var(--lgjm-text);
  background: transparent;
  padding: 0;
  box-shadow: none !important;
}
.lgjm-field-inner input::placeholder,
.lgjm-field-inner textarea::placeholder {
  color: var(--lgjm-text-3);
}

.lgjm-coords-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.lgjm-coords-row .lgjm-field { border-bottom: none; border-right: 0.5px solid var(--lgjm-border); padding: 10px 0; }
.lgjm-coords-row .lgjm-field:last-child { border-right: none; padding-left: 16px; }

.lgjm-modal-actions {
  padding: 12px 20px 18px;
  border-top: 0.5px solid var(--lgjm-border);
}
.lgjm-btn-primary {
  width: 100%;
  padding: 11px;
  background: var(--lgjm-accent);
  color: #fff;
  border: none;
  border-radius: var(--lgjm-radius-sm);
  font-family: var(--lgjm-font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.lgjm-btn-primary:hover  { background: var(--lgjm-accent-h); }
.lgjm-btn-primary:active { transform: scale(.98); }
.lgjm-btn-primary:disabled { background: var(--lgjm-text-3); cursor: not-allowed; }

/* ── Mensajes error / éxito ────────────────────── */
.lgjm-form-error,
.lgjm-form-success {
  margin: 0 20px 12px;
  padding: 10px 14px;
  border-radius: var(--lgjm-radius-sm);
  font-size: 13px;
}
.lgjm-form-error   { background: #fff2f2; color: var(--lgjm-danger); border: 0.5px solid rgba(255,59,48,.2); }
.lgjm-form-success { background: #f0fff4; color: #1a7f37;             border: 0.5px solid rgba(52,199,89,.2); }

/* ── Tabs importar ─────────────────────────────── */
.lgjm-tabs {
  display: flex;
  border-bottom: 0.5px solid var(--lgjm-border);
  margin: 0 20px 16px;
}
.lgjm-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -0.5px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: var(--lgjm-font);
  font-size: 13px;
  font-weight: 500;
  color: var(--lgjm-text-2);
  transition: color .15s, border-color .15s;
}
.lgjm-tab:hover  { color: var(--lgjm-accent); }
.lgjm-tab.active { color: var(--lgjm-accent); border-bottom-color: var(--lgjm-accent); }

/* ── Zona drag & drop ──────────────────────────── */
.lgjm-tab-panel { padding: 0 20px; }
.lgjm-file-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  border: 1.5px dashed var(--lgjm-border-s);
  border-radius: var(--lgjm-radius-md);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  color: var(--lgjm-text-3);
  font-family: var(--lgjm-font);
  font-weight: 400;
  transition: border-color .15s, background .15s;
}
.lgjm-file-label:hover,
.lgjm-drag-over .lgjm-file-label { border-color: var(--lgjm-accent); background: rgba(0,113,227,.04); color: var(--lgjm-accent); }
.lgjm-file-label input[type="file"] { display: none; }

#lgjm-import-text {
  width: 100%;
  box-sizing: border-box;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  border: 0.5px solid var(--lgjm-border-s);
  border-radius: var(--lgjm-radius-sm);
  padding: 12px;
  color: var(--lgjm-text);
  resize: vertical;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#lgjm-import-text:focus {
  border-color: var(--lgjm-accent);
  box-shadow: 0 0 0 3px rgba(0,113,227,.15);
}

/* ── Badge pequeño (popup) ─────────────────────── */
.lgjm-badge-sm { font-size: 11px; font-weight: 600; }

/* ── URL en popup ──────────────────────────────── */
.lgjm-popup-url {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--lgjm-accent);
  text-decoration: none;
  font-weight: 500;
}
.lgjm-popup-url:hover { text-decoration: underline; }

/* ── Popup Leaflet ─────────────────────────────── */
.lgjm-popup strong { font-size: 13px; display: block; margin-bottom: 4px; }
.lgjm-popup small  { font-size: 11px; color: var(--lgjm-text-3); display: block; margin-top: 4px; }

.lgjm-popup-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.lgjm-popup-actions button {
  flex: 1;
  font-family: var(--lgjm-font);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 8px;
  border: 0.5px solid var(--lgjm-border-s);
  border-radius: 6px;
  background: var(--lgjm-surface-2);
  color: var(--lgjm-text);
  cursor: pointer;
  transition: all .15s;
}
.lgjm-popup-actions button:hover {
  background: var(--lgjm-accent);
  color: #fff;
  border-color: transparent;
}