:root {
  --blue: #0a66c2;
  --blue-dark: #074d93;
  --ink: #111827;
  --text: #263244;
  --muted: #6b7280;
  --line: #d9dee8;
  --panel: #f7f8fb;
  --white: #ffffff;
  --red: #cf2f2f;
  --orange: #c45a11;
  --green: #118755;
  --violet: #4f46e5;
  --shadow: 0 18px 50px rgba(17, 24, 39, 0.16);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef2f7;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  position: relative;
  width: 100%;
  height: 100%;
  background: #e8edf3;
}

.topbar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  padding: 0 14px;
  background: rgba(247, 248, 251, 0.92);
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-logo {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.brand-logo span {
  color: var(--red);
}

.brand small {
  color: #8b95a5;
  font-size: 11px;
  font-weight: 800;
}

.top-icons {
  display: flex;
  gap: 8px;
}

.round-btn,
.ghost-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 50%;
  background: #f2f4f8;
  color: var(--ink);
  cursor: pointer;
}

.round-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.weekly-banner {
  position: absolute;
  top: 42px;
  right: 0;
  left: 0;
  z-index: 19;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 18px;
  background: rgba(255, 244, 244, 0.92);
  border-bottom: 1px solid rgba(207, 47, 47, 0.18);
  color: #a01414;
  backdrop-filter: blur(14px);
}

.weekly-banner p {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.weekly-banner span {
  color: #b45656;
  font-weight: 500;
}

.weekly-banner button {
  border: 0;
  background: transparent;
  color: #b45656;
  font-size: 20px;
  cursor: pointer;
}

.weekly-banner.hidden {
  display: none;
}

.map-stage {
  position: absolute;
  inset: 42px 0 0 0;
}

.map {
  position: absolute;
  inset: 0;
  background: #d9e1ea;
}

.map::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: rgba(255, 255, 255, 0.08);
}

.map-fallback {
  position: absolute;
  inset: 84px 12px auto 12px;
  z-index: 4;
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.control-strip {
  position: absolute;
  top: 52px;
  right: 14px;
  left: 0;
  z-index: 10;
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.control-strip select,
.view-toggle,
.control-strip input {
  pointer-events: auto;
}

select,
input,
textarea {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 248, 251, 0.94);
  color: var(--text);
  outline: none;
}

select {
  padding: 0 32px 0 10px;
}

input,
textarea {
  width: 100%;
  padding: 0 12px;
}

textarea {
  min-height: 84px;
  padding-top: 10px;
  resize: vertical;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.13);
}

.view-toggle {
  margin-left: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  min-width: 96px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(237, 240, 245, 0.92);
  border: 1px solid rgba(17, 24, 39, 0.08);
}

.view-toggle button {
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #677083;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.view-toggle button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 5px 14px rgba(17, 24, 39, 0.08);
}

.stats-card {
  position: absolute;
  top: 100px;
  left: 0;
  z-index: 8;
  display: flex;
  min-width: 204px;
  min-height: 46px;
  border-radius: 0 10px 10px 0;
  overflow: hidden;
  background: rgba(247, 248, 251, 0.88);
  border: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
}

.stats-card div {
  display: grid;
  align-content: center;
  min-width: 100px;
  padding: 8px 10px;
}

.stats-card div + div {
  border-left: 1px solid var(--line);
}

.stats-card strong {
  color: #b50e18;
  font-size: 18px;
  line-height: 1;
}

.stats-card span {
  color: var(--muted);
  font-size: 10px;
}

.area-card {
  position: absolute;
  left: 0;
  bottom: 108px;
  z-index: 8;
  display: grid;
  gap: 3px;
  min-width: 172px;
  padding: 12px 14px;
  border-radius: 0 10px 10px 0;
  background: rgba(247, 248, 251, 0.88);
  border: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
}

.area-card strong {
  font-size: 16px;
}

.area-card span {
  color: var(--muted);
  font-size: 11px;
}

.area-card b {
  color: #b50e18;
  font-size: 13px;
}

