/* =========================================================================
   Painéis (admin e cliente)
   ========================================================================= */

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

.sidebar {
  position: fixed; inset: 0 0 0 auto;
  width: min(78vw, 280px);
  background: var(--bg-1);
  border-left: 1px solid var(--line-strong);
  z-index: 200;
  padding: 22px;
  display: flex; flex-direction: column; gap: 4px;
  transform: translateX(100%);
  transition: transform .32s var(--ease-out);
  overflow-y: auto;
}
.sidebar.is-open { transform: translateX(0); }

.sidebar-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; margin-bottom: 22px; padding: 0 6px;}
.sidebar-brand img, .sidebar-brand svg { width: 30px; height: 30px; }

.sidebar-close { position: absolute; top: 18px; right: 18px; background: none; border: none; color: var(--text-dim); }

.side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 14px; font-weight: 600;
  transition: background .2s, color .2s;
}
.side-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.side-link:hover { background: rgba(201,217,94,0.08); color: var(--text); }
.side-link.is-active { background: rgba(201,217,94,0.12); color: var(--purple-400); }

.side-section-label {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-faint); margin: 18px 8px 6px;
}
.sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 6px 14px; }
.sidebar-user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-400), var(--purple-700));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #0a0a08; flex-shrink: 0;
}
.sidebar-user-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.sidebar-user-role { font-size: 11px; color: var(--text-faint); }

.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(5,3,10,0.6);
  z-index: 190; opacity: 0; pointer-events: none; transition: opacity .3s;
}
.sidebar-overlay.is-open { opacity: 1; pointer-events: auto; }

.topbar {
  position: sticky; top: 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 18px;
  background: rgba(10,10,8,0.8); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.menu-btn { background: none; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 9px; color: var(--text); }
.menu-btn svg { width: 20px; height: 20px; }

.main-content { flex: 1; min-width: 0; padding: 22px 16px 60px; }

/* --------------------------------------------------------------- stats -- */
.stat-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin-bottom: 26px; }
.stat-card { padding: 18px; }
.stat-card .label { font-size: 12px; color: var(--text-faint); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .04em; }
.stat-card .value { font-family: var(--font-display); font-size: 28px; margin-top: 6px; }

.panel { padding: 22px; margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 10px; flex-wrap: wrap; }
.panel-head h2 { font-size: 18px; }
.panel-head-sub { color: var(--text-faint); font-size: 13px; }

.empty-state {
  text-align: center; padding: 40px 20px; color: var(--text-faint);
}
.empty-state svg { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--purple-400); opacity: .7; }

.list-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: none; }
.list-row-main { min-width: 0; }
.list-row-title { font-weight: 600; font-size: 14px; }
.list-row-sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card { width: 100%; max-width: 400px; padding: 34px 28px; }
.login-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 6px; }
.login-card h1 { font-size: 22px; text-align: center; margin-bottom: 6px; }
.login-card .sub { text-align: center; color: var(--text-dim); font-size: 14px; margin-bottom: 26px; }

/* thread de chamado */
.thread { display: grid; gap: 14px; margin-bottom: 20px; }
.thread-msg { padding: 14px 16px; border-radius: var(--radius-md); max-width: 84%; }
.thread-msg.is-admin { background: rgba(201,217,94,0.14); border: 1px solid rgba(201,217,94,0.3); margin-right: auto; }
.thread-msg.is-cliente { background: rgba(255,255,255,0.03); border: 1px solid var(--line); margin-left: auto; }
.thread-msg-meta { font-size: 11px; color: var(--text-faint); margin-bottom: 6px; font-family: var(--font-mono); }
.thread-msg-body { font-size: 14px; white-space: pre-wrap; line-height: 1.5; }

@media (min-width: 700px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .sidebar { position: sticky; top: 0; height: 100vh; transform: none; width: 250px; border-left: none; border-right: 1px solid var(--line); }
  .sidebar-overlay { display: none; }
  .sidebar-close { display: none; }
  .menu-btn { display: none; }
  .main-content { padding: 30px 32px 60px; }
}

/* =========================================================================
   Editar página — navegação rápida + seções colapsáveis
   ========================================================================= */
.settings-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
  margin-bottom: 18px;
  position: sticky;
  top: 74px;
  z-index: 10;
}
.settings-jump a {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(201,217,94,0.06);
  border: 1px solid var(--line);
  color: var(--text-dim);
  white-space: nowrap;
}
.settings-jump a:hover { color: var(--text); border-color: var(--line-strong); }

