@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Sans:wght@400;500;600;700;800;900&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

body {
  font-family: 'Plus Jakarta Sans', 'DM Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  background-color: #F8FAFC;
  background-image:
    radial-gradient(at 0% 0%, hsla(217, 100%, 92%, 1) 0px, transparent 50%),
    radial-gradient(at 100% 0%, hsla(208, 100%, 95%, 1) 0px, transparent 50%),
    radial-gradient(at 100% 100%, hsla(210, 100%, 93%, 1) 0px, transparent 50%);
  background-attachment: fixed;
  overflow-x: hidden;
  color: #0F172A;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(.92)
  }

  to {
    opacity: 1;
    transform: scale(1)
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

@keyframes ping {

  75%,
  100% {
    transform: scale(1.8);
    opacity: 0
  }
}

@keyframes slideRight {
  0% {
    transform: translateX(-100%)
  }

  100% {
    transform: translateX(200%)
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-15px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px)
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0)
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0)
  }

  to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px)
  }
}

@keyframes overlayIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0)
  }

  to {
    opacity: 1;
    backdrop-filter: blur(6px)
  }
}

.animate-fade {
  animation: fadeIn .5s cubic-bezier(0.16, 1, 0.3, 1) both
}

.animate-scale {
  animation: scaleIn .5s cubic-bezier(0.16, 1, 0.3, 1)
}

.animate-spin {
  animation: spin .8s linear infinite
}

.animate-ping-slow {
  animation: ping 2.5s cubic-bezier(0, 0, .2, 1) infinite
}

.animate-slide {
  animation: slideRight 1.5s ease infinite
}

.animate-slideUp {
  animation: slideUp .5s cubic-bezier(0.16, 1, 0.3, 1)
}

.animate-slideDown {
  animation: slideDown .3s ease
}

.card-hover {
  transition: all .3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
}

.card-hover:hover {
  box-shadow: 0 16px 40px -8px rgba(15, 23, 42, 0.08);
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.3);
}

.btn-press {
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer
}

.btn-press:active {
  transform: scale(.95)
}

.btn-press:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important
}

.map-grid {
  background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 30%, #7DD3FC 60%, #38BDF8 100%);
  position: relative;
  overflow: hidden
}

.map-grid::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 12%, rgba(255, 255, 255, .3) 12%, rgba(255, 255, 255, .3) 12.5%), repeating-linear-gradient(90deg, transparent, transparent 12%, rgba(255, 255, 255, .3) 12%, rgba(255, 255, 255, .3) 12.5%)
}

.map-road-h {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, .6);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1)
}

.map-road-v {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: rgba(255, 255, 255, .6);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1)
}

.map-marker {
  width: 16px;
  height: 16px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #fff;
  box-shadow: 0 6px 12px rgba(0, 0, 0, .3);
  position: absolute;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1)
}

.map-marker:hover {
  transform: rotate(-45deg) scale(1.2)
}

.leaflet-shell {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid #E2E8F0;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 45px -18px rgba(15, 23, 42, 0.22);
  isolation: isolate;
  z-index: 1
}

.leaflet-map {
  min-height: 17rem;
  width: 100%
}

.leaflet-map--route {
  min-height: 10rem
}

.leaflet-shell .leaflet-container {
  height: 100%;
  width: 100%;
  font: inherit;
  background: #DBEAFE
}

.leaflet-shell .leaflet-top,
.leaflet-shell .leaflet-bottom {
  z-index: 450
}

.leaflet-shell .leaflet-control-zoom {
  border: none;
  box-shadow: 0 12px 30px -16px rgba(15, 23, 42, 0.4)
}

.leaflet-shell .leaflet-control-zoom a {
  border: none;
  color: #0F172A
}

.leaflet-shell .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 10px 0 0 0;
  padding: 2px 8px;
  color: #64748B
}

.leaflet-shell .leaflet-control-attribution,
.leaflet-shell .leaflet-control-attribution a {
  font-size: 10px
}

.map-chip {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 460;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
  box-shadow: 0 10px 24px -16px rgba(15, 23, 42, 0.5)
}

.map-chip::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #2563EB
}

.map-chip--subtle::before {
  background: #64748B
}

.resq-popup .leaflet-popup-content-wrapper {
  border-radius: 16px;
  box-shadow: 0 20px 40px -24px rgba(15, 23, 42, 0.45)
}

.resq-popup .leaflet-popup-content {
  margin: 12px 14px;
  font-family: inherit
}

.resq-popup__title {
  color: #0F172A;
  font-size: 13px;
  font-weight: 800
}

.resq-popup__meta {
  margin-top: 4px;
  color: #64748B;
  font-size: 11px;
  font-weight: 600
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0
}

