:root {
  --bg: #eef3f8;
  --bg-2: #f7f9fc;
  --ink: #1a2232;
  --muted: #5d6a7d;
  --primary: #0a6cc2;
  --primary-2: #2a8bd8;
  --accent: #1f9e9a;
  --card: #ffffff;
  --shadow: 0 16px 40px rgba(13, 35, 64, 0.12);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Noto Sans", "DejaVu Sans", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 15% 15%, #ffffff 0%, #f1f4fb 40%, #e7eef7 100%);
  color: var(--ink);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

.main {
  padding: 32px 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.topbar h1 {
  font-size: 26px;
  margin: 0;
}

.btn {
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid #d5dde8;
}

.btn.ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.card h3 { margin: 0 0 10px; }

.row {
  display: flex;
  gap: 8px;
}

.row select.input {
  min-width: 170px;
}

.input, textarea, select {
  width: 100%;
  border: 1px solid #d5dde8;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

.muted { color: var(--muted); font-size: 13px; }

.product-list { display: grid; gap: 12px; margin-top: 12px; }

.product {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #e1e7f0;
}

.product img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  background: #f5f7fb;
  border-radius: 10px;
  cursor: pointer;
}

.tag {
  display: inline-block;
  background: #eef4fb;
  color: #2f5d9b;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  margin-right: 6px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.selection {
  display: grid;
  gap: 12px;
}

.proposal-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

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

.proposal-saved {
  background: #f7faff;
  border: 1px solid #e1e7f0;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}

.proposal-list {
  display: grid;
  gap: 8px;
}

.proposal-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #e1e7f0;
  background: #fff;
}

.proposal-row .row {
  gap: 8px;
}

.collapsible .section-title {
  gap: 10px;
}

.compare-grid {
  display: grid;
  gap: 10px;
}

.compare-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #e1e7f0;
  background: #fff;
}

.compare-card img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #f5f7fb;
  border-radius: 10px;
  border: 1px solid #e3e9f3;
}

.compare-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.selection-item {
  border: 1px solid #e1e7f0;
  border-radius: 14px;
  padding: 14px;
  background: #fcfdff;
}

.selection-item .item-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.selection-item .item-head img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  background: #f5f7fb;
  border-radius: 10px;
  border: 1px solid #e3e9f3;
}

.prices {
  display: grid;
  gap: 8px;
}

.price-row {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr auto;
  gap: 8px;
}

.selection-item textarea,
.selection-item select,
.selection-item input {
  border: 1px solid #cfd8e5;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.selection-item textarea:focus,
.selection-item select:focus,
.selection-item input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10, 108, 194, 0.12);
}

.selection-item .section-title {
  margin-bottom: 12px;
}

.selection-item .btn.secondary {
  padding: 8px 12px;
  border-radius: 10px;
}

.price-row .btn.secondary {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  padding: 0;
}

.prices .btn.secondary {
  border-style: dashed;
  font-weight: 600;
}

.color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}

.color-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d7e0ec;
  background: #fff;
  font-size: 11px;
  cursor: pointer;
}

.color-chip.active {
  border-color: var(--primary);
  background: #eef5ff;
}

.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #222;
}

.color-dots-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.color-dot-sm {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #2a2a2a;
  background: #f0f3f8;
}

.color-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #2a2a2a;
  background: #f0f3f8;
  background-size: cover;
  background-position: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.color-swatch-select {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #2a2a2a;
  cursor: pointer;
  box-sizing: border-box;
}

.color-swatch-select.active {
  box-shadow: 0 0 0 2px var(--primary);
}

.color-swatch-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.color-swatch-label {
  font-size: 11px;
  color: var(--muted);
  max-width: 72px;
  text-align: center;
  line-height: 1.1;
}

.img-modal.hidden {
  display: none;
}

.img-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
}

.img-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.img-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: #fff;
  padding: 14px;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.img-modal-content img {
  max-width: 86vw;
  max-height: 86vh;
  object-fit: contain;
  display: block;
}

.footer-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.flash {
  background: #ffe2e2;
  color: #8a2c2c;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.login-wrap {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.login-card {
  width: 360px;
  background: #fff;
  padding: 24px;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

@media (max-width: 1024px) {
  .grid { grid-template-columns: 1fr; }
  .proposal-header { grid-template-columns: 1fr; }
  .proposal-actions { justify-content: flex-start; }
}
