/* ── TOKENS ── */
:root {
  --accent:        #F4611A;
  --accent-hover:  #D95212;
  --accent-muted:  #FEF0E8;
  --accent-light:  #FDE8D8;

  --bg:            #F4F6F8;
  --surface:       #FFFFFF;
  --surface-2:     #F9FAFB;

  --text-1:        #111827;
  --text-2:        #374151;
  --text-3:        #6B7280;
  --text-4:        #9CA3AF;

  --border:        #E5E7EB;
  --border-strong: #D1D5DB;

  --green:         #16A34A;
  --green-bg:      #DCFCE7;
  --blue:          #2563EB;
  --blue-bg:       #DBEAFE;
  --yellow:        #D97706;
  --yellow-bg:     #FEF3C7;
  --red:           #DC2626;
  --red-bg:        #FEE2E2;

  --radius:        8px;
  --sidebar-w:     232px;
  --shadow-sm:     0 1px 2px rgba(0,0,0,.06);
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:     0 4px 6px -1px rgba(0,0,0,.06), 0 2px 4px -1px rgba(0,0,0,.04);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
img { max-width: 100%; }
dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  /* Centralização garantida em qualquer viewport, incluindo mobile com teclado virtual */
  position: fixed;
  inset: 0;
  margin: auto;
  max-width: 96vw;
  max-height: min(90svh, 90vh);
  overflow-y: auto;
}
dialog::backdrop { background: rgba(0,0,0,.4); }

/* ── APP SHELL ── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
.app:not(.authenticated) .sidebar { pointer-events: none; opacity: .4; }

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-top { flex: 1; display: flex; flex-direction: column; }
.sidebar-footer { padding: 16px 16px 20px; border-top: 1px solid var(--border); }

/* ── BRAND ── */
.brand {
  padding: 16px;
  display: block;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  display: block;
  width: 100%;
  height: auto;
  max-height: 58px;
  object-fit: contain;
  object-position: left center;
}
.logo-upload-label {
  position: absolute;
  bottom: 8px; right: 8px;
  width: 26px; height: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-3);
  transition: background .12s, color .12s;
}
.logo-upload-label:hover { background: var(--accent-muted); color: var(--accent); }
.sidebar-close-btn {
  display: none;
  position: absolute;
  top: 10px; right: 10px;
  width: 28px; height: 28px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-3);
  align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.sidebar-close-btn:hover { background: var(--red-bg); color: var(--red); }