.primary-fab {
  position: absolute;
  right: 80px;
  bottom: 14px;
  left: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border: 0;
  border-radius: 0 8px 8px 0;
  background: #070b16;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 18px 44px rgba(7, 11, 22, 0.28);
  cursor: pointer;
}

.primary-fab span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  line-height: 1;
}

.marker {
  display: grid;
  width: clamp(42px, 7vw, 70px);
  height: clamp(42px, 7vw, 70px);
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  color: #fff;
  box-shadow: 0 8px 20px rgba(74, 20, 20, 0.3);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.marker.severe {
  background: #8e2428;
}

.marker.medium {
  background: #a2362e;
}

.marker.low {
  background: #df3d3d;
}

.marker.resolved {
  background: var(--green);
}

.user-marker {
  position: relative;
  width: 22px;
  height: 22px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 8px rgba(10, 102, 194, 0.18), 0 10px 20px rgba(17, 24, 39, 0.24);
}

.user-marker::after {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
}

.list-panel {
  position: absolute;
  inset: 94px 14px 76px 14px;
  z-index: 15;
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 16px;
  background: rgba(247, 248, 251, 0.96);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head p,
.issue-meta,
.mini-label {
  margin: 0;
  color: #7b8494;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.panel-head input {
  max-width: 260px;
}

.report-list {
  display: grid;
  gap: 10px;
  max-height: calc(100% - 76px);
  overflow: auto;
  padding: 12px;
}

.list-card,
.admin-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
}

.list-card {
  cursor: pointer;
}

.list-card strong,
.admin-item strong {
  font-size: 16px;
}

.list-card span,
.admin-item span {
  color: var(--muted);
  font-size: 12px;
}

.admin-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eef1f6;
}

.admin-thumb.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.admin-desc {
  margin: 0;
  color: #344052;
  font-size: 13px;
}

dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(17, 24, 39, 0.32);
}

.issue-dialog {
  width: min(500px, 92vw);
  max-width: 92vw;
}

.issue-sheet {
  position: relative;
  max-height: 88vh;
  overflow: auto;
  border-radius: 16px;
  background: rgba(247, 248, 251, 0.96);
  box-shadow: var(--shadow);
}

.issue-sheet::before {
  position: sticky;
  top: 8px;
  z-index: 2;
  display: block;
  width: 36px;
  height: 4px;
  margin: 8px auto 0;
  border-radius: 99px;
  background: #b8c0ce;
  content: "";
}

.sheet-close {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 3;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #7b8494;
  font-size: 26px;
  cursor: pointer;
}

.sheet-close.static {
  position: static;
}

.sheet-actions {
  position: absolute;
  top: 28px;
  right: 64px;
  z-index: 3;
}

.issue-content {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-right: 80px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 99px;
  background: #e9edf4;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.badge.severe {
  background: rgba(207, 47, 47, 0.12);
  color: var(--red);
}

.badge.medium {
  background: rgba(196, 90, 17, 0.13);
  color: var(--orange);
}

.badge.low {
  background: rgba(10, 102, 194, 0.12);
  color: var(--blue);
}

.badge.resolved {
  background: rgba(17, 135, 85, 0.12);
  color: var(--green);
}

.badge.review {
  background: rgba(196, 90, 17, 0.13);
  color: var(--orange);
}

.issue-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.issue-location {
  margin: -6px 0 0;
  color: #606b7c;
  font-size: 13px;
}

.issue-photo {
  width: 100%;
  aspect-ratio: 16 / 6;
  object-fit: cover;
  border-radius: 12px;
  background: #dce4ee;
}

.photo-placeholder {
  display: grid;
  min-height: 160px;
  place-items: center;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(10, 102, 194, 0.22), rgba(207, 47, 47, 0.12)),
    #e3e9f2;
  color: #3b4658;
  font-weight: 900;
}

