:root {
  --bg: #f7f8f4;
  --surface: #ffffff;
  --surface-2: #eef3ec;
  --surface-3: #18221b;
  --text: #162019;
  --muted: #607063;
  --soft: #8d9a8f;
  --border: #d9e1d8;
  --primary: #1f7a3f;
  --primary-2: #2f9e55;
  --accent: #c98324;
  --blue: #286f91;
  --danger: #b53d35;
  --warning: #9a6a16;
  --ok: #1f7a3f;
  --shadow: 0 12px 36px rgba(20, 37, 24, .10);
  --radius: 8px;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

img {
  display: block;
  max-width: 100%;
}

.top-strip {
  min-height: 36px;
  background: var(--surface-3);
  color: #edf6ec;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 248, 244, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  min-height: 72px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  flex: 0 0 auto;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
}

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

.btn-primary:hover {
  background: #196735;
}

.btn-dark {
  background: var(--surface-3);
  border-color: var(--surface-3);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.icon-btn {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px 24px 54px;
}

.campaign-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
  gap: 22px;
  align-items: start;
}

.intro-band {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: stretch;
}

.intro-copy {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 38px;
  line-height: 1.08;
  margin-bottom: 12px;
  max-width: 760px;
}

.lead {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
  max-width: 780px;
  margin-bottom: 0;
}

.benefit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.benefit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fbfcf9;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.visual-panel {
  min-height: 220px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #dfe8dc;
  overflow: hidden;
  position: relative;
}

.visual-panel img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}

.visual-fallback {
  height: 100%;
  min-height: 220px;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(31, 122, 63, .92), rgba(40, 111, 145, .82)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.12) 0 1px, transparent 1px 18px);
}

.visual-fallback svg {
  width: 86px;
  height: 86px;
}

.config-panel,
.quote-panel,
.admin-panel,
.login-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.config-panel {
  padding: 18px;
}

.quote-panel {
  position: sticky;
  top: 94px;
  padding: 18px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title h2,
.panel-title h3 {
  font-size: 18px;
  margin: 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fbfcf9;
  color: var(--text);
  min-height: 42px;
  padding: 10px 12px;
  outline: 0;
}

.textarea {
  min-height: 86px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  background: #fff;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 70px;
  gap: 10px;
  align-items: center;
}

.range-row input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.tools-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.product-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  min-height: 352px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.product-card:hover,
.product-card.active {
  border-color: var(--primary);
  box-shadow: 0 10px 26px rgba(31, 122, 63, .14);
  transform: translateY(-1px);
}

.product-image {
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image .no-image {
  color: var(--primary);
  display: grid;
  place-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 12px;
}

.product-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.product-title {
  font-size: 16px;
  line-height: 1.25;
  margin: 0;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
}

.spec-list {
  padding: 0;
  margin: 0;
  list-style: none;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.price-row {
  margin-top: auto;
  border-top: 1px dashed var(--border);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.price {
  color: var(--primary);
  font-size: 23px;
  font-weight: 800;
  white-space: nowrap;
}

.quote-empty {
  min-height: 200px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.quote-product {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.quote-price {
  background: var(--surface-3);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.quote-price strong {
  font-size: 27px;
}

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

.full {
  grid-column: 1 / -1;
}

.check-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 10px 0 14px;
}

.status-box {
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.4;
}

.status-ok {
  background: #e8f5e9;
  color: #1e6236;
  border: 1px solid #bbdfc4;
}

.status-error {
  background: #fff0ed;
  color: #96382f;
  border: 1px solid #f0c1ba;
}

.footer-band {
  border-top: 1px solid var(--border);
  margin-top: 32px;
  padding: 24px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.admin-sidebar {
  background: var(--surface-3);
  color: #f2f7f1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.admin-nav {
  display: grid;
  gap: 8px;
}

.admin-nav button {
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  color: #f2f7f1;
  border-color: rgba(255,255,255,.14);
}

.admin-nav button.active {
  background: #eff6eb;
  color: var(--surface-3);
}

.admin-main {
  padding: 24px;
  max-width: 1260px;
  width: 100%;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.admin-top h1 {
  font-size: 28px;
  margin: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.metric strong {
  font-size: 28px;
}

.admin-panel {
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: none;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.table th,
.table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  background: #f2f5ef;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  background: var(--surface-2);
  color: var(--muted);
}

.status-novo { background: #e8f5e9; color: var(--ok); }
.status-contactado { background: #e8f2f7; color: var(--blue); }
.status-reservado { background: #fff5df; color: var(--warning); }
.status-perdido { background: #fff0ed; color: var(--danger); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(10, 18, 12, .56);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal {
  width: min(780px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.modal-header,
.modal-body,
.modal-footer {
  padding: 16px;
}

.modal-header,
.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.modal-footer {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  justify-content: flex-end;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  padding: 22px;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .campaign-workspace,
  .intro-band,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .quote-panel,
  .admin-sidebar {
    position: static;
    height: auto;
  }

  .admin-main {
    padding: 18px;
  }

  .filter-grid,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .header-inner,
  .page {
    padding-left: 14px;
    padding-right: 14px;
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  h1 {
    font-size: 30px;
  }

  .filter-grid,
  .form-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

  .icon-btn {
    width: 40px;
  }
}