/* ── USER CARD ── */
.user-card {
  margin: 12px 10px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 34px; height: 34px;
  background: var(--accent-muted);
  color: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user-name { font-size: 12.5px; font-weight: 600; color: var(--text-1); }
.user-role { font-size: 11px; color: var(--text-4); }

/* ── NAV ── */
.nav {
  padding: 8px 8px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  transition: background .12s, color .12s;
  cursor: pointer;
}
.nav-link:hover { background: var(--bg); color: var(--text-1); }
.nav-link.active {
  background: var(--accent);
  color: #fff;
}
.nav-link.active .nav-icon { stroke: #fff; }
.nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  stroke: var(--text-3);
  transition: stroke .12s;
}
.nav-link:hover .nav-icon { stroke: var(--text-1); }

/* ── NAV CONTEXTO DE EVENTO ── */
.nav-event-ctx {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 4px;
}
.nav-event-hdr {
  padding: 8px 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-event-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .5px;
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 4px 2px 2px;
  transition: color .12s, background .12s;
  width: fit-content;
}
.nav-event-back:hover { color: var(--accent); background: var(--accent-muted); }
.nav-event-back svg { stroke: currentColor; }
.nav-event-titulo {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-1);
  padding: 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ── LOGOUT ── */
.logout-btn {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 500;
  color: var(--text-3);
  padding: 8px 12px;
  border-radius: 7px;
  transition: background .12s, color .12s;
  cursor: pointer;
  width: 100%;
}
.logout-btn:hover { background: var(--red-bg); color: var(--red); }

/* ── MAIN CONTENT ── */
.main {
  grid-column: 2;
  min-height: 100vh;
  overflow-y: auto;
}

/* ── PAGE WRAP ── */
.page-wrap {
  padding: 32px 36px;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title    { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.page-subtitle { font-size: 13px; color: var(--text-3); margin-top: 2px; }

/* ── CARD ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header-row {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
}

/* ── STATS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-card.loading {
  height: 82px;
  background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border: none;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.stat-icon-wrap {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon-wrap.orange { background: var(--accent-muted); color: var(--accent); stroke: var(--accent); }
.stat-icon-wrap.green  { background: var(--green-bg);     color: var(--green);  stroke: var(--green);  }
.stat-icon-wrap.blue   { background: var(--blue-bg);      color: var(--blue);   stroke: var(--blue);   }
.stat-icon-wrap.yellow { background: var(--yellow-bg);    color: var(--yellow); stroke: var(--yellow); }
.stat-icon-wrap svg    { stroke: inherit; }
.stat-value { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--text-3); margin-top: 1px; }

/* ── TABLE ── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg); }

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.badge-publicado  { background: var(--green-bg);  color: var(--green);  }
.badge-rascunho   { background: var(--border);     color: var(--text-3); }
.badge-encerrado  { background: var(--yellow-bg);  color: var(--yellow); }
.badge-pago       { background: var(--green-bg);   color: var(--green);  }
.badge-autorizado { background: var(--blue-bg);    color: var(--blue);   }
.badge-pendente   { background: var(--yellow-bg);  color: var(--yellow); }
.badge-cancelado  { background: var(--red-bg);     color: var(--red);    }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s, opacity .12s;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); }
.btn-full { width: 100%; }
.btn-lg { padding: 11px 22px; font-size: 14px; }

/* ── FORMS ── */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.15px;
  text-transform: uppercase;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

input:not([type]), input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="datetime-local"], input[type="search"],
textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--text-1);
  background: #F7F8FA;
  transition: border-color .15s, box-shadow .15s, background .15s;
  outline: none;
  box-shadow: inset 0 1.5px 3px rgba(0,0,0,.05);
}
select {
  width: 100%;
  padding: 10px 34px 10px 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--text-1);
  background: #F7F8FA url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 11px center;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  outline: none;
  box-shadow: inset 0 1.5px 3px rgba(0,0,0,.05);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3.5px rgba(244,97,26,.13);
}
input::placeholder, textarea::placeholder { color: var(--text-4); font-size: 13px; }
textarea { resize: vertical; min-height: 80px; }
.input-search { flex: 1; }
.input-lg { padding: 12px 16px; font-size: 14px; }
.search-row { padding: 12px 14px; }

