/* ═══════════════════════════════════════════════
   GUIA DE COMPRAS v5.2 — Stylesheet
   Aesthetic: Clean market-board meets digital zen
   Font: Syne (display) + DM Sans (body)
═══════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────── */
:root {
  --bg:          #F5F3EE;
  --surface:     #FFFFFF;
  --surface-2:   #F0EDE6;
  --border:      #E2DDD5;
  --border-soft: #EDE9E1;

  --ink:         #1A1714;
  --ink-2:       #4A453F;
  --ink-3:       #8C857A;

  --accent:      #2D6A4F;
  --accent-lt:   #D8EFE3;
  --accent-dk:   #1B4332;

  --warn:        #E07A5F;
  --warn-lt:     #FAE3DC;

  --gold:        #C9A84C;
  --gold-lt:     #FBF3DC;

  --radius:      12px;
  --radius-lg:   18px;
  --radius-xl:   24px;

  --shadow-sm:   0 1px 3px rgba(26,23,20,.06), 0 1px 2px rgba(26,23,20,.04);
  --shadow:      0 4px 16px rgba(26,23,20,.08), 0 1px 4px rgba(26,23,20,.04);
  --shadow-lg:   0 12px 40px rgba(26,23,20,.12), 0 4px 12px rgba(26,23,20,.06);

  --header-h:    64px;
  --transition:  .18s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: inherit; text-decoration: none; }

/* ── Typography ─────────────────────────────── */
h1, h2, h3, h4 { font-family: 'Syne', sans-serif; line-height: 1.2; }
h1 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }
h3 { font-size: 1.1rem; font-weight: 700; }

/* ── Header ─────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { font-size: 1.5rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text h1 { font-size: 1.05rem; }
.brand-version {
  font-size: .65rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  color: var(--ink-3);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.main-nav { display: flex; gap: 4px; }
.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 100px;
  font-family: 'Syne', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-3);
  transition: background var(--transition), color var(--transition);
}
.nav-btn:hover { background: var(--surface-2); color: var(--ink); }
.nav-btn.active { background: var(--ink); color: #fff; }
.nav-icon { font-size: .85rem; }

/* ── Main ───────────────────────────────────── */
.app-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

/* ── Views ──────────────────────────────────── */
.view { animation: fadeIn .25s ease; }
.view.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.view-header { margin-bottom: 24px; }
.view-header h2 { color: var(--ink); }
.view-subtitle { font-size: .875rem; color: var(--ink-3); margin-top: 4px; font-weight: 300; }

/* ── Controls ───────────────────────────────── */
.lista-controls, .gerar-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-end;
}
.date-picker-wrap, .sort-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.date-picker-wrap label, .sort-wrap label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
}
input[type="date"], select {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: .9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input[type="date"]:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lt);
}

/* ── Filter Bar ─────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .9rem;
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.search-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lt);
}
.filter-bar select {
  min-width: 160px;
}
.select-all-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: background var(--transition), border-color var(--transition);
}
.select-all-label:hover { background: var(--accent-lt); border-color: var(--accent); }
.select-all-label input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }

/* ── Calendar Strip ─────────────────────────── */
.calendar-strip-wrap {
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.calendar-strip {
  display: flex;
  gap: 8px;
  min-height: 72px;
  align-items: center;
}
.cal-day {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface);
  min-width: 52px;
  cursor: pointer;
  transition: all var(--transition);
}
.cal-day:hover { border-color: var(--accent); }
.cal-day.has-list { border-color: var(--accent); background: var(--accent-lt); }
.cal-day.has-list .cal-day-num { color: var(--accent-dk); }
.cal-day.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.cal-day.selected .cal-day-label,
.cal-day.selected .cal-day-num { color: #fff; }
.cal-day.disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }
.cal-day-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.cal-day-num { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 700; }
.cal-day-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.cal-day.selected .cal-day-dot { background: rgba(255,255,255,.7); }

