:root {
  --primary: #d72328;
  --bg: #eee;
  --white: #ffffff;
  --text: #222;
  --muted: #777;
  --border: #ddd;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

/* =======================
   TOP BAR
======================= */
.topbar {
  background: var(--white);
  border-bottom: 2px solid var(--primary);
  padding: 14px 0;
}

.brand {
  font-weight: 800;
  font-size: 18px;
  color: var(--primary);
}

.nav a {
  margin-left: 18px;
  font-weight: 500;
  color: var(--text);
}

.nav a:hover {
  color: var(--primary);
}

/* =======================
   HEADINGS
======================= */
h1 {
  font-size: 22px;
  margin-bottom: 15px;
  color: var(--primary);
}

.h3 {
  margin-top: 20px;
  color: var(--primary);
  font-size: 16px;
}

/* =======================
   CARDS
======================= */
.card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
  margin-top: 15px;
}

/* =======================
   GRID
======================= */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.grid3 {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 15px;
}

.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

/* =======================
   FORM
======================= */
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

input, select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
}

input:focus, select:focus {
  border-color: var(--primary);
  outline: none;
}

/* =======================
   BUTTONS
======================= */
.btn {
  padding: 9px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: var(--primary);
  color: white;
}

.btn:hover {
  opacity: 0.9;
}

.btn-light {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-danger {
  background: var(--primary);
  opacity: 0.85;
}

/* =======================
   TABLE
======================= */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
}

.table th, .table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table th {
  background: #f9f9f9;
  font-size: 12px;
  color: var(--muted);
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

/* =======================
   UTILITY
======================= */
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.space-between {
  justify-content: space-between;
}

.mt {
  margin-top: 20px;
}

.mt-sm {
  margin-top: 10px;
}

.sticky-preview {
  position: sticky;
  top: 20px;
  height: fit-content;
}

.small-preview {
  font-size: 12px;
  margin-top: 5px;
  color: #777;
}

details summary {
  cursor: pointer;
}

pre {
  background: #f8f8f8;
  padding: 10px;
  border-radius: 6px;
  overflow-x: auto;
}


.product-builder-layout {
  align-items: start;
}

.sticky-preview {
  position: sticky;
  top: 20px;
  height: fit-content;
}

.small-preview {
  font-size: 12px;
  margin-top: 6px;
  color: #777;
}

.percentage-summary-card {
  border-left: 4px solid #d72328;
}

.success-text {
  color: #1f7a1f;
  font-weight: 600;
}

.warning-text {
  color: #b26a00;
  font-weight: 600;
}

.error-text {
  color: #d72328;
  font-weight: 600;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-card {
  width: min(1100px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #ddd;
}