:root {
  --navy: #07182d;
  --navy-2: #0d2746;
  --blue: #1b65b8;
  --blue-soft: #e8f1fb;
  --gold: #f5b82e;
  --cream: #fffaf0;
  --white: #ffffff;
  --ink: #102033;
  --muted: #667587;
  --line: #dfe6ee;
  --green: #16845b;
  --orange: #d66a1f;
  --shadow: 0 14px 34px rgba(7, 24, 45, .12);
  --radius: 20px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #f5f7fa;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 72px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(7, 24, 45, .96);
  backdrop-filter: blur(18px);
  color: white;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: white;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--gold);
  font-size: 22px;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: -.2px; }
.brand small { margin-top: 2px; color: #b7c6d8; font-size: 11px; }

.icon-button, .map-tool-button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  color: white;
  font-size: 25px;
}

main { min-height: calc(100vh - 72px); }
.view { padding-bottom: calc(90px + var(--safe-bottom)); }

.hero {
  padding: 38px 18px 30px;
  color: white;
  background:
    radial-gradient(circle at 85% 10%, rgba(245,184,46,.22), transparent 31%),
    linear-gradient(150deg, var(--navy), var(--navy-2));
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.7px;
}

.hero .eyebrow { color: var(--gold); }

.hero h1, .compact-header h1 {
  margin: 0;
  letter-spacing: -1.8px;
  line-height: 1.02;
}

.hero h1 { font-size: clamp(35px, 10vw, 56px); }
.hero h1 span { color: var(--gold); }

.hero > p:not(.eyebrow) {
  max-width: 560px;
  margin: 17px 0 22px;
  color: #c8d5e4;
  line-height: 1.55;
}

.search-box {
  max-width: 700px;
  min-height: 56px;
  padding: 0 8px 0 17px;
  display: flex;
  gap: 10px;
  align-items: center;
  border-radius: 18px;
  background: white;
  color: var(--muted);
  box-shadow: var(--shadow);
}

.search-box > span { font-size: 24px; }
.search-box input, .map-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search-box button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 22px;
}

.quick-actions {
  max-width: 700px;
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-button, .secondary-button, .route-button {
  min-height: 48px;
  padding: 11px 16px;
  border-radius: 15px;
  font-weight: 800;
}

.primary-button {
  border: 0;
  background: var(--gold);
  color: var(--navy);
}

.secondary-button {
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
  color: white;
}

.content-section { padding: 26px 16px 0; }
.content-section.no-pad { padding-top: 28px; }

.section-heading {
  margin-bottom: 14px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 15px;
}

.section-heading h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -.5px;
}

.count-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.area-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.area-card {
  min-height: 125px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 6px 20px rgba(7,24,45,.05);
  text-decoration: none;
  color: inherit;
}

.area-card:first-child {
  grid-column: 1 / -1;
  background: var(--navy);
  color: white;
}

.area-symbol { font-size: 27px; }
.area-card strong { display: block; font-size: 18px; }
.area-card small { margin-top: 4px; display: block; color: var(--muted); }
.area-card:first-child small { color: #bac8d7; }

.location-list { display: grid; gap: 11px; }

.location-card {
  padding: 15px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: 0 5px 18px rgba(7,24,45,.05);
  color: inherit;
  text-decoration: none;
}

.location-card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--blue-soft);
  font-size: 22px;
}

