:root {
  --bg: #f6f5f9;
  --surface: #ffffff;
  --surface-soft: #efedf5;
  --ink: #1e1633;
  --muted: #6c6482;
  --accent: #ec257c;
  --accent-soft: rgba(236, 37, 124, 0.1);
  --purple: #371b71;
  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, 0.12);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.13);
  --cyan: #0284c7;
  --cyan-soft: rgba(2, 132, 199, 0.12);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.1);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-soft: 0 2px 12px rgba(30, 22, 51, 0.04);
  --topbar-bg: rgba(246, 245, 249, 0.88);
  --bottom-nav-bg: rgba(255, 255, 255, 0.92);
  --input-focus-bg: #ffffff;
  --border-subtle: transparent;
}

/* Tema Purple (padrão): cards claros estilo Light sobre fundo roxo #371B71 */
html[data-theme="purple"] {
  --bg: #371b71;
  --shadow-soft: 0 8px 24px rgba(18, 6, 48, 0.24);
  --topbar-bg: rgba(55, 27, 113, 0.9);
  --bottom-nav-bg: rgba(255, 255, 255, 0.96);
}

/* Tema Dark: fundo roxo #371B71 com superfícies escuras e texto claro */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #371b71;
  --surface: #2a1358;
  --surface-soft: #3c2178;
  --ink: #fcfcfb;
  --muted: #cbbfe6;
  --accent: #ec257c;
  --accent-soft: rgba(236, 37, 124, 0.22);
  --purple: #fcfcfb;
  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, 0.18);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.18);
  --cyan: #38bdf8;
  --cyan-soft: rgba(56, 189, 248, 0.18);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.2);
  --shadow-soft: 0 8px 24px rgba(14, 5, 36, 0.28);
  --topbar-bg: rgba(55, 27, 113, 0.88);
  --bottom-nav-bg: rgba(34, 15, 74, 0.94);
  --input-focus-bg: #46288a;
  --border-subtle: rgba(252, 252, 251, 0.11);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
  min-height: 100dvh;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.hidden {
  display: none !important;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Helpers de layout */
.stack-sm { display: flex; flex-direction: column; gap: 0.65rem; }
.stack-md { display: flex; flex-direction: column; gap: 1rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.row-gap { display: flex; align-items: center; gap: 0.5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.muted { color: var(--muted); }
.small-text { font-size: 0.82rem; }
.tiny-note { font-size: 0.76rem; color: var(--muted); }

/* Toast */
.toast {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  left: 50%;
  transform: translate(-50%, -140%);
  z-index: 900;
  background: var(--ink);
  color: #fff;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  max-width: calc(100vw - 2rem);
  text-align: center;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }
.toast.error { background: var(--red); }

/* Toast amarelo persistente (alterações não salvas) */
.unsaved-toast {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  left: 50%;
  transform: translate(-50%, -180%);
  z-index: 950;
  background: #fcd401;
  color: #1e1633;
  padding: 0.55rem 0.65rem 0.55rem 1.05rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  max-width: calc(100vw - 1.5rem);
  box-shadow: 0 8px 24px rgba(30, 22, 51, 0.22);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.unsaved-toast.show {
  transform: translate(-50%, 0);
}

.unsaved-save-btn {
  border: none;
  background: #1e1633;
  color: #fff;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* Login */
.login-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: 26px;
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.login-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 0.75rem;
  display: block;
}

.login-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--purple);
}

.login-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.help-inline-link {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: 0.82rem;
  color: var(--muted);
}

/* App Shell */
.app-shell {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(9.5rem + env(safe-area-inset-bottom));
}

@media (min-width: 950px) {
  .app-shell {
    padding-bottom: calc(6.5rem + env(safe-area-inset-bottom));
  }
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0.6rem;
  padding: max(0.8rem, env(safe-area-inset-top)) 1rem 0.7rem;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background-color 0.25s ease;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1 1 auto;
}

.topbar-brand-text {
  min-width: 0;
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.topbar-title {
  display: block;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--purple);
}

.topbar-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  flex-shrink: 0;
}

.icon-pill {
  height: 34px;
  padding: 0 0.72rem;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--purple);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}

.icon-pill:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.topbar .theme-opt-btn {
  width: 28px;
  min-width: 28px;
  padding: 0;
}

.topbar .theme-opt-label {
  display: none !important;
}

