:root {
  --navy-950: #0a1f3d;
  --navy-900: #0d3157;
  --navy-800: #123a63;
  --navy-700: #1c5fa8;
  --gold: #f2a93b;
  --gold-icon: #eeb95b;
  --orange: #d94c2b;
  --green: #1f7a45;
  --gray-bar: #e9edf1;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #eef1f5;
  color: #1f2937;
}

/* ---------- Header ---------- */
.fp-header {
  background: linear-gradient(120deg, #081b36, var(--navy-900));
}

.fp-logo-mark {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  overflow: hidden;
}
.fp-logo-mark span { display: block; width: 100%; height: 100%; }
.fp-logo-mark span:nth-child(1) { background: #1c5fa8; }
.fp-logo-mark span:nth-child(2) { background: #1f7a45; }
.fp-logo-mark span:nth-child(3) { background: #f2a93b; }
.fp-logo-mark span:nth-child(4) { background: #d94c2b; }
.fp-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }

/* ---------- Tabs bar (separate light gray strip) ---------- */
.tabs-bar {
  background: var(--gray-bar);
  border-bottom: 1px solid #d7dde3;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 9px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--navy-900);
  background: #fff;
  border: 1px solid #d7dde3;
  transition: all .15s ease;
  cursor: pointer;
  white-space: nowrap;
}
.tab-btn:hover { border-color: var(--navy-700); transform: translateY(-1px); }
.tab-btn.active {
  background: var(--navy-800);
  color: #fff;
  border-color: var(--navy-800);
  box-shadow: 0 4px 10px -4px rgba(14,42,77,.5);
}
.tab-btn .tab-icon-wrap {
  display: flex; align-items:center; justify-content:center;
  font-size: 13px;
  color: var(--navy-800);
}
.tab-btn.active .tab-icon-wrap { color: #fff; }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .35s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Info cards (left column overview) ---------- */
.info-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #e5e9ee;
  display: flex;
  gap: 12px;
}
.info-card .icon-circle {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items:center; justify-content:center;
  color: #fff; font-size: 16px;
}
.info-card h3 { font-size: 12px; font-weight: 800; line-height: 1.3; margin-bottom: 5px; }
.info-card p { font-size: 11.5px; color: #6b7280; line-height: 1.5; }

/* ---------- Interactive map ---------- */
.map-wrap {
  position: relative;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  overflow: hidden;
  background: #dfe4ea;
}
.map-wrap img.map-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.map-pin {
  position: absolute;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 12px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
  border: 2px solid #fff;
  z-index: 6;
  transition: transform .2s ease;
}
.map-pin:hover, .map-pin.active-pin { transform: scale(1.2); }

.map-callout {
  position: absolute;
  background: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.25;
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
  white-space: nowrap;
  z-index: 6;
  border: 2px solid #123a63;
}

.map-connector {
  position: absolute;
  z-index: 5;
  pointer-events: none;
}

.pin-detail-box {
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e5e9ee;
  padding: 12px 14px;
  transition: all .2s ease;
}

/* ---------- Ala B stand grid ---------- */
.ala-block {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #0a2b4d;
}
.ala-banner {
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .03em;
  padding: 8px 14px;
  text-align: center;
}
.ala-body {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
}
.ala-floor {
  position: relative;
  background: linear-gradient(160deg, #1a1d22, #2a2f36);
  padding: 14px 16px 16px;
  overflow: hidden;
}
.ala-floor::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 15% 20%, rgba(242,169,59,.18), transparent 40%),
              radial-gradient(circle at 85% 75%, rgba(242,169,59,.12), transparent 45%);
}
.ala-row {
  position: relative;
  display: grid;
  gap: 6px;
  z-index: 2;
}
.ala-row.row-top { grid-template-columns: repeat(4, 1fr); margin-bottom: 6px; }
.ala-row.row-mid { grid-template-columns: repeat(6, 1fr); margin-bottom: 6px; }
.ala-row.row-bot { grid-template-columns: repeat(7, 1fr); }
.ala-code-top {
  text-align: center;
  color: #f3f0e8;
  font-size: 10.5px;
  font-weight: 700;
}
.ala-cell {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 4px;
  text-align: center;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 9px 2px;
}
.ala-side {
  background: var(--navy-900);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.ala-side li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
}
.ala-side li i { margin-top: 2px; color: var(--gold); font-size: 13px; flex-shrink:0; }

/* ---------- Right column ---------- */
.connect-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #e5e9ee;
}
.connect-card li {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: #374151; padding: 4.5px 0;
}

.thumb-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  height: 118px;
}
.thumb-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-tag {
  position: absolute; top: 8px; left: 8px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .03em;
  padding: 4px 9px; border-radius: 5px; color: #fff;
}

/* ---------- Footer band (3 zones aligned with grid columns) ---------- */
.footer-band {
  display: grid;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #d7dde3;
  margin-top: 18px;
}
.footer-left {
  background: var(--navy-900);
  color: #fff;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}
.footer-left .fl-item { display: flex; align-items: center; gap: 10px; }
.footer-left .fl-icon {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,.12);
  display: flex; align-items:center; justify-content:center;
  font-size: 11px; flex-shrink: 0;
}
.footer-left .fl-text strong { display:block; font-size: 11px; }
.footer-left .fl-text span { font-size: 9.5px; color: #c9d3de; }

.footer-center {
  background: #fff;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 10px 6px;
}
.hl-item {
  text-align: center;
  padding: 4px 4px;
  border-right: 1px solid #eef0f3;
}
.hl-item:last-child { border-right: none; }
.hl-item .hl-head {
  display: flex; align-items:center; justify-content:center; gap: 5px;
  font-size: 10.5px; font-weight: 800; margin-bottom: 3px;
}
.hl-item p { font-size: 8.8px; color: #6b7280; line-height: 1.25; }

.footer-right {
  background: var(--navy-800);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
}
.footer-right i.big { font-size: 20px; color: var(--gold); }
.footer-right .fr-title { font-size: 11px; font-weight: 800; line-height: 1.25; }
.footer-right .fr-sub { font-size: 9.5px; color: #c9d3de; }

/* ---------- Placeholder panels (other tabs) ---------- */
.placeholder-card {
  background: #fff;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  padding: 22px;
  text-align: center;
  color: #94a3b8;
}
.placeholder-card i { font-size: 26px; margin-bottom: 10px; color: #cbd5e1; }
.placeholder-banner {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 12.5px;
  font-weight: 600;
}

.section-title-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.section-title-bar .icon-circle {
  width: 44px; height: 44px; border-radius: 12px;
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-size:18px;
}

@media (max-width: 1024px) {
  .overview-grid { grid-template-columns: 1fr !important; }
  .footer-band { grid-template-columns: 1fr !important; }
  .footer-center { grid-template-columns: repeat(4, 1fr) !important; }
}
@media (max-width: 640px) {
  .footer-center { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ============================================================
   PAINEL ADMIN
   ============================================================ */

/* Botão flutuante para abrir/fechar o modo admin */
#admin-toggle-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--navy-900, #0d3157);
  color: #fff;
  border: none;
  font-size: 18px;
  box-shadow: 0 6px 18px rgba(10, 31, 61, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}
#admin-toggle-btn:hover { transform: scale(1.08); background: var(--navy-800, #123a63); }
#admin-toggle-btn.active {
  background: var(--orange, #d94c2b);
  transform: rotate(45deg);
}

/* Modal de login */
.admin-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 35, 0.55);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-modal.hidden { display: none; }
.admin-modal-box {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  width: 320px;
  max-width: 92vw;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.admin-modal-box h3 { font-size: 16px; font-weight: 800; color: #0a1f3d; margin-bottom: 4px; }
.admin-modal-sub { font-size: 12px; color: #6b7280; margin-bottom: 14px; }
.admin-modal-box input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #d7dde3;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.admin-modal-box input[type="password"]:focus { border-color: #1c5fa8; }
.admin-login-error { color: #d94c2b; font-size: 11.5px; margin-top: 6px; min-height: 14px; font-weight: 600; }
.admin-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.admin-modal-actions button {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}
#admin-login-cancel { background: #eef1f5; color: #374151; }
#admin-login-submit { background: var(--navy-900, #0d3157); color: #fff; }

/* Barra superior do modo edição */
.admin-toolbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9998;
  background: #0a1f3d;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 18px;
  font-size: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  flex-wrap: wrap;
}
.admin-toolbar.hidden { display: none; }
.admin-toolbar-title { font-weight: 800; color: #f2a93b; white-space: nowrap; }
.admin-toolbar-hint { color: #c9d3de; font-size: 10.5px; flex: 1; min-width: 200px; }
.admin-toolbar-hint i { color: #f2a93b; }
.admin-toolbar-actions { display: flex; gap: 8px; }
.admin-toolbar-actions button {
  padding: 6px 12px;
  border-radius: 7px;
  border: none;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
#admin-save-btn { background: #1f7a45; color: #fff; }
#admin-save-btn.pulse { animation: adminPulse 1.4s infinite; }
@keyframes adminPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31,122,69,.6); }
  50% { box-shadow: 0 0 0 6px rgba(31,122,69,0); }
}
#admin-discard-btn { background: #374151; color: #fff; }
#admin-logout-btn { background: #d94c2b; color: #fff; }

/* Quando o modo admin está ativo, empurra o conteúdo para baixo da toolbar */
body.admin-mode { padding-top: 40px; }
body.admin-mode .admin-toolbar { display: flex; }

/* Toast */
.admin-toast {
  position: fixed;
  bottom: 78px;
  right: 18px;
  z-index: 9999;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
.admin-toast.hidden { display: none; }
.admin-toast-success { background: #1f7a45; }
.admin-toast-error { background: #d94c2b; }
.admin-toast-info { background: #1c5fa8; }

/* Campos editáveis */
body.admin-mode .editable-field {
  cursor: text;
  border-radius: 4px;
  transition: background 0.15s ease, outline 0.15s ease;
  outline: 1px dashed transparent;
}
body.admin-mode .editable-field:hover {
  outline: 1px dashed #1c5fa8;
  background: rgba(28, 95, 168, 0.06);
}
body.admin-mode .editable-field.editing {
  outline: 2px solid #d94c2b;
  background: #fff7ed;
}

/* Imagens editáveis */
body.admin-mode [data-img][data-editable="image"],
body.admin-mode [data-img-field][data-editable="image"] {
  cursor: pointer;
  position: relative;
  outline: 2px dashed transparent;
  transition: outline 0.15s ease;
}
body.admin-mode [data-img][data-editable="image"]:hover,
body.admin-mode [data-img-field][data-editable="image"]:hover {
  outline: 2px dashed #f2a93b;
}
.map-admin-upload-hint {
  display: none;
  position: absolute;
  left: 50%; top: 10px;
  transform: translateX(-50%);
  background: rgba(10,31,61,.85);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 700;
  z-index: 7;
  pointer-events: none;
}
body.admin-mode #map-wrap:hover .map-admin-upload-hint { display: block; }

/* Itens de repeater (cards, linhas de listas, etc.) */
body.admin-mode .admin-item {
  position: relative;
  transition: box-shadow 0.15s ease;
}
body.admin-mode .admin-item:hover {
  box-shadow: 0 0 0 2px #1c5fa8 inset;
  border-radius: 8px;
}
.admin-item-controls {
  display: none;
  position: absolute;
  top: 4px; right: 4px;
  gap: 4px;
  z-index: 5;
}
body.admin-mode .admin-item:hover .admin-item-controls { display: flex; }
.admin-drag-handle, .admin-remove-btn {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: #fff;
  border: 1px solid #d7dde3;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  color: #374151;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.admin-drag-handle { cursor: grab; }
.admin-drag-handle:active { cursor: grabbing; }
.admin-remove-btn:hover { background: #d94c2b; color: #fff; border-color: #d94c2b; }

/* Botões de remoção "mini" para itens pequenos (ala-cell, connect-card li, footer items) */
.admin-remove-mini {
  display: none;
  position: absolute;
  top: -6px; right: -6px;
  width: 18px; height: 18px;
  font-size: 9px;
  z-index: 5;
}
body.admin-mode .ala-cell,
body.admin-mode .ala-code-top,
body.admin-mode .connect-card li,
body.admin-mode .fl-item,
body.admin-mode .hl-item {
  position: relative;
}
body.admin-mode .ala-cell:hover .admin-remove-mini,
body.admin-mode .ala-code-top:hover .admin-remove-mini,
body.admin-mode .connect-card li:hover .admin-remove-mini,
body.admin-mode .fl-item:hover .admin-remove-mini,
body.admin-mode .hl-item:hover .admin-remove-mini {
  display: flex;
}

/* Thumbnails (fotos) */
.admin-thumb-wrap { position: relative; }
.thumb-controls { display: none; position: absolute; top: 6px; right: 6px; gap: 4px; z-index: 6; }
body.admin-mode .thumb-card:hover .thumb-controls { display: flex; }

/* Botões "Adicionar" */
.admin-add-btn {
  display: none;
  align-items: center; justify-content: center; gap: 6px;
  margin-top: 8px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1.5px dashed #94a3b8;
  background: transparent;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}
.admin-add-btn:hover { border-color: #1c5fa8; color: #1c5fa8; background: rgba(28,95,168,.05); }
body.admin-mode .admin-add-btn { display: flex; }
.admin-add-light { border-color: rgba(255,255,255,.4); color: rgba(255,255,255,.85); }
.admin-add-light:hover { border-color: #f2a93b; color: #f2a93b; background: rgba(255,255,255,.08); }

/* Placeholder card com imagem */
.admin-placeholder-card { position: relative; }
.placeholder-card-img { display: flex; align-items: center; justify-content: center; min-height: 40px; }
.placeholder-card-img img { max-width: 100%; max-height: 90px; border-radius: 8px; object-fit: cover; }

/* Pins e callouts arrastáveis no mapa */
body.admin-mode .admin-draggable-pin,
body.admin-mode .admin-draggable-callout {
  outline: 2px dashed transparent;
}
body.admin-mode .admin-draggable-pin:hover,
body.admin-mode .admin-draggable-callout:hover {
  outline: 2px dashed #f2a93b;
}
.dragging-pin { z-index: 20 !important; opacity: 0.85; }

/* Ala floor cells precisam de position relative para o botão mini funcionar corretamente */
.ala-cell, .ala-code-top { position: relative; }
.admin-add-inline { margin-top: 10px; }

@media (max-width: 640px) {
  .admin-toolbar { font-size: 10.5px; }
  .admin-toolbar-hint { display: none; }
}