/* ── DIALOG ── */
.dialog {
  width: min(520px, 92vw);
  border-radius: 14px;
  box-shadow: 0 4px 8px -2px rgba(0,0,0,.07), 0 16px 40px -4px rgba(0,0,0,.18);
}
.dialog-form {
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.dialog-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-1);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ── CREDENTIALS ── */
.checkin-card { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.checkin-search { display: flex; gap: 10px; }
.checkin-feedback {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.5;
}
.checkin-feedback.success { background: var(--green-bg);  color: var(--green); }
.checkin-feedback.error   { background: var(--red-bg);    color: var(--red);   }

/* ── LOGIN OVERLAY ── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.login-overlay.visible { opacity: 1; pointer-events: all; }
.login-card {
  width: min(400px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px 36px 32px;
  box-shadow: var(--shadow-md), 0 20px 48px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 0; text-align: center; }
.login-logo { width: 240px; height: auto; object-fit: contain; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-error { font-size: 12.5px; color: var(--red); text-align: center; min-height: 18px; }
.login-footer { font-size: 11px; color: var(--text-4); text-align: center; }

/* ── PENDÊNCIAS ── */
.pend-filter-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.pend-filter-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
  white-space: nowrap;
}
.pend-filter-btn:hover  { border-color: var(--accent); color: var(--accent); }
.pend-filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pend-filter-btn.active-warn { background: var(--yellow); border-color: var(--yellow); color: #fff; }
.pend-filter-btn.chip-validated { color: #059669; border-color: #059669; }
.pend-filter-btn.chip-validated:hover  { background: #059669; color: #fff; }
.pend-filter-btn.chip-validated.active { background: #059669; border-color: #059669; color: #fff; }
.chip-icon-green { color: #059669; }
.badge-email-val {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: #059669; color: #fff;
  margin-left: 6px; vertical-align: middle; flex-shrink: 0;
}
.chip-pend-icon {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-right: 4px;
  vertical-align: middle;
  line-height: 1;
  position: relative;
  top: -0.5px;
}
.pend-badges { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.pend-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.pend-red    { background: var(--red-bg);      color: var(--red);    }
.pend-yellow { background: var(--yellow-bg);   color: var(--yellow); }
.pend-orange { background: var(--accent-muted); color: var(--accent); }

/* ── CROP TOOL ── */
.crop-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
  background: var(--surface-2);
  border-radius: 8px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  cursor: default;
}
.crop-wrapper img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.crop-sh {
  position: absolute;
  background: rgba(0,0,0,.52);
  pointer-events: none;
}
.crop-box {
  position: absolute;
  border: 2px solid #fff;
  cursor: move;
  touch-action: none;
  box-sizing: border-box;
}
/* Rule-of-thirds overlay */
.crop-box::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right,  rgba(255,255,255,.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.18) 1px, transparent 1px);
  background-size: 33.333% 33.333%;
  pointer-events: none;
}
.crop-h {
  position: absolute;
  width: 13px; height: 13px;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 2px;
  z-index: 2;
}
.crop-h[data-handle="nw"] { top:-6px;    left:-6px;    cursor: nw-resize; }
.crop-h[data-handle="ne"] { top:-6px;    right:-6px;   cursor: ne-resize; }
.crop-h[data-handle="sw"] { bottom:-6px; left:-6px;    cursor: sw-resize; }
.crop-h[data-handle="se"] { bottom:-6px; right:-6px;   cursor: se-resize; }
.crop-info-lbl { font-size: 12px; color: var(--text-3); }
@media (max-width: 640px) {
  .crop-wrapper { height: 220px; }
  .crop-h { width: 22px; height: 22px; }
  .crop-h[data-handle="nw"] { top:-11px;    left:-11px; }
  .crop-h[data-handle="ne"] { top:-11px;    right:-11px; }
  .crop-h[data-handle="sw"] { bottom:-11px; left:-11px; }
  .crop-h[data-handle="se"] { bottom:-11px; right:-11px; }
}

/* ── BANNER ── */
.evt-banner-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.evt-banner-header { display: flex; justify-content: space-between; align-items: flex-start; }
.evt-section-title { font-size: 14px; font-weight: 700; color: var(--text-1); margin: 0 0 2px; }
.banner-current-wrap { border-radius: 8px; overflow: hidden; background: var(--bg); }
.banner-current-img { width: 100%; height: auto; display: block; }
.banner-empty-icon { font-size: 36px; }
.banner-upload-area {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.banner-upload-area.banner-upload-area-large { padding: 36px 20px; }
.banner-upload-area:hover, .banner-upload-area.banner-dragover {
  border-color: var(--accent);
  background: var(--accent-muted);
}
.banner-file-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  flex-wrap: wrap;
}
.banner-upload-area-large .banner-file-label {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}
.banner-file-icon { font-size: 18px; }
.banner-preview-container { border-radius: 8px; overflow: hidden; background: var(--bg); }
.banner-new-img { max-width: 100%; max-height: 240px; object-fit: contain; display: block; }
.banner-controls-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.banner-size-control { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.banner-size-label { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.banner-slider { width: 140px; accent-color: var(--accent); }
.banner-size-unit { font-size: 12px; color: var(--text-4); }
.banner-size-hint { font-size: 11px; color: var(--text-4); }
/* Upload modal — position:relative fica no .bup-inner para não quebrar o centramento nativo do <dialog> */
.bup-dialog { width: min(540px, 90vw); padding: 0; text-align: center; }
.bup-inner  { position: relative; padding: 28px 32px 36px; }
@media (max-width: 640px) {
  dialog.bup-dialog { width: min(92vw, 340px); }
  .bup-inner { padding: 24px 20px 28px; }
  .bup-dropzone { padding: 28px 16px 22px; }
}
.bup-close-btn {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 6px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.bup-close-btn:hover { background: var(--surface-2); color: var(--text-1); }
.bup-dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px 28px 32px;
  display: flex; flex-direction: column; align-items: center;
  transition: border-color .15s, background .15s;
  cursor: default;
}
.bup-dropzone.bup-dragover { border-color: var(--accent); background: var(--accent-muted); }
.bup-cloud-icon { color: var(--text-4); display: block; margin-bottom: 4px; }
.bup-browse-btn { margin: 16px 0 12px; }
.bup-drop-hint { font-size: 13px; color: var(--text-3); }

.btn-sm { padding: 5px 12px; font-size: 12px; }

/* Lista de eventos */
.evt-list-table .evt-col-status { width: 42px; text-align: center; padding: 0 4px; }
.evt-list-table .evt-col-sigla  { width: 90px; }
.evt-list-table .evt-col-dt     { width: 110px; white-space: nowrap; }
.evt-list-table .evt-col-local  { width: 20%; }
.evt-list-table .evt-col-lotes  { width: 80px; text-align: center; font-size: 12px; }
.evt-list-table .evt-col-act    { width: 80px; text-align: right; white-space: nowrap; }
.evt-icon-detail { color: var(--text-3); }
.evt-icon-detail:hover { background: var(--bg); color: var(--text-1); }
.evt-toggle-btn { font-size: 18px; }
.evt-status-dot { font-size: 14px; }

/* Date stack in events list */
.evt-dt-stack   { display: flex; flex-direction: column; gap: 2px; white-space: nowrap; font-size: 12px; }
.evt-dt-ini-lbl { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; color: var(--accent); line-height: 1.2; }
.evt-dt-fim-lbl { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-4); line-height: 1.2; }

@media (max-width: 640px) {
  .evt-list-table .evt-col-sigla,
  .evt-list-table .evt-col-local,
  .evt-list-table .evt-col-lotes { display: none; }
  /* Banner full-width on mobile, title below */
  .evt-td-titulo .evt-list-thumb {
    display: block;
    width: 100%;
    height: 52px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 0;
    margin-bottom: 5px;
    vertical-align: unset;
  }
}

/* Thumbs na lista */
.evt-list-thumb { width: 36px; height: 24px; object-fit: cover; border-radius: 4px; vertical-align: middle; margin-right: 8px; }

/* Campos obrigatórios card */
.evt-fields-card { padding: 16px 20px; }
.evt-fields-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.evt-field-tag {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.evt-field-tag.req { background: var(--green-bg); color: var(--green); }
.evt-field-tag.opt { background: var(--surface-2); color: var(--text-3); }

/* Dialog — seção divider */
.evt-section-divider { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.label-section { font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.4px; }
.label-badge-future {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--yellow-bg, #fef9c3);
  color: var(--yellow, #ca8a04);
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
}

/* Checkboxes */
.checkbox-row { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 8px; }
.checkbox-label { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

/* form-hint */
.form-hint { font-size: 11.5px; color: var(--text-4); margin: 4px 0 0; }

/* ── LOTES TABLE ── */
.lotes-table .lote-col-drag   { width: 28px; color: var(--text-4); text-align: center; padding: 0 4px; }
.lotes-table .lote-col-status { width: 36px; text-align: center; padding: 0 4px; }
.lotes-table .lote-col-pos    { width: 40px; text-align: center; }
.lotes-table .lote-col-ident  { width: 90px; }
.lotes-table .lote-col-dt     { white-space: nowrap; font-size: 12px; }
.lotes-table .lote-col-val    { width: 10%; white-space: nowrap; font-size: 12px; font-variant-numeric: tabular-nums; }
.lotes-table .lote-col-qtd    { width: 6%;  text-align: center; font-size: 12px; }
.lotes-table .lote-col-act    { width: 100px; text-align: right; white-space: nowrap; }
.lote-id-code {
  font-family: 'Menlo','Consolas','Courier New',monospace;
  font-size: 11px;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-2);
}
.lote-status-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px;
  border-radius: 4px;
  transition: opacity .12s;
}
.lote-status-btn:hover { opacity: .75; }
.lote-status-label { font-size: 10px; color: var(--text-4); margin-top: 2px; }

/* Lote tags (tipo / visibilidade) */
.lote-meta-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.lote-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.lote-tag-tipo-pago      { background: var(--blue-bg,#dbeafe);  color: var(--blue,#2563eb);  }
.lote-tag-tipo-gratuito  { background: var(--green-bg);         color: var(--green);          }
.lote-tag-vis-publico    { background: var(--accent-muted);     color: var(--accent);         }
.lote-tag-vis-privado    { background: var(--surface-2);        color: var(--text-3);         }

/* Ícones de ação nos lotes */
.lote-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .12s;
  opacity: .7;
}
.lote-icon-btn:hover { opacity: 1; }
.lote-icon-edit { color: var(--accent); }
.lote-icon-edit:hover { background: var(--accent-muted); }
.lote-icon-del  { color: var(--red); }
.lote-icon-del:hover  { background: var(--red-bg); }

/* Credenciamento e intervalo de datas */
.lote-cred-info { font-size: 10px; color: var(--text-4); margin-top: 2px; }
.lote-dt-range  { display: flex; flex-direction: column; gap: 1px; font-size: 12px; }
.lote-dt-sep    { font-size: 10px; color: var(--text-4); }

/* Drag-and-drop */
.drag-handle {
  cursor: grab;
  font-size: 16px;
  color: var(--text-4);
  user-select: none;
  display: inline-block;
  line-height: 1;
}
.drag-handle:active { cursor: grabbing; }
tr[draggable="true"] { transition: opacity .12s; }
tr.lote-drag-src  { opacity: .4; }
tr.lote-drag-over { background: var(--accent-muted) !important; }

/* label opcional */
.label-opt { font-size: 10px; font-weight: 400; color: var(--text-4); }

input[readonly] {
  background: var(--surface-2) !important;
  color: var(--text-3);
  cursor: default;
}

@media (max-width: 680px) {
  .lote-col-dt, .lote-col-val, .lote-col-qtd, .lote-col-drag { display: none; }
  .lotes-table .lote-col-pos    { width: 26px; font-size: 11px; }
  .lotes-table .lote-col-ident  { width: 58px; }
  .lotes-table .lote-col-act    { width: 66px; }
}

/* ── PARTICIPANT PICKER ── */
.ptpicker { display: flex; flex-direction: column; gap: 0; }
.ptpicker-search-wrap { display: flex; flex-direction: column; }
.ptpicker-search-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 13px;
  background: var(--surface);
  color: var(--text-1);
  outline: none;
  transition: border-color .15s;
}
.ptpicker-search-input:focus { border-color: var(--accent); }
.ptpicker-results {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
  max-height: 230px;
  overflow-y: auto;
}
.ptpicker-hint {
  padding: 11px 14px;
  font-size: 12px;
  color: var(--text-4);
  text-align: center;
}
.ptpicker-more {
  padding: 8px 14px;
  font-size: 11px;
  color: var(--text-4);
  text-align: center;
  border-top: 1px solid var(--border);
  font-style: italic;
}
.ptpicker-loading {
  padding: 11px 14px;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}
.ptpicker-item {
  display: block;
  width: 100%;
  padding: 9px 14px;
  text-align: left;
  border: none;
  border-top: 1px solid var(--border);
  background: none;
  cursor: pointer;
  transition: background .12s;
}
.ptpicker-item:first-child { border-top: none; }
.ptpicker-item:hover, .ptpicker-item:focus { background: var(--accent-muted); outline: none; }
.ptpicker-item-nome { font-size: 13px; font-weight: 600; color: var(--text-1); }
.ptpicker-item-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.ptpicker-item-meta span { font-size: 11px; color: var(--text-3); }

/* Selected state */
.ptpicker-sel {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ptpicker-sel-card {
  flex: 1;
  padding: 10px 14px;
  background: var(--accent-muted);
  border: 1px solid var(--accent-light, #fde8d8);
  border-radius: var(--radius);
}
.ptpicker-sel-nome { font-size: 13px; font-weight: 700; color: var(--text-1); }
.ptpicker-sel-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 3px;
}
.ptpicker-sel-meta span { font-size: 11px; color: var(--text-3); }

/* ── INSCRICOES TABLE ── */
.insc-table .insc-col-p   { width: 28%; }
.insc-table .insc-col-lote{ width: 6%; text-align: center; }
.insc-table .insc-col-tipo{ width: 10%; }
.insc-table .insc-col-dt  { width: 14%; }
.insc-table .insc-col-act { width: 72px; text-align: right; }
.insc-seq  { font-variant-numeric: tabular-nums; letter-spacing: 0.3px; }
.insc-hex  { font-family: 'Menlo','Consolas','Courier New',monospace; font-size: 10px;
             color: var(--text-4); margin-top: 2px; letter-spacing: 0.5px; }
.insc-meta-line { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.insc-alert-badge {
  display: inline-block; margin-top: 4px;
  padding: 1px 7px; border-radius: 10px;
  font-size: 10px; font-weight: 700;
  background: var(--yellow-bg); color: var(--yellow);
}
.insc-mobile-p { display: none; }
.insc-act-btn {
  background: none; border: none; cursor: pointer; padding: 4px 5px; border-radius: 6px;
  color: var(--text-3); font-size: 15px; line-height: 1; transition: background .12s, color .12s;
  display: inline-flex; align-items: center; justify-content: center;
}
.insc-act-btn:hover { background: var(--accent-muted); color: var(--accent); }
.insc-act-btn.danger:hover { background: var(--red-bg, #fee2e2); color: var(--red, #dc2626); }

@media (max-width: 640px) {
  .insc-table thead { display: none; }
  .insc-table tbody tr { display: flex; flex-direction: column; padding: 12px 14px;
                         border-bottom: 1px solid var(--border); gap: 4px; }
  .insc-table td { display: block; padding: 0; border: none; }
  .insc-col-p, .insc-col-lote, .insc-col-tipo, .insc-col-dt { display: none; }
  .insc-col-act { text-align: left; }
  .insc-mobile-p { display: flex; flex-direction: column; gap: 1px;
                   font-size: 12px; color: var(--text-3); margin-top: 3px; }
  .insc-mobile-p strong { font-size: 13px; color: var(--text-1); }
}

/* ── PARTICIPANTS TABLE ── */
.pt-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  flex-wrap: wrap;
}
.pt-btn-extra { gap: 6px; }
.pt-btn-extra.active { background: var(--accent-muted); color: var(--accent); border-color: var(--accent); }
.pt-extra-panel { padding: 14px 16px; }
.list-count {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-4);
  border-bottom: 1px solid var(--border);
}
.text-dash { color: var(--text-4); }
.pt-col-email { width: 28%; }
.pt-col-tel   { width: 14%; white-space: nowrap; }
.pt-col-cpf   { width: 13%; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 12px; }
.pt-col-act   { width: 52px; text-align: center; }

/* Pendência: ícone inline após o nome */
.pt-name-row  { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; }
.pend-icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 11px;
  padding: 1px 4px;
  border-radius: 4px;
  vertical-align: middle;
  line-height: 1;
}
.pend-sup { font-size: 8px; font-weight: 700; vertical-align: super; line-height: 0; }
.pi-red    { background: var(--red-bg);       color: var(--red);    }
.pi-yellow { background: var(--yellow-bg);    color: var(--yellow); }
.pi-orange { background: var(--accent-muted); color: var(--accent); }

/* Ícone lápis de edição */
.btn-edit-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .12s;
}
.btn-edit-icon:hover { background: var(--accent-muted); }
.btn-edit-row { opacity: .7; transition: opacity .12s; }
.participants-table tbody tr:hover .btn-edit-row { opacity: 1; }

/* Mobile sub-info (hidden on desktop, shown on mobile) */
.pt-mobile-sub,
.participants-table .pt-mobile-sub { display: none; }

/* Estado vazio inicial */
.pt-empty-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 20px;
  color: var(--text-4);
  font-size: 13px;
  text-align: center;
}

/* Paginação */
.pt-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}
.pt-pag-info { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.pt-pag-btn  { min-width: 90px; }

/* ID copiável no modal de edição */
.id-display-row {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
}
.input-mono {
  flex: 1;
  font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  color: var(--text-3);
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  min-width: 0;
}
.btn-copy {
  padding: 5px 10px;
  font-size: 12px;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
}
.btn-link:hover { text-decoration: underline; }

/* ── MOBILE: card layout com coluna de ação ── */
@media (max-width: 640px) {
  .participants-table thead { display: none; }
  .participants-table tbody tr {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
  }
  .participants-table td          { display: none; border: none; padding: 0; }
  .participants-table .pt-cell-nome {
    display: flex !important;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    padding: 11px 14px;
  }
  .participants-table .pt-col-act {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-left: 1px solid var(--border);
    width: 48px;
  }
  .btn-edit-row { opacity: 1; }

  /* Sub-info com labels */
  .participants-table .pt-mobile-sub {
    display: flex !important;
    flex-direction: column;
    gap: 2px;
    margin-top: 3px;
  }
  .pt-field-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 11.5px;
    flex-wrap: wrap;
  }
  .pt-lbl { color: var(--text-4); font-size: 10.5px; font-weight: 600; white-space: nowrap; }
  .pt-lbl-cpf { margin-left: 6px; }
  .pt-val { color: var(--text-2); font-size: 11.5px; }
  .pt-val em { color: var(--text-4); font-style: normal; }
}

/* ── UTILITIES ── */
.loading-row { padding: 20px 18px; color: var(--text-4); font-size: 13px; }
.empty-msg   { padding: 24px 18px; color: var(--text-4); font-size: 13px; }
.error-inline { font-size: 12.5px; color: var(--red); margin-top: 2px; min-height: 18px; }
.empty-hint { padding: 16px 18px; color: var(--text-3); font-size: 13px; }
.empty-hint a { color: var(--accent); text-decoration: underline; }

/* ── MOBILE TOPBAR ── */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 56px;
  padding: 0 16px;
  align-items: center;
  gap: 12px;
  grid-column: 1;
  grid-row: 1;
}
.hamburger {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  color: var(--text-2);
  flex-shrink: 0;
  transition: background .12s;
}
.hamburger:hover { background: var(--bg); }
.mobile-topbar-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
  object-position: left center;
}

/* ── SIDEBAR BACKDROP ── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
body.drawer-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: all;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 56px 1fr;
  }
  .mobile-topbar { display: flex; }
  .sidebar-backdrop { display: block; }
  .sidebar-close-btn { display: flex; }
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    width: min(var(--sidebar-w), 85vw);
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    z-index: 200;
  }
  body.drawer-open .sidebar { transform: translateX(0); }
  .main { grid-column: 1; grid-row: 2; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-wrap { padding: 20px 16px; }
}
@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .checkin-search { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .sidebar { transition: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
