header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding: 0.85rem 1.5rem;
}
header h1 { font-size: 1.25rem; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
.greeting { font-size: 0.95rem; color: var(--text-muted); font-weight: 500; }
main { max-width: 1040px; margin: 0 auto; padding: 1.5rem; }

button {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  background: var(--accent);
  color: #fff;
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
button:hover { background: var(--accent-hover); }
button:active { background: var(--accent-hover); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.secondary, a.secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.55rem 1rem; font: inherit; font-weight: 600;
  line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
button.secondary:hover, a.secondary:hover { background: var(--surface-raised); border-color: var(--border-strong); }
button.danger, a.danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  background: var(--danger); color: #fff; border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: 0.55rem 1rem; font: inherit; font-weight: 600;
  line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background 0.15s ease, filter 0.15s ease;
}
button.danger:hover, a.danger:hover { filter: brightness(0.93); }
button:focus-visible, a.secondary:focus-visible, a.danger:focus-visible { outline: none; box-shadow: var(--focus-ring); }

#login-section {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.login-card {
  width: 100%;
  max-width: 400px;
  margin: 0;
  background: var(--surface);
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.login-card h2 { margin-top: 0; font-size: 1.4rem; letter-spacing: -0.01em; }
.login-logo { display: block; text-align: center; margin: 0 auto 1.5rem; }
.login-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1.25rem;
}
.login-tabs button {
  flex: 1;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 7px;
  padding: 0.5rem;
  font-weight: 600;
}
.login-tabs button:hover { background: transparent; color: var(--text); }
.login-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }
label { display: block; font-size: 0.85rem; font-weight: 600; margin: 0.75rem 0 0.25rem; }
input {
  font: inherit;
  width: 100%;
  padding: 0.6rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.login-card button { width: 100%; margin-top: 1.25rem; }

.error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.75rem;
  min-height: 1.2em;
}

.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 2.4rem; }
.pwd-wrap button.pwd-toggle {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
  margin-top: 0;
  padding: 0;
  background: none;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
}
.pwd-wrap button.pwd-toggle:hover,
.pwd-wrap button.pwd-toggle:active { background: none; }
.pwd-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

.card {
  background: var(--surface);
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}
.card:hover { transform: none; }
.card h2 { margin-top: 0; font-size: 1.1rem; }

.events-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.events-toolbar h2 { margin: 0; font-size: 1.35rem; letter-spacing: -0.01em; }

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 1.1rem;
}

.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.event-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.skeleton-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.sk-cover { height: 168px; }
.sk-body { padding: 0.85rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.sk-line { height: 12px; border-radius: 999px; }
.sk-line-lg { width: 70%; }
.sk-line-sm { width: 45%; }
.sk-actions { height: 36px; margin-top: 0.4rem; border-radius: 8px; }
.sk-cover, .sk-line, .sk-actions {
  background: var(--surface-raised);
  background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.cover {
  position: relative;
  display: block;
  width: 100%;
  height: 168px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: var(--bg-subtle);
  cursor: pointer;
  overflow: hidden;
}
.cover:hover { background: var(--surface-raised); }
.cover-mosaic { position: absolute; inset: 0; display: grid; gap: 2px; }
.cover-mosaic.n1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.cover-mosaic.n2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
.cover-mosaic.n3,
.cover-mosaic.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.cover-mosaic.n3 img:first-child { grid-row: span 2; }
.cover-mosaic img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; display: block; }
.cover-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.4rem;
  color: var(--text-faint); font-size: 0.82rem;
}
.cover-empty svg { width: 32px; height: 32px; opacity: 0.55; }
.cover-count {
  position: absolute; left: 0.6rem; bottom: 0.6rem;
  background: rgba(17, 17, 17, 0.72); color: #fff;
  font-size: 0.76rem; font-weight: 600;
  padding: 0.2rem 0.55rem; border-radius: 999px;
}