.location-card h3 { margin: 0 0 4px; font-size: 16px; }
.location-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.location-card-arrow { color: #9ba8b6; font-size: 22px; }

.freshness {
  margin-top: 7px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.freshness::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.freshness.stale { color: var(--orange); }

.compact-header {
  padding: 25px 16px 15px;
  display: flex;
  gap: 13px;
  align-items: center;
  background: white;
}

.compact-header h1 { font-size: 30px; }

.back-button {
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--ink);
  font-size: 22px;
}

.breadcrumbs {
  padding: 2px 16px 16px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  white-space: nowrap;
  background: white;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumbs a { color: var(--blue); text-decoration: none; font-weight: 700; }

.area-list { padding: 16px; display: grid; gap: 10px; }

.area-row {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
  color: inherit;
  text-decoration: none;
}

.area-row strong { display: block; }
.area-row small { display: block; margin-top: 4px; color: var(--muted); }

.map-view {
  position: relative;
  height: calc(100vh - 72px);
  padding-bottom: 0;
  overflow: hidden;
}

#map { height: 100%; width: 100%; background: #dfe7eb; }

.map-toolbar {
  position: absolute;
  z-index: 700;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
}

.map-search {
  min-height: 46px;
  padding: 0 14px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 15px;
  background: white;
  box-shadow: var(--shadow);
}

.map-tool-button {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border: 0;
  background: var(--navy);
  box-shadow: var(--shadow);
}

.filter-bar {
  position: absolute;
  z-index: 700;
  top: 68px;
  left: 0;
  right: 0;
  padding: 0 12px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  box-shadow: 0 5px 15px rgba(7,24,45,.08);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.filter-chip.active { border-color: var(--navy); background: var(--navy); color: white; }

.map-summary {
  position: absolute;
  z-index: 700;
  left: 14px;
  right: 14px;
  bottom: calc(79px + var(--safe-bottom));
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 16px;
  background: rgba(7,24,45,.94);
  color: white;
  box-shadow: var(--shadow);
  font-size: 12px;
}

.map-summary span { color: #bdcad8; }

.custom-marker {
  width: 38px !important;
  height: 38px !important;
  margin: -19px 0 0 -19px !important;
  display: grid !important;
  place-items: center;
  border: 3px solid white;
  border-radius: 50% 50% 50% 8px;
  background: var(--navy);
  box-shadow: 0 5px 12px rgba(7,24,45,.28);
  transform: rotate(-45deg);
  font-size: 18px;
}

.custom-marker span { transform: rotate(45deg); }

.popup-card { min-width: 210px; }
.popup-card h3 { margin: 0 0 5px; }
.popup-card p { margin: 0 0 9px; color: var(--muted); }
.popup-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.popup-actions a {
  padding: 8px;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue);
  text-align: center;
  font-weight: 800;
  text-decoration: none;
}

.list-search { margin: 0 16px 12px; box-shadow: none; border: 1px solid var(--line); }
.list-filters {
  position: static;
  padding: 0 16px 13px;
}
.list-filters .filter-chip { box-shadow: none; }

.sort-row {
  padding: 0 16px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.sort-row select {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
}

#allResults, #browseResults { padding: 0 16px; }

.detail-cover {
  position: relative;
  height: 190px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 70% 20%, rgba(245,184,46,.32), transparent 33%),
    linear-gradient(145deg, var(--navy), #143f6e);
}

.detail-back { position: absolute; top: 15px; left: 15px; }

.detail-icon {
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  border: 4px solid rgba(255,255,255,.28);
  border-radius: 29px;
  background: var(--gold);
  font-size: 46px;
  box-shadow: var(--shadow);
}

.detail-content { padding: 22px 17px; }

.detail-content h1 {
  margin: 0 0 6px;
  font-size: 30px;
  letter-spacing: -1px;
}

.detail-meta { color: var(--muted); line-height: 1.5; }

.status-banner {
  margin: 20px 0;
  padding: 15px;
  border-radius: 17px;
  background: #e8f7f1;
  color: #0b6846;
}

.status-banner strong { display: block; margin-bottom: 3px; }

.detail-box {
  margin: 12px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
}

.detail-box h2 { margin: 0 0 10px; font-size: 17px; }

.product-tags { display: flex; flex-wrap: wrap; gap: 7px; }

.product-tag {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.route-button {
  width: 100%;
  display: block;
  border: 0;
  background: var(--gold);
  color: var(--navy);
  text-align: center;
  text-decoration: none;
}

.empty-state {
  padding: 30px 18px;
  border: 1px dashed #b9c5d2;
  border-radius: 18px;
  background: white;
  color: var(--muted);
  text-align: center;
}

.empty-state strong { display: block; margin-bottom: 4px; color: var(--ink); }

.bottom-nav {
  position: fixed;
  z-index: 900;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(69px + var(--safe-bottom));
  padding: 7px 8px var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(18px);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 13px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}

.bottom-nav a span { font-size: 22px; line-height: 1; }
.bottom-nav a.active { color: var(--blue); background: var(--blue-soft); }

.toast {
  position: fixed;
  z-index: 2000;
  left: 50%;
  bottom: calc(85px + var(--safe-bottom));
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border-radius: 13px;
  background: var(--navy);
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 15px);
  transition: .2s ease;
  font-size: 13px;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 760px) {
  body { background: #eef2f6; }
  .topbar { padding-inline: max(24px, calc((100vw - 1180px)/2)); }
  .view:not(.map-view) { max-width: 1180px; margin: 0 auto; background: #f5f7fa; }
  .hero { padding: 58px 48px 48px; border-radius: 0 0 28px 28px; }
  .content-section { padding-inline: 30px; }
  .area-grid { grid-template-columns: repeat(3, 1fr); }
  .area-card:first-child { grid-column: auto; }
  .location-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bottom-nav { left: 50%; right: auto; width: 460px; transform: translateX(-50%); border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; }
  .map-toolbar { max-width: 540px; left: 24px; right: auto; width: calc(100% - 48px); }
  .filter-bar { left: 12px; right: 12px; top: 70px; }
  .map-summary { left: auto; right: 24px; width: 340px; bottom: 86px; }
  .compact-header, .breadcrumbs { padding-inline: 30px; }
  .area-list { grid-template-columns: repeat(3, 1fr); padding-inline: 30px; }
  #allResults, #browseResults { padding-inline: 30px; }
  .list-search { margin-inline: 30px; }
  .list-filters, .sort-row { padding-inline: 30px; }
  .detail-content { max-width: 760px; margin: 0 auto; }
}

@media (max-width: 390px) {
  .quick-actions { grid-template-columns: 1fr; }
  .map-summary span { display: none; }
}


/* Adminpanel */
.topbar-actions { display: flex; gap: 8px; }

.admin-view { min-height: calc(100vh - 72px); background: #eef2f6; }
.admin-header { border-bottom: 1px solid var(--line); }
.admin-shell { max-width: 520px; margin: 40px auto; padding: 0 16px; }
.admin-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
  box-shadow: 0 8px 28px rgba(7,24,45,.08);
}
.admin-card h2 { margin: 0 0 8px; }
.admin-card > p { color: var(--muted); line-height: 1.55; }
.admin-card code { padding: 2px 5px; border-radius: 5px; background: #eef2f6; }
.admin-login-card { text-align: left; }
.admin-login-card > h2, .admin-login-card > p { text-align: center; }
.admin-lock { margin: 0 auto 12px; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 20px; background: var(--blue-soft); font-size: 28px; }

.form-field { display: grid; gap: 7px; margin-top: 14px; }
.form-field > span, .product-fieldset legend { color: #34465a; font-size: 12px; font-weight: 800; }
.form-field input, .form-field select, .form-field textarea, .admin-search input {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid #cfd9e4;
  border-radius: 12px;
  outline: 0;
  background: white;
  color: var(--ink);
}
.form-field textarea { resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus, .admin-search input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(27,101,184,.12);
}
.full-button { width: 100%; margin-top: 18px; }
.form-error { min-height: 20px; margin: 10px 0 0 !important; color: #b42318 !important; font-size: 13px; }

.admin-dashboard { padding: 18px 16px 100px; }
.admin-toolbar {
  max-width: 1440px;
  margin: 0 auto 14px;
  padding: 14px 16px;
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: space-between;
  border-radius: 18px;
  background: var(--navy);
  color: white;
}
.admin-toolbar strong, .admin-toolbar small { display: block; }
.admin-toolbar small { margin-top: 3px; color: #b9c8d8; }
.admin-toolbar-actions { display: flex; gap: 8px; }
.secondary-dark-button {
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid #cbd6e2;
  border-radius: 13px;
  background: white;
  color: var(--ink);
  font-weight: 800;
}
.admin-toolbar .secondary-dark-button { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.1); color: white; }

.admin-layout {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.admin-list-panel {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 115px);
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
}
.admin-search {
  min-height: 46px;
  padding: 0 11px;
  display: flex;
  gap: 8px;
  align-items: center;
  border-radius: 13px;
  background: #f3f6f9;
}
.admin-search input { min-height: 40px; padding: 6px; border: 0; background: transparent; box-shadow: none !important; }
.admin-location-list { margin-top: 10px; max-height: calc(100vh - 195px); overflow-y: auto; display: grid; gap: 7px; }
.admin-location-item {
  width: 100%;
  padding: 11px;
  display: grid;
  grid-template-columns: 38px minmax(0,1fr);
  gap: 9px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 13px;
  background: #f5f7fa;
  color: var(--ink);
  text-align: left;
}
.admin-location-item.active { border-color: var(--blue); background: var(--blue-soft); }
.admin-location-item-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: white; }
.admin-location-item strong, .admin-location-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-location-item small { margin-top: 3px; color: var(--muted); font-size: 11px; }

.admin-editor .admin-card { padding: 24px; }
.admin-form-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-form-heading h2 { margin: 0; font-size: 26px; }
.danger-button {
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid #f4b4ae;
  border-radius: 12px;
  background: #fff1f0;
  color: #b42318;
  font-weight: 800;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 14px; }
.form-span-2 { grid-column: 1 / -1; }
.product-fieldset { padding: 13px; border: 1px solid #cfd9e4; border-radius: 14px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.checkbox-grid label { padding: 9px; border-radius: 10px; background: #f3f6f9; font-size: 12px; }
.checkbox-grid input { min-height: auto; width: auto; }
.toggle-field { margin-top: 28px; display: flex; gap: 9px; align-items: center; font-weight: 800; font-size: 13px; }
.toggle-field input { width: 19px; height: 19px; }

.coordinate-help { margin-top: 20px; padding: 12px 14px; display: flex; justify-content: space-between; gap: 10px; border-radius: 13px 13px 0 0; background: var(--navy); color: white; }
.coordinate-help span { color: #bdcad8; font-size: 12px; }
.admin-map { height: 390px; border-radius: 0 0 16px 16px; background: #dfe7eb; overflow: hidden; }
.admin-save-row { margin-top: 18px; display: flex; gap: 9px; align-items: center; justify-content: flex-end; }
.admin-save-row > span { margin-right: auto; color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-list-panel { position: static; max-height: none; }
  .admin-location-list { max-height: 270px; }
  .checkbox-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 600px) {
  .admin-dashboard { padding-inline: 10px; }
  .admin-toolbar { align-items: flex-start; }
  .admin-toolbar, .admin-toolbar-actions { flex-direction: column; }
  .admin-toolbar-actions, .admin-toolbar-actions button { width: 100%; }
  .admin-toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .admin-editor .admin-card { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-span-2 { grid-column: auto; }
  .checkbox-grid { grid-template-columns: 1fr 1fr; }
  .coordinate-help { flex-direction: column; }
  .admin-map { height: 320px; }
  .admin-save-row { flex-wrap: wrap; }
  .admin-save-row > span { width: 100%; }
  .admin-save-row button { flex: 1; }
}


/* Områdeadministrasjon */
.admin-tabs {
  max-width: 1440px;
  margin: 0 auto 14px;
  padding: 5px;
  display: flex;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}
.admin-tab {
  min-height: 42px;
  padding: 8px 18px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}
.admin-tab.active { background: var(--navy); color: white; }

.admin-areas-panel { max-width: 1440px; margin: 0 auto; }
.admin-intro { margin: 8px 0 20px; color: var(--muted); line-height: 1.5; }
.area-admin-layout {
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(360px, 1.1fr);
  gap: 18px;
  align-items: start;
}
.admin-area-tree {
  margin-top: 10px;
  max-height: 650px;
  overflow-y: auto;
  display: grid;
  gap: 5px;
}
.admin-area-item {
  width: 100%;
  min-height: 44px;
  padding: 8px 11px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 11px;
  background: #f5f7fa;
  color: var(--ink);
  text-align: left;
}
.admin-area-item:hover, .admin-area-item.active {
  border-color: var(--blue);
  background: var(--blue-soft);
}
.admin-area-item strong, .admin-area-item small { display: block; }
.admin-area-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.area-type-badge {
  padding: 5px 7px;
  border-radius: 8px;
  background: white;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
}
.area-editor {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fafc;
}
.area-editor h3 { margin: 0; font-size: 21px; }
.area-path-preview {
  margin-top: 16px;
  padding: 13px;
  border-radius: 13px;
  background: var(--blue-soft);
}
.area-path-preview span, .area-path-preview strong { display: block; }
.area-path-preview span { color: var(--muted); font-size: 11px; }
.area-path-preview strong { margin-top: 5px; color: var(--blue); line-height: 1.45; }

@media (max-width: 850px) {
  .area-admin-layout { grid-template-columns: 1fr; }
  .admin-area-tree { max-height: 340px; }
}


/* Produksjonsklart adressøk */
.geocode-panel {
  margin-top: 20px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  background: #f8fafc;
}
.geocode-panel > div:first-child strong,
.geocode-panel > div:first-child span { display: block; }
.geocode-panel > div:first-child span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.geocode-search {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 8px;
}
.geocode-search input {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cfd9e4;
  border-radius: 12px;
  outline: 0;
}
.geocode-search input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(27,101,184,.12);
}
.geocode-results { margin-top: 9px; display: grid; gap: 6px; }
.geocode-result {
  width: 100%;
  padding: 10px 11px;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  gap: 9px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  color: var(--ink);
  text-align: left;
}
.geocode-result:hover { border-color: var(--blue); background: var(--blue-soft); }
.geocode-result strong, .geocode-result small { display: block; }
.geocode-result small { margin-top: 3px; color: var(--muted); line-height: 1.35; }
.geocode-message { padding: 9px; color: var(--muted); font-size: 12px; }
.map-data-credit { margin: 7px 2px 0; color: var(--muted); font-size: 10px; }
.geocode-panel + .coordinate-help { margin-top: 0; border-radius: 0; }

@media (max-width: 550px) {
  .geocode-search { grid-template-columns: 1fr; }
}


/* Tilgjengelighetsstatus */
.availability {
  margin-top: 7px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 900;
}

.availability::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: currentColor;
}

.availability.confirmed { color: #16845b; }
.availability.unconfirmed { color: #c58a00; }
.availability.out-of-stock { color: #c43d35; }

.status-banner.unconfirmed {
  background: #fff4d8;
  color: #8d6100;
}

.status-banner.out-of-stock {
  background: #fff0ef;
  color: #a52d27;
}

.custom-marker.unconfirmed { background: #c58a00; }
.custom-marker.out-of-stock { background: #c43d35; }
.custom-marker.confirmed { background: #16845b; }

/* Coop hurtigimport */
.coop-import-card {
  max-width: 1440px;
  margin: 0 auto 14px;
}

.coop-import-heading {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

.coop-import-heading h2 { margin: 0 0 5px; }
.coop-import-heading p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.coop-import-status {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.coop-import-status.success { color: #16845b; font-weight: 800; }
.coop-import-status.error { color: #b42318; font-weight: 800; }

@media (max-width: 700px) {
  .bottom-nav a { font-size: 9px; }
  .bottom-nav a span { font-size: 20px; }
  .coop-import-heading { align-items: stretch; flex-direction: column; }
  .coop-import-heading button { width: 100%; }
}


/* Enkel masseimport */
.bulk-import-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.bulk-format-help {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.bulk-import-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.file-button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

@media (max-width: 760px) {
  .bulk-import-grid { grid-template-columns: 1fr; }
  .bulk-import-actions { flex-direction: column; }
  .bulk-import-actions > * { width: 100%; }
}


/* Robust importmotor */
.import-dropzone {
  margin-top: 16px;
  min-height: 92px;
  padding: 16px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #b9c8d8;
  border-radius: 16px;
  background: #f8fafc;
  text-align: center;
  cursor: pointer;
}

.import-dropzone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.import-dropzone strong,
.import-dropzone span {
  display: block;
}

.import-dropzone span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.import-preview {
  margin-top: 16px;
}

.import-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}

.import-stats > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  text-align: center;
}

.import-stats strong,
.import-stats span {
  display: block;
}

.import-stats strong {
  font-size: 24px;
}

.import-stats span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.import-options {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
}

.import-details {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.import-details summary {
  cursor: pointer;
  font-weight: 800;
}

.import-preview-list {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.import-preview-item {
  padding: 9px 10px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 10px;
  border-radius: 10px;
  background: #f5f7fa;
}

.import-preview-item strong,
.import-preview-item small {
  display: block;
}

.import-preview-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.import-badge {
  align-self: center;
  padding: 5px 7px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
}

.import-badge.new {
  background: #e8f7f1;
  color: #16845b;
}

.import-badge.duplicate {
  background: #fff4d8;
  color: #8d6100;
}

.import-badge.invalid {
  background: #fff0ef;
  color: #a52d27;
}

.import-progress-wrap {
  margin-top: 16px;
  padding: 13px;
  border-radius: 13px;
  background: var(--navy);
  color: white;
}

.import-progress-head {
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.import-progress-head span {
  color: #bdcad8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-progress-wrap progress {
  width: 100%;
  height: 12px;
}

.bulk-import-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .import-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .import-options { grid-template-columns: 1fr; }
  .bulk-import-actions { flex-direction: column; }
  .bulk-import-actions button { width: 100%; }
}


/* Fellesskapsrapporter */
.community-box {
  margin: 18px 0 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  box-shadow: 0 7px 22px rgba(7,24,45,.06);
}

.community-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.community-heading h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.community-dot {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 7px;
  border-radius: 50%;
  background: #9aa8b7;
  box-shadow: 0 0 0 5px rgba(154,168,183,.14);
}

.community-dot.confirmed {
  background: #16845b;
  box-shadow: 0 0 0 5px rgba(22,132,91,.14);
}

.community-dot.out_of_stock {
  background: #c43d35;
  box-shadow: 0 0 0 5px rgba(196,61,53,.14);
}

.community-dot.mixed {
  background: #c58a00;
  box-shadow: 0 0 0 5px rgba(197,138,0,.14);
}

.community-counts {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.community-counts span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #f3f6f9;
}

.community-counts .community-positive {
  background: #e8f7f1;
  color: #116746;
  font-weight: 800;
}

.community-counts .community-negative {
  background: #fff0ef;
  color: #a52d27;
  font-weight: 800;
}

.community-question {
  margin: 20px 0 10px;
  font-weight: 900;
}

.report-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.report-button {
  min-height: 105px;
  padding: 14px;
  display: grid;
  grid-template-columns: 35px minmax(0,1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
  color: var(--ink);
  text-align: left;
}

.report-button > span {
  grid-row: 1 / 3;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 900;
}

.report-button strong {
  align-self: end;
  font-size: 14px;
}

.report-button small {
  align-self: start;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.3;
}

.report-confirmed > span {
  background: #e8f7f1;
  color: #16845b;
}

.report-unavailable > span {
  background: #fff0ef;
  color: #c43d35;
}

.report-confirmed.selected {
  border-color: #16845b;
  background: #e8f7f1;
}

.report-unavailable.selected {
  border-color: #c43d35;
  background: #fff0ef;
}

.report-button:disabled {
  opacity: .55;
  cursor: wait;
}

.user-report-note {
  min-height: 18px;
  margin: 11px 0 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.report-disclaimer {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

@media (max-width: 530px) {
  .report-buttons {
    grid-template-columns: 1fr;
  }
}


/* Områdereparasjon og autosortering */
.area-repair-card {
  max-width: 1440px;
  margin: 0 auto 14px;
  border-color: #f0cf76;
  background: linear-gradient(135deg, #fffdf6, #ffffff);
}

.area-repair-heading h2 {
  margin: 0 0 6px;
}

.area-repair-heading p:last-child {
  max-width: 850px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.area-repair-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
}

.area-repair-actions button {
  flex: 1;
}

@media (max-width: 650px) {
  .area-repair-actions {
    flex-direction: column;
  }
}

/* Admin rapportinnboks */
.reports-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.reports-header h2 {
  margin: 0 0 5px;
}

.reports-header p:last-child {
  margin: 0;
  color: var(--muted);
}

.admin-reports-list {
  margin-top: 18px;
  display: grid;
  gap: 11px;
}

.admin-report-card {
  padding: 15px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.admin-report-card.confirmed {
  border-left: 5px solid #16845b;
}

.admin-report-card.unavailable {
  border-left: 5px solid #c43d35;
}

.admin-report-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f3f6f9;
  font-size: 22px;
  font-weight: 900;
}

.admin-report-card.confirmed .admin-report-icon {
  background: #e8f7f1;
  color: #16845b;
}

.admin-report-card.unavailable .admin-report-icon {
  background: #fff0ef;
  color: #c43d35;
}

.admin-report-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.admin-report-heading strong,
.admin-report-heading span {
  display: block;
}

.admin-report-heading span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.admin-report-heading time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.admin-report-actions {
  margin-top: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.danger-button {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #e1b4b0;
  border-radius: 12px;
  background: #fff0ef;
  color: #a52d27;
  font-weight: 800;
}

@media (max-width: 650px) {
  .reports-header,
  .admin-report-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-report-heading time {
    white-space: normal;
  }

  .admin-report-actions {
    flex-direction: column;
  }

  .admin-report-actions > * {
    width: 100%;
    text-align: center;
  }
}

.smart-cluster {
  background: transparent;
}

.smart-cluster span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  color: white;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 5px 15px rgba(7, 24, 45, 0.3);
}

.smart-cluster-confirmed span {
  background: #16845b;
}

.smart-cluster-unavailable span {
  background: #c43d35;
}

.smart-cluster-unconfirmed span {
  background: #d99b00;
}

.smart-cluster-mixed span {
  background: #163d68;
}