﻿:root {
  color-scheme: light;
  --bg: #eef2f7;
  --panel: #ffffff;
  --ink: #0f1b2d;
  --muted: #5b6b7c;
  --accent: #e4572e;
  --navy: #0b2b46;
  --mint: #69b3a2;
  --teal: #3f9fb7;
  --shadow: 0 18px 40px rgba(15, 27, 45, 0.12);
  --soft-shadow: 0 10px 20px rgba(15, 27, 45, 0.08);
  --radius: 18px;
  --gap: 14px;
}

* {
  box-sizing: border-box;
  font-family: "Sora", sans-serif;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 12% 15%, rgba(66, 113, 174, 0.12), transparent 45%),
    radial-gradient(circle at 88% 8%, rgba(228, 87, 46, 0.12), transparent 45%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.92), rgba(236, 243, 251, 0.95));
  z-index: -1;
}

.powered-by {
  position: fixed;
  right: 18px;
  bottom: 12px;
  font-size: 11px;
  color: rgba(15, 27, 45, 0.35);
  letter-spacing: 0.06em;
  font-weight: 700;
  pointer-events: none;
  z-index: 2000;
}

.page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 14px 22px 18px;
  gap: var(--gap);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.tabs {
  display: flex;
  gap: 10px;
  margin: 2px 0 -4px;
  align-items: center;
}

.single-site-select {
  margin-left: 8px;
  min-width: 260px;
}

.tab {
  border: 1px solid #d2dae3;
  background: rgba(255,255,255,0.75);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(15, 27, 45, 0.12);
}

.tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.search-area {
  display: flex;
  gap: 16px;
  align-items: stretch;
  flex: 1;
}

.search-card {
  background: var(--panel);
  padding: 12px 14px;
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
  min-width: 420px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-button {
  border: none;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.compare-button {
  border: 1px solid #d2dae3;
  background: #fff;
  color: #162437;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.compare-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.compare-count {
  color: var(--muted);
  font-weight: 700;
  margin-left: 4px;
}

.search-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 27, 45, 0.18);
}

.export-button {
  border: 1px solid #d5dee8;
  background: #fff;
  color: #162437;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  margin-right: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.report-select {
  margin-right: 10px;
}

#download-report {
  font-weight: 800;
}

#download-report:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.export-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 27, 45, 0.12);
}

.share-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.share-modal.open {
  display: flex;
}

.share-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 27, 45, 0.55);
  backdrop-filter: blur(6px);
}

.share-card {
  position: relative;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(12, 20, 31, 0.22);
  padding: 20px 22px;
  width: min(560px, 90vw);
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.share-card h3 {
  margin: 0;
  font-size: 16px;
}

.share-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.share-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.share-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d7e0ea;
  border-radius: 10px;
  font-size: 12px;
}

.share-copy {
  border: none;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.search-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

#address-input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #d6dde6;
  font-size: 14px;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

#address-input:focus {
  border-color: #8bb0d8;
  box-shadow: 0 0 0 3px rgba(139, 176, 216, 0.35);
}

.radius-pills {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.pill {
  border: 1px solid #d2dae3;
  background: #f4f7fb;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(15, 27, 45, 0.12);
}

.pill.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.status-card {
  background: var(--panel);
  padding: 16px 20px;
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 220px;
}

.status-title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-value {
  font-size: 18px;
  font-weight: 600;
  margin-top: 8px;
}

.status-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.brand {
  display: flex;
  align-items: center;
  padding-left: 6px;
}

.logo {
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.08));
}

.dashboard {
  flex: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-rows: 1.15fr 0.85fr;
  grid-template-areas:
    "map supply"
    "wage trend";
  gap: var(--gap);
  min-height: 0;
}

.compare-dashboard {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1.2fr 0.8fr;
  gap: var(--gap);
  min-height: 0;
}

.compare-map-panel {
  padding-bottom: 16px;
}

.compare-table-wrap {
  overflow: auto;
  border: 1px solid #e3e9f2;
  border-radius: 14px;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.compare-table th,
.compare-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15, 27, 45, 0.08);
  vertical-align: top;
}

