/* ============================================================
   layout.css
   App shell: header, sidebar, map container.
   ============================================================ */

/* ── App Shell ───────────────────────────────────────────────── */

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Header ─────────────────────────────────────────────────── */

.header {
  height: var(--header-height);
  background: var(--bg-void);
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  flex-shrink: 0;
  z-index: 600;
  position: relative;
}

/* Subtle scanline effect */
.header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255,255,255,0.01) 2px,
    rgba(255,255,255,0.01) 4px
  );
  pointer-events: none;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  user-select: none;
}

.header__logomark {
  width: 34px;
  height: 34px;
  background: var(--uc-red);
  color: white;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
  flex-shrink: 0;
}

.header__wordmark {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.4px;
  color: var(--text-primary);
}

.header__wordmark em {
  font-style: normal;
  color: var(--uc-red);
}

.header__meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.header__status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.header__status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Body ───────────────────────────────────────────────────── */

.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-panel);
  border-right: 1px solid var(--border-dim);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 500;
}

.sidebar__section {
  padding: var(--space-lg) var(--space-md) 0;
}

.sidebar__section:last-child {
  padding-bottom: var(--space-lg);
}

.section-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2.5px;
  color: var(--uc-red);
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-dim);
}

/* ── Map Container ───────────────────────────────────────────── */

.map-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg-void);
}

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

@media (max-width: 768px) {
  .app {
    width: 100%;
    min-height: 100vh;
    height: auto;
  }

  .app-body {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .sidebar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--border-dim);
  }

  .map-wrap {
    width: 100%;
    height: 52vh;
    min-height: 400px;
    flex: none;
  }

  .sidebar__section {
    padding: 16px 12px 0;
  }

  .header {
    padding: 0 var(--space-md);
  }

  .header__meta {
    display: none;
  }
}