.app { min-height: 100vh; padding: 20px; }
/* O sistema só aparece depois do login */
body:not(.is-auth) .app { display: none; }

/* ---------- Tela de login ---------- */
.login {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(700px 420px at 50% 100%, var(--glow-1), transparent 70%),
    var(--page-bg);
}
.login[hidden] { display: none; }
.login-card {
  position: relative; overflow: hidden;
  width: 100%; max-width: 400px;
  padding: 36px 32px 28px;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(11, 9, 10, .14);
  text-align: center;
}
.checker-top {
  position: absolute; top: 0; left: 0; right: 0;
  height: 8px;
  background: repeating-conic-gradient(var(--black) 0 25%, #fff 0 50%) 0 0 / 8px 8px;
}
:root[data-theme="dark"] .login-logo { background: #fff; border-radius: 14px; padding: 10px; }
.login-logo { width: 190px; height: auto; margin: 6px auto 18px; display: block; }
.login h1 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin-bottom: 18px; }
.login form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login .btn { width: 100%; margin-top: 4px; }
.login-foot { margin-top: 18px; font-size: 12px; color: var(--text-3); }

.shell {
  position: relative;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: calc(100vh - 40px);
  background: var(--shell);
  border-radius: var(--radius-xl);
  overflow: hidden;
  isolation: isolate;
}

/* Brilho laranja suave atrás do conteúdo */
.shell::before {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  background:
    radial-gradient(640px 400px at 70% 75%, var(--glow-1), transparent 70%),
    radial-gradient(520px 320px at 40% 90%, var(--glow-2), transparent 70%);
  pointer-events: none;
}

/* ---------- Menu lateral (preto, como a bandeira da logo) ---------- */
.sidebar {
  display: flex; flex-direction: column;
  padding: 18px 16px 22px;
  background: var(--sidebar);
  color: var(--sidebar-text);
}

/* Marca: logo horizontal oficial "Chaveiro Catarina" (versão para fundo escuro) */
.brand {
  display: flex; align-items: center;
  padding: 6px 4px 4px;
  color: inherit;
  text-decoration: none;
}
.brand img { display: block; height: auto; }
.brand-logo { width: 100%; max-width: 210px; }

/* Faixa quadriculada — referência à bandeira de chegada da logo */
.checker {
  height: 6px;
  margin: 16px 2px 18px;
  border-radius: 2px;
  background: repeating-conic-gradient(#f5f3f2 0 25%, transparent 0 50%) 0 0 / 6px 6px;
  opacity: .35;
}

.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--nav-pill);
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 500;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
  transition: background .15s;
}
.nav a svg { color: var(--brand); flex: none; }
.nav a:hover { background: var(--nav-pill-hover); }
.nav a.active { background: var(--brand); color: var(--on-brand); font-weight: 700; box-shadow: none; }
.nav a.active svg { color: var(--on-brand); }
.nav .nav-sep { height: 8px; }

.sidebar-foot {
  margin-top: auto;
  padding: 18px 6px 0;
  font-family: var(--font-display);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-3);
}
.sidebar-foot strong { color: var(--brand); font-weight: 600; }

/* ---------- Área principal ---------- */
.main { min-width: 0; padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 18px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title > div { min-width: 0; }
.topbar h1 { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -.005em; }
.topbar p { margin-top: 2px; color: var(--text-2); font-size: 13px; }
.topbar h1 .accent { color: var(--brand); }

.toolbar-pill {
  display: flex; align-items: center; gap: 2px;
  padding: 6px;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.icon-btn.menu-btn { display: none; }
.topbar-symbol { display: none; width: 52px; height: auto; flex: none; }
:root[data-theme="dark"] .topbar-symbol { content: url("../assets/simbolo-negativo.png"); }

.view { min-width: 0; outline: none; }

.sidebar-backdrop { display: none; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .app { padding: 0; }
  .shell { grid-template-columns: minmax(0, 1fr); border-radius: 0; min-height: 100vh; }
  .main { padding: 16px; }
  .icon-btn.menu-btn { display: grid; }
  .topbar-symbol { display: block; }
  .sidebar {
    position: fixed; z-index: 30; top: 0; bottom: 0; left: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform .2s ease;
    overflow-y: auto;
  }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .45);
  }
  .topbar h1 { font-size: 21px; }
}

@media (max-width: 520px) {
  .topbar p { display: none; }
  #bell-btn { display: none; }
}

/* Versão publicada (para conferir se o navegador está com a mais recente) */
.app-version { display: block; margin-top: 4px; font-family: var(--font); font-size: 10px; letter-spacing: .02em; text-transform: none; color: var(--text-3); }
