* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f5f6f8;
  color: #1f2430;
  min-height: 100vh;
}

.app-header {
  background: #ea1d2c;
  color: #fff;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-header h1 {
  margin: 0 0 4px;
  font-size: 1.5rem;
}

.subtitle {
  margin: 0;
  opacity: 0.9;
  font-size: 0.95rem;
}

.btn-clear {
  background: #fff;
  color: #ea1d2c;
  font-weight: 600;
  flex-shrink: 0;
  border: 1px solid #fff;
}

.btn-clear:hover {
  background: #ffe5e5;
}

main {
  width: 100%;
  margin: 0;
  padding: 24px 32px;
}

section {
  background: #fff;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.control-card {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px 14px;
  background: #fafafa;
}

.control-label {
  font-weight: 600;
}

.control-card input[type="number"] {
  width: 120px;
}

.control-card input[type="range"] {
  width: 100%;
}

.hint {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

.channels-panel-header,
.products-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.export-actions {
  display: flex;
  gap: 8px;
}

.channels-panel-header h2,
.products-panel-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.add-channel-wrapper {
  position: relative;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.channel-picker {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  min-width: 180px;
  z-index: 10;
  overflow: hidden;
}

.channel-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}

.channel-option:hover {
  background: #f5f5f5;
}

.channel-option + .channel-option {
  border-top: 1px solid #f0f0f0;
}

.channels-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.channels-list:empty::after {
  content: "Nenhum canal adicionado ainda. Clique em \"+ Adicionar canal\" para escolher entre os canais suportados.";
  color: #888;
  font-size: 0.9rem;
}

.channel-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fafafa;
  max-width: 260px;
}

.channel-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.channel-card .channel-name {
  font-weight: 600;
}

.channel-card .channel-fee {
  color: #555;
}

.channel-card .channel-details {
  color: #888;
  font-size: 0.78rem;
  white-space: normal;
}

.channel-card .remove-channel {
  color: #ea1d2c;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
}

input[type="text"],
input[type="number"] {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
}

.table-scroll {
  overflow-x: auto;
  margin-bottom: 12px;
}

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

th, td {
  border: 1px solid #e5e5e5;
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}

th {
  background: #fafafa;
  font-size: 0.85rem;
}

.col-recommended {
  background: #fff7e6;
  font-weight: 700;
}

.remove-product {
  color: #ea1d2c;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 1.1rem;
  line-height: 1;
}

.btn {
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-primary {
  background: #ea1d2c;
  color: #fff;
}

.btn-secondary {
  background: #eee;
  color: #333;
}