/* ── Lista Content ──────────────────────────── */
.lista-content {}
.lista-category-group {
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.lista-cat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
}
.lista-cat-header h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.cat-badge {
  margin-left: auto;
  font-size: .72rem;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--border);
  color: var(--ink-3);
  font-weight: 600;
}
.lista-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--transition);
}
.lista-item:last-child { border-bottom: none; }
.lista-item:hover { background: var(--bg); }
.lista-item.checked { opacity: .5; }
.lista-item.checked .item-name { text-decoration: line-through; color: var(--ink-3); }

.item-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  flex: 0 0 auto;
  transition: all var(--transition);
  position: relative;
}
.item-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.item-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 8px; height: 12px;
  border: 2.5px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}
.item-name { flex: 1; font-size: .92rem; font-weight: 400; }
.item-qty-wrap { display: flex; align-items: center; gap: 6px; }
.item-qty-input {
  width: 62px;
  padding: 5px 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  text-align: center;
  font-size: .85rem;
  background: var(--bg);
  transition: border-color var(--transition);
}
.item-qty-input:focus { outline: none; border-color: var(--accent); }
.item-unit { font-size: .78rem; color: var(--ink-3); font-weight: 500; }

/* ── Lista Summary ──────────────────────────── */
.lista-summary {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: .85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 50;
  white-space: nowrap;
}
.lista-summary.hidden { display: none; }
.progress-bar {
  width: 100px;
  height: 4px;
  background: rgba(255,255,255,.25);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent-lt);
  border-radius: 100px;
  transition: width .3s ease;
  width: 0%;
}

/* ── Gerar Catalog ──────────────────────────── */
.gerar-catalog {}
.gerar-cat-group {
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.gerar-cat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  user-select: none;
}
.gerar-cat-header h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.gerar-cat-toggle { margin-left: auto; font-size: .75rem; color: var(--ink-3); transition: transform var(--transition); }
.gerar-cat-header.collapsed .gerar-cat-toggle { transform: rotate(-90deg); }
.gerar-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border-soft);
}
.gerar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--surface);
  cursor: pointer;
  transition: background var(--transition);
}
.gerar-item:hover { background: var(--accent-lt); }
.gerar-item.selected { background: var(--accent-lt); }
.gerar-item input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; flex: 0 0 auto; }
.gerar-item-info { flex: 1; min-width: 0; }
.gerar-item-name { font-size: .88rem; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gerar-item-meta { font-size: .72rem; color: var(--ink-3); }

.gerar-footer {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 16px 0;
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.gerar-count { font-size: .875rem; color: var(--ink-3); font-weight: 500; }

/* ── Admin ──────────────────────────────────── */
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  align-items: center;
  justify-content: space-between;
}
.admin-toolbar .filter-bar { flex: 1; margin-bottom: 0; }
.admin-actions { display: flex; gap: 8px; flex-shrink: 0; }

.admin-catalog {}
.admin-cat-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.admin-cat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
}
.admin-cat-header h3 { flex: 1; font-size: .92rem; }
.admin-cat-actions { display: flex; gap: 6px; }
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  font-size: .85rem;
  transition: background var(--transition);
  color: var(--ink-3);
}
.btn-icon:hover { background: var(--surface-2); color: var(--ink); }
.btn-icon.danger:hover { background: var(--warn-lt); color: var(--warn); }

.admin-items-list { padding: 0; }
.admin-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-soft);
  font-size: .88rem;
}
.admin-item-row:last-child { border-bottom: none; }
.admin-item-name { flex: 1; }
.admin-item-meta { color: var(--ink-3); font-size: .78rem; }
.admin-item-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition); }
.admin-item-row:hover .admin-item-actions { opacity: 1; }

