/* Login (index.html) e painel (dashboard.html). Base em base.css. */

/* ---------- Login / Cadastro ---------- */
.auth-page { display: flex; justify-content: center; padding: 32px 16px calc(32px + env(safe-area-inset-bottom)); }
.auth-box { width: 100%; max-width: 400px; }
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-head h1 { margin: 0; font-size: 1.6rem; }
.auth-head p { margin: 6px 0 0; color: var(--muted); font-size: .875rem; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; margin-bottom: 14px;
        background: var(--card); border-radius: var(--radius); }
.tabs button { min-height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
               font: inherit; font-weight: 700; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--accent); color: #fff; }
.auth-box form.card { display: block; background: var(--card); border-radius: var(--radius); padding: 18px 16px 20px; }
.auth-box .msg { margin-bottom: 12px; }
.btn-block { width: 100%; }

/* ---------- Painel: barra lateral fixa no computador, gaveta no celular ---------- */
.app-page { --sidebar: 264px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
          height: 56px; padding: 0 12px; background: rgba(18, 18, 20, .96); border-bottom: 1px solid var(--border); }
.topbar-title { font-weight: 700; }
.menu-btn { width: 44px; height: 44px; border: 2px solid var(--border); border-radius: 8px; background: var(--inner);
            color: var(--text); font-size: 1.25rem; cursor: pointer; }
.backdrop { position: fixed; inset: 0; z-index: 29; background: rgba(0, 0, 0, .55); }
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 30;
  width: min(var(--sidebar), 86vw); overflow-y: auto;
  display: flex; flex-direction: column; gap: 22px;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  background: var(--card); border-right: 1px solid var(--border);
  transform: translateX(-100%); transition: transform .2s ease;
}
.sidebar.open { transform: none; }
@media (min-width: 860px) {
  .topbar, .backdrop { display: none; }
  .sidebar { width: var(--sidebar); transform: none; transition: none; }
  .content { margin-left: var(--sidebar); }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

.profile { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.avatar { position: relative; width: 96px; height: 96px; padding: 0; border-radius: 50%; overflow: hidden;
          border: 3px solid var(--accent); background: var(--inner); color: #fff; cursor: pointer;
          font: 700 2.5rem/1 system-ui, sans-serif; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-edit { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 0 5px; font-size: .9rem;
               background: rgba(0, 0, 0, .6); opacity: 0; transition: opacity .15s; }
.avatar:hover .avatar-edit, .avatar:focus-visible .avatar-edit { opacity: 1; }
@media (hover: none) { .avatar-edit { opacity: 1; } }
.profile-name { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px;
                font-size: 1.05rem; overflow-wrap: anywhere; }
.badge { padding: 2px 8px; border-radius: 6px; background: var(--gold); color: #1a1a1a;
         font-size: .6875rem; font-weight: 800; letter-spacing: .5px; }

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; border-radius: 10px;
            border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 700;
            text-align: left; text-decoration: none; cursor: pointer; }
.nav-item:hover, .nav-item.active { background: var(--inner); }
.nav-item:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: -2px; }
.nav-create { background: var(--accent); color: #fff; }
.nav-create:hover { background: var(--accent-hover); }

/* ---------- Conteúdo ---------- */
.content { padding: 20px 12px calc(32px + env(safe-area-inset-bottom)); }
.content > * { max-width: 1100px; }
.content h1 { margin: 0 0 16px; font-size: 1.5rem; }
.content .msg { margin-bottom: 12px; }
.warning { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; padding: 12px 14px;
           border: 1px solid var(--gold); border-radius: 10px; background: rgba(230, 180, 80, .1); font-size: .9rem; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
         margin: 8vh auto 0; padding: 32px 20px; max-width: 420px; background: var(--card); border-radius: var(--radius); }
.empty-icon { font-size: 3rem; }
.empty h2 { margin: 0; font-size: 1.25rem; }
.empty p { margin: 0 0 12px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.sheet-card { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px;
              background: var(--card); border-radius: var(--radius); border-top: 4px solid var(--cls); }
.sheet-card h2 { margin: 0; font-size: 1.125rem; overflow-wrap: anywhere; }
.sheet-nick { margin: 0; color: var(--muted); font-style: italic; font-size: .875rem; }
.sheet-nick:empty { display: none; }
.sheet-meta { margin: 4px 0 0; font-weight: 700; font-size: .9rem; color: var(--cls); }
.sheet-info { margin: 0; color: var(--muted); font-size: .8125rem; }
.sheet-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.sheet-actions .btn { padding: 0 6px; }

/* ---------- Modal de configurações ---------- */
.modal { width: min(440px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--border); border-radius: var(--radius);
         background: var(--card); color: var(--text); }
.modal::backdrop { background: rgba(0, 0, 0, .6); }
.modal form { padding: 20px 18px; }
.modal h2 { margin: 0 0 12px; color: var(--accent-hover); font-size: 1.25rem; }
.modal h3 { margin: 18px 0 10px; font-size: 1rem; }
.modal h3:first-of-type { margin-top: 0; }
.modal .msg { margin-bottom: 12px; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
