:root{
  --bsm-orange: #F85838;
  --bsm-dark: #484050;
  --bg: #f6f7fb;
  --card: #ffffff;
  --border: #e6e7ee;
  --text: #111827;
  --muted: #6b7280;
  --danger: #b91c1c;
}

*{ box-sizing: border-box; }

html, body{
  height: 100%;
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}

.topbar{
  height: 64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 0 16px;
  background: var(--bsm-dark);
  color: #fff;
  border-bottom: 4px solid var(--bsm-orange);
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
}
.logo{
  height: 42px;
  width: auto;
  border-radius: 6px;
  background: #fff;
  padding: 2px;
}
.titles .title{
  font-weight: 700;
  font-size: 16px;
  line-height: 1.1;
}
.titles .subtitle{
  font-size: 12px;
  opacity: 0.9;
}

.top-actions{
  display:flex;
  gap: 8px;
}

.main{
  height: calc(100vh - 64px);
  display:flex;
}

.sidebar{
  width: 380px;
  min-width: 340px;
  max-width: 420px;
  overflow-y: auto;
  padding: 10px 10px 24px 10px;
  border-right: 1px solid var(--border);
  background: #fbfbfe;
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  margin: 10px 0;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.04);
}

.card h3{
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--bsm-dark);
}

label{
  display:block;
  font-size: 12px;
  font-weight: 600;
  margin-top: 10px;
  margin-bottom: 6px;
  color: #111827;
}

.input{
  width: 100%;
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: #fff;
  font-size: 13px;
}

.input:focus{
  border-color: rgba(248, 88, 56, 0.75);
  box-shadow: 0 0 0 3px rgba(248, 88, 56, 0.15);
}

.row{
  display:flex;
  gap: 8px;
  margin-top: 10px;
}
.row.small{
  align-items:center;
  margin-top: 8px;
}
.row.small a{
  font-size: 12px;
  color: var(--bsm-dark);
  text-decoration: none;
}
.row.small a:hover{
  text-decoration: underline;
}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hint{
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.btn{
  appearance: none;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--bsm-dark);
  font-weight: 700;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.btn:hover{
  border-color: rgba(72, 64, 80, 0.35);
}

.btn.primary{
  background: var(--bsm-orange);
  border-color: var(--bsm-orange);
  color: #fff;
}

.btn.primary:hover{
  filter: brightness(0.97);
}

.btn.danger{
  background: #fff;
  border-color: rgba(185, 28, 28, 0.35);
  color: var(--danger);
}

.btn.full{
  width: 100%;
  margin-top: 10px;
}

.summary{
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed rgba(72, 64, 80, 0.25);
  background: #fafafa;
  font-size: 12px;
  color: var(--bsm-dark);
  min-height: 24px;
}

.statusBox{
  font-size: 12px;
  color: var(--bsm-dark);
}

.tableOptions{
  margin-top: 8px;
  padding-top: 4px;
}

.mapwrap{
  flex: 1;
  position: relative;
}

#map{
  width: 100%;
  height: calc(100vh - 64px);
}

.mapLegend{
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  font-size: 12px;
  color: var(--bsm-dark);
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.08);
}
.mapLegend .swatch{
  display:inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  border: 1px solid rgba(0,0,0,0.15);
}
.swatch.surface{ background: rgba(248, 88, 56, 0.45); }
.swatch.exclusion{ background: rgba(185, 28, 28, 0.35); }
.swatch.modules{ background: rgba(72, 64, 80, 0.25); }

.mapTop{
  position: absolute;
  left: 12px;
  top: 12px;
  right: 12px;
  display:flex;
  gap: 8px;
  z-index: 1000;
}

.chartWrap{
  margin-top: 10px;
}

.leaflet-container{
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