.admin-add-item {
  padding: 12px 18px;
  border-top: 1px solid var(--border-soft);
}
.btn-add-item {
  font-size: .82rem;
  color: var(--accent);
  font-weight: 600;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-add-item:hover { opacity: .75; }

/* ── Buttons ────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  font-family: 'Syne', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition), opacity var(--transition);
}
.btn-primary:hover { background: var(--accent-dk); }
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--surface);
  color: var(--ink-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Syne', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  transition: background var(--transition), border-color var(--transition);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--ink-3); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--warn);
  color: #fff;
  border-radius: var(--radius);
  font-family: 'Syne', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  transition: opacity var(--transition);
}
.btn-danger:hover { opacity: .85; }

.btn-arrow { font-size: 1rem; }

/* ── Modal ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,23,20,.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fadeIn .2s ease;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  animation: slideUp .25s cubic-bezier(.4,0,.2,1);
}
.modal-sm { max-width: 340px; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.modal-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  color: var(--ink-3);
  transition: background var(--transition);
}
.modal-close:hover { background: var(--surface-2); color: var(--ink); }

.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-body label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
  margin-top: 4px;
}
.modal-body input[type="text"],
.modal-body input[type="number"],
.modal-body select {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font-size: .9rem;
}
.modal-body input:focus, .modal-body select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lt);
  background: var(--surface);
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border-soft);
}

/* ── Empty & Loading ────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-3);
}
.empty-state.hidden { display: none; }
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state p { font-size: 1rem; font-weight: 500; color: var(--ink-2); }
.empty-state small { font-size: .82rem; }

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--ink-3);
  font-size: .9rem;
}
.loading-state.hidden { display: none; }
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ──────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 11px 22px;
  border-radius: 100px;
  font-size: .85rem;
  font-weight: 500;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--accent); }
.toast.error { background: var(--warn); }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 600px) {
  .header-inner { padding: 0 14px; }
  .nav-btn span:last-child { display: none; }
  .nav-btn { padding: 8px 12px; }
  .app-main { padding: 20px 14px 80px; }
  h2 { font-size: 1.25rem; }
  .admin-toolbar { flex-direction: column; align-items: stretch; }
  .admin-toolbar .filter-bar { flex-direction: column; }
  .admin-actions { justify-content: flex-end; }
  .gerar-items-grid { grid-template-columns: 1fr 1fr; }
  .lista-summary { font-size: .78rem; padding: 10px 18px; }
  .gerar-footer { flex-direction: column; align-items: stretch; }
  .gerar-footer .btn-primary { justify-content: center; }
}

/* ── Scrollbar ──────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* ═══════════════════════════════════════════
   v5.3 ADDITIONS
═══════════════════════════════════════════ */

/* ── Listagem de listas (home) ─────────────── */
.listas-date-group { margin-bottom: 28px; }
.listas-date-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-3);
  margin-bottom: 10px;
  padding-left: 2px;
}
.lista-card {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.lista-card:hover { box-shadow: var(--shadow); border-color: var(--border); }
.lista-card-body {
  flex: 1;
  padding: 16px 18px;
  cursor: pointer;
}
.lista-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.lista-card-nome {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.lista-card-shop {
  font-size: .75rem;
  font-weight: 600;
  color: var(--accent-dk);
  background: var(--accent-lt);
  padding: 2px 9px;
  border-radius: 100px;
}
.lista-card-meta {
  font-size: .8rem;
  color: var(--ink-3);
  font-weight: 300;
}
.lista-card-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 8px 10px;
  border-left: 1px solid var(--border-soft);
  background: var(--bg);
}

/* ── Lista view header ─────────────────────── */
.lista-view-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.btn-back {
  font-family: 'Syne', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-3);
  padding: 7px 12px;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-back:hover { background: var(--surface-2); color: var(--ink); }
.lista-view-info { flex: 1; min-width: 0; }
.lista-view-info h2 { font-size: 1.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista-view-meta { display: flex; gap: 12px; font-size: .8rem; color: var(--ink-3); margin-top: 2px; flex-wrap: wrap; }
.btn-sm { padding: 7px 14px !important; font-size: .8rem !important; white-space: nowrap; flex-shrink: 0; }

/* ── Gerar meta bar ────────────────────────── */
.gerar-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.input-wrap { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 180px; }
.input-wrap label,
.date-picker-wrap label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
}
.input-wrap input {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: inherit;
  font-size: .9rem;
  color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lt);
  background: var(--surface);
}