.badge-pending {
  background: #FEF3C7;
  color: #92400E
}

.badge-pending::before {
  background: #F59E0B
}

.badge-responding {
  background: #DBEAFE;
  color: #1E40AF
}

.badge-responding::before {
  background: #3B82F6
}

.badge-resolved {
  background: #D1FAE5;
  color: #065F46
}

.badge-resolved::before {
  background: #10B981
}

.badge-critical {
  background: #FEE2E2;
  color: #991B1B
}

.badge-critical::before {
  background: #EF4444;
  box-shadow: 0 0 8px #EF4444
}

.badge-high {
  background: #FFEDD5;
  color: #9A3412
}

.badge-high::before {
  background: #F97316
}

.badge-medium {
  background: #FEF3C7;
  color: #92400E
}

.badge-medium::before {
  background: #F59E0B
}

.badge-low {
  background: #D1FAE5;
  color: #065F46
}

.badge-low::before {
  background: #10B981
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px
}

::-webkit-scrollbar-track {
  background: transparent
}

::-webkit-scrollbar-thumb {
  background: rgba(203, 213, 225, 0.7);
  border-radius: 4px
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.8)
}


.bottom-nav {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 440px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 10px;
  z-index: 600;
  box-shadow: 0 16px 40px -8px rgba(15, 23, 42, 0.15);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bottom-nav-brand {
  display: none;
}

.bottom-nav-brand img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.bottom-nav-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bottom-nav-brand-copy strong {
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
  color: #DC2626;
  letter-spacing: -0.04em;
}

.bottom-nav-brand-copy span {
  font-size: 10px;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #64748B;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 6px;
  cursor: pointer;
  color: #64748B;
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  position: relative;
  border-radius: 16px;
}

.nav-item:hover {
  color: #1D4ED8;
  background: rgba(239, 246, 255, 0.5);
}

.nav-item.active {
  color: #1D4ED8;
  background: #EFF6FF;
}

.nav-item span {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: all .2s;
}

.nav-item:hover svg {
  transform: translateY(-2px);
}

.nav-item.active svg {
  stroke: #1D4ED8;
}

select {
  background-image: 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='%2364748B' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  appearance: none
}

.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 14px 24px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .15);
  white-space: nowrap;
  animation: toastIn .4s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 90%;
  backdrop-filter: blur(8px)
}

.toast.out {
  animation: toastOut .3s ease forwards
}

.toast-success {
  background: rgba(5, 150, 105, 0.95);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2)
}

.toast-error {
  background: rgba(220, 38, 38, 0.95);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2)
}

.toast-info {
  background: rgba(30, 41, 59, 0.95);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2)
}

.toast-warning {
  background: rgba(245, 158, 11, 0.95);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2)
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .4);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: overlayIn .4s cubic-bezier(0.16, 1, 0.3, 1)
}

.modal-content {
  background: #fff;
  border-radius: 32px 32px 0 0;
  max-width: 480px;
  width: 100%;
  padding: 32px;
  animation: slideUp .4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15)
}

@media(min-width:640px) {
  .modal-content {
    border-radius: 24px;
    margin-bottom: auto;
    margin-top: auto;
    max-width: 440px
  }
}

input,
textarea,
select {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
}

input:focus,
textarea:focus,
select:focus {
  border-color: #3B82F6 !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .15);
  outline: none;
  background: #fff;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(15, 23, 42, .18);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  overflow-y: auto
}

.menu-overlay-shell {
  display: flex;
  min-height: 100%;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 78px 12px 12px
}

.menu-sheet {
  width: min(320px, calc(100vw - 24px));
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, .95);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .18);
  padding: 10px;
  overflow: hidden;
  isolation: isolate;
  animation: slideDown .3s cubic-bezier(0.16, 1, 0.3, 1)
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
  position: relative;
  z-index: 1
}

.dropdown-item:hover {
  background: #F8FAFC;
  color: #1D4ED8;
  transform: translateX(4px)
}

.dropdown-item svg {
  flex-shrink: 0;
  transition: all 0.2s
}

.dropdown-item:hover svg {
  stroke: #1D4ED8
}

body.dropdown-open {
  overflow: hidden
}

.hidden {
  display: none !important
}

.chat-widget {
  right: 12px;
  bottom: 108px
}

#aiChatWindow {
  width: min(360px, calc(100vw - 24px));
  height: min(460px, calc(100vh - 210px));
  max-height: calc(100vh - 210px)
}

#aiChatMessages {
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, .24) transparent
}

#aiChatMessages::-webkit-scrollbar {
  width: 6px
}

