html, body { height: 100%; margin: 0; overflow: hidden; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #17212b; background: #f5f7f4; }
.topbar { height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 22px; background: #fff; border-bottom: 1px solid #dde5dc; box-shadow: 0 2px 12px rgba(0,0,0,.05); }
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.logo { width: 142px; max-height: 64px; object-fit: contain; flex: 0 0 auto; }
h1 { margin: 0; font-size: clamp(22px, 3vw, 32px); line-height: 1.05; }
.subtitle { margin: 5px 0 0; font-size: 15px; color: #607466; font-weight: 700; }
.layout { height: calc(100vh - 93px); display: grid; grid-template-columns: 340px minmax(0, 1fr); overflow: hidden; }
.panel { overflow: auto; padding: 18px; background: #ffffff; border-right: 1px solid #dde5dc; }
.panel section { margin-bottom: 20px; }
label, h2 { display: block; margin: 0 0 8px; font-size: 14px; font-weight: 800; }
select, button { width: 100%; box-sizing: border-box; border: 1px solid #ccd8cd; border-radius: 10px; background: #fff; padding: 10px 12px; font: inherit; }
button { width: auto; cursor: pointer; font-weight: 700; background: #edf5ed; }
button:hover { background: #dfeede; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.actions button { white-space: nowrap; }
.mapwrap { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; background: #e9efe7; }
.status { position: absolute; left: 16px; bottom: 16px; z-index: 500; background: rgba(255,255,255,.94); border: 1px solid #d8e1d8; border-radius: 12px; padding: 10px 12px; box-shadow: 0 6px 24px rgba(0,0,0,.15); font-size: 13px; }
.legend div { display: flex; align-items: center; gap: 9px; margin: 7px 0; font-size: 14px; }
.legend span { width: 20px; height: 14px; border: 1px solid rgba(0,0,0,.25); border-radius: 4px; display: inline-block; }
.legend .nodata { background: repeating-linear-gradient(45deg,#eee,#eee 5px,#ddd 5px,#ddd 10px); }
.summary { display: grid; gap: 8px; }
.card { border: 1px solid #e0e7df; border-left: 6px solid #999; border-radius: 10px; padding: 10px; background: #fbfcfb; cursor: pointer; }
.card strong { display: block; font-size: 14px; }
.card small { color: #5e6d63; }
.source { color: #66736a; font-size: 12px; line-height: 1.4; }
.leaflet-popup-content h3 { margin: 0 0 6px; font-size: 16px; }
.leaflet-popup-content p { margin: 4px 0; }
.upload-box { border: 1px solid #dfe8df; background: #f7faf6; border-radius: 12px; padding: 12px; }
.upload-bottom { margin-top: 24px; }
.upload-box button { width: 100%; }
input[type=file] { width: 100%; box-sizing: border-box; border: 1px dashed #b9c9bb; border-radius: 10px; background: #fff; padding: 10px; font: inherit; }
.hint { margin: 8px 0 0; color: #66736a; font-size: 12px; line-height: 1.35; }
.status.ok { border-color: #8cc6a1; background: #eaf7ef; color: #185a34; }
.status.warn { border-color: #e5b65d; background: #fff3cd; color: #6a4b00; }
.status.error { border-color: #d66; }
@media (max-width: 850px) {
  html, body { overflow: auto; }
  .topbar { height: auto; padding: 14px; align-items: flex-start; flex-direction: column; }
  .brand { align-items: flex-start; }
  .logo { width: 120px; max-height: 56px; }
  .layout { height: auto; min-height: calc(100vh - 150px); grid-template-columns: 1fr; grid-template-rows: 420px 1fr; overflow: visible; }
  .panel { order: 2; border-right: 0; border-top: 1px solid #dde5dc; }
  .mapwrap { order: 1; min-height: 420px; }
}
.popup-concello h3 { margin: 0 0 8px; font-size: 17px; color: #17212b; }
.popup-concello p { margin: 5px 0; font-size: 14px; }

.info-box { border: 1px solid #dfe8df; background: #f9fbf8; border-radius: 12px; padding: 12px; }
.info-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.info-head h2 { margin: 0; }
.close-info { width: 32px; height: 32px; padding: 0; border-radius: 999px; line-height: 1; font-size: 20px; }
.concello-info { display: grid; gap: 8px; font-size: 14px; }
.concello-info.muted { color: #68766c; line-height: 1.35; }
.info-row { border: 1px solid #e4ebe3; background: #fff; border-radius: 10px; padding: 9px 10px; }
.info-row span { display: block; color: #657267; font-size: 12px; font-weight: 700; margin-bottom: 3px; }
.info-row strong { display: flex; align-items: center; gap: 7px; font-size: 15px; }
.level-dot { width: 14px; height: 14px; border: 1px solid rgba(0,0,0,.25); border-radius: 4px; display: inline-block; flex: 0 0 auto; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  padding: 16px;
}
.modal.hidden { display: none; }
.modal-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  padding: 22px;
}
.modal-card h2 { margin: 0 0 8px; }
.modal-card label { display:block; margin-top: 14px; font-weight: 700; }
.modal-card input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 15px;
}
.modal-actions {
  display:flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}
button.secondary { background: #e5e7eb; color: #111827; }
.auth-error { color: #b91c1c; min-height: 20px; font-weight: 700; }
.error-text { color: #b91c1c !important; font-weight: 700; }
.ok-text { color: #166534 !important; font-weight: 700; }

.logo{max-height:90px;width:auto;display:block}
.brand{align-items:center;gap:16px}
