/* ============================================================
   AFK Totem — tema visual (Super Admin + Painel de Controle)
   Estrutura: menu lateral fixo + conteúdo, estilo produto SaaS.
   ============================================================ */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-hover: #f1f5f9;
  --border: #e5e7eb;
  --border-strong: #d8dbe0;

  --text: #101828;
  --text-muted: #667085;
  --text-faint: #98a2b3;

  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --primary-dark: #075985;
  --primary-soft: #e0f2fe;
  --primary-border: #bae6fd;

  --success: #059669;
  --success-soft: #ecfdf5;
  --success-border: #a7f3d0;

  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;

  --warning: #b45309;
  --warning-soft: #fffbeb;
  --warning-border: #fde68a;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 6px 16px -6px rgba(16, 24, 40, 0.10);
  --shadow-md: 0 4px 10px -2px rgba(16, 24, 40, 0.08), 0 14px 28px -10px rgba(16, 24, 40, 0.12);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}

svg.icon { flex-shrink: 0; display: block; }

/* ============================================================
   Casca da aplicação: menu lateral + área principal
   ============================================================ */

.app-shell { display: flex; min-height: 100vh; align-items: stretch; }

.sidebar {
  width: 236px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand { display: flex; align-items: center; gap: 9px; padding: 22px 20px 18px; }
.sidebar-brand .brand-mark {
  display: flex; align-items: center; justify-content: center;
  width: 27px; height: 27px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  flex-shrink: 0;
}
.sidebar-brand .brand-name { font-weight: 800; font-size: 15px; letter-spacing: -0.01em; color: var(--text); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 12px; flex: 1; }
.sidebar-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint); padding: 14px 12px 6px;
}
.sidebar-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.sidebar-nav-item:hover { background: var(--surface-hover); color: var(--text); }
.sidebar-nav-item.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.sidebar-nav-item.active svg.icon { color: var(--primary-hover); }
.sidebar-nav-badge {
  margin-left: auto;
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid var(--warning-border);
  font-size: 11px; font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.sidebar-event-name {
  padding: 10px 12px 4px;
  font-size: 12px; font-weight: 700; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .04em;
}
.sidebar-event-title {
  padding: 0 12px 12px;
  font-size: 14.5px; font-weight: 700; color: var(--text);
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  word-break: break-word;
}

.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.app-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.app-topbar-title { font-weight: 700; font-size: 15px; color: var(--text); }
.app-topbar-meta { display: flex; align-items: center; gap: 14px; font-size: 13.5px; }
.user-chip, .event-chip {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-muted); font-weight: 500;
}
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-muted); text-decoration: none; font-weight: 600;
  transition: color .15s;
}
.nav-link:hover { color: var(--text); }

.app-content { padding: 30px 32px 72px; max-width: 1040px; width: 100%; }

/* páginas de login/instalação (sem menu lateral) ainda usam .container */
.container { max-width: 920px; margin: 0 auto; padding: 32px 20px 80px; }

/* ============================================================
   Hero / feature cards (telas "Início")
   ============================================================ */

.hero-card {
  background: linear-gradient(135deg, var(--primary-soft) 0%, #ffffff 65%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px 38px;
  margin-bottom: 22px;
}
.hero-eyebrow {
  text-transform: uppercase; letter-spacing: .06em; font-size: 12px; font-weight: 700;
  color: var(--primary-hover); margin-bottom: 10px;
}
.hero-title { font-size: 27px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px; color: var(--text); }
.hero-desc { color: var(--text-muted); font-size: 14.5px; max-width: 580px; margin: 0; line-height: 1.65; }

.stat-row { display: flex; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.stat-card {
  flex: 1; min-width: 160px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.stat-value { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; line-height: 1.2; }
.stat-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); font-weight: 600; margin-top: 4px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.feature-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  text-decoration: none;
  transition: box-shadow .15s, border-color .15s, transform .1s;
}
a.feature-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-border); transform: translateY(-1px); }
.feature-card-icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: var(--primary-soft); color: var(--primary-hover);
  border-radius: 10px; margin-bottom: 14px;
}
.feature-card h2 { margin: 0 0 6px; }
.feature-card p { color: var(--text-muted); font-size: 13.5px; line-height: 1.55; margin: 0 0 14px; flex: 1; }
.feature-card-link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--primary-hover); font-weight: 600; font-size: 13.5px; text-decoration: none;
}
.feature-card-link svg { transition: transform .15s; }
a.feature-card:hover .feature-card-link svg { transform: translateX(3px); }

/* ============================================================
   Componentes gerais
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.card-narrow { max-width: 420px; margin: 56px auto; }

.auth-card { text-align: center; }
.auth-mark {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: 0 auto 18px;
  background: var(--primary); color: #fff; border-radius: 12px;
}
.auth-title { justify-content: center; margin-bottom: 4px; }
.auth-subtitle { margin-bottom: 24px; text-align: center; }
.auth-card form { text-align: left; }

h1 {
  font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
  margin: 0 0 18px; color: var(--text);
  display: flex; align-items: center; gap: 9px;
}
h1 svg.icon { color: var(--primary-hover); }

h2 { font-size: 16px; font-weight: 600; margin: 0 0 4px; color: var(--text); letter-spacing: -0.01em; }

.muted { color: var(--text-muted); font-size: 13.5px; line-height: 1.5; }
.subtitle-inline { color: var(--text-muted); margin: 2px 0 0; font-size: 14px; }
.page-desc { color: var(--text-muted); font-size: 14.5px; margin: -12px 0 22px; }

/* ---------- forms ---------- */

