/* ---------------- Body & Sections ---------------- */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f8f9fb;
  color: #333;
  line-height: 1.4;
  padding: 0 0 40px;
  --bas-btn-primary: #6b92ef;
  --bas-btn-primary-deep: #5078d8;
  --bas-btn-primary-glow: rgba(107, 146, 239, 0.2);
  --bas-btn-secondary-bg: linear-gradient(180deg, #ffffff 0%, #edf3ff 100%);
  --bas-btn-secondary-border: #b8caee;
  --bas-btn-secondary-ink: #2d57ab;
  --bas-btn-secondary-hover: #dfeaff;
}

.bas-estimator-shell {
  width: min(1180px, calc(100% - 24px));
  margin: 18px auto 48px;
  padding: 24px;
  border: 1px solid #dddddd;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: none;
}

.section {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 16px;
  padding: 16px;
  margin: 14px 0;
}

/* ---------------- Inputs & Buttons ---------------- */
input[type="text"],
input[type="number"],
select {
  padding: 5px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 0;
  max-width: none;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid #a9bee9;
  background: #eef4ff;
  color: #2850a5;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  box-shadow: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

button:hover,
button:focus {
  background: #dbe8ff;
  border-color: #a9bee9;
  color: #2850a5;
  outline: none;
}

button:active {
  box-shadow: none;
}

button.small,
.basPopup-header button,
.bulk-controls button {
  min-height: 44px;
  min-width: 0;
  max-width: none;
  padding: 10px 20px;
  font-size: 16px;
}

/* ---------------- Tables ---------------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 13px;
}

th, td {
  border: 1px solid #e7e7e7;
  padding: 4px 6px;
  text-align: left;
}

th {
  background: #f6fbff;
}

/* ---------------- Notes ---------------- */
.note {
  font-size: 11px;
  opacity: 0.8;
}

/* ---------------- Popup ---------------- */
#basOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: none;
  z-index: 998;
}

#basPopup {
  position: fixed;
  z-index: 999;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #ddd;
  display: none;
  padding: 4px;
  box-sizing: border-box;
}

/* Popup header */
#basPopup .basPopup-header {
  position: sticky;
  top: 0;
  background: #f9fbff;
  border-bottom: 1px solid #e6eefb;
  padding: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
}

/* Global length/filter */
.basPopup-global-length,
.basPopup-filter {
  padding: 10px;
  border-bottom: 1px solid #eee;
  font-size: 12px;
}

/* Point list & entries */
#pointList {
  padding: 4px;
}

.point-entry {
  border-bottom: 1px dashed #eee;
  padding: 10px 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.point-left,
.point-right {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Bulk controls */
.bulk-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
}

/* Pills */
.pill {
  display: inline-block;
  padding: 2px 5px;
  border-radius: 999px;
  background: #f4f6f9;
  border: 1px solid #e6eaf2;
  font-size: 11px;
  margin-right: 4px;
}

/* System controls grid */
.sys-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

/* Subtotal line */
.subtotal-line {
  font-weight: bold;
  margin-top: 4px;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 480px) {
  .bas-estimator-shell {
      width: calc(100% - 16px);
      margin: 12px auto 28px;
      padding: 14px;
  }
  #basPopup {
      width: 95vw;
      max-height: 90vh;
  }
  .point-entry {
      grid-template-columns: 1fr; /* stack left/right for small screens */
  }
  th, td {
      font-size: 12px;
      padding: 3px 4px;
  }
  input[type="text"],
  input[type="number"],
  select,
  button {
      font-size: 12px;
  }

  button {
      width: 100%;
      min-width: 0;
      max-width: none;
      padding: 10px 12px;
  }

  button.small,
  .basPopup-header button,
  .bulk-controls button {
      min-width: 0;
  }
}

#disclaimer {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-style: italic;
  font-size: 14px;
  color: #333;
  background: #fefefe;
  border-left: 4px solid #0073e6;
  border-radius: 8px;
  padding: 12px 16px;
  padding-left: 12px;
  padding-right: 12px;
  margin: 10px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  line-height: 1.5;
  transition: transform 0.2s ease;
}

#disclaimer:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
