/* ============================================================
   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%; }

/* Botão de menu (hamburguer) e véu de fundo — só aparecem em telas
   estreitas, para abrir/fechar o menu lateral (veja @media no fim). */
.sidebar-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}
.sidebar-toggle svg { width: 18px; height: 18px; }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(16, 24, 40, 0.5);
  z-index: 19;
}
.sidebar-backdrop.open { display: block; }

/* 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-toggle { display: inline-flex; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 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; gap: 10px; }
  .app-topbar-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-topbar-meta .event-chip span { display: none; }
}

@media (max-width: 480px) {
  .app-topbar-meta { display: none; }
}

/* ============================================================
   Shell v2 — sidebar estreita (só ícone), topbar com busca, painel
   lateral direito com resumo. Usado no Super Admin e no painel do
   cliente (o conteúdo de cada página continua igual, só a "casca"
   muda).
   ============================================================ */

.shell-v2 { display: flex; min-height: 100vh; background: var(--bg); }

.rail-backdrop { display: none; position: fixed; inset: 0; background: rgba(16,24,40,.5); z-index: 19; }
.rail-backdrop.open { display: block; }

.rail {
  width: 76px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
  transition: width .18s ease;
  overflow: hidden;
}
.rail-brand {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px;
  flex-shrink: 0;
}
.rail-nav { display: flex; flex-direction: column; gap: 8px; flex: 1; width: 100%; align-items: center; }
.rail-item {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.rail-item:hover { background: var(--surface-hover); color: var(--text); }
.rail-item.active { background: var(--primary); color: #fff; }
.rail-item .rail-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--surface);
}
.rail-foot { display: flex; flex-direction: column; gap: 8px; width: 100%; align-items: center; }

.rail-collapse-btn {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint);
  background: none; border: none; cursor: pointer;
  transition: background .15s, color .15s, transform .18s;
  flex-shrink: 0;
}
.rail-collapse-btn:hover { background: var(--surface-hover); color: var(--text); }
.rail.expanded .rail-collapse-btn svg { transform: rotate(180deg); }

/* Estado expandido (desktop) — mostra o texto de cada aba. Preferência
   salva no navegador (localStorage), então fica do jeito que a pessoa
   deixar. */
@media (min-width: 861px) {
  .rail.expanded { width: 216px; align-items: stretch; padding-left: 16px; padding-right: 16px; }
  .rail.expanded .rail-brand { align-self: flex-start; }
  .rail.expanded .rail-nav,
  .rail.expanded .rail-foot { align-items: stretch; }
  .rail.expanded .rail-item {
    width: 100%; justify-content: flex-start; gap: 12px; padding: 0 12px;
  }
  .rail.expanded .rail-label { display: inline; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
  .rail.expanded .rail-collapse-btn { align-self: flex-start; }
}

.shell-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.shell-body { flex: 1; display: flex; min-width: 0; }
.shell-content { flex: 1; min-width: 0; padding: 28px 32px 60px; }
.shell-right {
  width: 296px; flex-shrink: 0;
  padding: 28px 24px;
  border-left: 1px solid var(--border);
}

.topbar-v2 {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.topbar-v2-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}
.topbar-v2-title { font-weight: 800; font-size: 16px; color: var(--text); white-space: nowrap; }
.topbar-search {
  flex: 1; max-width: 360px;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 9px 16px;
  color: var(--text-faint);
}
.topbar-search input {
  border: none; background: transparent; outline: none;
  flex: 1; font: inherit; color: var(--text); font-size: 13.5px;
}
.topbar-user { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }
.topbar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}

/* painel lateral direito */
.panel-greeting { font-size: 13.5px; color: var(--text-muted); margin-bottom: 2px; }
.panel-name { font-size: 19px; font-weight: 800; margin-bottom: 24px; color: var(--text); }
.panel-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint); margin-bottom: 10px;
}
.panel-stat { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.panel-stat:last-child { border-bottom: none; }
.panel-stat-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.panel-stat-value { font-weight: 800; font-size: 15.5px; line-height: 1.2; color: var(--text); }
.panel-stat-label { font-size: 12px; color: var(--text-muted); }

/* cards estilo "pasta" (clientes) */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 18px; }
.folder-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow .15s, transform .1s, border-color .15s;
  position: relative;
}
.folder-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: var(--primary-border); }
.folder-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.folder-card-icon {
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--primary-soft); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.folder-card-title { font-weight: 700; font-size: 14.5px; color: var(--text); margin: 0; }
.folder-card-meta { font-size: 12px; color: var(--text-muted); }

/* ============================================================
   Login (card dividido, com painel colorido do lado) — usado no
   Super Admin e no painel do cliente.
   ============================================================ */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.auth-split {
  display: flex;
  width: 100%;
  max-width: 780px;
  min-height: 440px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.auth-split-form {
  flex: 1 1 54%;
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-split-form .auth-mark {
  margin: 0 0 18px;
}

.auth-split-form h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  display: block;
}

.auth-split-form .subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 28px;
}

.auth-split-form form { text-align: left; }

.auth-split-decor {
  flex: 0 0 42%;
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 180px 0 0 180px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 30px;
}

.auth-split-decor h2 {
  font-size: 23px;
  font-weight: 800;
  margin: 0 0 12px;
  color: #fff;
}

.auth-split-decor p {
  font-size: 13.5px;
  line-height: 1.6;
  opacity: 0.92;
  margin: 0;
  max-width: 220px;
}

@media (max-width: 680px) {
  .auth-split { max-width: 380px; }
  .auth-split-decor { display: none; }
  .auth-split-form { padding: 40px 30px; }
}

@media (max-width: 980px) {
  .shell-right { display: none; }
}

@media (max-width: 860px) {
  .topbar-v2-toggle { display: inline-flex; }
  .rail {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform .2s;
    flex-direction: column;
    width: 240px;
    align-items: flex-start;
    padding: 20px 16px;
  }
  .rail.open { transform: translateX(0); box-shadow: var(--shadow-md); }
  .rail-nav { flex-direction: column; width: 100%; }
  .rail-item { width: 100%; justify-content: flex-start; gap: 10px; padding: 0 12px; }
  .rail-item .rail-label { display: inline; font-size: 13.5px; font-weight: 600; }
  .rail-foot { width: 100%; }
  .shell-content { padding: 20px 18px 50px; }
  .topbar-v2 { padding: 14px 16px; gap: 10px; }
  .topbar-search { display: none; }
}

@media (min-width: 861px) {
  .rail-label { display: none; }
}

/* ============================================================
   Lista de conteúdo (painel do cliente) — ordem de exibição na
   tela, com botões pra mover cada item pra cima/baixo.
   ============================================================ */

.media-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.media-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.media-list-order {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  flex-shrink: 0;
}
.media-list-thumb {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
}
.media-list-thumb img, .media-list-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-list-body { flex: 1; min-width: 0; }
.media-list-name { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-list-meta { font-size: 12px; color: var(--text-muted); }
.media-list-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.media-list-actions form { display: inline-flex; }
.media-move-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.media-move-btn:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }
.media-move-btn:disabled { opacity: .35; cursor: default; }

.media-list-handle {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 40px; flex-shrink: 0;
  color: var(--text-faint);
  cursor: grab;
  touch-action: none;
}
.media-list-handle:hover { color: var(--text-muted); }
.media-list-item.dragging { opacity: .4; }
.media-list-item.drag-over { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }

@media (max-width: 640px) {
  .media-list-handle { display: none; }
}