.compare-table th {
  position: sticky;
  top: 0;
  background: #f7f9fc;
  z-index: 1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.compare-table thead tr:nth-child(2) th {
  top: 34px; /* second header row under the first */
  font-size: 11px;
}

.header-info {
  border: none;
  background: transparent;
  color: #0b2b46;
  font-weight: 900;
  cursor: pointer;
  padding: 0 2px;
}

.compare-details-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1300;
}

.compare-details-modal.open { display: flex; }

.compare-details-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 27, 45, 0.55);
  backdrop-filter: blur(6px);
}

.compare-details-card {
  position: relative;
  background: linear-gradient(160deg, #ffffff 0%, #f7f9fc 100%);
  border-radius: 20px;
  box-shadow:
    0 28px 80px rgba(12, 20, 31, 0.22),
    0 8px 20px rgba(12, 20, 31, 0.12);
  padding: 18px 18px 14px;
  width: min(980px, 92vw);
  max-height: 86vh;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.compare-details-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(15, 27, 45, 0.08);
}

.details-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.details-toggle {
  border: 1px solid #d2dae3;
  background: #f4f7fb;
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.details-toggle.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.details-heat {
  padding: 10px 12px;
}

.heat-grid {
  display: grid;
  gap: 10px;
}

.heat-occ {
  border: 1px solid rgba(15, 27, 45, 0.10);
  border-radius: 14px;
  overflow: hidden;
}

.heat-occ-title {
  padding: 10px 12px;
  font-weight: 800;
  font-size: 12px;
  background: rgba(15, 27, 45, 0.04);
  display: flex;
  align-items: center;
  gap: 8px;
}

.heat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.heat-table th,
.heat-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(15, 27, 45, 0.06);
  text-align: left;
  white-space: nowrap;
}

.heat-table th {
  background: #fbfcfe;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.compare-details-header h3 {
  margin: 0;
  font-size: 16px;
}

.compare-details-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.compare-details-close {
  background: #f1f4f9;
  border: none;
  border-radius: 999px;
  font-size: 20px;
  width: 36px;
  height: 36px;
  cursor: pointer;
}

.compare-details-body {
  margin-top: 12px;
  overflow: auto;
  border: 1px solid #e3e9f2;
  border-radius: 14px;
  background: #fff;
}

.details-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.details-table th,
.details-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15, 27, 45, 0.08);
  text-align: left;
}