/* ── Shop pill ─────────────────────────────── */
.shop-pill {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  background: var(--accent-lt);
  color: var(--accent-dk);
  padding: 1px 7px;
  border-radius: 100px;
}
.item-shop-tag {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--accent-lt);
  color: var(--accent-dk);
  padding: 2px 7px;
  border-radius: 100px;
  margin-top: 3px;
}
.item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ── Lista controls ────────────────────────── */
.lista-controls { margin-bottom: 18px; }

/* ── Responsive extras ─────────────────────── */
@media (max-width: 600px) {
  .lista-view-header { gap: 10px; }
  .lista-view-info h2 { font-size: 1.1rem; }
  .gerar-meta-bar { flex-direction: column; }
  .lista-card-actions { flex-direction: row; padding: 8px; border-left: none; border-top: 1px solid var(--border-soft); }
}

/* ═══════════════════════════════════════════
   v5.4 ADDITIONS
═══════════════════════════════════════════ */

/* ── Budget bar (lista detalhe) ─────────────── */
.budget-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  background: var(--gold-lt);
  border: 1px solid #e8d48a;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  padding: 12px 20px;
  box-shadow: var(--shadow-sm);
}
.budget-bar.hidden { display: none; }
.budget-inner { display: flex; align-items: center; justify-content: space-between; }
.budget-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #a07a00;
}
.budget-total {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: #7a5c00;
}

/* ── Budget preview (gerar) ─────────────────── */
.gerar-budget-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gold-lt);
  border: 1px solid #e8d48a;
  border-radius: var(--radius);
  padding: 10px 18px;
  margin-bottom: 16px;
}
.gerar-budget-preview.hidden { display: none; }
.gerar-budget-preview .budget-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #a07a00;
}
.gerar-budget-preview .budget-total {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: #7a5c00;
}

/* ── Price pill ──────────────────────────────── */
.price-pill {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  background: var(--gold-lt);
  color: #7a5c00;
  padding: 1px 7px;
  border-radius: 100px;
}

/* ── Line total per item ─────────────────────── */
.item-line-total {
  font-size: .75rem;
  color: var(--ink-3);
  white-space: nowrap;
  min-width: 64px;
  text-align: right;
  font-weight: 500;
}

/* ── Remove item button ──────────────────────── */
.btn-remove-item {
  opacity: 0;
  transition: opacity var(--transition);
  flex-shrink: 0;
  font-size: .75rem;
}
.lista-item:hover .btn-remove-item { opacity: 1; }

/* ── Shop distribution ───────────────────────── */
.shop-dist {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.shop-dist.hidden { display: none; }
.shop-dist-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.shop-dist-bars {
  display: flex;
  height: 10px;
  border-radius: 100px;
  overflow: hidden;
  gap: 1px;
  margin-bottom: 10px;
}
.dist-seg {
  border-radius: 0;
  transition: width .3s ease;
  cursor: default;
}
.dist-seg:first-child { border-radius: 100px 0 0 100px; }
.dist-seg:last-child  { border-radius: 0 100px 100px 0; }
.dist-seg:only-child  { border-radius: 100px; }
.shop-dist-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.dist-leg-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .75rem;
  color: var(--ink-2);
}
.dist-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Gerar supermercado readonly ─────────────── */
#gerar-supermercado[readonly] {
  background: var(--accent-lt);
  color: var(--accent-dk);
  font-weight: 600;
  cursor: default;
}

/* ── Add product modal ───────────────────────── */
.modal-lg { max-width: 580px; }
.add-product-list {
  max-height: 380px;
  overflow-y: auto;
  margin: 0 -24px;
  padding: 0 24px 8px;
}
.add-product-group { margin-bottom: 12px; }
.add-product-cat-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-3);
  padding: 8px 0 5px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 4px;
}
.add-product-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
}
.add-product-row:hover { background: var(--bg); }
.add-product-row.selected { background: var(--accent-lt); }
.add-product-row input[type="checkbox"] { accent-color: var(--accent); flex-shrink: 0; width: 15px; height: 15px; }
.add-product-info { flex: 1; min-width: 0; }
.add-product-name { font-size: .88rem; display: block; }
.add-product-meta { font-size: .73rem; color: var(--ink-3); }