@media (max-width: 440px) {
  .topbar {
    gap: 0.4rem;
    padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem 0.65rem;
  }

  .topbar-avatar {
    width: 32px;
    height: 32px;
  }

  .topbar-title {
    font-size: 0.94rem;
  }

  .topbar-sub {
    font-size: 0.68rem;
  }

  .topbar-actions {
    gap: 0.28rem;
  }

  .icon-pill {
    height: 32px;
    padding: 0 0.56rem;
    font-size: 0.71rem;
  }

  .topbar .theme-opt-btn {
    width: 26px;
    min-width: 26px;
    height: 26px;
  }
}

/* Tab Panels */
.tab-panel {
  padding: 0.5rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-head h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--purple);
  margin-bottom: 0.2rem;
}

/* Inputs minimalistas sem borda pesada */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
}

.field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  padding-left: 0.15rem;
}

.input-with-action {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
}

.input-with-action input {
  flex: 1;
  min-width: 0;
}

.url-open-btn {
  flex-shrink: 0;
  width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 800;
  transition: background 0.16s, color 0.16s, opacity 0.16s;
}

.url-open-btn:hover:not(.is-disabled) {
  background: var(--accent);
  color: #fff;
}

.url-open-btn.is-disabled {
  background: var(--surface-soft);
  color: var(--muted);
  opacity: 0.45;
  pointer-events: none;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="search"],
textarea,
select {
  width: 100%;
  border: none;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  padding: 0.82rem 0.95rem;
  font-size: 0.95rem;
  outline: none;
  transition: box-shadow 0.18s ease, background 0.18s ease;
}

input:focus,
textarea:focus,
select:focus {
  background: var(--input-focus-bg);
  box-shadow: 0 0 0 2px rgba(236, 37, 124, 0.35);
}

textarea {
  resize: vertical;
  min-height: 92px;
}

.search-wrap input {
  background: var(--surface);
  border-radius: 999px;
  padding: 0.78rem 1.1rem;
  box-shadow: var(--shadow-soft);
}

/* Segmented control */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
  background: var(--surface-soft);
  padding: 0.28rem;
  border-radius: 14px;
}

.segmented.segmented-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 440px) {
  .segmented.segmented-4 .seg-btn {
    flex-direction: column;
    gap: 0.14rem;
    padding: 0.45rem 0.2rem;
    font-size: 0.74rem;
  }
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 0.55rem 0.4rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: background 0.18s, color 0.18s;
}

.seg-btn.active {
  background: var(--surface);
  color: var(--purple);
  box-shadow: 0 1px 4px rgba(30, 22, 51, 0.08);
}

.seg-count {
  font-size: 0.72rem;
  background: var(--surface-soft);
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
}

/* Filtro de meses (aba Próximos) */
.month-filter-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.05rem 0.05rem 0.15rem;
}

.month-filter-row::-webkit-scrollbar {
  display: none;
}

.month-pill {
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow-soft);
  padding: 0.4rem 0.78rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.month-pill:hover {
  color: var(--purple);
}

.month-pill.active {
  background: var(--accent);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(236, 37, 124, 0.28);
}

.month-pill .month-full {
  display: none;
}

.month-pill .month-short {
  display: inline;
}

@media (min-width: 560px) {
  .month-pill .month-full {
    display: inline;
  }

  .month-pill .month-short {
    display: none;
  }
}

/* Superfícies sem borda */
.surface {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow-soft);
}

.block-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--purple);
}

.sub-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
}

.soft-divider {
  border: none;
  height: 1px;
  background: var(--surface-soft);
}

/* Lista de Shows */
.show-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.show-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: opacity 0.2s;
}

.show-card.is-inactive {
  opacity: 0.72;
}

