* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Outfit', Arial, sans-serif;
  background: #f4f8fb;
  color: #14213d;
  position: relative;
  overflow-x: hidden;
}

.gb-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #1e3a5f 0%, #0f2744 50%, #0a1929 100%);
}
.gb-auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,0.18);
  position: relative;
  z-index: 2;
}
.gb-brand { text-align: center; margin-bottom: 8px; }
.gb-brand img { width: 190px; max-width: 100%; }
.gb-brand .gb-brand-sec { width: 220px; margin-top: 6px; }
.gb-login-bottom {
  text-align: center;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #d5e0ea;
}
.gb-login-bottom .gb-brand-sec {
  width: 230px;
  max-width: 100%;
  display: block;
  margin: 0 auto;
}
.gb-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccd6e0;
  border-radius: 8px;
  margin: 6px 0 12px;
}
.gb-btn {
  display: inline-block;
  border: 0;
  background: #1d7f3f;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
}
.gb-btn:hover { filter: brightness(1.05); }
.gb-btn-alt { background: #365f88; }
.gb-btn-sm { padding: 7px 10px; font-size: 13px; }
.gb-btn-danger { background: #b42318; }
.gb-inline-form { display: inline; margin: 0; padding: 0; }
.gb-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.gb-error, .gb-ok {
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0;
}
.gb-error { background: #ffe0e0; color: #8a1e1e; }
.gb-ok { background: #dff5e7; color: #155d2f; }
.gb-links { margin-top: 12px; font-size: 14px; }

.gb-leaves { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.gb-leaf {
  position: absolute;
  width: 20px;
  height: 20px;
  left: calc(var(--i, 0) * 7% - 5%);
  top: -20px;
  opacity: 0.6;
  animation: gb-leaf-fall 12s linear infinite;
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 18px;
  color: #22c55e;
}
.gb-leaf::before { content: "\f06c"; }
.gb-leaf:nth-child(3n) { color: #f59e0b; }
.gb-leaf:nth-child(5n) { color: #d97706; }
.gb-leaf:nth-child(7n) { color: #059669; }
.gb-leaf:nth-child(1) { --i: 1; animation-delay: 0s; animation-duration: 14s; }
.gb-leaf:nth-child(2) { --i: 3; animation-delay: 2s; animation-duration: 11s; font-size: 14px; }
.gb-leaf:nth-child(3) { --i: 5; animation-delay: 4s; animation-duration: 16s; }
.gb-leaf:nth-child(4) { --i: 2; animation-delay: 1s; animation-duration: 13s; }
.gb-leaf:nth-child(5) { --i: 7; animation-delay: 3s; animation-duration: 15s; }
.gb-leaf:nth-child(6) { --i: 4; animation-delay: 5s; animation-duration: 12s; font-size: 22px; }
.gb-leaf:nth-child(7) { --i: 6; animation-delay: 0.5s; animation-duration: 17s; }
.gb-leaf:nth-child(8) { --i: 8; animation-delay: 2.5s; animation-duration: 10s; }
.gb-leaf:nth-child(9) { --i: 10; animation-delay: 6s; animation-duration: 14s; }
.gb-leaf:nth-child(10) { --i: 9; animation-delay: 1.5s; animation-duration: 11s; }
.gb-leaf:nth-child(11) { --i: 11; animation-delay: 4.5s; animation-duration: 15s; }
.gb-leaf:nth-child(12) { --i: 12; animation-delay: 3.5s; animation-duration: 13s; }
.gb-leaf:nth-child(13) { --i: 14; animation-delay: 7s; animation-duration: 16s; }
.gb-leaf:nth-child(14) { --i: 13; animation-delay: 2s; animation-duration: 12s; }
.gb-leaf:nth-child(15) { --i: 15; animation-delay: 5.5s; animation-duration: 18s; }
.gb-leaf:nth-child(16) { --i: 1; animation-delay: 8s; animation-duration: 11s; }
.gb-leaf:nth-child(17) { --i: 6; animation-delay: 1s; animation-duration: 14s; }
.gb-leaf:nth-child(18) { --i: 10; animation-delay: 6.5s; animation-duration: 13s; }

@keyframes gb-leaf-fall {
  0% { top: -20px; transform: translateX(0) rotate(0deg); opacity: 0.6; }
  25% { transform: translateX(16px) rotate(180deg); }
  50% { transform: translateX(-12px) rotate(360deg); }
  75% { transform: translateX(18px) rotate(540deg); }
  100% { top: 100vh; transform: translateX(0) rotate(720deg); opacity: 0.35; }
}

.gb-topbar {
  background: #0e2a47;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.gb-logo-link {
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.gb-logo-link img { height: 36px; }
.gb-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.gb-nav a {
  color: #d7e6f8;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
}
.gb-nav a.active, .gb-nav a:hover { background: rgba(255,255,255,.18); color: #fff; }
.gb-main { padding: 18px; max-width: 1180px; margin: 0 auto; }

.gb-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 22px rgba(0,0,0,.08);
  margin-bottom: 16px;
}
.gb-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.gb-kpis strong { font-size: 28px; color: #1d7f3f; }
.gb-table-wrap { overflow-x: auto; }
.gb-table {
  width: 100%;
  border-collapse: collapse;
}
.gb-table th, .gb-table td {
  border-bottom: 1px solid #e6edf3;
  text-align: left;
  padding: 10px 8px;
  font-size: 14px;
}

.gb-form-grid { display: grid; gap: 8px; max-width: 760px; }
.gb-filtros {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  align-items: end;
}

.gb-camera-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: 2fr 1fr;
}
.gb-video {
  width: 100%;
  border-radius: 12px;
  background: #000;
  min-height: 280px;
}
.gb-side { display: flex; flex-direction: column; }
.gb-inline { display: flex; gap: 8px; }
.gb-help { margin-top: 8px; font-size: 13px; color: #4a5b6d; }
.gb-hidden { display: none; }
.gb-preview {
  width: 100%;
  margin-top: 12px;
  border-radius: 12px;
}

.gb-grid-registros {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}
.gb-foto {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 10px;
  background: #dce6ef;
}
.gb-foto-modal-trigger {
  cursor: zoom-in;
}
.gb-foto-modal-trigger:focus {
  outline: 2px solid #1d7f3f;
  outline-offset: 3px;
}
.gb-panel-subida {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #d6e2ec;
  border-radius: 10px;
  background: #f8fbff;
}
.gb-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.gb-modal.gb-hidden {
  display: none;
}
.gb-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  cursor: pointer;
}
.gb-modal-dialog {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1200px);
  max-height: 90vh;
}
.gb-modal-img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.gb-modal-close {
  position: absolute;
  top: -10px;
  right: -10px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #14213d;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.28);
}
.gb-modal-close:hover {
  filter: brightness(0.95);
}
.gb-foto-edit { max-width: 460px; display: block; margin-bottom: 12px; }
.gb-meta { display: grid; gap: 6px; font-size: 14px; }
.gb-map-wrap {
  margin-top: 8px;
  border: 1px solid #d6e2ec;
  border-radius: 10px;
  overflow: hidden;
  background: #f7fbff;
}
.gb-map-wrap .gb-leaflet-map {
  width: 100%;
  height: 200px;
  border: 0;
  display: block;
  border-radius: 0;
  background: #dde8f0;
}
.gb-map-wrap .gb-leaflet-map .leaflet-tile-container img {
  border-radius: 0;
}
/* Marcador: miniatura circular + pin en el punto exacto del mapa */
.leaflet-marker-icon.gb-map-pin-marker {
  background: transparent !important;
  border: none !important;
}
.gb-map-pin-marker .gb-map-pin-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.gb-map-pin-marker .gb-map-pin-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #1d7f3f;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  background: #fff;
}
.gb-map-pin-marker .gb-map-pin-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gb-map-pin-marker .gb-map-pin-tail {
  width: 0;
  height: 0;
  margin-top: -4px;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 16px solid #1d7f3f;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.28));
}
.gb-map-link {
  display: block;
  text-align: center;
  font-size: 13px;
  padding: 8px 10px;
  text-decoration: none;
  color: #1d4e89;
  background: #edf5ff;
}
.gb-map-link:hover {
  background: #deecff;
}

@media (max-width: 900px) {
  .gb-camera-layout { grid-template-columns: 1fr; }
  .gb-map-wrap .gb-leaflet-map { height: 170px; }
}
