/* ===== Festa Mania ===== */
:root {
  --purple: #7c3aed;
  --purple-dark: #5b21b6;
  --pink: #db2777;
  --orange: #f97316;
  --bg: #f4f2fb;
  --card: #ffffff;
  --ink: #20223a;
  --muted: #6b7280;
  --line: #e8e4f7;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --shadow: 0 8px 24px rgba(76, 29, 149, 0.08);
  --radius: 16px;
  /* Com foto de capa, o JS troca estas cores pela cor quente da própria foto
     (cartões, abas, botões e títulos acompanham a capa). */
  --accent: var(--purple);
  --accent-2: var(--pink);
  --accent-ink: var(--purple-dark);
  --btn-shadow: 0 8px 18px rgba(124, 58, 237, .3);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  /* Com foto de capa, o JS define --page-bg na cor da própria foto
     (laterais, vãos entre os cards e a faixa das abas acompanham a capa). */
  background:
    var(--page-bg,
      radial-gradient(1200px 400px at 20% -10%, rgba(219, 39, 119, 0.10), transparent 60%),
      radial-gradient(900px 380px at 90% 0%, rgba(249, 115, 22, 0.10), transparent 55%),
      var(--bg));
  color: var(--ink);
  min-height: 100vh;
}
button { font-family: inherit; }
/* ===== Topbar ===== */
.topbar {
  background: linear-gradient(115deg, var(--purple-dark) 0%, var(--purple) 35%, var(--pink) 72%, var(--orange) 100%);
  color: #fff;
  padding: 14px clamp(14px, 4vw, 32px);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.brand-img {
  display: block;
  height: 58px;
  max-width: min(92vw, 460px);
  width: auto;
  object-fit: contain;
}
/* ===== Notificação de nova reserva (só o dono) ===== */
.topbar { position: relative; }
.notif-area {
  position: absolute;
  right: clamp(10px, 3vw, 26px);
  top: 50%;
  transform: translateY(-50%);
}
.notif-area[hidden] { display: none; }
.notif-bell {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: transform .15s ease, background .15s ease;
}
.notif-bell:hover { transform: scale(1.07); background: rgba(255, 255, 255, .3); }
.notif-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  animation: notif-pulse 1.2s ease-in-out infinite;
}
.notif-count[hidden] { display: none; }
@keyframes notif-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
/* Ferramentas do aviso dentro da aba Reservas. */
.notif-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 2px;
}
.notif-tools[hidden] { display: none; }
@media (max-width: 560px) {
  .topbar { padding-right: 74px; }
  .brand-img { height: 46px; max-width: calc(100vw - 90px); }
}
/* ===== Frase de orientação ===== */
.tagline {
  max-width: 1180px;
  margin: 0 auto;
  text-align: center;
  font-weight: 700;
  color: var(--purple-dark);
  font-size: clamp(15px, 3.4vw, 19px);
  padding: 14px clamp(14px, 4vw, 32px) 0;
}
/* ===== Abas ===== */
.tabs {
  display: flex;
  gap: 8px;
  padding: 14px clamp(14px, 4vw, 32px) 0;
  max-width: 1180px;
  margin: 0 auto;
  /* Roleta: puxa pro lado e anda só a barra de abas (a página não acompanha). */
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  padding: 12px clamp(10px, 2vw, 18px);
  border-radius: 14px 14px 0 0;
  font-size: clamp(13px, 2.6vw, 15px);
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.tab:hover { color: var(--accent); }
.tab.active {
  color: var(--accent-ink);
  background: var(--card);
  border-bottom-color: var(--card);
  box-shadow: 0 -4px 12px rgba(76, 29, 149, 0.06);
  position: relative;
}
.tab.active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: -1px;
  height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
/* ===== Barra de data ===== */
.datebar {
  max-width: 1180px;
  margin: 0 auto;
  /* Sem caixa branca: mostra o fundo da página — a MESMA cor da lateral
     (com foto de capa, a cor quente tirada da foto). */
  background: transparent;
  border: 1px solid var(--line);
  border-top: none;
  padding: 12px clamp(12px, 3vw, 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.date-field { display: flex; flex-direction: column; gap: 2px; }
.date-field span { font-size: 11px; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .6px; }
.date-field input {
  border: 1px solid var(--line);
  background: #faf9ff;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 15px;
  color: var(--ink);
}
.icon-btn {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #faf9ff;
  font-size: 22px;
  line-height: 1;
  color: var(--purple);
  cursor: pointer;
}
.icon-btn:hover { background: #f1ecff; }
.date-title {
  font-weight: 700;
  color: var(--accent-ink);
  font-size: clamp(14px, 3vw, 17px);
  text-transform: capitalize;
}
.date-title .today-tag {
  font-size: 11px; background: var(--ok); color: #fff;
  padding: 2px 8px; border-radius: 999px; margin-left: 6px; text-transform: none;
}
/* ===== Etapas (Dia/Semana/Mês/Ano) ===== */
.segmented {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.seg {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s ease;
}
.seg:hover { color: var(--purple); border-color: #ddd2ff; }
.seg.active {
  background: linear-gradient(115deg, var(--purple), var(--pink));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(124, 58, 237, .25);
}
/* ===== Painéis ===== */
main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px clamp(14px, 4vw, 32px) 40px;
}
.panel { display: none; }
.panel.active { display: block; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(14px, 3vw, 22px);
  margin-bottom: 14px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px; margin-bottom: 8px; flex-wrap: wrap;
}
.card h2 { margin: 0; font-size: clamp(16px, 3vw, 19px); color: var(--accent-ink); }
.card h3 { margin: 0 0 8px; font-size: 16px; }
.badge {
  background: #f1ecff; color: var(--purple-dark);
  font-size: 13px; font-weight: 700;
  padding: 5px 10px; border-radius: 999px;
}
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 14px; }
/* ===== Formulário ===== */
.form-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 860px) { .form-grid { grid-template-columns: 1fr; } }
.item-rows { display: flex; flex-direction: column; gap: 10px; }
.item-row {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 6px 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fbfaff;
  border-radius: 14px;
  padding: 10px 12px;
}
.item-row.has-qty { border-color: var(--purple); background: #f7f3ff; }
.item-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.item-emoji { font-size: 24px; }
.item-name { font-weight: 700; font-size: 15px; }
.item-detail { color: var(--muted); font-size: 12px; }
.qty {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 8px;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  background: #fff;
  color: var(--ink);
}
.qty:focus { outline: 2px solid rgba(124, 58, 237, .35); border-color: var(--purple); }
.item-meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.item-meta .price { font-weight: 700; color: var(--purple-dark); }
.item-meta .avail.ok { color: var(--ok); }
.item-meta .avail.warn { color: var(--warn); font-weight: 700; }
.item-meta .avail.bad { color: var(--bad); font-weight: 700; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.field input, .field select, .stock-card input {
  border: 1px solid var(--line);
  background: #faf9ff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--ink);
}
.field input:focus, .field select:focus { outline: 2px solid rgba(124, 58, 237, .3); border-color: var(--purple); }
.delivery-box {
  border: 1px dashed var(--line);
  background: #fbfaff;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
}
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--purple); }
.delivery-fields { margin-top: 12px; }
.totals {
  background: #faf9ff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.total-row { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; color: var(--muted); }
.total-row strong { color: var(--ink); }
.total-row.grand { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px; font-size: 17px; }
.total-row.grand strong { color: var(--purple-dark); font-size: 21px; }
.consumption {
  font-size: 13px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.consumption .chip {
  display: inline-block;
  background: #ffedd5;
  border: 1px solid #fdba74;
  border-radius: 999px;
  padding: 2px 9px;
  margin: 2px 4px 2px 0;
  font-weight: 700;
  font-size: 12.5px;
}
.alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  border: none;
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .12s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(115deg, var(--accent), var(--accent-2));
  color: #fff;
  flex: 1;
  min-width: 180px;
  box-shadow: var(--btn-shadow);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--purple-dark);
}
.btn.ghost:hover { background: #f7f3ff; }
.btn.small { padding: 9px 14px; font-size: 13px; }
.btn.danger { background: #fff; border: 1px solid #fecaca; color: var(--bad); }
.btn.danger:hover { background: #fef2f2; }
/* ===== Reservas ===== */
.rental-list { display: flex; flex-direction: column; gap: 12px; }
.empty {
  text-align: center;
  color: var(--muted);
  padding: 22px 10px;
  font-size: 14px;
  background: #fbfaff;
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.day-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0 0;
}
.date-link {
  background: #f1ecff; color: var(--purple-dark);
  border: none; border-radius: 999px;
  font-weight: 800; font-size: 13px;
  padding: 7px 14px; cursor: pointer;
}
.date-link:hover { background: #e6dcff; }
.day-total { font-size: 13px; color: var(--muted); font-weight: 600; }
.rental-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fbfaff;
}
.rental-card.editing { border-color: var(--purple); box-shadow: 0 0 0 2px rgba(124, 58, 237, .18); }
.rental-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.rental-head strong { font-size: 15.5px; }
.rental-total { font-weight: 800; color: var(--purple-dark); white-space: nowrap; }
.chips { margin: 8px 0 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 700;
}
.rental-note { font-size: 12.5px; color: #9a3412; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 6px 9px; display: inline-block; }
.rental-delivery { font-size: 13px; color: var(--ink); margin-top: 8px; }
.rental-notes { font-size: 13px; color: var(--muted); margin-top: 6px; font-style: italic; }
.rental-foot {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 8px; margin-top: 10px;
}
.rental-date { font-size: 13px; color: var(--muted); font-weight: 600; }
/* Tudo dentro da caixa: quebra linha em vez de vazar pra fora. */
.mini-actions {
  display: flex; gap: 8px; flex-wrap: wrap; width: 100%;
  border-top: 1px dashed var(--line); padding-top: 9px;
}
.btn.mini { padding: 8px 13px; font-size: 13px; border-radius: 10px; }
/* ===== Estoque ===== */
.info-card { background: #f7f3ff; border-color: #ddd2ff; }
.info-card ul { margin: 0 0 12px; padding-left: 18px; line-height: 1.7; font-size: 14px; }
.stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.stock-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stock-head { display: flex; align-items: center; gap: 10px; }
.stock-head .em { font-size: 26px; }
.stock-head h3 { margin: 0; font-size: 16.5px; }
.stock-avail {
  background: #f7f3ff;
  border: 1px solid #e6dcff;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}
.stock-avail .big { font-size: 30px; font-weight: 900; color: var(--purple-dark); display: block; line-height: 1.1; }
.stock-avail small { color: var(--muted); font-size: 12px; }
.stock-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.stock-card input { font-size: 15px; font-weight: 700; color: var(--ink); }
.virtual-tag { font-size: 12px; color: var(--muted); }
/* ===== Controle de estoque (bloqueios) ===== */
.block-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.block-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.block-form input, .block-form select {
  border: 1px solid var(--line);
  background: #faf9ff;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  color: var(--ink);
}
.block-list { margin-top: 14px; }
.block-day { margin-bottom: 14px; }
.block-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fbfaff;
  border-radius: 12px;
  padding: 9px 12px;
  margin-top: 8px;
  font-size: 14px;
}
.block-row .blocked-qty { font-weight: 700; color: var(--bad); }
/* ===== Financeiro ===== */
.fin-rental {
  border: 1px solid var(--line);
  background: #fbfaff;
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 10px;
}
.fin-desc { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.fin-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.fin-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 4px 0;
  color: var(--muted);
}
.fin-row strong { color: var(--ink); }
.fin-row.delivery-row strong { color: var(--orange); }
/* Caixa retangular do total (dia ou dois dias somados) */
.fin-daybox {
  border: 2px solid var(--purple);
  background: #f7f3ff;
  border-radius: 14px;
  padding: 12px 16px;
  margin-top: 10px;
}
.fin-daybox-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--purple-dark);
  font-size: 15px;
  padding-bottom: 6px;
  margin-bottom: 4px;
  border-bottom: 1px dashed #ddd2ff;
}
.fin-daybox-title strong { font-size: 19px; }
.fin-daybox .fin-row { padding: 3px 0; }
.fin-daybox .fin-row span { text-transform: lowercase; }
/* ===== Soma de dois dias ===== */
.two-days {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  background: #fbfaff;
  border-radius: 14px;
  margin-bottom: 12px;
}
.two-days-toggle { margin-bottom: 8px; }
.two-days-fields { display: flex; gap: 10px; flex-wrap: wrap; }
.two-days-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.two-days-fields input {
  border: 1px solid var(--line);
  background: #faf9ff;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 14.5px;
  color: var(--ink);
}
.two-days-summary { margin-bottom: 14px; }
.two-days-summary[hidden] { display: none; }
/* ===== Dica de mínimo por item ===== */
.item-hint {
  grid-column: 1 / -1;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--warn);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 4px 9px;
}
.item-hint[hidden] { display: none; }
/* ===== Card de reserva: contato ===== */
.rental-contact { font-size: 13px; color: var(--muted); margin-top: 4px; font-weight: 600; }
/* ===== Confirmação de reserva ===== */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 20px;
}
.success-overlay[hidden] { display: none; }
.success-box {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 34px 44px 30px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  max-width: 90vw;
  animation: success-pop 0.25s ease;
}
/* ✕ no canto direito: é o único jeito de fechar (sem tempo limitado). */
.success-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.success-x:hover { background: #f1ecff; color: var(--purple-dark); border-color: #ddd2ff; }
@keyframes success-pop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.success-check { font-size: 54px; line-height: 1; margin-bottom: 10px; }
.success-msg { font-size: clamp(18px, 4vw, 24px); font-weight: 800; color: var(--purple-dark); }
/* ===== Rodapé/toast ===== */
.footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 10px 0 30px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
  z-index: 50;
  max-width: 92vw;
  text-align: center;
}
/* Toast que é um atalho (ex.: reserva nova): clica e abre a aba Reservas. */
.toast.clickable { cursor: pointer; border: 1px solid rgba(255, 255, 255, .45); }
.toast.clickable::after { content: ' →'; font-weight: 900; }

/* ===== Logo (header) ===== */
.topbar .brand-img { filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); }
.tagline-2 { font-size: 12.5px; color: var(--muted); text-align: center; }

/* ===== WhatsApp ===== */
.wa-link {
  color: #128c7e;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dashed rgba(18, 140, 126, .5);
}
.wa-link:hover { text-decoration: underline; }
.wa-confirm { text-decoration: none; margin-top: 14px; display: inline-block; }

/* ===== Confirmação com código ===== */
.success-sub {
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink);
  background: #f7f3ff;
  border: 1px solid #ddd2ff;
  border-radius: 10px;
  padding: 8px 12px;
  max-width: 320px;
}
.success-sub strong { color: var(--purple-dark); letter-spacing: 1px; }
.success-close { margin-top: 12px; font-size: 12px; color: var(--muted); }
.success-sub[hidden], .success-wa[hidden] { display: none; }

/* ===== Reserva: código e busca ===== */
.res-code {
  margin-top: 6px;
  font-size: 13px;
  color: var(--purple-dark);
  background: #f1ecff;
  border: 1px dashed #ddd2ff;
  border-radius: 10px;
  padding: 5px 10px;
  display: inline-block;
}
.code-lookup {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.code-lookup input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: #faf9ff;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  color: var(--ink);
  text-transform: uppercase;
}
.code-lookup input:focus { outline: 2px solid rgba(124, 58, 237, .3); border-color: var(--purple); }

/* ===== Alertas de sucesso ===== */
.alert.ok-box {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

/* ===== WhatsApp da loja (estoque) ===== */
.shop-wa { margin-top: 16px; max-width: 380px; }

/* ===== Rotas ===== */
.rotas-origin {
  border: 1px dashed var(--line);
  background: #fbfaff;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}
.rotas-origin .origin-label { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.origin-row { display: flex; gap: 8px; margin-top: 6px; }
.origin-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14.5px;
  color: var(--ink);
}
.origin-row input:focus { outline: 2px solid rgba(124, 58, 237, .3); border-color: var(--purple); }

.rotas-days { margin-bottom: 12px; }
.day-add { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.day-add label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.day-add input {
  border: 1px solid var(--line);
  background: #faf9ff;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 14.5px;
  color: var(--ink);
}
.day-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.day-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1ecff;
  color: var(--purple-dark);
  border: 1px solid #ddd2ff;
  border-radius: 999px;
  padding: 7px 8px 7px 13px;
  font-size: 13px;
  font-weight: 700;
}
.day-chip.is-today { background: linear-gradient(115deg, var(--purple), var(--pink)); color: #fff; border-color: transparent; }
.chip-x {
  border: none;
  background: rgba(0, 0, 0, .08);
  color: inherit;
  border-radius: 999px;
  width: 20px;
  height: 20px;
  line-height: 1;
  cursor: pointer;
  font-size: 12px;
}
.chip-x:hover { background: rgba(0, 0, 0, .2); }
.quick-days { display: flex; gap: 8px; flex-wrap: wrap; }

.rotas-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; align-items: center; }
.rotas-actions .btn { text-decoration: none; }

.rotas-summary {
  border: 2px solid var(--purple);
  background: #f7f3ff;
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 6px;
}
.rotas-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 800;
  color: var(--purple-dark);
  font-size: 15px;
}
.rotas-summary-head strong { font-size: 19px; }
.rotas-summary-note { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.rotas-stops { display: flex; flex-direction: column; gap: 10px; }
.rotas-stop {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fbfaff;
  border-radius: 14px;
  padding: 10px 12px;
}
.rotas-stop.selected { border-color: var(--purple); background: #f7f3ff; }
.stop-body { min-width: 0; }
.stop-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stop-kind {
  font-size: 11.5px;
  font-weight: 800;
  border-radius: 999px;
  padding: 3px 9px;
  cursor: pointer;
  border: 1px solid transparent;
}
.stop-kind.ent { background: #ffedd5; color: #9a3412; border-color: #fdba74; }
.stop-kind.ret { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.stop-time { font-size: 12.5px; font-weight: 800; color: var(--ok); }
.stop-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.stop-addr { font-size: 13.5px; color: var(--muted); margin-top: 3px; word-break: break-word; }
.stop-actions { display: flex; gap: 6px; }
.stop-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--purple-dark);
  font-size: 14px;
  cursor: pointer;
}
.stop-btn:hover:not(:disabled) { background: #f1ecff; }
.stop-btn:disabled { opacity: .35; cursor: not-allowed; }
.stop-btn.danger { color: var(--bad); border-color: #fecaca; }
.stop-btn.danger:hover { background: #fef2f2; }

.rotas-add-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.rotas-add-row input[type="text"] {
  flex: 2;
  min-width: 200px;
  border: 1px solid var(--line);
  background: #faf9ff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14.5px;
  color: var(--ink);
}
.rotas-add-row input[type="time"] {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #faf9ff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14.5px;
  color: var(--ink);
}

/* ===== Alerta de erro do formulário (sempre embaixo, fácil de ver) ===== */
.alert.form-alert {
  border-width: 2px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 12px;
  animation: alert-in .18s ease;
}
@keyframes alert-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ===== Estoque: botão de visibilidade no card ===== */
.stock-card .vis-toggle { width: 100%; margin-top: 4px; }

/* ===== Planilha ===== */
/* Caixinha de ano: você abre e escolhe o ano que quer ver. */
.year-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 800;
  color: var(--purple-dark);
}
.year-select {
  border: 1px solid var(--line);
  background: linear-gradient(115deg, var(--purple), var(--pink));
  color: #fff;
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  min-width: 96px;
}
.plan-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.plan-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 900px; }
.plan-table th, .plan-table td {
  border: 1px solid var(--line); padding: 9px 7px; text-align: right; white-space: nowrap;
}
.plan-table th {
  background: #f7f3ff; color: var(--purple-dark); font-weight: 800;
  text-transform: uppercase; font-size: 12px; letter-spacing: .4px;
}
.plan-table tr > th:first-child { text-align: left; }
.plan-table tr:first-child th { background: #ede9fe; }
.plan-table td {
  text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; background: #fff;
}
.plan-table tr:nth-child(even) td { background: #fbfaff; }
.plan-table .plan-total { font-weight: 800; color: var(--purple-dark); background: #f1ecff !important; }
.plan-table .plan-grand th, .plan-table .plan-grand td {
  font-weight: 900; background: #f7f3ff; border-top: 2px solid var(--purple);
}


/* ===== v2: itens visíveis (Estoque ADM) ===== */
.vis-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.vis-item {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); background: #fbfaff; border-radius: 14px; padding: 10px 12px;
}
.vis-item .em { font-size: 22px; }
.vis-item .vis-name { flex: 1; font-weight: 700; font-size: 14px; }
.vis-item.on { border-color: #bbf7d0; background: #f0fdf4; }

/* ===== v2: ADM itens novos ===== */
.adm-item-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.adm-item-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.adm-item-form input { border: 1px solid var(--line); background: #faf9ff; border-radius: 10px; padding: 11px 12px; font-size: 15px; }
.custom-items { display: flex; flex-direction: column; gap: 8px; }
.custom-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border: 1px solid var(--line); background: #fbfaff; border-radius: 12px; padding: 10px 12px; font-size: 14px;
}

/* ===== v2: ADM entrega (cidades/bairros) ===== */
.adm-delivery { display: flex; flex-direction: column; gap: 12px; }
.adm-city { border: 1px solid var(--line); background: #fbfaff; border-radius: 14px; padding: 12px; }
.adm-city-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.adm-hood { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px dashed var(--line); padding: 7px 0; font-size: 14px; }
.adm-fee { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.adm-fee input { width: 90px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 8px; font-size: 14px; }
.adm-add-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.adm-add-row input { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 10px; font-size: 14px; }

/* ===== v2: barra de WhatsApp em lote ===== */
.wa-batch-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: linear-gradient(115deg, #f0fdf4, #ecfdf5);
  border: 1px solid #bbf7d0; border-radius: 14px; padding: 10px 14px; margin-bottom: 12px;
  font-weight: 700; color: #166534; font-size: 14px;
}
.wa-batch-bar[hidden] { display: none; }

/* ===== v2: fila do WhatsApp (próximo) ===== */
/* Fila do WhatsApp: só os botões, sem caixa preta com texto. */
.wa-next {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; z-index: 70;
  background: transparent; padding: 0; max-width: 94vw;
}
.wa-next[hidden] { display: none; }
.wa-next .btn { box-shadow: 0 10px 26px rgba(124, 58, 237, .3); }

/* ===== v2: entregue ===== */
.rental-card.delivered { opacity: .65; border-color: #bbf7d0; }
.rental-card.delivered .rental-head strong { text-decoration: none; }
.delivered-tag {
  display: inline-block; margin-top: 6px; background: #f0fdf4; color: #166534;
  border: 1px solid #bbf7d0; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 800;
}
.mini-check { font-size: 12px; gap: 5px; }
.fin-rental.delivered { opacity: .65; }
.rotas-stop.delivered { opacity: .6; border-color: #bbf7d0; }

/* ===== v2: endereço clicável (Google Maps) ===== */
.addr-link { color: var(--purple-dark); text-decoration: none; border-bottom: 1px dashed #c4b5fd; }
.addr-link:hover { color: var(--pink); border-bottom-color: var(--pink); }
.stop-addr.addr-link { display: inline-block; font-size: 13.5px; margin-top: 3px; word-break: break-word; }
/* Paradas: endereço em destaque e menos ruído visual. */
.rotas-stop { grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; }
.rotas-stop .stop-body { padding-top: 2px; }

/* textarea ADM */
.field textarea {
  border: 1px solid var(--line); background: #faf9ff; border-radius: 10px; padding: 10px 12px;
  font-size: 14px; color: var(--ink); font-family: inherit; resize: vertical;
}
.field textarea:focus { outline: 2px solid rgba(124, 58, 237, .3); border-color: var(--purple); }

/* ===== Reservas: abas Novas / Todas ===== */
.res-filter { margin-bottom: 8px; }
.seg-count {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 5px;
  background: var(--bad); color: #fff; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; line-height: 18px; text-align: center;
}
.seg-count[hidden] { display: none; }
.seg.active .seg-count { background: rgba(255, 255, 255, .28); }
.novas-hint {
  font-size: 13px; font-weight: 700; color: var(--purple-dark);
  background: #f7f3ff; border: 1px dashed #ddd2ff; border-radius: 12px;
  padding: 9px 12px; margin-bottom: 4px;
}
.rental-card.is-new {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
  background: linear-gradient(0deg, #fdfcff, #fdfcff);
}
.seen-btn { color: var(--ok); border-color: #bbf7d0; font-weight: 800; }
.seen-btn:hover { background: #f0fdf4; }

/* ===== Planilha: células editáveis ===== */
.plan-edit-cell { padding: 3px 4px !important; }
.plan-cell {
  width: 100%; min-width: 62px; border: 1px dashed var(--purple);
  background: #fff; border-radius: 8px; padding: 5px 6px;
  font-size: 12.5px; font-weight: 700; color: var(--ink); text-align: right;
  font-variant-numeric: tabular-nums;
}
.plan-cell:focus { outline: 2px solid rgba(124, 58, 237, .35); border-style: solid; }
#planEditBtn.primary { box-shadow: 0 6px 14px rgba(124, 58, 237, .25); }

/* ===== Botões das reservas: um do lado do outro, do mesmo tamanho ===== */
.mini-actions { align-items: stretch; }
.mini-actions > * { flex: 1 1 92px; justify-content: center; }
.mini-actions .check {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  padding: 8px 6px; min-height: 34px; cursor: pointer;
}
.mini-actions .check:hover { border-color: var(--purple); }

/* ===== Faixa da reserva entregue (minimizada) ===== */
.rental-card.collapsed { padding: 8px 10px; opacity: 1; }
.deliv-strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  cursor: pointer; border-radius: 10px; padding: 2px 4px;
}
.deliv-strip:hover { background: #f0fdf4; }
.deliv-strip .check { cursor: pointer; padding: 4px 8px; min-height: 30px; flex: 0 0 auto; }
.deliv-hood { font-size: 14px; color: #166534; }
.deliv-value { font-weight: 800; color: var(--purple-dark); }
.deliv-addr { font-size: 13px; flex: 1 1 140px; word-break: break-word; }
.deliv-date { font-size: 12.5px; color: var(--muted); }
.deliv-strip .btn { flex: 0 0 auto; }

/* ===== Figurinhas (estilo WhatsApp) no lugar dos emojis ===== */
.sticker { width: 34px; height: 34px; display: inline-block; flex: 0 0 auto; }
.sticker.em-sticker { width: 30px; height: 30px; }
.item-info .sticker { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .18)); }

/* ===== Logo do site: envio + corte ===== */
.logo-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.logo-preview {
  height: 54px; max-width: min(90vw, 320px); object-fit: contain;
  background: linear-gradient(115deg, #2b1055, #7c3aed);
  border-radius: 12px; padding: 6px 10px; border: 1px solid var(--line);
}
.logo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.logo-actions .btn { cursor: pointer; }
.crop-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(23, 10, 46, .6); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.crop-overlay[hidden] { display: none; }
.crop-box {
  background: #fff; border-radius: 16px; box-shadow: var(--shadow);
  padding: 16px; width: min(94vw, 580px); display: flex; flex-direction: column; gap: 12px;
}
.crop-head { font-weight: 700; font-size: 13.5px; color: var(--purple-dark); }
.crop-stage {
  border: 2px dashed #c4b5fd; border-radius: 12px; overflow: hidden;
  background: #f7f3ff; touch-action: none; cursor: grab; line-height: 0;
}
.crop-stage:active { cursor: grabbing; }
.crop-stage canvas { width: 100%; height: auto; display: block; }
.crop-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ===== Logo enviado: faixa de cima inteira, de fora a fora ===== */
.topbar.has-logo { padding: 0; display: block; }
.topbar.has-logo .brand-img {
  width: 100%; max-width: none;
  /* Maior que a faixa de antes (foto + frase): a foto cresce e encosta nos botões. */
  height: 36vw;
  max-height: 50vh;
  object-fit: cover; object-position: center; display: block; filter: none;
}
.topbar.has-logo .notif-area { right: 12px; z-index: 5; }
/* Com foto própria, a imagem vai até os botões de aba (sem frase no meio). */
.topbar.has-logo + .tagline { display: none; }
.topbar.has-logo ~ .tabs { padding-top: 0; }
@media (max-width: 560px) {
  .topbar.has-logo { padding-right: 0; }
  .topbar.has-logo .brand-img { max-height: 40vh; }
}

/* ===== ADM: lista de fotos dos itens ===== */
.item-img-list { display: flex; flex-direction: column; gap: 8px; }
.item-img-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fff;
}
.item-img-row .sticker { width: 40px; height: 40px; }
.item-img-name { font-weight: 700; font-size: 14px; flex: 1 1 120px; }
.item-img-row .btn { cursor: pointer; }

/* ===== Rodapé com o botão de sair ===== */
.footer { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.footer #logoutBtn { opacity: .85; }
.footer #logoutBtn:hover { opacity: 1; }