.show-top {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.date-pill {
  flex-shrink: 0;
  width: 54px;
  padding: 0.45rem 0.25rem;
  border-radius: 14px;
  background: var(--accent-soft);
  text-align: center;
}

.date-pill.past {
  background: var(--surface-soft);
}

.date-day {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.05;
  color: var(--purple);
}

.date-mon {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.date-pill.past .date-mon {
  color: var(--muted);
}

.show-main {
  flex: 1;
  min-width: 0;
}

.show-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 0.28rem;
}

.show-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.show-edit-btn {
  border: none;
  background: var(--surface-soft);
  color: var(--purple);
  padding: 0.42rem 0.72rem;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

/* Pílulas de toggle rápido 1-toque */
.quick-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.flag-chip {
  border: none;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0.34rem 0.68rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
}

.flag-chip.on-active { background: var(--green-soft); color: var(--green); }
.flag-chip.on-soldout { background: var(--red-soft); color: var(--red); }
.flag-chip.on-last { background: var(--cyan-soft); color: var(--cyan); }
.flag-chip.on-extra { background: var(--amber-soft); color: var(--amber); }
.flag-chip.on-solidarity { background: var(--accent-soft); color: var(--accent); }

/* Botões */
.btn-primary {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 0.88rem 1.25rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.16s, transform 0.1s;
}
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-subtle {
  border: none;
  background: var(--surface-soft);
  color: var(--purple);
  padding: 0.8rem 1.15rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.16s, transform 0.1s;
}
.btn-subtle:active { transform: scale(0.99); }
.btn-subtle:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-danger-ghost {
  border: none;
  background: var(--red-soft);
  color: var(--red);
  padding: 0.8rem 1.15rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-full { width: 100%; }

.text-btn {
  border: none;
  background: none;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.danger-text { color: var(--red); }
.link-accent { color: var(--accent); font-size: 0.85rem; font-weight: 700; }

.file-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-soft);
  color: var(--purple);
  padding: 0.52rem 0.88rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.form-error {
  color: var(--red);
  font-size: 0.85rem;
  background: var(--red-soft);
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 2.5rem 1rem;
  font-size: 0.92rem;
}

/* WhatsApp Card */
.whatsapp-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: #25d366;
  color: #fff;
  padding: 1.05rem 1.15rem;
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.25);
}

.wa-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.wa-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.wa-body strong { font-size: 0.98rem; }
.wa-body span { font-size: 0.8rem; opacity: 0.92; }
.wa-arrow { font-size: 1.2rem; font-weight: 700; }

.guide-item strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.15rem;
}
.guide-item p { font-size: 0.83rem; }

/* Medidores R2 */
.meter-block { display: flex; flex-direction: column; gap: 0.35rem; }
.meter-track {
  height: 8px;
  background: var(--surface-soft);
  border-radius: 999px;
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.35s ease;
}
.meter-fill.warn { background: var(--amber); }
.meter-fill.danger { background: var(--red); }

/* FAB */
.fab {
  position: fixed;
  right: 1rem;
  bottom: calc(5.15rem + env(safe-area-inset-bottom));
  z-index: 45;
  border: none;
  background: var(--purple);
  color: #fff;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(55, 27, 113, 0.28);
  cursor: pointer;
}
.fab-plus { font-size: 1.2rem; line-height: 1; }

@media (min-width: 950px) {
  .fab {
    left: calc(50vw + 320px);
    right: auto;
  }
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bottom-nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0.45rem 0.5rem calc(0.55rem + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 16px rgba(30, 22, 51, 0.08);
  transition: background-color 0.25s ease;
}

.nav-item {
  border: none;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem 0;
}
.nav-item.active { color: var(--accent); }
.nav-ico { font-size: 1.15rem; line-height: 1; }

html.modal-open,
body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

/* Sheet Modal (Bottom Sheet mobile / Modal desktop) */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 12, 42, 0.48);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overscroll-behavior: contain;
  touch-action: none;
}

@media (min-width: 640px) {
  .sheet-backdrop {
    align-items: center;
    padding: 1.5rem;
  }
}

.sheet-panel {
  width: 100%;
  max-width: 540px;
  max-height: 92dvh;
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 640px) {
  .sheet-panel {
    border-radius: 26px;
  }
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem 0.75rem;
}

.sheet-head h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--purple);
}

.icon-close {
  border: none;
  background: var(--surface-soft);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 0.95rem;
  cursor: pointer;
}

.sheet-body {
  padding: 0.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.info-banner {
  background: var(--amber-soft);
  color: #92400e;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  font-size: 0.83rem;
}

/* Atalhos rápidos de data e horários no formulário */
.quick-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.preset-chip {
  border: 1px solid transparent;
  background: var(--surface-soft);
  color: var(--purple);
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.1s ease;
}

.preset-chip:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.preset-chip:active {
  transform: scale(0.96);
}

.preset-chip.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(236, 37, 124, 0.32);
}

/* Upload Banner / Flyer */
.flyer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.flyer-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: var(--surface-soft);
  padding: 0.2rem;
  border-radius: 10px;
}

.flyer-mode-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.34rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.flyer-mode-btn.active {
  background: var(--surface);
  color: var(--purple);
  box-shadow: 0 1px 4px rgba(30, 22, 51, 0.12);
}

.flyer-link-panel {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.review-flyer-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.review-flyer-row input {
  flex: 1;
  min-width: 0;
}

.upload-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.upload-drop {
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.88rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--purple);
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  line-height: 1.25;
  transition: background 0.16s, color 0.16s;
}

.upload-drop:hover {
  background: #e5e1f0;
}

.upload-paste {
  background: var(--accent-soft);
  color: var(--accent);
}

.upload-paste:hover {
  background: rgba(236, 37, 124, 0.18);
}

