/* FBC Costing engine page styles (reuses master.css theme). */
.costing-shell {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 18px;
  align-items: start;
}

.costing-card {
  background: var(--panel, #ffffff);
  border: 1px solid var(--border, #e5e9f0);
  border-radius: 12px;
  padding: 20px;
}

.costing-card__title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 650;
}

.costing-card__sub {
  margin: 0 0 16px;
  font-size: 12.5px;
  color: var(--fg-muted, #5d7684);
}

.costing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.costing-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--fg-muted, #5d7684);
}

.costing-field--check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--fg, #1a1f2b);
}

.costing-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.costing-result {
  margin-top: 16px;
  border-top: 1px dashed var(--border, #e5e9f0);
  padding-top: 12px;
}

.costing-result__row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}

.costing-result__row--total {
  border-top: 1px solid var(--border, #e5e9f0);
  margin-top: 4px;
  padding-top: 10px;
  font-weight: 650;
  font-size: 14px;
}

.costing-result__note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--fg-muted, #5d7684);
}

.costing-result--agg {
  margin-top: 14px;
}

/* margin line editor */
.margin-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.margin-line {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.6fr 1fr auto;
  gap: 8px;
  align-items: center;
}

.margin-line__del {
  color: #b3352f;
}

.margin-result {
  margin-top: 16px;
}

.margin-missing td {
  color: #b3352f;
}

.margin-missing {
  background: #fdf3f2;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (prefers-color-scheme: dark) {
  .costing-card { background: #1a1f2b; border-color: #2a3040; }
  .costing-result__row--total { border-color: #2a3040; }
  .margin-missing { background: #2a1e1d; }
}
