/* ====== Buttons ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: 15px 22px;
  border-radius: var(--radius-pill);
  border: none;
  font-size: 15px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--brand-primary); color: var(--text-inverse); box-shadow: 0 8px 20px rgba(66, 27, 204, 0.32); }
.btn-accent { background: var(--brand-accent); color: #fff; box-shadow: 0 8px 20px rgba(255, 122, 69, 0.32); }
.btn-secondary { background: var(--surface-muted); color: var(--text-primary); }
.btn-danger { background: var(--danger); color: var(--text-inverse); }
.btn-ghost { background: transparent; color: var(--text-primary); box-shadow: inset 0 0 0 1.5px var(--border); }
.btn-inline { width: auto; padding: 10px 18px; font-size: 13px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn.on-dark { background: rgba(255,255,255,0.16); color: var(--text-inverse); box-shadow: none; }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-flip { transform: rotate(180deg); }

/* Row of pill quick-actions with icon + label (home hero) */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); }
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-inverse);
}
.quick-action .icon-btn { width: 50px; height: 50px; background: rgba(255,255,255,0.16); color: #fff; box-shadow: none; }
.quick-action span { font-size: 11.5px; font-weight: 600; color: var(--text-inverse-muted); }

/* ====== Card ====== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

/* ====== Hero (home balance card) — azul Magis5 sólido, sem degradê de fundo ====== */
.hero {
  position: relative;
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-5) var(--space-6);
  background: var(--brand-primary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-hero);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: -40% -20% auto auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.hero-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.hero-greeting { font-size: 13px; color: var(--text-inverse-muted); font-weight: 600; margin: 0; position: relative; z-index: 1; }
.hero-name { font-weight: 800; font-size: 24px; letter-spacing: -0.01em; margin: 2px 0 0; position: relative; z-index: 1; color: var(--text-inverse); }
.hero-balance-label { font-size: 12.5px; color: var(--text-inverse-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin: var(--space-4) 0 2px; position: relative; z-index: 1; }
.hero-balance {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: var(--brand-five-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-balance small { font-size: 15px; font-weight: 700; color: var(--text-inverse-muted); -webkit-text-fill-color: var(--text-inverse-muted); }

/* ====== Inputs ====== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-4); }
.field label { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.field input,
.field textarea,
.field select {
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  background: var(--surface);
  color: var(--text-primary);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(66, 27, 204, 0.14);
}
.field-check { display: flex; align-items: flex-start; gap: var(--space-2); }
.field-check input { margin-top: 3px; }
.field-help { font-size: 12.5px; color: var(--text-secondary); font-weight: 500; }

/* ====== Alerts ====== */
.alert { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: 13.5px; font-weight: 600; margin-bottom: var(--space-4); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }

/* ====== Badges / status ====== */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-neutral { background: var(--surface-muted); color: var(--text-secondary); }
.badge-accent { background: rgba(255, 122, 69, 0.14); color: #C24E1F; }

/* ====== Participant topbar (voltar + título + ajuda/sair) ====== */
.page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) 0 var(--space-4);
}
.page-topbar-title { font-size: 15px; font-weight: 800; }
.page-topbar-actions { display: flex; align-items: center; gap: 8px; }

/* Legacy top bar (staff/operações) */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-brand { font-weight: 800; font-size: 15px; }

/* ====== Empty state ====== */
.empty-state { text-align: center; padding: var(--space-6) var(--space-4); color: var(--text-secondary); font-weight: 600; font-size: 13.5px; }
.empty-state .icon-btn { margin: 0 auto var(--space-3); background: var(--surface-muted); box-shadow: none; }

/* ====== Language switcher ====== */
.lang-switcher { display: flex; justify-content: center; gap: 8px; }
.lang-flag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  opacity: 0.55;
  overflow: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.lang-flag img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.brand-mark { width: 84px; height: auto; margin: 0 auto; object-fit: contain; }
.lang-flag.is-active { opacity: 1; box-shadow: 0 0 0 2px var(--brand-primary); transform: scale(1.05); }

/* ====== Skeleton ====== */
.skeleton {
  background: linear-gradient(90deg, var(--surface-muted) 25%, #e2ddf5 37%, var(--surface-muted) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* Overlay de skeleton exibido durante a transição entre páginas (SSR = sem spinner de dados,
   mas a rede do evento pode ser lenta — isso dá feedback instantâneo ao toque). */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--background);
  z-index: 100;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.page-loader.is-visible { opacity: 1; pointer-events: all; }
.page-loader-hero { height: 150px; border-radius: var(--radius-lg); margin-bottom: var(--space-5); }
.page-loader-row { height: 56px; border-radius: var(--radius-md); margin-bottom: 8px; }

/* ====== Help modal ("?" contextual) ====== */
.help-trigger { }
.help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 23, 48, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.help-overlay.is-open { opacity: 1; pointer-events: all; }
.help-sheet {
  background: var(--surface);
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-5) var(--space-5) var(--space-6);
  transform: translateY(16px);
  transition: transform 0.15s ease;
}
.help-overlay.is-open .help-sheet { transform: translateY(0); }
.help-sheet-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.help-item { display: flex; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.help-item:first-of-type { border-top: none; }
.help-item-icon { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-muted); color: var(--brand-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.help-item-title { font-size: 13.5px; font-weight: 700; margin: 0 0 2px; }
.help-item-body { font-size: 12.5px; color: var(--text-secondary); font-weight: 500; margin: 0; }

/* ====== Category tabs (guias) ====== */
.tabs { display: flex; gap: var(--space-2); overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.tab.is-active { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }

/* ====== Dense list row (ativações, pedidos) ====== */
.list-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.list-row.is-done { opacity: 0.55; }
.list-row-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface-muted);
  color: var(--brand-primary);
}
.list-row-icon.done { background: var(--success-bg); color: var(--success); }
.list-row-body { flex: 1; min-width: 0; }
.list-row-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row-meta { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.list-row-end { flex-shrink: 0; text-align: right; }

/* ====== Bottom nav (floating, icon-only, estilo ativo uniforme) ====== */
.bottom-nav {
  position: fixed;
  left: var(--space-4);
  right: var(--space-4);
  bottom: var(--space-4);
  max-width: 448px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--surface);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  padding: 8px;
  z-index: 20;
}
.bottom-nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: background 0.12s ease, color 0.12s ease;
}
.bottom-nav-item.is-active {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(66, 27, 204, 0.35);
}
.page-with-nav { padding-bottom: 104px; }

/* ====== Progress bar ====== */
.progress {
  height: 8px;
  background: var(--surface-muted);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-fill { height: 100%; background: var(--brand-five-gradient); }

/* ====== Reward celebration ====== */
.reward-hero { text-align: center; padding: var(--space-8) var(--space-4); }
.reward-icon {
  width: 84px; height: 84px; margin: 0 auto var(--space-4);
  border-radius: 50%;
  background: var(--brand-five-gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-hero);
  animation: reward-pop 0.4s ease;
}
.reward-amount {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--brand-five-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin: var(--space-2) 0;
  animation: reward-pop 0.4s ease;
}
@keyframes reward-pop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ====== Transaction row (extrato) ====== */
.tx-row { display: flex; align-items: center; gap: var(--space-3); padding: 12px var(--space-4); }
.tx-icon { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tx-icon.positive { background: var(--success-bg); color: var(--success); }
.tx-icon.negative { background: var(--danger-bg); color: var(--danger); }
.tx-body { flex: 1; min-width: 0; }
.tx-title { font-size: 13.5px; font-weight: 700; }
.tx-meta { font-size: 11.5px; color: var(--text-secondary); font-weight: 600; }
.tx-amount { font-weight: 800; font-size: 14px; white-space: nowrap; }
.tx-amount.positive { color: var(--success); }
.tx-amount.negative { color: var(--danger); }

/* ====== KDS (operação) ====== */
.kds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}
.kds-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  box-shadow: var(--shadow-sm);
}
.kds-customer { font-size: 15px; font-weight: 700; }
.kds-items { font-size: 13.5px; color: var(--text-secondary); font-weight: 600; }
.kds-actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.kds-actions .btn { width: auto; flex: 1; }

/* ====== Admin shell ====== */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 236px;
  flex-shrink: 0;
  background: var(--brand-primary-deep);
  background-image: radial-gradient(circle at 100% 100%, rgba(255, 122, 69, 0.18), transparent 55%);
  color: var(--text-inverse);
  padding: var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  position: sticky;
  top: 0;
  height: 100vh;
}
.admin-sidebar-brand { font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.admin-sidebar-brand small { display: block; font-size: 11px; font-weight: 600; color: var(--text-inverse-muted); margin-top: 2px; }
.admin-sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.admin-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: rgba(255,255,255,0.72);
  font-size: 13.5px;
  font-weight: 700;
}
.admin-sidebar-nav a.is-active,
.admin-sidebar-nav a:hover { background: rgba(255,255,255,0.14); color: #fff; }
.admin-content { flex: 1; padding: var(--space-6); max-width: 1200px; }

.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-5); }

.admin-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-md); overflow: hidden; }
.admin-table th, .admin-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.admin-table th { background: var(--surface-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); font-weight: 700; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table a { color: var(--brand-primary); font-weight: 700; text-decoration: none; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-4); }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); }
.stat-card .value { font-size: 26px; font-weight: 800; background: var(--brand-five-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-card .label { font-size: 12.5px; color: var(--text-secondary); font-weight: 600; }

@media (max-width: 860px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; flex-direction: row; overflow-x: auto; }
  .admin-sidebar-nav { flex-direction: row; }
  .admin-content { padding: var(--space-4); }
}
