:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #020713;
  color: #f5f8ff;
  font-synthesis: none;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% -10%, rgba(0, 175, 255, .13), transparent 34rem),
    radial-gradient(circle at 85% 0%, rgba(255, 181, 45, .07), transparent 28rem),
    #020713;
}

button, input { font: inherit; }

button { cursor: pointer; }

.login-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  overflow: hidden;
}

.login-map-preview {
  position: absolute;
  inset: clamp(1rem, 3vw, 3rem);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-content: center;
  opacity: .78;
}

.preview-map-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(107, 150, 199, .25);
  border-radius: 1.15rem;
  background: rgba(0, 3, 9, .96);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 1.5rem 4rem rgba(0,0,0,.32);
}

.preview-map-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem .2rem;
}

.preview-map-card header span { font-size: clamp(1.1rem, 2vw, 1.6rem); font-weight: 600; }
.preview-map-card header small { color: #6f829d; font-size: .72rem; }
.preview-map-card svg { display: block; width: 100%; aspect-ratio: 1.86; padding: .35rem .7rem .7rem; }
.preview-map-card .country { fill: #02050b; stroke: rgba(92, 129, 169, .43); }
.visitor-preview header span { color: #48dff1; }
.contract-preview header span { color: #ffd06d; }

.login-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at center, rgba(2, 7, 19, .12) 0 16rem, rgba(2, 7, 19, .46) 42rem);
  pointer-events: none;
}

.login-panel {
  position: relative;
  z-index: 2;
  width: min(100%, 27rem);
  padding: clamp(1.6rem, 5vw, 2.5rem);
  border: 1px solid rgba(126, 167, 211, .22);
  border-radius: 1.5rem;
  background: linear-gradient(150deg, rgba(8, 24, 48, .96), rgba(3, 11, 25, .98));
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, .52), inset 0 1px 0 rgba(255, 255, 255, .04);
}

.brand-mark {
  display: flex;
  align-items: end;
  gap: .34rem;
  height: 2.25rem;
  margin-bottom: 1.5rem;
}

.brand-mark span {
  display: block;
  width: .62rem;
  border-radius: 999px;
  background: linear-gradient(#45e5ff, #078eff);
  box-shadow: 0 0 1.25rem rgba(20, 193, 255, .5);
}

.brand-mark span:first-child { height: 1.4rem; }
.brand-mark span:last-child { height: 2.15rem; }

.eyebrow, .panel-kicker {
  margin: 0 0 .55rem;
  color: #32cef1;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 { margin: 0; font-size: clamp(1.75rem, 5vw, 2.35rem); line-height: 1.1; }

.login-copy { color: #9db0c9; line-height: 1.6; }

form { display: grid; gap: .7rem; margin-top: 1.8rem; }

label { color: #c9d6e8; font-size: .9rem; }

input {
  width: 100%;
  min-height: 3rem;
  margin-bottom: .55rem;
  border: 1px solid rgba(129, 164, 207, .28);
  border-radius: .8rem;
  padding: .7rem .9rem;
  background: #050d1c;
  color: #fff;
  outline: none;
}

input:focus { border-color: #20c9ef; box-shadow: 0 0 0 3px rgba(32, 201, 239, .13); }

form button {
  min-height: 3.1rem;
  margin-top: .35rem;
  border: 0;
  border-radius: .85rem;
  background: linear-gradient(135deg, #09a9e7, #15d3c0);
  color: #00101b;
  font-weight: 800;
}

.form-error { margin: .5rem 0 0; color: #ff8f97; line-height: 1.45; }

.dashboard-shell { min-height: 100vh; padding: 1.3rem; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 112rem;
  margin: 0 auto 1rem;
  padding: .4rem .4rem .65rem;
}

.brand-name { margin: 0; font-size: 1.05rem; font-weight: 650; }
.last-update { margin: .2rem 0 0; color: #7185a2; font-size: .76rem; }
.topbar-actions { display: flex; align-items: center; gap: .85rem; }

.live-status {
  display: inline-flex;
  align-items: center;
  gap: .48rem;
  color: #35e879;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.live-status i {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 .8rem currentColor;
}

.live-status.offline { color: #ff8f97; }

.quiet-button {
  border: 1px solid rgba(126, 167, 211, .2);
  border-radius: .65rem;
  padding: .55rem .75rem;
  background: transparent;
  color: #a9bbd2;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 112rem;
  margin: 0 auto;
}

.map-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(107, 150, 199, .23);
  border-radius: 1.1rem;
  background: linear-gradient(145deg, rgba(5, 18, 39, .94), rgba(1, 8, 20, .97));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 1rem 3rem rgba(0,0,0,.22);
}

.panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem 1.35rem .35rem;
}

.panel-header h2 { margin: 0; font-size: clamp(1.45rem, 2.3vw, 2rem); font-weight: 550; }

.metric-row { display: flex; align-items: stretch; }

.metric {
  display: grid;
  min-width: 8.8rem;
  padding: .2rem 0 .2rem 1.2rem;
  border-left: 1px solid rgba(138, 168, 205, .2);
}

.metric:first-child { padding-left: 0; padding-right: 1.2rem; border-left: 0; }
.metric strong { font-size: 1.3rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.metric span { margin-top: .18rem; color: #8da0ba; font-size: .72rem; }
.visitor-panel .primary-metric strong, .visitor-panel .activity-section h3 { color: #24d8f3; }
.contract-panel .primary-metric strong, .contract-panel .activity-section h3 { color: #ffc65a; }

.map-stage { position: relative; aspect-ratio: 1.86; min-height: 17rem; padding: .5rem 1.1rem; }
.map-stage svg { display: block; width: 100%; height: 100%; overflow: visible; }
.country { fill: rgba(7, 17, 32, .52); stroke: rgba(112, 143, 180, .29); stroke-width: .7; vector-effect: non-scaling-stroke; }
.empty-map { position: absolute; inset: 50% 0 auto; margin: 0; transform: translateY(-50%); color: #40516b; text-align: center; font-size: .8rem; letter-spacing: .04em; }

.map-dot { fill: #ffd266; filter: drop-shadow(0 0 4px rgba(255, 210, 102, .7)); }
.map-pulse-core { fill: #dcfbff; }
.visitor-pulse .map-pulse-ring, .visitor-pulse .map-pulse-core { stroke: #18d9e9; }
.contract-pulse .map-pulse-ring, .contract-pulse .map-pulse-core { stroke: #ffc75c; }
.map-pulse-ring { fill: none; stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: pulse 1.15s ease-out 2; }
.map-pulse-core { stroke-width: 5; filter: drop-shadow(0 0 9px currentColor); }

@keyframes pulse {
  from { r: 7px; opacity: 1; }
  to { r: 30px; opacity: 0; }
}

.activity-section { margin: 0 1.1rem 1.05rem; border-top: 1px solid rgba(119, 153, 192, .17); padding-top: .75rem; }
.activity-section h3 { margin: 0 0 .65rem; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.activity-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 0; padding: 0; list-style: none; }
.activity-list li { min-width: 0; padding-right: .6rem; border-right: 1px solid rgba(118, 150, 188, .14); }
.activity-list li:last-child { border-right: 0; }
.activity-place { display: block; overflow: hidden; color: #e5edf8; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.activity-time { display: block; margin-top: .2rem; color: #60748f; font-size: .68rem; font-variant-numeric: tabular-nums; }
.empty-activity { grid-column: 1 / -1; border: 0 !important; color: #536780; font-size: .76rem; }

@media (max-width: 1050px) {
  .map-grid { grid-template-columns: 1fr; }
  .map-stage { min-height: 19rem; }
  .login-map-preview { grid-template-columns: 1fr; inset: 1rem; opacity: .58; }
  .preview-map-card:last-child { display: none; }
}

@media (max-width: 620px) {
  .dashboard-shell { padding: .75rem; }
  .topbar { padding-inline: .2rem; }
  .last-update { display: none; }
  .panel-header { display: grid; padding: 1.1rem 1rem .2rem; }
  .metric-row { width: 100%; }
  .metric { flex: 1; min-width: 0; }
  .map-stage { min-height: 13.5rem; padding: .35rem .45rem; }
  .activity-section { margin-inline: .85rem; }
  .activity-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-list li:nth-child(n+3) { display: none; }
  .brand-name { font-size: .9rem; }
  .quiet-button { padding: .48rem .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .map-pulse-ring { animation: none; }
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.2rem;
  border-radius: 12px;
  color: #03121c;
  background: linear-gradient(135deg, #58e9d8, #69bfff);
  font-weight: 750;
  text-decoration: none;
}
