/* painel/app.css — layout geral, login, menu lateral e componentes comuns */
:root {
  --menu-fundo: #141414;
  --menu-hover: #242424;
  --menu-ativo: #242424;
  --menu-texto: #ededed;
  --destaque: #141414;
  --fundo: #ffffff;
  --fundo-suave: #f5f5f5;
  --texto: #171717;
  --suave: #737373;
  --borda: #e5e5e5;
  --raio: 8px;
  --fonte: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--fonte); color: var(--texto); background: var(--fundo); line-height: 1.5; }
h1, h2 { line-height: 1.2; margin: 0; }
:focus-visible { outline: 2px solid #171717; outline-offset: 2px; }

/* ---------- componentes comuns ---------- */
.btn { font: inherit; font-weight: 600; border: 1px solid transparent; border-radius: var(--raio); padding: 10px 18px; cursor: pointer; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primario { background: var(--destaque); color: #fff; }
.btn-primario:hover:not(:disabled) { background: #3a3a3a; }
.btn-sec { background: #fff; color: var(--texto); border-color: var(--borda); }
.btn-sec:hover:not(:disabled) { background: var(--fundo-suave); }

.campo { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid #d4d4d4; border-radius: var(--raio); background: #fff; color: var(--texto); }
textarea.campo { resize: vertical; min-height: 120px; line-height: 1.5; }
.campo:focus { border-color: #171717; outline: none; box-shadow: 0 0 0 3px rgba(0,0,0,.08); }
.campo-grupo { display: flex; flex-direction: column; gap: 6px; }
.campo-grupo label, label { font-weight: 600; font-size: .92rem; }
.campo-dica { color: var(--suave); font-size: .85rem; margin: 0; }

.estado { color: var(--suave); margin: 0; }
.estado-erro { color: #404040; font-weight: 600; }
.estado-ok { color: #171717; font-weight: 600; }

/* ---------- login ---------- */
.tela-centro { min-height: 100%; display: grid; place-items: center; background: var(--fundo-suave); padding: 24px; }
.login-caixa { width: min(380px, 100%); background: #fff; border: 1px solid var(--borda); border-radius: 12px; padding: 32px; display: flex; flex-direction: column; gap: 12px; }
.login-caixa h1 { font-size: 1.6rem; }
.login-sub { margin: 0 0 8px; color: var(--suave); }
.login-erro { margin: 0; color: #404040; font-weight: 600; font-size: .92rem; }

/* ---------- casca do painel ---------- */
#painel { display: flex; height: 100vh; }
.menu { width: 264px; flex: none; background: var(--menu-fundo); color: var(--menu-texto); display: flex; flex-direction: column; padding: 14px 10px; gap: 14px; transition: width .2s ease; }
.menu-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 4px 10px; min-height: 40px; }
.menu-marca { font-weight: 600; font-size: 1rem; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-toggle { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: var(--raio); background: transparent; color: inherit; cursor: pointer; }
.menu-toggle:hover { background: var(--menu-hover); }
.menu-toggle svg { transition: transform .2s ease; }

.menu svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.menu-itens { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: var(--raio); background: transparent; color: inherit; font: inherit; text-decoration: none; cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--menu-hover); }
.menu-item[aria-current="page"] { background: var(--menu-ativo); box-shadow: inset 3px 0 0 #fff; }
.menu-icone { flex: none; display: grid; place-items: center; }
.menu-rotulo { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* menu minimizado: só ícones (o rótulo continua para leitor de tela) */
.menu-min .menu { width: 68px; }
.menu-min .menu-toggle svg { transform: rotate(180deg); }
.menu-min .menu-topo { justify-content: center; padding: 4px 0; }
.menu-min .menu-marca { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.menu-min .menu-item { justify-content: center; }
.menu-min .menu-rotulo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.area { flex: 1; min-width: 0; overflow: auto; background: var(--fundo); padding: 32px 36px 48px; }

@media (max-width: 720px) {
  .area { padding: 22px 16px 40px; }
  .menu { width: 68px; }
}