.banner-preview {
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.banner-preview-stage {
  background: #1b1330;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.banner-preview img {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  display: block;
}

.banner-preview-fallback {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
  text-align: center;
  padding: 1.25rem 1rem;
}

.banner-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.8rem;
}

/* Switches limpos */
.switches-group {
  background: var(--surface-soft);
  border-radius: var(--radius);
  padding: 0.35rem 0.95rem;
  display: flex;
  flex-direction: column;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.72rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.switch-row + .switch-row {
  border-top: 1px solid rgba(30, 22, 51, 0.06);
}

.toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #cdc8db;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.toggle:checked {
  background: var(--accent);
}
.toggle:checked::after {
  transform: translateX(18px);
}

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

/* Revisão de importação JSON */
.review-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.review-card.excluded {
  opacity: 0.45;
}

.dup-badge {
  display: inline-block;
  background: var(--amber-soft);
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.review-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  font-size: 0.82rem;
}

.review-flags label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

/* Exportação JSON (Backup dos cards) */
.export-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.export-details {
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  padding: 0.72rem 0.9rem;
}

.export-details-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--purple);
  cursor: pointer;
  list-style: none;
}

.export-details-summary::-webkit-details-marker {
  display: none;
}

.export-details-summary::after {
  content: '▾';
  font-size: 0.8rem;
  color: var(--muted);
  transition: transform 0.18s ease;
}

.export-details[open] .export-details-summary::after {
  transform: rotate(180deg);
}

.export-picker-body {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(30, 22, 51, 0.08);
}

.export-cards-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.export-card-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: var(--surface);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  transition: opacity 0.16s ease;
}

.export-card-item.is-unchecked {
  opacity: 0.52;
}

.export-card-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 0.15rem;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.export-card-main {
  flex: 1;
  min-width: 0;
}

.export-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  word-break: break-word;
}

.export-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.5rem;
  margin-top: 0.25rem;
  font-size: 0.74rem;
  color: var(--muted);
}

.export-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--purple);
}

.export-tag.is-inactive {
  background: var(--amber-soft);
  color: var(--amber);
}

.export-tag.is-past {
  background: var(--surface-soft);
  color: var(--muted);
}

.export-tag.is-soldout {
  background: var(--red-soft);
  color: var(--red);
}

.json-box {
  background: #1b1330;
  color: #e9e4f5;
  padding: 0.95rem;
  border-radius: 14px;
  font-size: 0.76rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow: auto;
  max-height: 280px;
  white-space: pre;
  line-height: 1.45;
  tab-size: 2;
}

/* Seletor compacto de 3 temas (Dark / Light / Purple) */
.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.login-theme-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.login-theme-wrap .theme-switcher {
  background: var(--surface-soft);
  box-shadow: none;
}

.theme-opt-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  height: 28px;
  min-width: 28px;
  padding: 0 0.42rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.theme-opt-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: block;
}

.theme-opt-label {
  display: none;
  line-height: 1;
}

@media (min-width: 560px) {
  .theme-opt-btn {
    padding: 0 0.58rem;
  }

  .theme-opt-label {
    display: inline;
  }
}

.theme-opt-btn:hover {
  color: var(--purple);
  background: var(--surface-soft);
}

.theme-opt-btn[data-theme-option="dark"][aria-pressed="true"] {
  background: #200e4a;
  color: #fcfcfb;
}

.theme-opt-btn[data-theme-option="dark"][aria-pressed="true"] svg {
  color: #fcd401;
}

.theme-opt-btn[data-theme-option="light"][aria-pressed="true"] {
  background: #fde8f2;
  color: #371b71;
}

.theme-opt-btn[data-theme-option="light"][aria-pressed="true"] svg {
  color: #f59e0b;
}

.theme-opt-btn[data-theme-option="purple"][aria-pressed="true"] {
  background: #ec257c;
  color: #ffffff;
}

.theme-opt-btn[data-theme-option="purple"][aria-pressed="true"] svg {
  color: #fcd401;
}

/* Ajustes específicos: Tema Purple (elementos fora dos cards brancos sobre #371B71) */
html[data-theme="purple"] .topbar-title,
html[data-theme="purple"] .section-head h2,
html[data-theme="purple"] .review-header strong {
  color: #fcfcfb;
}

html[data-theme="purple"] .topbar-sub,
html[data-theme="purple"] .section-head .muted,
html[data-theme="purple"] .empty-state {
  color: rgba(252, 252, 251, 0.78);
}

html[data-theme="purple"] .review-header .text-btn {
  color: #fcd401;
}

html[data-theme="purple"] .segmented {
  background: rgba(252, 252, 251, 0.14);
}

