:root { --module-color: #2563eb; }
body[data-module-theme="green"] { --module-color: #16a34a; }
body[data-module-theme="orange"] { --module-color: #ea580c; }
body[data-module-theme="violet"] { --module-color: #7c3aed; }
body[data-module-theme="slate"] { --module-color: #475569; }
body[data-module-theme="amber"] { --module-color: #b45309; }
body[data-module-theme="cyan"] { --module-color: #0891b2; }
.module-heading { color: var(--module-color); }
.module-button, .nav-item.active { background: var(--module-color); color: white; }
.nav-item.active:hover { background: var(--module-color); background: color-mix(in srgb, var(--module-color) 90%, black); color: white; }
.nav-item.active > button:hover { background: rgb(255 255 255 / 18%); color: white; }
.spinner { width: 1.25rem; height: 1.25rem; border: 2px solid #cbd5e1; border-top-color: var(--module-color); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

body.gis-fullscreen header,
body.gis-fullscreen #sidebar,
body.gis-fullscreen #sidebar-backdrop {
  display: none !important;
}

body.gis-fullscreen #main-content {
  padding-top: 0 !important;
  padding-left: 0 !important;
  width: 100vw !important;
  min-height: 100dvh !important;
}

body.gis-fullscreen #main-content-inner {
  max-width: none !important;
  width: 100vw !important;
  min-height: 100dvh !important;
  padding: 0 !important;
}

body.gis-fullscreen #gis-project-detail,
body.gis-fullscreen #gis-layer-records {
  min-height: 100vh;
  margin: 0 !important;
  padding: 0 !important;
}

body.gis-fullscreen .gis-fullscreen-hidden {
  display: none !important;
}

body.gis-fullscreen .gis-map-panel {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  width: 100vw !important;
  min-height: 100dvh !important;
}

body.gis-fullscreen .gis-map-panel > :not(.gis-project-map):not([data-gis-map-actions]):not([data-gis-layer-controls]):not([data-gis-draw-overlay]):not([data-gis-draw-done-button]) {
  display: none !important;
}

body.gis-fullscreen .gis-map-layout {
  display: block !important;
  gap: 0 !important;
  margin-top: 0 !important;
}

body.gis-fullscreen .gis-project-map {
  width: 100vw !important;
  height: 100dvh !important;
}

body.gis-fullscreen [data-gis-map-actions] {
  position: fixed !important;
  left: 0.75rem !important;
  top: 0.75rem !important;
}

body.gis-fullscreen [data-gis-layer-controls] {
  position: fixed !important;
  left: 0.75rem !important;
  bottom: 0.75rem !important;
}

.gis-feature-editor-drawer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  width: min(28rem, 96vw);
  max-height: 100dvh;
  transform: translateX(-102%);
  transition: transform 0.2s ease-in-out;
  padding: 0.75rem;
}

.gis-feature-editor-drawer.is-open {
  transform: translateX(0);
}

.gis-feature-editor-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 1.5rem);
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.gis-feature-editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem 0.7rem;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.gis-feature-editor-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.gis-feature-editor-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: #475569;
}

.gis-feature-editor-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.gis-feature-editor-control {
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}

.gis-feature-editor-control:hover {
  background: #f8fafc;
}

.gis-feature-editor-error {
  margin: 0.75rem 1rem 0;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  background: #fff1f2;
  color: #b91c1c;
  padding: 0.55rem 0.7rem;
  font-size: 0.82rem;
}

.gis-feature-editor-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.9rem 1rem 1rem;
  overflow: auto;
}

.gis-feature-editor-field {
  display: block;
}

.gis-feature-editor-field-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
}

.gis-feature-editor-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.86rem;
  color: #0f172a;
  background: #ffffff;
}

.gis-feature-editor-input:focus {
  outline: 2px solid #bae6fd;
  border-color: #0891b2;
}

.gis-feature-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: auto;
  padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
  position: sticky;
  bottom: 0;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.gis-feature-editor-btn {
  border-radius: 0.5rem;
  border: 1px solid transparent;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.gis-feature-editor-btn-secondary {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #334155;
}

.gis-feature-editor-btn-secondary:hover {
  background: #f8fafc;
}

.gis-feature-editor-btn-primary {
  border-color: #0e7490;
  background: #0e7490;
  color: #ffffff;
}

.gis-feature-editor-btn-primary:hover {
  background: #155e75;
}
/* Dashboard cards keep their navbar icons stable in the two-column mobile grid. */
[data-module-card] > div > span:first-child > span:first-child {
  flex: none;
}

@media (max-width: 639px) {
  [data-module-card] {
    min-height: 9rem;
    padding: 0.75rem;
  }

  [data-module-card] > div {
    gap: 0.5rem;
  }

  [data-module-card] > div > span:first-child {
    min-width: 0;
    gap: 0.5rem;
  }

  [data-module-card] > div > span:first-child > span:first-child {
    width: 2rem;
    height: 2rem;
  }

  [data-module-card] h3 {
    font-size: 0.875rem;
    line-height: 1.25rem;
  }

  [data-module-card] > div > span:last-child {
    flex: none;
  }

  [data-module-card] > p {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.125rem;
  }
}