label { display: block; margin-bottom: 16px; font-size: 13px; font-weight: 600; color: var(--text); }

input:not([type="checkbox"]), select {
  display: block; width: 100%; margin-top: 7px;
  padding: 10px 13px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14.5px; font-weight: 400; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:not([type="checkbox"]):focus, select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
input::placeholder { color: var(--text-faint); }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

.file-drop {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 14.5px; font-weight: 500; color: var(--text-muted);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: 16px;
}
.file-drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.file-drop input { display: none; }
.file-drop-icon {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--primary-hover); flex-shrink: 0;
}

/* ---------- buttons ---------- */

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--primary); color: #ffffff;
  border: 1px solid var(--primary);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .1s;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
}
button:hover, .button:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button:active, .button:active { box-shadow: none; }

.button-secondary { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.button-secondary:hover { background: var(--surface-hover); border-color: var(--border-strong); }

.button-danger { background: var(--surface); border: 1px solid var(--danger-border); color: var(--danger); }
.button-danger:hover { background: var(--danger-soft); border-color: var(--danger); }

.button-approve { background: var(--success); border-color: var(--success); }
.button-approve:hover { background: #047857; border-color: #047857; }

.button-small { padding: 6px 12px; font-size: 13px; }

.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
  box-shadow: var(--shadow-sm);
}
.icon-button:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-strong); }
.icon-button-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }

/* ---------- page head / row actions ---------- */

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.row-actions { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.row-actions form { display: inline-flex; }

/* ---------- checkbox ---------- */

.checkbox-row { display: flex; align-items: center; gap: 10px; font-weight: 400; font-size: 14px; color: var(--text); }
.checkbox-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }

/* ---------- flash / feedback ---------- */

.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14px; font-weight: 500; border: 1px solid transparent; }
.flash-success { background: var(--success-soft); color: var(--success); border-color: var(--success-border); }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }

/* ---------- badges ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}
.badge-active { background: var(--success-soft); color: var(--success); border-color: var(--success-border); }
.badge-archived { background: var(--surface-2); color: var(--text-faint); }
.badge-neutral { background: var(--surface-2); color: var(--text-muted); }

.pending-badge {
  display: inline-flex; min-width: 22px; height: 22px; padding: 0 7px;
  align-items: center; justify-content: center;
  background: var(--warning-soft); color: var(--warning); border: 1px solid var(--warning-border);
  font-weight: 700; border-radius: 999px; font-size: 12.5px;
}

/* ---------- meta row (cards de evento) ---------- */

.meta-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 12px; }
.meta-item { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-muted); }
.meta-item svg.icon { color: var(--text-faint); }
.badge-row { display: flex; gap: 8px; }

/* ---------- link rows ---------- */

.link-rows { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.link-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.link-row-icon {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--primary-hover); flex-shrink: 0;
}
.link-row-body { flex: 1; min-width: 0; }
.link-row-label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.link-row-label em { font-style: normal; font-weight: 400; color: var(--text-faint); }
.link-row-url { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--text-muted); }

.copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
  padding: 8px 13px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s;
}
.copy-btn:hover { background: var(--surface-hover); }
.copy-btn-done { background: var(--success-soft); border-color: var(--success-border); color: var(--success); }

/* ---------- empty state ---------- */

.empty-state { text-align: center; padding: 48px 24px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--text-muted); }
.empty-state-icon {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin: 0 auto 16px;
  background: var(--primary-soft); color: var(--primary-hover); border-radius: 50%;
}
.empty-state p { margin: 0 0 18px; font-size: 14.5px; }

/* ---------- media grid (retrospectiva / fila) ---------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin-top: 18px; }
.thumb { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-remove {
  position: absolute; top: 6px; right: 6px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(16, 24, 40, 0.65); backdrop-filter: blur(4px);
  color: #fff; border: none; border-radius: 50%; width: 26px; height: 26px; padding: 0; cursor: pointer;
}
.thumb-remove:hover { background: var(--danger); }

.thumb-pending { aspect-ratio: auto; background: var(--surface); border: 1px solid var(--border); padding: 10px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-sm); }
.thumb-pending img, .thumb-pending video { border-radius: 7px; aspect-ratio: 1; }
.thumb-caption { margin: 0; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.thumb-actions { display: flex; flex-direction: column; gap: 6px; }
.thumb-actions button { width: 100%; }

/* ---------- utility ---------- */

.wrap { max-width: 420px; margin: 0 auto; }
.success { color: var(--success); }
.success-icon { font-size: 40px; }

/* ---------- responsivo ---------- */

@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-md); }
  .app-content { padding: 22px 18px 60px; }
  .app-topbar { padding: 14px 18px; }
}