.details-table th {
  background: #f7f9fc;
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.occ-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.compare-table .site-name {
  font-weight: 700;
  color: #10233b;
}

.compare-table .site-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.select {
  border: 1px solid #d2dae3;
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  color: #162437;
}

.link-btn {
  border: none;
  background: transparent;
  color: #0b2b46;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(11, 43, 70, 0.08);
  color: #0b2b46;
}

.badge.adv { background: rgba(59, 178, 115, 0.12); color: #2b8a57; }
.badge.comp { background: rgba(228, 87, 87, 0.12); color: #b53b3b; }
.badge.neu { background: rgba(11, 43, 70, 0.10); color: #0b2b46; }

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  overflow: hidden;
  animation: panelRise 0.7s ease both;
}

.dashboard .panel:nth-child(1) {
  animation-delay: 0.05s;
}

.dashboard .panel:nth-child(2) {
  animation-delay: 0.15s;
}

.dashboard .panel:nth-child(3) {
  animation-delay: 0.25s;
}

.dashboard .panel:nth-child(4) {
  animation-delay: 0.35s;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.panel-header h2 {
  margin: 0;
  font-size: 18px;
}

.panel-header p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.panel-pill {
  background: #f1f4f9;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.trend-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trend-toggle {
  border: 1px solid #d2dae3;
  background: #f4f7fb;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.trend-toggle.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.map-panel {
  grid-area: map;
  padding-bottom: 48px;
}

.map {
  flex: 1;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  border: 1px solid #e3e9f2;
  overflow: hidden;
  animation: mapReveal 1.1s ease both;
}

.map-legend {
  position: absolute;
  left: 24px;
  bottom: 20px;
  background: rgba(255, 255, 255, 0.92);
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(15, 27, 45, 0.12);
  font-size: 11px;
  animation: floatIn 0.9s ease both 0.4s;
}

.legend-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.legend-bar {
  width: 160px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #ffffff 0%,
    #d9d9d9 25%,
    #b0b0b0 50%,
    #7a7a7a 75%,
    #1a1a1a 100%
  );
  margin-bottom: 6px;
}

.legend-range {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.wage-panel {
  grid-area: wage;
}

.supply-panel {
  grid-area: supply;
}

.trend-panel {
  grid-area: trend;
}

.chart {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.supply-metrics {
  display: flex;
  gap: 12px;
  margin: 6px 0 10px;
}

.hiring-box {
  flex: 1;
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(140deg, rgba(11, 43, 70, 0.08), rgba(255, 255, 255, 0.95));
  border: 1px solid rgba(11, 43, 70, 0.18);
  box-shadow: 0 10px 22px rgba(15, 27, 45, 0.08);
}

.hiring-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hiring-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #10233b;
}

.hiring-note {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
}

.hiring-value {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 700;
  color: #0f1b2d;
}

.hiring-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}


.wage-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.wage-trend-overlay {
  position: absolute;
  inset: 14px 18px 18px;
  background: rgba(15, 27, 45, 0.28);
  border-radius: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 5;
  backdrop-filter: blur(6px);
}

.wage-trend-overlay.open {
  display: flex;
  animation: modalPop 0.25s ease both;
}

.wage-trend-card {
  width: min(760px, 100%);
  height: min(100%, 520px);
  background: linear-gradient(150deg, #ffffff 0%, #f5f8fc 100%);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(12, 20, 31, 0.18);
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
}

.wage-trend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(15, 27, 45, 0.08);
  padding-bottom: 10px;
}

.wage-trend-header h3 {
  margin: 0;
  font-size: 16px;
}

.wage-trend-header p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.wage-trend-close {
  background: #f1f4f9;
  border: none;
  border-radius: 999px;
  font-size: 20px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wage-trend-close:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 18px rgba(15, 27, 45, 0.12);
}

.wage-trend-chart {
  flex: 1;
  min-height: 280px;
  margin-top: 12px;
}

.summary-card {
  border-radius: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--card-accent-soft, #f4f7fb), #ffffff 70%);
  border: 1px solid var(--card-accent-border, #e3e9f2);
  font-size: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 27, 45, 0.12);
}

.summary-title {
  font-weight: 600;
  color: #1c2d44;
  margin-bottom: 2px;
  font-size: 12px;
}

.summary-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.summary-card span {
  display: block;
  font-size: 18px;
  font-weight: 600;
  margin-top: 6px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.open {
  display: flex;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 27, 45, 0.55);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  background: linear-gradient(160deg, #ffffff 0%, #f7f9fc 100%);
  border-radius: 20px;
  box-shadow:
    0 28px 80px rgba(12, 20, 31, 0.22),
    0 8px 20px rgba(12, 20, 31, 0.12);
  padding: 24px 28px 26px;
  width: min(720px, 90vw);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  z-index: 1;
  animation: modalPop 0.25s ease both;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(15, 27, 45, 0.08);
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-close {
  background: #f1f4f9;
  border: none;
  border-radius: 999px;
  font-size: 20px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-close:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 18px rgba(15, 27, 45, 0.12);
}

.modal-chart {
  flex: 1;
  min-height: 300px;
  margin-top: 14px;
  padding: 6px 2px 6px 2px;
}

.modal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(15, 27, 45, 0.08);
}

@keyframes panelRise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mapReveal {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1200px) {
  .page {
    height: auto;
  }

  .dashboard {
    grid-template-columns: 1fr;
    grid-template-areas:
      "map"
      "supply"
      "wage"
      "trend";
    grid-template-rows: auto;
  }

  .panel {
    min-height: 380px;
  }

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

  .search-area {
    flex-direction: column;
  }
}
