/* ── App shell ─────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Header ─────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  height: 54px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif, Georgia, serif);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--primary);
  text-decoration: none;
  flex-shrink: 0;
  user-select: none;
}

.logo img,
.logo svg { width: 26px; height: 26px; flex-shrink: 0; }

.hdr-badge {
  font-size: 10.5px;
  color: var(--muted-2);
  background: var(--surface-2);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.hdr-spacer { flex: 1; }

/* Toggle de tema */
#btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
#btn-theme-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}

/* ── Layout central ──────────────────────────────────────── */
.main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-sec {
  padding: 16px 14px 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 14px;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: background var(--tr-fast), color var(--tr-fast), border-color var(--tr-fast);
}
.nav-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}
.nav-btn.active {
  background: var(--primary-dim);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}
.nav-btn svg      { flex-shrink: 0; opacity: 0.6; }
.nav-btn:hover svg  { opacity: 0.85; }
.nav-btn.active svg { opacity: 1; }

.nav-div {
  height: 1px;
  background: var(--border);
  margin: 5px 12px;
}

/* Seletor de tipo */
.nav-work {
  padding: 12px 14px 16px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.nav-work label {
  display: block;
  font-size: 10px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
  font-weight: 700;
}

/* ── Área de conteúdo ─────────────────────────────────────── */
#content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ── Painéis ──────────────────────────────────────────────── */
.panel {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 28px 30px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}
.panel.active {
  display: flex;
  flex-direction: column;
}

/* Preview sem padding e sem max-width */
#panel-prev {
  padding: 0;
  max-width: none;
}

/* Home: sem max-width, sem padding — seções controlam internamente */
#panel-home {
  padding: 0;
  max-width: none;
}

/* Wizard e Template: padding lateral menor para mais espaço */
#panel-wizard,
#panel-tpl {
  padding: 24px 28px;
}

/* Painéis de suporte/help: max-width maior */
#panel-help, #panel-formato, #panel-partes, #panel-contato, #panel-account {
  max-width: 800px;
}

/* ── Cabeçalhos de painel (título + subtítulo) ─────────────── */
.panel-heading {
  margin-bottom: 24px;
}
.panel-heading h2 {
  font-family: var(--serif, Georgia, serif);
  font-size: var(--fs-section, clamp(1.4rem, 2vw, 2.1rem));
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.018em;
  margin-bottom: 6px;
  line-height: 1.2;
}
.panel-heading p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Rodapé fixo (Wizard / Template) ─────────────────────── */
.sticky-foot {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 13px 28px;
  display: flex;
  gap: 9px;
  margin: 0 -28px -24px;
  box-shadow: 0 -4px 16px var(--shadow);
}