html[data-theme="purple"] .seg-btn {
  color: rgba(252, 252, 251, 0.85);
}

html[data-theme="purple"] .seg-count {
  background: rgba(252, 252, 251, 0.18);
  color: #fcfcfb;
}

html[data-theme="purple"] .seg-btn.active {
  background: #ffffff;
  color: #371b71;
  box-shadow: 0 3px 10px rgba(18, 6, 48, 0.22);
}

html[data-theme="purple"] .seg-btn.active .seg-count {
  background: #efedf5;
  color: #371b71;
}

html[data-theme="purple"] .month-pill {
  background: rgba(252, 252, 251, 0.14);
  color: rgba(252, 252, 251, 0.88);
  box-shadow: none;
}

html[data-theme="purple"] .month-pill:hover {
  background: rgba(252, 252, 251, 0.22);
  color: #ffffff;
}

html[data-theme="purple"] .month-pill.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(236, 37, 124, 0.35);
}

html[data-theme="purple"] .fab {
  background: var(--accent);
  box-shadow: 0 8px 24px rgba(18, 6, 48, 0.42);
}

html[data-theme="purple"] .bottom-nav {
  box-shadow: 0 -4px 20px rgba(18, 6, 48, 0.28);
}

/* Ajustes específicos: Tema Dark */
html[data-theme="dark"] .topbar {
  border-bottom: 1px solid rgba(252, 252, 251, 0.08);
}

html[data-theme="dark"] .login-card,
html[data-theme="dark"] .surface,
html[data-theme="dark"] .show-card,
html[data-theme="dark"] .review-card,
html[data-theme="dark"] .sheet-panel,
html[data-theme="dark"] .icon-pill,
html[data-theme="dark"] .theme-switcher {
  border: 1px solid var(--border-subtle);
}

html[data-theme="dark"] .segmented {
  background: rgba(20, 8, 48, 0.45);
}

html[data-theme="dark"] .seg-btn.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(236, 37, 124, 0.35);
}

html[data-theme="dark"] .seg-btn.active .seg-count {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

html[data-theme="dark"] .month-pill {
  background: rgba(20, 8, 48, 0.45);
  color: rgba(252, 252, 251, 0.82);
  border-color: var(--border-subtle);
  box-shadow: none;
}

html[data-theme="dark"] .month-pill:hover {
  background: rgba(252, 252, 251, 0.12);
  color: #ffffff;
}

html[data-theme="dark"] .month-pill.active {
  background: var(--accent);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(236, 37, 124, 0.35);
}

html[data-theme="dark"] .fab {
  background: var(--accent);
  box-shadow: 0 8px 24px rgba(14, 5, 36, 0.45);
}

html[data-theme="dark"] .bottom-nav {
  border-top: 1px solid rgba(252, 252, 251, 0.1);
  box-shadow: 0 -4px 20px rgba(14, 5, 36, 0.35);
}

html[data-theme="dark"] .toast {
  background: #180a36;
  border: 1px solid rgba(252, 252, 251, 0.14);
}

html[data-theme="dark"] .info-banner,
html[data-theme="dark"] .dup-badge {
  color: #fde68a;
}

html[data-theme="dark"] .upload-drop:hover {
  background: #482a8c;
}

html[data-theme="dark"] .flyer-mode-switch {
  background: rgba(20, 8, 48, 0.55);
}

html[data-theme="dark"] .flyer-mode-btn.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(236, 37, 124, 0.32);
}

html[data-theme="dark"] .preset-chip:hover {
  background: rgba(236, 37, 124, 0.28);
  color: #ffffff;
}

html[data-theme="dark"] .preset-chip.is-active {
  background: var(--accent);
  color: #ffffff;
  border-color: transparent;
}

html[data-theme="dark"] .icon-pill:hover {
  background: rgba(236, 37, 124, 0.28);
  color: #ffffff;
}

html[data-theme="dark"] .switch-row + .switch-row {
  border-top-color: rgba(252, 252, 251, 0.1);
}

html[data-theme="dark"] .export-picker-body {
  border-top-color: rgba(252, 252, 251, 0.1);
}

html[data-theme="dark"] .export-card-item {
  border: 1px solid var(--border-subtle);
}

html[data-theme="dark"] .json-box {
  background: #170a33;
  border: 1px solid var(--border-subtle);
}

html[data-theme="dark"] .toggle {
  background: rgba(252, 252, 251, 0.24);
}

html[data-theme="dark"] .theme-opt-btn[data-theme-option="light"][aria-pressed="true"] {
  background: #ffffff;
  color: #371b71;
}
