/* Voa Entregador — Formulário de cadastro, tabs e turnos
   Carregado da estrutura de componentes */

.merchant-form {
    position: absolute;
    inset: 0;
    background: var(--bg);
    z-index: 45;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.22, 0.9, 0.28, 1);
    padding-bottom: var(--bottom-nav-h);
  }
  .merchant-form.show { transform: translateY(0); }

  .merchant-form-header {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--ink-200);
    flex-shrink: 0;
  }
  .merchant-form-header h1 {
    margin: 0;
    font-size: 17px; font-weight: 700; letter-spacing: -0.015em;
    flex: 1;
  }
  .merchant-form-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px 120px;
    display: flex; flex-direction: column; gap: 20px;
  }

  .form-section {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--ink-200);
    overflow: hidden;
    flex-shrink: 0;
  }
  .form-section-header {
    padding: 14px 16px 6px;
    font-size: 12px; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--ink-500);
  }
  .form-field {
    display: flex; flex-direction: column;
    padding: 10px 16px 14px;
    border-bottom: 1px solid var(--ink-200);
  }
  .form-field:last-child { border-bottom: none; }
  .form-field label {
    font-size: 12px; font-weight: 600;
    color: var(--ink-500);
    margin-bottom: 6px;
  }
  .form-field input[type="text"],
  .form-field input[type="time"] {
    border: none; outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 15px; font-weight: 500;
    color: var(--ink-900);
    padding: 4px 0;
    width: 100%;
  }
  .form-field input::placeholder { color: var(--ink-400); font-weight: 400; }

  /* Autocomplete de endereço */
  .address-field { position: relative; }
  .address-suggestions {
    display: none;
    position: absolute;
    left: 8px; right: 8px; top: calc(100% - 2px);
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--ink-200);
    box-shadow: var(--shadow-lg);
    z-index: 5;
    max-height: 220px;
    overflow-y: auto;
  }
  .address-suggestions.show { display: block; }
  .address-suggestions button {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    width: 100%;
    text-align: left;
    font-size: 13px; font-weight: 500;
    color: var(--ink-900);
    border-bottom: 1px solid var(--ink-100);
    transition: background 0.1s;
  }
  .address-suggestions button:hover { background: var(--surface-2); }
  .address-suggestions button:last-child { border-bottom: none; }
  .address-suggestions .addr-ic {
    width: 28px; height: 28px; border-radius: 8px;
    background: var(--brand-soft); color: var(--brand);
    display: grid; place-items: center; flex-shrink: 0;
  }
  .address-suggestions .addr-txt { min-width: 0; }
  .address-suggestions .addr-txt .main {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .address-suggestions .addr-txt .sub {
    font-size: 11px; color: var(--ink-500); font-weight: 400;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  /* Abas de dia da semana */
  .days-tabs {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding: 12px 12px 6px;
    border-bottom: 1px solid var(--ink-200);
  }
  .day-tab {
    position: relative;
    padding: 10px 0;
    border-radius: 10px;
    font-size: 11px; font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--ink-500);
    background: transparent;
    transition: background 0.15s, color 0.15s;
  }
  .day-tab:hover { background: var(--ink-100); color: var(--ink-900); }
  .day-tab.active {
    background: var(--brand);
    color: white;
  }
  /* Bolinha indicadora: aparece se o dia tem shifts preenchidos */
  .day-tab.has-shifts::after {
    content: '';
    position: absolute;
    bottom: 3px; left: 50%;
    transform: translateX(-50%);
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--open);
  }
  .day-tab.active.has-shifts::after { background: white; }

  /* Estado vazio do editor de horários */
  .schedules-empty {
    padding: 20px 16px;
    text-align: center;
    color: var(--ink-400);
    font-size: 13px;
    font-weight: 500;
  }

  /* Editor de horários */
  .schedules-list { display: flex; flex-direction: column; gap: 10px; padding: 10px 16px 14px; }
  .shift-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px; align-items: center;
  }
  .shift-row .shift-input {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--ink-200);
    background: var(--surface);
    font-family: 'SF Mono', ui-monospace, 'Menlo', 'Consolas', monospace;
    font-size: 15px; font-weight: 600;
    color: var(--ink-900);
    letter-spacing: 0.02em;
    text-align: center;
    width: 100%;
  }
  .shift-row .shift-input:focus { outline: none; border-color: var(--brand); }
  .shift-row .shift-input.invalid {
    border-color: var(--closed);
    background: var(--closed-soft);
  }
  .shift-row .copy-shift {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--ink-100); color: var(--ink-500);
    display: grid; place-items: center;
    font-size: 16px; font-weight: 700;
    font-family: inherit;
    line-height: 1;
    transition: background 0.15s, color 0.15s, transform 0.15s;
  }
  .shift-row .copy-shift:hover { background: var(--brand-soft); color: var(--brand); }
  .shift-row .copy-shift.copied {
    background: var(--open-soft, rgba(34, 197, 94, 0.14));
    color: var(--open, #22C55E);
  }
  .shift-row .remove-shift {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--ink-100); color: var(--ink-500);
    display: grid; place-items: center;
    transition: background 0.15s, color 0.15s;
  }
  .shift-row .remove-shift:hover { background: var(--closed-soft); color: var(--closed); }
  .add-shift {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    background: var(--brand-soft); color: var(--brand);
    font-size: 13px; font-weight: 600;
    border: 1px dashed var(--brand);
    transition: background 0.15s;
  }
  .add-shift:hover { background: rgba(11,59,97,0.12); }

  /* Mini-mapa de confirmação */
  .mini-map-wrap { padding: 10px 16px 14px; }
  .mini-map-hint {
    font-size: 12px; color: var(--ink-500); font-weight: 500;
    margin-bottom: 8px;
  }
  .mini-map {
    position: relative;
    width: 100%; height: 180px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--map-bg);
    border: 1px solid var(--ink-200);
    cursor: crosshair;
    touch-action: none;
  }
  .mini-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
  .mini-map .mm-pin {
    position: absolute;
    width: 28px; height: 36px;
    transform: translate(-50%, -100%);
    pointer-events: none;
    filter: drop-shadow(0 4px 10px rgba(11,18,32,0.28));
  }
  .mini-map .mm-pin svg { shape-rendering: geometricPrecision; }
  .mini-map .mm-hint {
    position: absolute;
    bottom: 8px; left: 8px; right: 8px;
    background: rgba(11,18,32,0.72);
    color: white;
    font-size: 11px; font-weight: 500;
    padding: 6px 10px;
    border-radius: 8px;
    text-align: center;
    pointer-events: none;
  }

  /* Footer fixo com ações */
  .merchant-form-footer {
    position: absolute;
    left: 0; right: 0;
    bottom: var(--bottom-nav-h);
    padding: 12px 16px;
    background: var(--surface);
    border-top: 1px solid var(--ink-200);
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
  }

  /* ---------- Página de Estatísticas ---------- */
