/* Campos compartilhados (prefixo c-): input, select, textarea, rótulo e
   busca com ícone. Mesma altura dos botões (--ctl-h); dentro de modais
   os campos de formulário usam --ctl-h-lg.

   <div class="c-field"><label>Origem</label><select class="c-select">…</select></div>
   <div class="c-search"><svg>…</svg><input class="c-input" type="search"></div> */

.c-input,
.c-select,
.c-textarea {
  height: var(--ctl-h);
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  background-color: #fff;
  font-family: inherit;
  font-size: var(--fs-ctl);
  color: var(--text);
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.c-input:hover,
.c-select:hover,
.c-textarea:hover {
  border-color: var(--line-hover);
}

.c-input:focus,
.c-select:focus,
.c-textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.c-input::placeholder,
.c-textarea::placeholder {
  color: var(--ghost);
}

.c-input:disabled,
.c-select:disabled,
.c-textarea:disabled {
  background-color: #f4f1eb;
  color: var(--muted);
  cursor: not-allowed;
}

.c-input.is-invalid,
.c-select.is-invalid,
.c-textarea.is-invalid {
  border-color: var(--error);
}

.c-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
}

/* Select com seta própria: 12px da borda, texto a 32px dela. */
.c-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236d685e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 6px;
  cursor: pointer;
}

/* Filtro com valor escolhido. */
.c-select.on,
.c-input.on {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

.c-textarea {
  display: block;
  width: 100%;
  height: auto;
  min-height: 72px;
  padding: 10px 12px;
  line-height: 1.4;
  resize: vertical;
}

.c-textarea--mono {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ── Tamanhos ──────────────────────────────────────────────────────── */
.c-input--sm,
.c-select--sm {
  height: var(--ctl-h-sm);
  font-size: var(--fs-ctl-sm);
}

.c-input--sm {
  padding: 0 10px;
}

.c-select--sm {
  padding: 0 28px 0 10px;
  background-position: right 10px center;
}

.c-input--lg,
.c-select--lg {
  height: var(--ctl-h-lg);
  font-size: 13.5px;
}

.c-input--block,
.c-select--block {
  width: 100%;
}

/* Formulários em modal: campos maiores e largura total. */
.c-modal .c-input,
.c-modal .c-select {
  width: 100%;
  height: var(--ctl-h-lg);
  font-size: 13.5px;
}

.c-modal .c-textarea {
  font-size: 13.5px;
}

/* ── Rótulo + campo ────────────────────────────────────────────────── */
.c-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

.c-field > label,
.c-field > .c-label,
.c-label {
  display: block;
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted);
}

/* Segmentado e botão dentro do campo ficam do tamanho do conteúdo. */
.c-field > .c-seg:not(.c-seg--block),
.c-field > .c-btn:not(.c-btn--block) {
  align-self: flex-start;
}

.c-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* ── Busca com ícone ───────────────────────────────────────────────── */
.c-search {
  position: relative;
  min-width: 0;
}

.c-search > svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: var(--ico);
  height: var(--ico);
  color: var(--ghost);
  pointer-events: none;
}

.c-search > .c-input {
  width: 100%;
  padding-left: 32px;
}

/* ── Caixa de seleção ──────────────────────────────────────────────── */
.c-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: var(--fs-ctl);
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.c-check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Linha de controles (barra de filtros, campos lado a lado). */
.c-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.c-row > span {
  font-size: 12px;
  color: var(--muted);
}

/* ── Barra de filtros em cartão (período, vendedor, conta) ─────────── */
.c-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.c-bar > label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--subtle);
}

.c-bar__divider {
  flex: none;
  align-self: center;
  width: 1px;
  height: 20px;
  background: var(--line-strong);
}
