/* ── RF Coverage HiRes — Global styles ───────────────────────────────────── */

:root {
  --navy:    #1E3A5F;
  --teal:    #0D7377;
  --teal-lt: #4ADE80; /* Option 2: High-contrast Light Green (Good) */
  --green:   #14532D; /* Option 2: High-contrast Dark Green (Strong) */
  --amber:   #F59E0B;
  --red:     #EF4444;
  --purple:  #7C3AED;
  --lgrey:   #F1F5F9;
  --dgrey:   #374151;
  --white:   #FFFFFF;
  --sidebar-w: 310px;
}

/* ── Reset & base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  background: #F8FAFC;
  color: var(--dgrey);
}

/* ── App shell ───────────────────────────────────────────────────────────── */
#app-root { display: flex; flex-direction: column; height: 100vh; }

/* ── Top nav bar ─────────────────────────────────────────────────────────── */
.nav-bar {
  display: flex;
  align-items: center;
  height: 48px;
  background: var(--navy);
  padding: 0 16px;
  gap: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  z-index: 100;
}
.nav-brand {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: .3px;
  white-space: nowrap;
}
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-link {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  transition: background .15s, color .15s;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,.12);
  color: var(--white);
}
.tier-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 2px 8px;
  border-radius: 99px;
  color: var(--white);
  background: var(--teal);
  text-transform: uppercase;
}

/* ── Coverage page layout (sidebar + map) ────────────────────────────────── */
.coverage-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid #E2E8F0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-header {
  padding: 12px 14px 8px;
  border-bottom: 2px solid var(--teal);
  background: var(--navy);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.sidebar-section {
  border-bottom: 1px solid #E2E8F0;
  padding: 10px 12px;
}
.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}
.sidebar label {
  font-size: 11px;
  color: #64748B;
  margin-bottom: 2px;
  display: block;
}
.sidebar .dash-input, .sidebar input, .sidebar select {
  width: 100%;
  font-size: 12px;
  border: 1px solid #CBD5E1;
  border-radius: 5px;
  padding: 5px 8px;
  margin-bottom: 6px;
  background: #FAFAFA;
  transition: border-color .15s;
}
.sidebar .dash-input:focus, .sidebar input:focus {
  outline: none;
  border-color: var(--teal);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .08s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary  { background: var(--teal);  color: var(--white); }
.btn-primary:hover { background: #0B6165; }
.btn-navy     { background: var(--navy);  color: var(--white); }
.btn-navy:hover { background: #152c4a; }
.btn-danger   { background: var(--red);   color: var(--white); }
.btn-danger:hover { background: #c91c1c; }
.btn-ghost    { background: transparent; border: 1px solid #CBD5E1; color: var(--dgrey); }
.btn-ghost:hover { background: var(--lgrey); }
.btn-full     { width: 100%; }
.btn-sm       { padding: 4px 10px; font-size: 11px; }

/* ── Map panel ───────────────────────────────────────────────────────────── */
.map-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.map-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--white);
  border-bottom: 1px solid #E2E8F0;
  flex-shrink: 0;
}
.map-container {
  flex: 1;
  position: relative;
}
#main-map { width: 100%; height: 100%; }

/* ── Mode indicator pills ────────────────────────────────────────────────── */
.mode-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  display: inline-block;
}
.mode-pill.tx  { background: #FEE2E2; color: #991B1B; }
.mode-pill.rx  { background: #DCFCE7; color: var(--green); }
.mode-pill.pan { background: #EFF6FF; color: #1E40AF; }

/* ── Results / info panel tabs ───────────────────────────────────────────── */
.results-panel {
  height: 260px;
  background: var(--white);
  border-top: 1px solid #E2E8F0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.tab-bar {
  display: flex;
  border-bottom: 1px solid #E2E8F0;
  background: var(--lgrey);
  flex-shrink: 0;
}
.tab-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #64748B;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.tab-btn.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
  background: var(--white);
}
.tab-content { flex: 1; overflow: auto; padding: 8px 12px; }

/* ── Coverage legend ─────────────────────────────────────────────────────── */
.legend {
  position: absolute;
  bottom: 32px;
  right: 10px;
  background: rgba(255,255,255,.95);
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  padding: 12px 14px;
  z-index: 1000;
  min-width: 180px;
  max-width: 240px;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.legend-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  margin-bottom: 4px;
}
.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.results-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.results-table th {
  background: var(--navy);
  color: var(--white);
  padding: 5px 8px;
  text-align: left;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}
.results-table td { padding: 4px 8px; border-bottom: 1px solid #F1F5F9; }
.results-table tr:nth-child(even) td { background: #F8FAFC; }
.results-table tr:hover td { background: #EFF6FF; }
.los-clear        { color: var(--green);  font-weight: 600; }
.los-obstructed   { color: var(--red);    font-weight: 600; }
.los-horizon      { color: var(--purple); font-weight: 600; }
.los-tx           { color: var(--navy);   font-weight: 700; background: #FEF3C7; }

/* ── Progress bar ────────────────────────────────────────────────────────── */
.progress-wrap { padding: 8px 12px; }
.progress-bar-outer {
  height: 8px;
  background: #E2E8F0;
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar-inner {
  height: 100%;
  background: var(--teal);
  border-radius: 99px;
  transition: width .3s ease;
}
.progress-label { font-size: 11px; color: #64748B; margin-top: 4px; }

/* ── Login / account pages ───────────────────────────────────────────────── */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 48px);
  background: var(--lgrey);
}
.auth-card {
  background: var(--white);
  border-radius: 12px;
  padding: 36px 40px;
  width: 380px;
  box-shadow: 0 4px 24px rgba(0,0,0,.10);
}
.auth-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}
.auth-subtitle {
  font-size: 13px;
  color: #64748B;
  margin-bottom: 24px;
}
.auth-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #CBD5E1;
  border-radius: 7px;
  font-size: 13px;
  margin-bottom: 12px;
  transition: border-color .15s;
}
.auth-input:focus { outline: none; border-color: var(--teal); }
.auth-error { color: var(--red);   font-size: 12px; margin-bottom: 10px; min-height: 16px; }
.auth-info  { color: var(--teal);  font-size: 12px; margin-bottom: 10px; }

/* ── Utility ─────────────────────────────────────────────────────────────── */
.text-muted   { color: #94A3B8; font-size: 11px; }
.text-success { color: var(--green); }
.text-error   { color: var(--red); }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; }
.mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; }
.flex-row { display: flex; align-items: center; gap: 8px; }
.flex-spacer { flex: 1; }
.hidden { display: none !important; }

/* ── Scrollbars ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* RX signal level labels on map */
.rx-signal-label {
    background: rgba(30, 30, 30, 0.82) !important;
    border: none !important;
    color: white !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    white-space: nowrap !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.4) !important;
}
.rx-signal-label::before {
    display: none !important;
}