  :root {
    --red:        #C8102E;
    --red-dark:   #9B0C23;
    --red-light:  #E8384F;
    --red-pale:   #FFF0F2;
    --red-muted:  #F5C2C9;
    --white:      #FFFFFF;
    --gray-50:    #F7F7F7;
    --gray-100:   #EFEFEF;
    --gray-200:   #DCDCDC;
    --gray-400:   #AAAAAA;
    --gray-600:   #666666;
    --gray-800:   #2E2E2E;
    --text:       #1C1C1C;
    --radius:     10px;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    background: var(--gray-50);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
  }

  /* ── Top bar ─────────────────────────────────────── */
  .topbar {
    background: var(--red);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    box-shadow: 0 2px 8px rgba(200,16,46,0.25);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .brand { display: flex; align-items: center; gap: 16px; }

  .brand-logo {
    height: 44px; width: auto;
    display: block;
    filter: brightness(0) invert(1);
  }

  .brand-divider { width: 1px; height: 30px; background: rgba(255,255,255,0.3); }

  .brand-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.75);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    font-weight: 500;
  }

  .topbar-right { display: flex; gap: 10px; }

  .btn-outline {
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.5);
    color: var(--white);
    padding: 8px 18px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
  }
  .btn-outline:hover { background: rgba(255,255,255,0.15); border-color: white; }

  .btn-primary {
    background: var(--white);
    border: none;
    color: var(--red);
    padding: 8px 22px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: all 0.2s;
    display: flex; align-items: center; gap: 7px;
    white-space: nowrap;
  }
  .btn-primary:hover { background: var(--red-pale); }

  /* ── Layout ──────────────────────────────────────── */
  .layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 0;
    min-height: calc(100vh - 68px);
    align-items: start;
  }

  .main-col {
    padding: 36px 40px;
    border-right: 1px solid var(--gray-200);
  }

  .summary-col {
    padding: 32px 28px;
    position: sticky;
    top: 68px;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
    background: var(--white);
    border-left: 1px solid var(--gray-200);
  }

  /* ── Section blocks ──────────────────────────────── */
  .section {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    padding: 22px 26px;
    margin-bottom: 18px;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .section:focus-within {
    border-color: var(--red-light);
    box-shadow: 0 0 0 3px rgba(200,16,46,0.08);
  }

  .section-label {
    font-size: 10px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--red);
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-100);
  }

  /* ── Form elements ───────────────────────────────── */
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .form-full { grid-column: 1 / -1; }

  .field label {
    display: block;
    font-size: 11px;
    color: var(--gray-600);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 6px;
  }

  .field input, .field select {
    width: 100%;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .field input:focus, .field select:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(200,16,46,0.1);
  }

  /* ── Radio toggle ────────────────────────────────── */
  .toggle-group {
    display: flex;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: 9px;
    overflow: hidden;
  }
  .toggle-group input[type="radio"] { display: none; }
  .toggle-group label {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--gray-600);
    transition: all 0.18s;
    border-right: 1px solid var(--gray-200);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    line-height: 1.4;
  }
  .toggle-group label:last-of-type { border-right: none; }
  .toggle-group input[type="radio"]:checked + label {
    background: var(--red);
    color: var(--white);
    font-weight: 600;
  }

  .cmv-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    padding: 7px 12px;
    min-width: 100px;
  }
  .cmv-input-wrap:focus-within { border-color: var(--red); }
  .cmv-input-wrap input {
    background: transparent;
    border: none;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    width: 50px;
    outline: none;
    text-align: right;
    font-weight: 500;
  }
  .cmv-input-wrap span { color: var(--gray-400); font-size: 13px; }

  /* ── Menu item toggle buttons ────────────────────── */
  .menu-type-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gray-600);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .menu-counter {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--gray-400);
    transition: color 0.15s;
  }
  .menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 4px;
  }
  .menu-item-btn {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    text-align: left;
    transition: all 0.15s;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }
  .menu-item-btn:hover:not(.disabled) {
    border-color: var(--red-light);
    background: var(--red-pale);
	color: var(--red)
  }
  .menu-item-btn.selected {
    background: var(--red);
    border-color: var(--red);
    color: white;
  }
  .menu-item-btn .check-mark {
    opacity: 0;
    font-size: 11px;
    flex-shrink: 0;
    transition: opacity 0.15s;
  }
  .menu-item-btn.selected .check-mark { opacity: 1; }
  .menu-item-btn.disabled:not(.selected) {
    opacity: 0.38;
    cursor: not-allowed;
  }

  /* ── Summary column ──────────────────────────────── */
  .summary-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    color: var(--red);
    font-weight: 700;
  }
  .summary-subtitle {
    font-size: 11px;
    color: var(--gray-400);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 22px;
    font-weight: 500;
  }
  .summary-block {
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 12px;
  }
  .summary-block-title {
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gray-400);
    font-weight: 700;
    margin-bottom: 10px;
  }
  .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 13px;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-100);
  }
  .summary-row:last-child { border-bottom: none; }
  .summary-row span:last-child { font-weight: 600; color: var(--text); }

  .summary-sel-list {
    font-size: 11.5px;
    color: var(--gray-600);
    line-height: 1.7;
    padding: 4px 0;
  }
  .summary-sel-list span {
    display: inline-block;
    background: var(--red-pale);
    border: 1px solid var(--red-muted);
    color: var(--red-dark);
    border-radius: 5px;
    padding: 1px 7px;
    margin: 2px 2px;
    font-size: 11px;
    font-weight: 500;
  }

  .summary-total-block {
    background: var(--red);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 14px;
  }
  .total-main {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.75);
    font-weight: 600;
    margin-bottom: 6px;
  }
  .total-value {
    font-family: 'Playfair Display', serif;
    font-size: 30px;
    color: var(--white);
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 14px;
  }
  .total-sub { font-size: 11px; color: rgba(255,255,255,0.65); font-weight: 500; }
  .total-sub-value { font-size: 15px; font-weight: 700; color: var(--white); }

  .send-btn {
    width: 100%;
    background: var(--red);
    border: none;
    color: var(--white);
    padding: 13px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-top: 4px;
    transition: background 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
  }
  .send-btn:hover { background: var(--red-dark); }

  /* ── Alertas ─────────────────────────────────────── */
  .alert-box {
    display: none;
    align-items: flex-start;
    gap: 10px;
    background: #FFF8E1;
    border: 1.5px solid #F5C518;
    border-left: 4px solid #F5C518;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 14px;
    font-size: 12.5px;
    color: #7A5C00;
    line-height: 1.5;
    animation: fadeIn 0.2s ease;
  }
  .alert-box.show { display: flex; }
  .alert-box .alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
  .alert-box strong { display: block; font-size: 12px; font-weight: 700; margin-bottom: 2px; color: #5C4200; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

  /* ── Modal ───────────────────────────────────────── */
  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .modal-overlay.open { display: flex; }
  .modal-box {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 540px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.3);
    animation: fadeIn 0.2s ease;
  }
  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
  }
  .modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    color: var(--red);
    font-weight: 700;
  }
  .modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--gray-400);
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.15s;
  }
  .modal-close:hover { color: var(--text); }
  .modal-msg {
    font-size: 13px;
    line-height: 1.8;
    white-space: pre-line;
    background: var(--gray-50);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    color: var(--text);
    border: 1px solid var(--gray-200);
    max-height: 40vh;
    overflow-y: auto;
  }
  .modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
  .modal-btn-copy {
    flex: 1;
    min-width: 130px;
    padding: 11px;
    background: var(--gray-100);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    transition: background 0.15s;
  }
  .modal-btn-copy:hover { background: var(--gray-200); }
  .modal-btn-wpp {
    flex: 2;
    min-width: 160px;
    padding: 11px;
    background: #25D366;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: white;
    transition: background 0.15s;
  }
  .modal-btn-wpp:hover { background: #1fad54; }

  /* ── Print ───────────────────────────────────────── */
  @media print {
    @page { margin: 12mm 14mm; size: A4; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    body { background: white; font-size: 12px; }
    .topbar-right, .summary-col, .modal-overlay { display: none !important; }
    .topbar { background: var(--red) !important; height: auto; padding: 12px 20px; margin-bottom: 18px; border-radius: 8px; }
    .layout { display: block !important; }
    .main-col { padding: 0; border: none; }
    .section { break-inside: avoid; margin-bottom: 12px; padding: 14px 18px; box-shadow: none; }
    .menu-item-btn.selected { background: var(--red) !important; color: white !important; }
    .menu-item-btn:not(.selected) { display: none; }
    .menu-counter { display: none; }
    .toggle-group input[type="radio"]:checked + label { background: var(--red) !important; color: white !important; }
  }

  /* ── Mobile ──────────────────────────────────────── */
  @media (max-width: 768px) {
    .topbar {
      padding: 0 16px;
      height: auto;
      min-height: 60px;
      flex-wrap: wrap;
      gap: 8px;
      padding-top: 10px;
      padding-bottom: 10px;
    }
    .brand-sub { display: none; }
    .brand-divider { display: none; }
    .topbar-right { gap: 6px; }
    .btn-outline { padding: 7px 12px; font-size: 12px; }
    .btn-primary { padding: 7px 14px; font-size: 12px; }

    .layout {
      grid-template-columns: 1fr;
      min-height: auto;
    }

    .main-col {
      padding: 20px 16px;
      border-right: none;
      border-bottom: 1px solid var(--gray-200);
    }

    .summary-col {
      position: static;
      max-height: none;
      padding: 20px 16px;
      border-left: none;
    }

    .form-grid { grid-template-columns: 1fr; }
    .form-full { grid-column: 1; }

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

    .section { padding: 16px 18px; }

    .total-value { font-size: 24px; }

    .toggle-group { flex-wrap: wrap; border-radius: 9px; }
    .toggle-group label {
      flex: 1 1 45%;
      min-width: 120px;
      border-right: 1px solid var(--gray-200);
      border-bottom: 1px solid var(--gray-200);
    }
    .toggle-group label:last-of-type { border-right: none; }

    .modal-box { padding: 20px 16px; }
  }

  @media (max-width: 400px) {
    .menu-grid { grid-template-columns: 1fr; }
    .menu-item-btn { font-size: 13px; }
  }

/* --- Validação elegante --- */
.field-error input {
  border-color: #C8102E !important;
  box-shadow: 0 0 0 3px rgba(200,16,46,0.15) !important;
}

.form-error-box {
  display: none;
  background: #FFF5F5;
  border: 1.5px solid #E08A8A;
  border-left: 4px solid #C8102E;
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  color: #7A1F1F;
  font-size: 13px;
  line-height: 1.6;
  animation: fadeIn 0.25s ease;
}

.form-error-box.show {
  display: block;
}

.form-error-box strong {
  font-size: 13px;
  font-weight: 700;
  color: #8A1B1B;
}