.card-body { padding: 0.85rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.event-name { font-size: 1.02rem; font-weight: 600; margin: 0; line-height: 1.25; letter-spacing: -0.01em; word-break: break-word; }
.status-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
  background: #6b7280;
}
.status-badge.status-ao_vivo { background: #e23b3b; }
.status-badge.status-agendado { background: #d98e1f; }
.status-badge.status-encerrado { background: #6b7280; }
.event-meta {
  font-size: 0.82rem; color: var(--text-muted);
  display: flex; flex-wrap: wrap; gap: 0.3rem 0.45rem; align-items: center;
}
.event-meta .dot { color: var(--border-strong); }
.event-owner-tag {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  color: var(--text-muted); background: var(--surface-raised);
  padding: 0.05rem 0.45rem; border-radius: 999px;
}
.event-feedback { font-size: 0.8rem; color: var(--success); font-weight: 600; min-height: 1.1em; }

.card-actions {
  display: flex; align-items: center; gap: 0.5rem;
  margin-top: auto; padding-top: 0.35rem; flex-wrap: wrap;
}
.btn-view { flex: 1 1 7rem; }
.action-icons { display: flex; gap: 0.15rem; margin-left: auto; }
.icon-btn {
  background: transparent; color: var(--text-muted);
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--surface-raised); color: var(--text); }
.icon-btn-danger:hover { background: var(--surface-raised); color: var(--danger); }

.empty {
  grid-column: 1 / -1;
  color: var(--text-muted); text-align: center; padding: 3rem 1.5rem;
}
.empty svg { width: 48px; height: 48px; opacity: 0.4; display: block; margin: 0 auto 0.75rem; }
.empty .empty-title { font-weight: 600; color: var(--text); margin-bottom: 0.25rem; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  background: var(--surface);
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-md);
}
.modal h3 { margin-top: 0; }
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.photos-modal .modal {
  max-width: 880px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.75rem;
}
.modal-head h3 { margin: 0; line-height: 1.25; word-break: break-word; }
.modal-body { overflow-y: auto; }
.modal-close {
  background: transparent; color: var(--text-muted);
  font-size: 1.4rem; line-height: 1; padding: 0.1rem 0.45rem;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--surface-raised); color: var(--text); }

.qr-modal .modal { max-width: 380px; }
.qr-frame {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem; min-height: 240px; margin-bottom: 0.85rem;
}
.qr-frame img { width: 100%; max-width: 280px; height: auto; display: block; image-rendering: pixelated; }
.qr-state { position: absolute; color: #5f6670; font-size: 0.9rem; }
.qr-event-name { margin: 0; font-weight: 600; text-align: center; word-break: break-word; }
.qr-link { margin: 0.15rem 0 0; font-size: 0.85rem; color: var(--text-muted); text-align: center; word-break: break-all; }
.qr-modal .event-feedback { display: block; text-align: center; }

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.photos-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  background: var(--bg-subtle);
  display: block;
  transition: opacity 0.15s ease;
}
.photos-grid img:hover { opacity: 0.88; }
.photos-grid .photo-cell { position: relative; }
.photo-del {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; line-height: 20px; padding: 0;
  border: none; border-radius: 999px;
  background: rgba(0, 0, 0, 0.55); color: #fff;
  font-size: 14px; cursor: pointer; display: none;
}
.photo-cell:hover .photo-del { display: block; }
.photo-del svg { width: 12px; height: 12px; display: block; margin: 5px auto; }
.photo-del:hover { background: var(--danger); }
.photos-msg { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.5rem; }

