/* Top-nav horizontal + container central — versão minimalista */

* { box-sizing: border-box }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  min-height: 100vh;
}

body { display: block }

.app-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .65rem 1.5rem;
}

.app-logo {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  white-space: nowrap;
  user-select: none;
  position: relative;
  top: -2px;   /* sobe o logo p/ alinhar visualmente com o menu */
}
/* ƒ (florin) tem perninha/descendente — nudge p/ alinhar a base com as outras letras */
.logo-f { display: inline-block; transform: translateY(0.07em); }
.app-logo-sub {
  color: var(--text-mut);
  font-weight: 400;
  font-size: .8rem;
  margin-left: .25rem;
}

.app-nav {
  display: flex;
  gap: 0;
  flex-shrink: 0;
}
.app-nav-item {
  flex-shrink: 0;
  white-space: nowrap;
  padding: .42rem .85rem;
  font-size: .8rem;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .12s, background .12s;
}
.app-nav-item:hover { background: var(--bg-2); color: var(--text) }
.app-nav-item.active {
  border-bottom-color: #2563eb;
  color: #1d4ed8;
  font-weight: 600;
}

.app-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}

.theme-toggle-mini {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: .35rem;
  overflow: hidden;
}
.theme-toggle-mini button {
  padding: .25rem .55rem;
  font-size: .65rem;
  font-weight: 600;
  border: none;
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
}
.theme-toggle-mini button.on {
  background: var(--text);
  color: var(--surface);
}

.app-main {
  padding: 1.25rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.page.hidden { display: none }

/* área de usuário — pill único [ Nome · Sair · ☀/🌙 ] */
.app-header-actions { align-items: center; }
.user-pill {
  display: inline-flex; align-items: stretch; height: 2rem;
  border: 1px solid var(--border); border-radius: .55rem; overflow: hidden;
  background: var(--surface);
}
.user-pill .up-nome {
  display: inline-flex; align-items: center; padding: 0 .7rem;
  font-size: .76rem; font-weight: 700; color: var(--text); background: var(--bg-2);
}
.user-pill .up-seg {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-left: 1px solid var(--border); background: var(--surface);
  color: var(--text-dim); cursor: pointer; font-size: .73rem; font-weight: 600;
}
.user-pill .up-sair { padding: 0 .7rem; }
.user-pill .up-theme { width: 2rem; }
.user-pill .up-seg:hover { background: var(--bg-2); color: var(--text); }
.up-theme .ico-sun, .up-theme .ico-moon { display: none; }
[data-theme="light"] .up-theme .ico-sun { display: block; }
[data-theme="dark"] .up-theme .ico-moon { display: block; }

/* placeholder de páginas em construção */
.placeholder-panel {
  margin: 2rem auto; max-width: 520px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: .85rem; padding: 2.2rem 1.5rem;
}
.placeholder-title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: .4rem; }
.placeholder-hint { font-size: .82rem; color: var(--text-mut); line-height: 1.5; }

/* toggle de tema discreto (ícone único sol/lua) */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: .5rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-mut); cursor: pointer;
}
.theme-toggle:hover { background: var(--bg-2); color: var(--text); }
.theme-toggle .ico-sun, .theme-toggle .ico-moon { display: none; }
[data-theme="light"] .theme-toggle .ico-sun { display: block; }
[data-theme="dark"] .theme-toggle .ico-moon { display: block; }

/* Indicador global de carregamento (barra no topo) — padrão do sistema todo */
#fp-loadbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 99999; pointer-events: none; opacity: 0; transition: opacity .15s; }
#fp-loadbar.on { opacity: 1; }
#fp-loadbar .fp-loadbar-fill {
  height: 100%; width: 32%;
  background: linear-gradient(90deg, rgba(99,102,241,.2), #6366f1, #4f46e5);
  border-radius: 0 3px 3px 0; box-shadow: 0 0 10px rgba(79,70,229,.55);
  animation: fp-loadbar-slide 1.05s ease-in-out infinite;
}
#fp-loadbar.done .fp-loadbar-fill { animation: none; width: 100%; margin-left: 0; transition: width .26s ease-out; }
@keyframes fp-loadbar-slide { 0% { margin-left: -32%; } 50% { margin-left: 58%; } 100% { margin-left: 100%; } }
body.fp-loading { cursor: progress; }
