:root{
  --bg: #07070a;
  --panel: rgba(14, 16, 22, 0.88);
  --panel2: rgba(10, 12, 18, 0.92);

  --txt: #f3f5ff;
  --muted: rgba(243,245,255,0.72);
  --border: rgba(255,255,255,0.10);

  --gold: #caa64b;
  --danger: #ff4d4d;
  --ok: #2dd4bf;

  --radius: 18px;
  --shadow: 0 18px 60px rgba(0,0,0,0.55);
  --shadow2: 0 12px 36px rgba(0,0,0,0.45);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  color: var(--txt);
  background:
    radial-gradient(1200px 600px at 40% 0%, rgba(202,166,75,0.10), transparent 55%),
    radial-gradient(900px 500px at 80% 100%, rgba(243,245,255,0.06), transparent 60%),
    linear-gradient(180deg, #06060a, #0a0b12);
  overflow-x:hidden;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body::before,
body::after{
  content:"";
  position: fixed;
  width: 520px;
  height: 520px;
  filter: blur(55px);
  opacity: 0.55;
  pointer-events:none;
  z-index:0;
}
body::before{
  left:-180px;
  top:-200px;
  background: radial-gradient(circle, rgba(202,166,75,0.55), transparent 60%);
}
body::after{
  right:-220px;
  bottom:-240px;
  background: radial-gradient(circle, rgba(243,245,255,0.40), transparent 60%);
}

.app{
  position:relative;
  z-index:1;
  min-height: 100svh;
  display:flex;
  flex-direction:column;
}

/* NAV */
.nav{
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  background: rgba(8,10,14,0.70);
}

.nav-inner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display:flex;
  align-items:center;
  gap: 12px;
}

.brand{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 180px;
}

.badge{
  display:inline-flex;
  align-items:center;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  letter-spacing: .12em;
  font-weight: 800;
  font-size: 11px;
  color: var(--txt);
  background: rgba(0,0,0,0.18);
  flex: 0 0 auto;
}

.brand-title{
  display:flex;
  flex-direction:column;
  line-height:1.1;
}
.brand-title strong{
  font-weight: 900;
  font-size: 14px;
}
.brand-title span{
  color: var(--muted);
  font-size: 12px;
}

.nav-toggle{
  margin-left:auto;
  display:none;
  border:1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.18);
  color: var(--txt);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 800;
  cursor:pointer;
}

.menu{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap: 8px;
}

.menu a{
  color: rgba(243,245,255,0.82);
  text-decoration:none;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.menu a:hover{
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
}
.menu a.active{
  color: var(--txt);
  border-color: rgba(202,166,75,0.55);
  background: rgba(202,166,75,0.10);
}

/* CONTENT */
.container{
  max-width: 1100px;
  width:100%;
  margin: 0 auto;
  padding: 18px 16px 28px;
}

.panel{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow2);
  overflow:hidden;
  backdrop-filter: blur(10px);
}

.panel-header{
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
}
.panel-header h1{
  margin:0;
  font-size: 22px;
  letter-spacing:-.01em;
  font-weight: 900;
}
.panel-header p{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.panel-body{
  padding: 18px;
}

/* Cards grid */
.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.card{
  grid-column: span 6;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  background: rgba(0,0,0,0.22);
  padding: 14px;
}
.card h3{
  margin:0;
  font-size: 15px;
  font-weight: 900;
}
.card p{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.card a{
  display:inline-flex;
  margin-top: 10px;
  text-decoration:none;
  color: var(--txt);
  border: 1px solid rgba(202,166,75,0.55);
  background: rgba(202,166,75,0.10);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 900;
}

/* Auth loading overlay (evita flash de conteúdo) */
.auth-loading{
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-loading .box{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(10,10,10,.65);
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  color: rgba(255,255,255,.9);
  font-weight: 700;
  font-size: 13px;
}

.auth-loading .spinner{
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.18);
  border-top-color: rgba(202,166,75,.95);
  animation: spin .9s linear infinite;
}

@keyframes spin{
  to { transform: rotate(360deg); }
}

html.auth-pending body > *{
  visibility: hidden;
}
html.auth-pending .auth-loading{
  visibility: visible;
}

@media (max-width: 820px){
  .grid{ grid-template-columns: repeat(6, 1fr); }
  .card{ grid-column: span 6; }
}

@media (max-width: 720px){
  .nav-toggle{ display:inline-flex; }
  .menu{
    position:absolute;
    left: 12px;
    right: 12px;
    top: 60px;
    display:none;
    flex-direction:column;
    align-items:stretch;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(8,10,14,0.92);
    box-shadow: var(--shadow2);
  }
  .menu.open{ display:flex; }
  .menu a{ width:100%; }
}