.photos-grid .photo-cell { display: flex; flex-direction: column; }
.photo-badge {
  position: absolute; top: 4px; left: 4px; z-index: 1;
  font-size: 0.62rem; font-weight: 700; line-height: 1;
  padding: 3px 6px; border-radius: 999px; color: #fff;
  background: rgba(0, 0, 0, 0.6); max-width: calc(100% - 8px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.photo-badge.ok { background: rgba(39, 128, 58, 0.9); }
.photo-badge.pending { background: rgba(110, 110, 110, 0.9); }
.photo-badge.blocked { background: rgba(192, 57, 43, 0.92); }
.photo-badge.flagged { background: rgba(200, 140, 20, 0.92); }
.photo-badge.error { background: rgba(80, 80, 80, 0.9); }
.photo-cap { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; line-height: 1.25; }
.photo-cap .nm { font-weight: 700; color: var(--text); display: block; overflow-wrap: anywhere; }
.photo-cap .msg { display: block; overflow-wrap: anywhere; }

.mod-options { display: flex; flex-direction: column; gap: 0.7rem; margin: 0.25rem 0 0; }
.mod-option { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.95rem; cursor: pointer; }
.mod-option input { width: auto; min-height: 0; margin: 0.15rem 0 0; }
.mod-option .mod-desc { font-size: 0.8rem; color: var(--text-muted); display: block; }

#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  cursor: zoom-out;
  z-index: 100;
}
#lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

@media (max-width: 560px) {
  header { padding: 0.75rem 1rem; gap: 0.5rem; flex-wrap: wrap; }
  header h1 { font-size: 1.1rem; }
  .greeting { display: none; }
  main { padding: 1rem; }
  .card { padding: 1.15rem; }
  .events-grid { grid-template-columns: 1fr; gap: 0.9rem; }
  .btn-view { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .login-card { padding: 1.5rem; }
  .photos-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
}

.lb-btn {
  position: absolute;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.15s;
}
.lb-btn:hover { background: rgba(0, 0, 0, 0.8); }
.lb-btn:disabled { opacity: 0.25; cursor: default; }
.lb-btn-close { top: 1rem; right: 1rem; font-size: 1.6rem; }
.lb-btn-prev  { left: 1rem;  top: 50%; transform: translateY(-50%); }
.lb-btn-next  { right: 1rem; top: 50%; transform: translateY(-50%); }
.lb-status {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 0.6rem 1rem;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.9rem;
  text-align: center;
  word-break: break-word;
}
.lb-status.ok      { color: #6fcf97; }
.lb-status.pending { color: #f2c94c; }
.lb-status.flagged { color: #f2994a; }
.lb-status.blocked { color: #eb5757; }
.lb-status.error   { color: #bdbdbd; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .event-card:hover { transform: none; }
}

/* ===================== EVENT DETAIL ===================== */
#event-detail-section { max-width: 1040px; margin: 0 auto; padding: 1.5rem; }
.detail-header {
  display: flex; align-items: center; gap: 0.5rem 0.75rem;
  flex-wrap: wrap; margin-bottom: 0.5rem;
}
.detail-back { display: inline-flex; align-items: center; gap: 0.35rem; }
.detail-back svg { width: 18px; height: 18px; }
.detail-title {
  font-size: 1.35rem; margin: 0; flex: 1; min-width: 10ch;
  letter-spacing: -0.01em; word-break: break-word;
}
.detail-count { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }
.detail-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.detail-photos { min-height: 40vh; }
#detail-sentinel { height: 1px; }
#detail-feedback { display: block; margin-bottom: 0.25rem; }

/* Selection */
.photo-check {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  width: 22px; height: 22px; border-radius: 999px;
  border: 2px solid #fff; background: rgba(0, 0, 0, 0.35);
  display: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.detail-photos.selecting .photo-check { display: block; }
.detail-photos.selecting .photo-del { display: none !important; }
.detail-photos.selecting .photo-cell,
.detail-photos.selecting .photo-cell img { cursor: pointer; }
.photo-cell.selected .photo-check { background: var(--accent); border-color: #fff; }
.photo-cell.selected .photo-check::after {
  content: ""; position: absolute; left: 6px; top: 2px;
  width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.photo-cell.selected img { outline: 3px solid var(--accent); outline-offset: -3px; }
.photo-cell.pending-remove { display: none; }
.photo-cell.is-hidden-photo img { opacity: 0.5; filter: grayscale(0.4); }
.photo-badge.hidden { background: rgba(60, 60, 60, 0.92); }

/* Bulk action bar */
.bulk-bar {
  position: sticky; bottom: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; padding: 0.7rem 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
}
.bulk-count { font-weight: 600; font-size: 0.9rem; }
.bulk-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* Undo toast */
.undo-toast {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%);
  z-index: 120; display: flex; align-items: center; gap: 1rem;
  background: #1f1f1f; color: #fff; padding: 0.7rem 1.1rem;
  border-radius: 999px; box-shadow: var(--shadow-md); font-size: 0.9rem;
  max-width: calc(100vw - 2rem);
}
.undo-toast button {
  background: transparent; color: #6fb0ff; font-weight: 700;
  padding: 0.2rem 0.4rem; min-height: 0;
}
.undo-toast button:hover { background: transparent; text-decoration: underline; }

/* Lightbox v2 info panel */
.lb-info {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; flex-direction: column; gap: 0.5rem;
  padding: 1.5rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0));
  cursor: default;
}
.lb-info .lb-status { position: static; background: transparent; padding: 0; text-align: left; }
.lb-meta { color: #eee; font-size: 0.85rem; display: flex; flex-wrap: wrap; gap: 0.15rem 0.6rem; }
.lb-meta .lb-nm { font-weight: 700; color: #fff; }
.lb-meta .lb-when { color: #bbb; }
.lb-meta .lb-msg { width: 100%; color: #ddd; overflow-wrap: anywhere; }
.lb-actions { display: flex; gap: 0.5rem; }
.lb-actions button { min-height: 0; padding: 0.4rem 0.9rem; font-size: 0.85rem; }

/* ===================== APP SHELL ===================== */
.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}
.app-nav {
  position: sticky; top: 0; align-self: start;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 0.35rem;
  padding: 1.1rem 0.9rem;
  background: var(--surface); border-right: 1px solid var(--border);
}
.app-nav-brand { padding: 0.4rem 0.6rem 1rem; }
.app-nav-brand .brand-logo { height: 26px; width: auto; }
.app-nav-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.app-nav-link {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.7rem; border-radius: 10px;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  transition: background 0.15s, color 0.15s;
}
.app-nav-link svg { width: 20px; height: 20px; flex: none; }
.app-nav-link:hover { background: var(--surface-raised); }
.app-nav-link.active { background: var(--accent); color: #fff; }
.app-nav-link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-nav-user {
  margin-top: auto; display: flex; flex-direction: column; gap: 0.15rem;
  padding: 0.7rem; border-radius: 10px; text-decoration: none;
  background: var(--surface-raised); color: var(--text);
}
.app-nav-user:hover { background: var(--border); }
.app-nav-user-name { font-weight: 700; font-size: 0.9rem; }
.app-nav-user-badge {
  align-self: flex-start; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.03em;
  padding: 0.1rem 0.4rem; border-radius: 999px; background: #7c3aed; color: #fff;
}
.app-main { max-width: none; margin: 0; padding: 0; min-width: 0; }
.section-body { max-width: 1040px; margin: 0 auto; padding: 1.5rem; }
.page-title { font-size: 1.6rem; font-weight: 700; margin: 0 0 1.5rem; letter-spacing: -0.02em; }

/* Account — settings layout (menu + content) */
.settings-layout { display: grid; grid-template-columns: 196px 1fr; gap: 2rem; align-items: start; }
.settings-menu { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 1rem; }
.settings-menu-item {
  display: flex; align-items: center; gap: 0.6rem;
  text-align: left; background: transparent; color: var(--text-muted); border: 1px solid transparent;
  border-radius: 8px; padding: 0.55rem 0.75rem; font: inherit; font-weight: 600; font-size: 0.94rem; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.settings-menu-item svg { width: 18px; height: 18px; flex: none; }
.settings-menu-item:hover { background: var(--surface-raised); color: var(--text); }
.settings-menu-item.active { background: var(--accent-soft); color: var(--accent); }

/* Account identity header */
.account-identity { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.account-avatar {
  width: 56px; height: 56px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-size: 1.5rem; font-weight: 700;
}
.account-identity-name { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.account-identity-role { font-size: 0.9rem; color: var(--text-muted); }
.settings-content {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem 1.9rem; max-width: 620px;
}
.settings-pane-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 1.35rem; letter-spacing: -0.01em; }
@media (max-width: 680px) {
  .settings-layout { grid-template-columns: 1fr; gap: 1rem; }
  .settings-menu { flex-direction: row; overflow-x: auto; position: static; gap: 4px; padding-bottom: 4px; }
  .settings-menu-item { white-space: nowrap; }
  .settings-content { padding: 1.35rem 1.4rem; }
}

/* Account cards (used in event Settings tab summary) */
.account-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.35rem 1.4rem; box-shadow: none;
}
.account-card h3 { margin: 0 0 1rem; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.account-muted { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 1rem; line-height: 1.5; }
.account-label { display: block; font-size: 0.78rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.6rem; }
.account-msg { color: var(--text-muted); font-size: 0.9rem; }
.profile-row {
  display: grid; grid-template-columns: 116px 1fr; align-items: baseline; gap: 0.75rem;
  padding: 0.7rem 0; border-bottom: 1px solid var(--border); font-size: 0.94rem;
}
.profile-row:first-child { padding-top: 0; }
.profile-row:last-child { border-bottom: none; padding-bottom: 0; }
.profile-label { color: var(--text-muted); font-size: 0.88rem; }
.profile-value { text-align: left; overflow-wrap: anywhere; font-weight: 500; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase; padding: 0.15rem 0.5rem; border-radius: 6px;
  background: var(--surface-raised); color: var(--text-muted); border: 1px solid var(--border);
}
.chip-ok { background: var(--success-soft); color: var(--success); border-color: transparent; }
.theme-choices {
  display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-raised);
  border: 1px solid var(--border); border-radius: 10px;
}
.theme-choice {
  background: transparent; color: var(--text-muted); border: none; border-radius: 7px;
  padding: 0.4rem 0.85rem; font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.theme-choice:hover { color: var(--text); background: transparent; }
.theme-choice.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-nav {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    height: auto; flex-direction: row; align-items: center; gap: 0.25rem;
    padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom));
    border-right: none; border-top: 1px solid var(--border); z-index: 50;
  }
  .app-nav-brand { display: none; }
  .app-nav-links { flex-direction: row; flex: 1; justify-content: space-around; }
  .app-nav-link { flex-direction: column; gap: 0.15rem; font-size: 0.72rem; padding: 0.35rem 0.5rem; }
  .app-nav-link.active { background: transparent; color: var(--accent); }
  .app-nav-user {
    margin: 0; flex-direction: row; align-items: center; gap: 0.3rem;
    background: transparent; padding: 0.35rem 0.5rem;
  }
  .app-nav-user-name { font-size: 0.72rem; max-width: 8ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-main { padding-bottom: 72px; }
}

/* ===================== EVENT DETAIL TABS ===================== */
.detail-tabs {
  display: flex; gap: 0.25rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); margin: 0.5rem 0 1.25rem;
}
.detail-tab {
  background: transparent; color: var(--text-muted); border: none;
  border-bottom: 2px solid transparent; border-radius: 0;
  padding: 0.6rem 0.9rem; font: inherit; font-weight: 600; font-size: 0.92rem;
  cursor: pointer; margin-bottom: -1px;
}
.detail-tab:hover { color: var(--text); background: transparent; }
.detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); background: transparent; }
.detail-tab:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }
.detail-panel[hidden] { display: none; }
.photos-toolbar { display: flex; gap: 0.4rem; margin-bottom: 0.6rem; }

/* Visão geral / stats */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.9rem; margin-bottom: 1.75rem; }
.kpi {
  display: flex; align-items: center; gap: 0.9rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.kpi-icon {
  width: 42px; height: 42px; flex: none; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-body { display: flex; flex-direction: column; min-width: 0; }
.kpi-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: 0.82rem; color: var(--text-muted); }
.stat-block { margin-bottom: 1.75rem; }
.stat-block h4 { margin: 0 0 0.85rem; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.bar-chart {
  display: flex; align-items: flex-end; gap: 5px; height: 150px; overflow-x: auto; padding-top: 0.5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem;
}
.bar-col { flex: 1 0 22px; min-width: 22px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 0.4rem; }
.bar { width: 68%; max-width: 30px; background: var(--accent); border-radius: 5px 5px 0 0; min-height: 4px; }
.bar-label { font-size: 0.65rem; color: var(--text-muted); white-space: nowrap; }
.top-contributors { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.top-contributors li {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.85rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; font-size: 0.92rem;
}
.tc-rank {
  width: 22px; height: 22px; flex: none; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-raised); color: var(--text-muted); font-size: 0.75rem; font-weight: 700;
}
.tc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.tc-count { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* Configurações */
.settings-summary { margin-bottom: 1rem; max-width: 520px; }
.settings-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Compartilhar */
.share-card {
  max-width: 400px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem;
}
.share-card .share-qr { align-self: center; width: 200px; }
.share-card .qr-frame {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 0.9rem; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
}
.share-card .share-qr img { width: 100%; height: auto; display: block; }
.share-card .qr-state { color: var(--text-muted); font-size: 0.85rem; text-align: center; }
.share-field { display: flex; flex-direction: column; gap: 0.5rem; }
.share-link-row { display: flex; gap: 0.5rem; align-items: stretch; }
.share-link-row .share-link {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 0.55rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-raised); color: var(--text-muted); font-size: 0.88rem; line-height: 1.4;
}
.share-link-row #share-copy { flex: none; }
.share-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.share-actions > * { flex: 1; min-width: 100px; }
.share-btn-link { text-decoration: none; }
@media (max-width: 560px) {
  .detail-tabs { flex-wrap: nowrap; overflow-x: auto; }
}

/* Events list controls (search / filter / sort) */
.events-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.events-controls #events-search { flex: 1 1 200px; min-width: 160px; margin: 0; }
.events-controls select {
  font: inherit; padding: 0.55rem 2rem 0.55rem 0.65rem;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); cursor: pointer; min-height: 42px;
}
.events-controls select:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