/* ── Lista header actions ────────────────────── */
.lista-header-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Supermercado field readonly ─────────────── */
input[readonly] {
  cursor: default;
}

/* ═══════════════════════════════════════════
   v5.5 ADDITIONS
═══════════════════════════════════════════ */

/* ── Admin tabs ──────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-soft);
  padding-bottom: 0;
}
.admin-tab {
  font-family: 'Syne', sans-serif;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-3);
  padding: 9px 18px;
  border-radius: var(--radius) var(--radius) 0 0;
  border: 2px solid transparent;
  border-bottom: none;
  margin-bottom: -2px;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
  cursor: pointer;
}
.admin-tab:hover { color: var(--ink); background: var(--surface-2); }
.admin-tab.active {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--border-soft);
  border-bottom-color: var(--surface);
}
.admin-tab-panel.hidden { display: none; }

/* ── Shop admin rows ─────────────────────────── */
.admin-shops-list { display: flex; flex-direction: column; gap: 8px; }
.shop-admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}
.shop-color-swatch {
  width: 28px; height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
}
.shop-admin-nome { font-weight: 600; font-size: .92rem; flex: 1; }
.shop-admin-id   { font-size: .72rem; color: var(--ink-3); font-family: monospace; }

/* ── Color picker ────────────────────────────── */
.color-picker-row { display: flex; align-items: center; gap: 12px; }
input[type="color"] {
  width: 40px; height: 40px;
  padding: 2px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--surface);
}

/* ── Shop dot in item tag ────────────────────── */
.shop-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.item-shop-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ═══════════════════════════════════════════
   ITINERÁRIO INTELIGENTE — v5.5
═══════════════════════════════════════════ */

/* ── Modal size ──────────────────────────────── */
.modal-itinerario {
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-itinerario .modal-body { display: block; }
.modal-itinerario .modal-header {
  flex-shrink: 0;
}

/* ── Header ──────────────────────────────────── */
.iti-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.iti-icon { font-size: 1.5rem; }
.iti-subtitle {
  font-size: .75rem;
  color: var(--ink-3);
  font-weight: 300;
  margin-top: 1px;
}

/* ── Steps (scrollable content) ─────────────── */
.iti-step {
  overflow-y: auto;
  padding: 20px 24px;
  flex: 1;
  min-height: 0;
}
.iti-step.hidden { display: none; }

/* ── Section labels ──────────────────────────── */
.iti-section-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-3);
  margin-bottom: 10px;
}

/* ── Origin tabs ─────────────────────────────── */
.iti-origin-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.iti-origin-tab {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Syne', sans-serif;
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.iti-origin-tab:hover  { border-color: var(--accent); color: var(--accent); }
.iti-origin-tab.active { border-color: var(--accent); background: var(--accent-lt); color: var(--accent-dk); }

/* ── Origin panels ───────────────────────────── */
.iti-origin-panel { margin-bottom: 4px; }
.iti-origin-panel.hidden { display: none; }
.iti-origin-panel label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
  margin: 10px 0 4px;
}
.iti-origin-panel input[type="number"] {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: inherit;
  font-size: .9rem;
  color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.iti-origin-panel input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lt);
  background: var(--surface);
}
.iti-hint {
  font-size: .78rem;
  color: var(--ink-3);
  margin: 8px 0 10px;
  font-weight: 300;
}

/* ── GPS status ──────────────────────────────── */
.iti-status-line {
  font-size: .8rem;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  min-height: 28px;
}
.iti-status-line.success { background: var(--accent-lt); color: var(--accent-dk); }
.iti-status-line.error   { background: var(--warn-lt);   color: var(--warn); }

/* ── Radio group ─────────────────────────────── */
.iti-radio-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.iti-radio {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .88rem;
  cursor: pointer;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), background var(--transition);
}
.iti-radio:hover { border-color: var(--accent); background: var(--accent-lt); }
.iti-radio input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }

/* ── Shop chips ──────────────────────────────── */
.iti-shops-preview { margin-top: 4px; }
.iti-shops-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.iti-shop-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1.5px solid color-mix(in srgb, var(--chip-color) 30%, transparent);
  background: color-mix(in srgb, var(--chip-color) 12%, transparent);
  color: var(--chip-color);
}
.chip-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.iti-no-shops { font-size: .82rem; color: var(--ink-3); }

/* ── Error ───────────────────────────────────── */
.iti-error {
  background: var(--warn-lt);
  color: var(--warn);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: .84rem;
  margin-top: 12px;
  font-weight: 500;
}
.iti-error.hidden { display: none; }

/* ── Loading step ────────────────────────────── */
#iti-step-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 20px;
  text-align: center;
}
.iti-loading-anim {
  position: relative;
  width: 72px; height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.iti-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--accent);
  animation: iti-pulse 1.4s ease-in-out infinite;
}
@keyframes iti-pulse {
  0%   { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}
.iti-loading-icon { font-size: 2rem; position: relative; z-index: 1; }
.iti-loading-status { font-size: .9rem; color: var(--ink-3); font-weight: 400; }

/* ── Result: summary strip ───────────────────── */
.iti-summary-strip {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}
.iti-summary-stat { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.iti-stat-val {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
}
.iti-stat-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; opacity: .65; }
.iti-summary-divider { width: 1px; height: 36px; background: rgba(255,255,255,.2); }

/* ── Map toggle ──────────────────────────────── */
.iti-map-toggle-bar { margin-bottom: 12px; }
.iti-map-toggle-btn {
  width: 100%;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Syne', sans-serif;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  text-align: center;
}
.iti-map-toggle-btn:hover { background: var(--accent-lt); border-color: var(--accent); color: var(--accent-dk); }

/* ── Map container ───────────────────────────── */
.iti-map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
}
.iti-map-container.hidden { display: none; }
.iti-map { width: 100%; height: 320px; }

/* ── Route steps ─────────────────────────────── */
.iti-route-steps { display: flex; flex-direction: column; }
.iti-step-node {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.iti-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: .8rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.origin-dot {
  color: var(--ink);
  font-size: 1rem;
  line-height: 28px;
  text-align: center;
  flex-shrink: 0;
}
.iti-step-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 3px;
  flex: 1;
}
.iti-step-label {
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink);
}
.iti-step-address, .iti-step-coords {
  font-size: .75rem;
  color: var(--ink-3);
  font-weight: 300;
}

/* ── Connector ───────────────────────────────── */
.iti-connector {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 6px 13px;
}
.iti-connector-line {
  width: 2px;
  height: 28px;
  background: var(--border);
  border-radius: 2px;
  flex-shrink: 0;
}
.iti-connector-info {
  font-size: .75rem;
  color: var(--ink-3);
  font-weight: 500;
}

/* ── Skipped ─────────────────────────────────── */
.iti-skipped {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--gold-lt);
  border-radius: var(--radius);
  font-size: .8rem;
  color: #7a5c00;
}
.iti-skipped.hidden { display: none; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 600px) {
  .modal-itinerario { max-height: 95vh; }
  .iti-map { height: 240px; }
  .iti-summary-strip { padding: 12px 10px; }
  .iti-stat-val { font-size: 1rem; }
  .iti-origin-tabs { flex-direction: column; }
}

/* ═══════════════════════════════════════════
   AD-HOC PRODUCTS
═══════════════════════════════════════════ */

/* ── Toggle button ───────────────────────────── */
.adhoc-section {
  border-top: 1px solid var(--border-soft);
  margin-top: 12px;
  padding-top: 12px;
}
.adhoc-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  font-family: 'Syne', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}
.adhoc-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent-dk);
  background: var(--accent-lt);
}
.adhoc-toggle-btn.open {
  border-color: var(--accent);
  background: var(--accent-lt);
  color: var(--accent-dk);
}
.adhoc-toggle-icon {
  font-size: 1.1rem;
  font-weight: 400;
  flex-shrink: 0;
  transition: transform var(--transition);
}
.adhoc-toggle-btn.open .adhoc-toggle-icon { transform: rotate(45deg); }