.settings-section summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  padding: 4px 2px;
}
.settings-section summary::-webkit-details-marker { display: none; }
.settings-section summary::before {
  content: '▸';
  color: var(--purple-400);
  margin-right: 10px;
  transition: transform .2s;
  display: inline-block;
}
.settings-section[open] summary::before { transform: rotate(90deg); }
.settings-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 500;
}

.settings-fields {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.field-hint {
  display: block;
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 5px;
}

.settings-save-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  margin-top: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 -10px 30px -10px rgba(0,0,0,0.4);
}

@media (min-width: 700px) {
  .settings-fields { grid-template-columns: 1fr 1fr; }
  .settings-fields .field:has(textarea) { grid-column: 1 / -1; }
}

/* =========================================================================
   Editor Hero — sliders de posição/tamanho dos mascotes
   ========================================================================= */
.he-group { margin-bottom: 18px; }
.he-group-title {
  font-family: var(--font-display);
  font-size: 15px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.he-controls {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
.he-control label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.he-control output {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--purple-400);
  background: rgba(201,217,94, 0.12);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}
.he-control input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(178, 158, 255, 0.18);
  border-radius: 3px;
  outline: none;
}
.he-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--purple);
  cursor: pointer;
  border: 3px solid var(--bg-elevated);
  box-shadow: 0 2px 8px rgba(201,217,94, 0.5);
}
.he-control input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--purple);
  cursor: pointer;
  border: 3px solid var(--bg-elevated);
}
@media (min-width: 700px) {
  .he-controls { grid-template-columns: 1fr 1fr; }
}

/* =========================================================================
   Editor Hero — layout do quadro editavel (iframe + lista lateral)
   ========================================================================= */
.he-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.he-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.02);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 13.5px;
  transition: color .2s, background .2s, border-color .2s;
}
.he-tab svg { width: 16px; height: 16px; }
.he-tab:hover { color: var(--text); }
.he-tab.is-active {
  color: #0a0a08;
  background: linear-gradient(135deg, var(--pink), var(--cyan));
  border-color: transparent;
}
.he-tab-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-left: 4px;
}

.he-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.he-stage-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: auto;
  background: #0a0a08;
  padding: 18px;
}
.he-stage-inner { transition: max-width .35s var(--ease-out); }
/* aba "Mobile": estreita o quadro pra largura de celular de verdade -- é
   isso que faz a media query do proprio site trocar sozinha pros valores
   mobile, sem nenhuma logica de "simular dispositivo" por fora. */
.he-stage-inner.is-mobile {
  max-width: 390px;
  margin: 0 auto;
  border: 8px solid #1b1b12;
  border-radius: 28px;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.7);
  overflow: hidden;
}
.he-iframe {
  width: 100%;
  height: 78vh;
  min-height: 520px;
  border: none;
  display: block;
}
.he-stage-inner.is-mobile .he-iframe { height: 74vh; }
.he-sidebar { padding: 18px; }
.he-side-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.he-side-focus {
  background: none;
  border: none;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  text-align: left;
  padding: 0 0 8px;
  cursor: pointer;
  width: 100%;
}
.he-side-focus:hover { color: var(--purple-400); }
.he-mini-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.he-mini-field {
  font-size: 11px;
  color: var(--text-faint);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.he-mini-field input {
  background: rgba(201,217,94,0.06);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 5px 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  width: 100%;
}

@media (min-width: 1100px) {
  .he-layout { grid-template-columns: 1fr 300px; }
}

/* =========================================================================
   Editor Hero — toggle de visibilidade + importar imagem na lista lateral
   ========================================================================= */
.he-side-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.he-visible-toggle {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
  flex-shrink: 0;
}
.he-visible-toggle input { opacity: 0; width: 0; height: 0; }
.he-visible-toggle span {
  position: absolute; inset: 0;
  background: rgba(201,217,94,0.16);
  border-radius: 999px;
  transition: background .2s;
  cursor: pointer;
}
.he-visible-toggle span::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.he-visible-toggle input:checked + span { background: var(--purple); }
.he-visible-toggle input:checked + span::before { transform: translateX(14px); }

.he-upload-btn {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: 8px;
  margin-top: 10px;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.he-upload-btn:hover { border-color: var(--purple-400); color: var(--text); }
.he-upload-status {
  display: block;
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 6px;
  min-height: 14px;
}

.he-reset-btn {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-faint);
  background: none;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 6px;
  margin-top: 8px;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.he-reset-btn:hover { border-color: rgba(224,69,123,0.5); color: #e0457b; }
