:root {
  --sand: #f7f2e7;
  --sand-strong: #efe2c6;
  --ink: #16202b;
  --ink-soft: #43515e;
  --accent: #ef8354;
  --accent-deep: #d66334;
  --mint: #2a9d8f;
  --line: rgba(22, 32, 43, 0.12);
  --glass: rgba(255, 255, 255, 0.72);
  --shadow: 0 20px 50px rgba(17, 25, 40, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Tajawal", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(239, 131, 84, 0.18), transparent 34%),
    radial-gradient(circle at left bottom, rgba(42, 157, 143, 0.16), transparent 26%),
    linear-gradient(135deg, #fbf7ef 0%, #f2e6d2 100%);
}

.landing-body {
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.landing-shell {
  width: min(100%, 900px);
}

.glass-card {
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 28px;
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  padding: 36px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-deep);
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
}

.lead {
  margin: 0 0 26px;
  max-width: 56rem;
  color: var(--ink-soft);
  font-size: 1.1rem;
  line-height: 1.7;
}

.share-form {
  display: grid;
  gap: 14px;
}

.field-label,
.status-label,
dt {
  color: var(--ink-soft);
  font-weight: 700;
}

.text-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  padding: 16px 18px;
  font: inherit;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.text-input:focus {
  outline: none;
  border-color: rgba(239, 131, 84, 0.8);
  box-shadow: 0 0 0 4px rgba(239, 131, 84, 0.14);
}

.action-row,
.helper-row,
.sidebar-head,
.summary-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.primary-button,
.ghost-button,
.map-link {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background-color 0.18s ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent) 0%, #f3a662 100%);
  color: #fff;
  font-weight: 800;
}

.ghost-button,
.map-link {
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  border: 1px solid rgba(22, 32, 43, 0.08);
}

.primary-button:hover,
.ghost-button:hover,
.map-link:hover {
  transform: translateY(-1px);
}

.status-grid,
.details-grid {
  display: grid;
  gap: 14px;
}

.status-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 22px 0 18px;
}

.status-card,
.details-card {
  border-radius: 22px;
  border: 1px solid rgba(22, 32, 43, 0.08);
  background: rgba(255, 255, 255, 0.58);
  padding: 18px;
}

.status-card {
  display: grid;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 800;
}

.status-idle {
  background: rgba(22, 32, 43, 0.08);
  color: var(--ink);
}

.status-waiting {
  background: rgba(239, 131, 84, 0.14);
  color: var(--accent-deep);
}

.status-live {
  background: rgba(42, 157, 143, 0.14);
  color: var(--mint);
}

.status-off {
  background: rgba(169, 44, 65, 0.14);
  color: #8e2133;
}

.status-message {
  margin: 0 0 16px;
  font-size: 1rem;
  line-height: 1.7;
}

.details-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 0;
}

dt {
  margin-bottom: 6px;
}

dd {
  margin: 0;
  font-weight: 700;
}

.helper-note {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.map-body {
  min-height: 100vh;
  padding: 18px;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  gap: 18px;
  min-height: calc(100vh - 36px);
}

.sidebar,
.map-panel {
  padding: 20px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.secondary-link {
  white-space: nowrap;
}

.summary-number {
  font-size: 2rem;
}

.fit-button {
  width: 100%;
}

.empty-state {
  border-radius: 18px;
  border: 1px dashed rgba(22, 32, 43, 0.18);
  padding: 18px;
  color: var(--ink-soft);
  text-align: center;
}

.users-list {
  list-style: none;
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  overflow: auto;
}

.user-item {
  border: 1px solid rgba(22, 32, 43, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  padding: 14px;
  cursor: pointer;
}

.user-item strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.user-meta {
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.7;
}

.map-canvas {
  width: 100%;
  min-height: 100%;
  border-radius: 24px;
  overflow: hidden;
}

.leaflet-container {
  font-family: "Tajawal", "Segoe UI", sans-serif;
}

.person-marker {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50% 50% 50% 12%;
  background: linear-gradient(145deg, var(--accent) 0%, var(--accent-deep) 100%);
  box-shadow:
    0 12px 22px rgba(17, 25, 40, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
  transform: rotate(-45deg);
}

.person-marker svg {
  position: absolute;
  inset: 7px;
  width: 26px;
  height: 26px;
  transform: rotate(45deg);
  fill: none;
  stroke: #fff8ef;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-name-tooltip {
  border: 0;
  border-radius: 999px;
  background: rgba(22, 32, 43, 0.9);
  color: #fff;
  box-shadow: none;
  padding: 4px 8px;
}

.user-name-tooltip::before {
  display: none;
}

.popup-card {
  min-width: 180px;
}

.popup-card strong {
  display: block;
  margin-bottom: 8px;
}

.popup-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

@media (max-width: 900px) {
  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-panel {
    min-height: 60vh;
  }
}

@media (max-width: 640px) {
  .hero-card,
  .sidebar,
  .map-panel {
    padding: 20px;
    border-radius: 22px;
  }

  h1 {
    font-size: 1.8rem;
  }

  .action-row,
  .helper-row,
  .sidebar-head {
    align-items: stretch;
  }

  .primary-button,
  .ghost-button,
  .map-link {
    width: 100%;
    text-align: center;
  }
}