/* ── Adhoc form ──────────────────────────────── */
.adhoc-form {
  margin-top: 12px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  animation: fadeIn .2s ease;
}
.adhoc-form.hidden { display: none; }

.adhoc-form-grid {
  display: grid;
  grid-template-columns: 1fr 80px 90px;
  gap: 8px;
  margin-bottom: 10px;
}
.adhoc-field { display: flex; flex-direction: column; gap: 3px; }
.adhoc-field-name { grid-column: 1 / -1; }
.adhoc-field label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
}
.adhoc-field input,
.adhoc-field select {
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-family: inherit;
  font-size: .85rem;
  color: var(--ink);
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.adhoc-field input:focus,
.adhoc-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lt);
}

/* ── Pending adhoc list (gerar view) ─────────── */
.adhoc-pending-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.adhoc-pending-header {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent-dk);
  background: var(--accent-lt);
  padding: 5px 10px;
  border-radius: 6px;
  margin-bottom: 2px;
}
.adhoc-pending-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}
.adhoc-pending-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.adhoc-pending-name { font-size: .88rem; font-weight: 500; }
.adhoc-pending-meta { font-size: .73rem; color: var(--ink-3); }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 520px) {
  .adhoc-form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .adhoc-field-name { grid-column: 1 / -1; }
}

/* ═══════════════════════════════════════════
   MODAL ADD-TO-LISTA — tabbed compact layout
═══════════════════════════════════════════ */

/* ── Modal size ──────────────────────────────── */
.modal-add {
  max-width: 520px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Inner tabs ──────────────────────────────── */
.add-modal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-soft);
  flex-shrink: 0;
  padding: 0 24px;
}
.add-modal-tab {
  font-family: 'Syne', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-3);
  padding: 10px 18px;
  border: none;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  background: none;
  transition: color var(--transition), border-color var(--transition);
}
.add-modal-tab:hover  { color: var(--ink); }
.add-modal-tab.active { color: var(--accent-dk); border-bottom-color: var(--accent); }

/* ── Panel (scrollable area) ─────────────────── */
.add-modal-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.add-modal-panel.hidden { display: none; }

/* ── Catalog tab ─────────────────────────────── */
.add-catalog-filters {
  display: flex;
  gap: 8px;
  padding: 12px 24px 8px;
  flex-shrink: 0;
}
.add-product-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 4px;
  min-height: 0;
}

/* ── Novo produto tab ────────────────────────── */
.novo-produto-form {
  flex: 1;
  overflow-y: auto;
  padding: 14px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.novo-row {
  display: flex;
  gap: 8px;
}
.novo-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.novo-field-full { flex: 0 0 100%; width: 100%; }
.novo-field label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
}
.novo-field input,
.novo-field select {
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-family: inherit;
  font-size: .88rem;
  color: var(--ink);
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.novo-field input:focus,
.novo-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lt);
  background: var(--surface);
}

/* ── Category row with "+ Nova" inline ──────── */
.novo-cat-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.novo-cat-row select { flex: 1; }
.novo-cat-row .btn-sm { flex-shrink: 0; white-space: nowrap; padding: 7px 12px; font-size: .78rem; }

.novo-new-cat-wrap {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  align-items: stretch;
}
.novo-new-cat-wrap input { flex: 1; padding: 7px 10px; border: 1.5px solid var(--accent); border-radius: 8px; background: var(--accent-lt); font-family: inherit; font-size: .88rem; }
.novo-new-cat-wrap input:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-lt); }
.novo-new-cat-wrap.hidden { display: none; }

/* ── Hint text ───────────────────────────────── */
.novo-hint {
  font-size: .75rem;
  color: var(--ink-3);
  background: var(--gold-lt);
  border-radius: 8px;
  padding: 7px 11px;
  font-weight: 400;
  flex-shrink: 0;
}