.seen-btn {
  justify-self: end;
  min-height: 34px;
  margin-top: -54px;
  margin-right: 10px;
  padding: 0 14px;
  border: 1px solid rgba(196, 90, 17, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #bd4b0c;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.seen-btn.voted {
  color: var(--green);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metric {
  display: grid;
  gap: 6px;
  min-height: 68px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #eef1f6;
}

.metric strong {
  color: var(--orange);
  font-size: 19px;
}

.metric span {
  color: #7b8494;
  font-size: 11px;
  font-weight: 800;
}

.metric.type strong {
  color: var(--violet);
  font-size: 14px;
  line-height: 1.1;
}

.accountability {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #eef1f6;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.account-box {
  display: grid;
  place-items: center;
  min-height: 64px;
  padding: 8px;
  border: 1px solid rgba(207, 47, 47, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  text-align: center;
}

.account-box span {
  color: #8a5360;
  font-size: 11px;
  font-weight: 800;
}

.account-box strong {
  color: #a31219;
}

.authority-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
}

.authority-card h3 {
  margin: 0;
  font-size: 18px;
}

.authority-card p {
  margin: -4px 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.action-link,
.admin-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: #edf0f5;
  color: #344052;
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
}

.action-link.primary {
  background: #cff8e3;
  color: #09623f;
}

.share-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.form-dialog,
.admin-dialog {
  width: min(520px, 94vw);
}

.report-form,
.admin-panel {
  overflow: hidden;
  border-radius: 16px;
  background: rgba(247, 248, 251, 0.98);
  box-shadow: var(--shadow);
}

.report-form {
  display: grid;
  gap: 12px;
  padding-bottom: 16px;
}

.report-form label {
  display: grid;
  gap: 6px;
  padding: 0 16px;
}

.report-form label span {
  color: #596579;
  font-size: 12px;
  font-weight: 900;
}

.report-meta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(10, 102, 194, 0.14);
  border-radius: 12px;
  background: rgba(232, 241, 251, 0.82);
}

.report-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 16px;
}

.report-meta-card > div {
  flex: 1 1 auto;
  min-width: 0;
}

.report-meta-card.subtle {
  background: rgba(247, 248, 251, 0.98);
  border-color: var(--line);
}

.report-meta-card strong {
  display: block;
  font-size: 13px;
  line-height: 1.4;
}

.meta-label {
  display: block;
  margin-bottom: 3px;
  color: #596579;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.meta-action {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.meta-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.report-meta-card .meta-action {
  min-width: 84px;
}

.submit-btn {
  min-height: 46px;
  margin: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.admin-list {
  display: grid;
  gap: 10px;
  max-height: 70vh;
  overflow: auto;
  padding: 14px;
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-action.danger {
  color: var(--red);
}

.admin-action.approve {
  background: #cff8e3;
  color: #09623f;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 78px;
  left: 16px;
  z-index: 80;
  max-width: 520px;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 12px;
  background: #07111f;
  color: #fff;
  box-shadow: 0 18px 48px rgba(17, 24, 39, 0.26);
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.empty {
  padding: 28px 14px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 700px) {
  .topbar {
    height: 42px;
    padding-inline: 10px;
  }

  .brand-logo {
    font-size: 19px;
  }

  .control-strip {
    top: 50px;
    right: 8px;
    left: 8px;
    flex-wrap: wrap;
  }

  .control-strip select {
    max-width: calc(33.33% - 6px);
    min-width: 0;
    font-size: 12px;
  }

  .view-toggle {
    order: 5;
    width: 96px;
  }

  .stats-card {
    top: 124px;
  }

  .issue-dialog {
    width: 100vw;
    max-width: 100vw;
    margin: auto 0 0;
  }

  .issue-sheet {
    max-height: 82vh;
    border-radius: 18px 18px 0 0;
  }

  .issue-content {
    padding: 18px 16px 22px;
  }

  .metric-grid,
  .account-grid,
  .share-row {
    grid-template-columns: 1fr;
  }

  .list-panel {
    inset: 126px 8px 76px;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-head input {
    max-width: none;
  }

  .primary-fab {
    right: 70px;
  }

  .report-meta-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-actions {
    padding: 0 16px;
  }

  .report-meta-card .meta-action {
    width: 100%;
  }
}