#aiChatMessages::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, .24);
  border-radius: 999px
}

.chat-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 40px;
  margin-top: -4px
}

.chat-quick-action {
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #334155;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 10px 18px -16px rgba(15, 23, 42, .35);
  transition: transform .2s ease, box-shadow .2s ease, color .2s ease, background .2s ease;
  cursor: pointer
}

.chat-quick-action:hover {
  transform: translateY(-1px);
  background: #EEF2FF;
  color: #3730A3;
  box-shadow: 0 14px 24px -18px rgba(79, 70, 229, .5)
}

.chat-quick-action:focus-visible {
  outline: 2px solid rgba(79, 70, 229, .35);
  outline-offset: 2px
}

@media (max-width: 767px) {
  .chat-widget {
    right: 12px;
    bottom: 106px
  }

  #aiChatWindow {
    width: calc(100vw - 24px);
    height: min(430px, calc(100vh - 220px));
    max-height: calc(100vh - 220px);
    border-radius: 24px
  }

  .chat-quick-actions {
    padding-left: 0
  }
}

@media (min-width: 768px) {
  .chat-widget {
    right: 32px;
    bottom: 32px
  }

  #aiChatWindow {
    width: 380px;
    height: min(520px, calc(100vh - 110px));
    max-height: calc(100vh - 110px)
  }
}



.sos-nav-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
  margin-top: -30px;
  border: 4px solid #fff;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  z-index: 601;
  flex: 0 0 68px;
  flex-shrink: 0;
}

.sos-nav-center:hover,
.sos-nav-center:active {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 12px 28px rgba(220, 38, 38, 0.5);
  color: #fff;
}

.sos-nav-center svg {
  margin-bottom: 2px;
  stroke: #fff;
  transition: all .2s;
}

.sos-nav-center span {
  font-size: 12px;
  line-height: 1;
}

@media (max-width: 380px) {
  .bottom-nav {
    width: calc(100% - 12px);
    gap: 2px;
    padding: 7px 7px;
    border-radius: 22px;
  }

  .nav-item {
    padding: 7px 2px;
    gap: 3px;
    border-radius: 14px;
  }

  .nav-item span {
    font-size: 9px;
  }

  .nav-item svg {
    width: 17px;
    height: 17px;
  }

  .sos-nav-center {
    width: 62px;
    height: 62px;
    margin-top: -26px;
    border-width: 3px;
    flex-basis: 62px;
  }

  .sos-nav-center span {
    font-size: 11px;
  }

  .sos-nav-center svg {
    width: 18px;
    height: 18px;
  }
}


@media (min-width: 768px) {
  .bottom-nav {
    top: 0;
    left: 0;
    bottom: 0;
    transform: none;
    width: 260px;
    height: 100vh;
    max-width: none;
    border-radius: 0;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 32px 20px;
    border: none;
    border-right: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 4px 0 30px rgba(15, 23, 42, 0.03);
    z-index: 100;
  }

  .bottom-nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    margin-bottom: 28px;
  }

  .nav-item {
    flex: 0 0 auto;
    width: 100%;
    flex-direction: row;
    padding: 14px 16px;
    border-radius: 12px;
    justify-content: flex-start;
    gap: 16px;
    margin-bottom: 8px;
    color: #475569;
  }

  .nav-item svg {
    width: 20px;
    height: 20px;
  }

  .nav-item span {
    font-size: 15px;
  }

  .nav-item:hover {
    background: #F8FAFC;
    color: #0F172A;
  }

  .nav-item.active {
    background: #EFF6FF;
    color: #1D4ED8;
  }

  .nav-item:hover svg {
    transform: none;
    stroke: currentColor;
  }



  .sos-nav-center {
    display: none !important;
  }

  .app-wrapper {
    padding-left: 260px;
  }

  .app-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
  }
}

@media (min-width: 1024px) {
  .bottom-nav {
    width: 280px;
    padding: 40px 24px;
  }


  .sos-nav-center {
    display: none !important;
  }

  .app-wrapper {
    padding-left: 280px;
  }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar-brand-logo {
  width: 58px;
  min-width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-brand-copy h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #F8FAFC;
}

.sidebar-brand-copy p {
  margin: 6px 0 0;
  font-size: 10px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .56);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px !important;
  padding: 12px 16px !important;
  border-radius: 12px !important;
  color: #94A3B8 !important;
  cursor: pointer;
  margin-bottom: 4px;
  transition: all 0.2s ease;
  font-size: 14px !important;
  font-weight: 600 !important;
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  font-family: inherit;
  text-align: left;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
}

.sidebar-item.active {
  background: #2563EB !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
  border: none !important;
}