/* ── Sticky footer inside panel ─────────────── */
.add-modal-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border-soft);
  padding: 12px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--surface);
}

/* ── Remove old adhoc styles if leftover ────── */
.adhoc-section, .adhoc-toggle-btn, .adhoc-form,
.adhoc-pending-list, .adhoc-pending-row { display: none !important; }

@media (max-width: 540px) {
  .novo-row { flex-wrap: wrap; }
  .novo-field { flex: 0 0 calc(50% - 4px); }
  .novo-field-full { flex: 0 0 100%; }
}

/* ═══════════════════════════════════════════
   GERAR VIEW — NOVO PRODUTO TAB
═══════════════════════════════════════════ */

.gerar-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-soft);
  margin-bottom: 16px;
}
.gerar-tab {
  font-family: 'Syne', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-3);
  padding: 9px 18px;
  border: none;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  background: none;
  transition: color var(--transition), border-color var(--transition);
}
.gerar-tab:hover  { color: var(--ink); }
.gerar-tab.active { color: var(--accent-dk); border-bottom-color: var(--accent); }
.gerar-tab-panel.hidden { display: none; }

/* Pending novos list in gerar view */
.gerar-novos-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
}
.gerar-novos-list .adhoc-pending-header {
  display: flex;
}

/* Compact color input */
.color-input-sm {
  width: 38px;
  height: 36px;
  padding: 2px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  background: var(--surface);
}

/* Override: hide old adhoc CSS rules that suppress display */
.adhoc-section, .adhoc-toggle-btn, .adhoc-form,
.adhoc-pending-list, .adhoc-pending-row {
  display: revert !important;
}
/* But keep adhoc pending rows styled */
.adhoc-pending-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}
.adhoc-pending-header {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent-dk);
  background: var(--accent-lt);
  padding: 5px 10px;
  border-radius: 6px;
  margin-bottom: 2px;
}
.adhoc-pending-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.adhoc-pending-name { font-size: .88rem; font-weight: 500; }
.adhoc-pending-meta { font-size: .73rem; color: var(--ink-3); }

/* ═══════════════════════════════════════════
   DEFAULT ITINERARY BANNER (admin view)
═══════════════════════════════════════════ */
.iti-default-banner { margin-bottom: 16px; }
.iti-default-banner-inner {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}
.iti-default-banner-inner.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-3);
  font-size: .85rem;
}
.iti-default-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
.iti-def-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.iti-def-title {
  font-family: 'Syne', sans-serif;
  font-size: .92rem;
  font-weight: 700;
  color: var(--ink);
}
.iti-def-origin { font-size: .78rem; color: var(--ink-3); }
.iti-def-stats {
  display: flex;
  gap: 12px;
  font-size: .75rem;
  color: var(--ink-3);
  margin-left: auto;
  flex-wrap: wrap;
}
.iti-def-stops {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.iti-def-stop {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--stop-cor) 12%, transparent);
  color: var(--stop-cor);
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid color-mix(in srgb, var(--stop-cor) 25%, transparent);
}
.iti-def-num {
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.iti-def-arrow { color: var(--ink-3); font-size: .75rem; }
.iti-def-actions { display: flex; gap: 8px; }
.iti-def-btn-map {
  flex: 1;
  padding: 8px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-lt);
  color: var(--accent-dk);
  font-family: 'Syne', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
}
.iti-def-btn-map:hover { background: var(--accent); color: #fff; }
.iti-def-btn-custom {
  flex: 1;
  padding: 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-3);
  font-family: 'Syne', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.iti-def-btn-custom:hover { background: var(--surface-2); color: var(--ink); }
.iti-default-map-wrap {
  margin-top: 10px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-soft);
}
.iti-default-map-wrap.hidden { display: none; }
.iti-default-map { width: 100%; height: 280px; }

@media (max-width: 600px) {
  .iti-def-stats { gap: 8px; }
  .iti-def-top { gap: 6px; }
}