/* ============================================================
   NEXUS HUB — Portal do Projeto. Design system.
   Marca: roxo/lilas #9f68bb sobre preto arroxeado. Titulos condensados
   caixa-alta (Oswald), slogans em script (Caveat), corpo Inter, numeros mono.
   ============================================================ */
:root {
  /* --- marca --- */
  --brand:        #9f68bb;   /* roxo/lilas acento */
  --brand-2:      #7d4f9e;   /* roxo mais fundo */
  --brand-3:      #c9a6df;   /* lilas claro (hover/realce) */
  --brand-soft:   rgba(159,104,187,.14);
  --brand-line:   rgba(159,104,187,.30);

  /* --- fundos escuros --- */
  --bg:           #0c0b13;   /* preto arroxeado (base) */
  --bg-2:         #100a16;   /* painel */
  --bg-3:         #17111f;   /* card elevado */
  --bg-4:         #1e1729;   /* hover de card */
  --stroke:       rgba(232,226,214,.10);
  --stroke-2:     rgba(232,226,214,.16);

  /* --- claro (secoes bege) --- */
  --cream:        #e8e2d6;   /* off-white bege */
  --cream-2:      #f2eee6;
  --ink:          #171219;   /* texto sobre bege */

  /* --- texto sobre escuro --- */
  --text:         #ece8f2;
  --text-dim:     #a59fb4;
  --text-faint:   #726c82;

  /* --- fontes --- */
  --f-display: "Oswald", "Archivo Narrow", system-ui, sans-serif;
  --f-script:  "Caveat", "Dancing Script", cursive;
  --f-body:    "Inter", system-ui, -apple-system, sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, monospace;

  --radius:   14px;
  --radius-s: 10px;
  --shadow:   0 18px 50px -20px rgba(0,0,0,.7);
  --sidebar-w: 300px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--brand); color: #fff; }

/* scrollbar sutil */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2136; border-radius: 20px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #372a48; }

/* ---------- helpers tipograficos ---------- */
.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--brand-3);
}
.script { font-family: var(--f-script); }
.mono { font-family: var(--f-mono); }
.display { font-family: var(--f-display); text-transform: uppercase; letter-spacing: .01em; font-weight: 600; }

/* ============================================================
   LOGIN — split: capa executiva (esq) + card (dir)
   ============================================================ */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
}
.auth-cover {
  position: relative;
  padding: 56px 60px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(120% 90% at 18% 8%, rgba(159,104,187,.22), transparent 55%),
    linear-gradient(160deg, #140d1d 0%, #0c0b13 62%);
  overflow: hidden;
  border-right: 1px solid var(--stroke);
}
.auth-cover::after {
  /* textura de pontos sutil */
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .5; pointer-events: none;
}
.auth-cover > * { position: relative; z-index: 1; }
.brand-lockup { display: flex; align-items: center; gap: 14px; }
.brand-lockup img { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(159,104,187,.4)); }
.brand-lockup .wm { display: flex; flex-direction: column; line-height: 1; }
.brand-lockup .wm b { font-family: var(--f-display); font-weight: 700; font-size: 26px; letter-spacing: .03em; }
.brand-lockup .wm b span { color: var(--brand); }
.brand-lockup .wm small { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .32em; color: var(--text-dim); margin-top: 5px; text-transform: uppercase; }

.auth-pitch { max-width: 460px; }
.auth-pitch .slogan { font-family: var(--f-script); font-size: 46px; color: var(--brand-3); line-height: .95; margin: 0 0 8px; }
.auth-pitch h1 { font-family: var(--f-display); font-weight: 600; text-transform: uppercase; font-size: 40px; line-height: 1.03; margin: 6px 0 18px; letter-spacing: .01em; }
.auth-pitch h1 em { font-style: normal; color: var(--brand); }
.auth-pitch p { color: var(--text-dim); font-size: 15px; max-width: 420px; }

.pillars { display: flex; flex-direction: column; gap: 2px; margin-top: 26px; }
.pillar { display: flex; align-items: baseline; gap: 16px; padding: 13px 0; border-top: 1px solid var(--stroke); }
.pillar:last-child { border-bottom: 1px solid var(--stroke); }
.pillar .n { font-family: var(--f-mono); font-size: 13px; color: var(--brand); min-width: 26px; }
.pillar .t { font-family: var(--f-display); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; font-size: 16px; }
.pillar .d { color: var(--text-faint); font-size: 13px; margin-left: auto; }

.auth-foot { font-family: var(--f-mono); font-size: 11px; color: var(--text-faint); letter-spacing: .06em; }
.auth-foot b { color: var(--text-dim); font-weight: 500; }

/* card direito */
.auth-main {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; background: var(--bg-2);
}
.auth-card { width: 100%; max-width: 380px; }
.auth-card .kicker { font-family: var(--f-mono); font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--brand-3); }
.auth-card h2 { font-family: var(--f-display); font-weight: 600; text-transform: uppercase; font-size: 30px; margin: 10px 0 4px; letter-spacing: .01em; }
.auth-card .lede { color: var(--text-dim); font-size: 14px; margin: 0 0 26px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 7px; font-family: var(--f-mono); letter-spacing: .04em; text-transform: uppercase; }
.field input {
  width: 100%; padding: 13px 15px; border-radius: var(--radius-s);
  background: #0b0910; border: 1px solid var(--stroke-2); color: var(--text);
  font-size: 15px; font-family: var(--f-body); transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.btn-primary {
  width: 100%; padding: 14px; border: none; border-radius: var(--radius-s); cursor: pointer;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-family: var(--f-display); text-transform: uppercase; letter-spacing: .08em;
  font-weight: 600; font-size: 15px; transition: transform .12s, box-shadow .2s, opacity .2s;
  box-shadow: 0 12px 26px -10px rgba(159,104,187,.6);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 32px -10px rgba(159,104,187,.75); }
.btn-primary:disabled { opacity: .6; cursor: default; transform: none; }
.auth-msg { display: none; margin-bottom: 16px; padding: 11px 14px; border-radius: var(--radius-s); font-size: 13.5px; }
.auth-msg.show { display: block; }
.auth-msg.error { background: rgba(220,80,90,.12); border: 1px solid rgba(220,80,90,.4); color: #f2b8bd; }
.auth-hint { margin-top: 22px; padding: 13px 15px; border: 1px dashed var(--brand-line); border-radius: var(--radius-s); font-size: 12.5px; color: var(--text-dim); background: var(--brand-soft); }
.auth-hint b { color: var(--brand-3); font-family: var(--f-mono); }

/* ============================================================
   SHELL DO APP — sidebar numerada + conteudo
   ============================================================ */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, #120b1b, #0b0911);
  border-right: 1px solid var(--stroke);
  display: flex; flex-direction: column;
  padding: 26px 20px 20px;
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; border-bottom: 1px solid var(--stroke); }
.side-brand img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 3px 9px rgba(159,104,187,.45)); }
.side-brand .wm { line-height: 1; }
.side-brand .wm b { font-family: var(--f-display); font-weight: 700; font-size: 21px; letter-spacing: .03em; display: block; }
.side-brand .wm b span { color: var(--brand); }
.side-brand .wm small { font-family: var(--f-mono); font-size: 8px; letter-spacing: .28em; color: var(--text-faint); text-transform: uppercase; }

.side-slogan { font-family: var(--f-script); font-size: 22px; color: var(--brand-3); padding: 16px 8px 6px; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 13px; padding: 11px 12px; border-radius: var(--radius-s);
  cursor: pointer; color: var(--text-dim); transition: background .14s, color .14s;
  border: 1px solid transparent;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: #fff; border-color: var(--brand-line); }
.nav-item .idx { font-family: var(--f-mono); font-size: 12px; color: var(--brand); min-width: 22px; }
.nav-item.active .idx { color: var(--brand-3); }
.nav-item .lbl { font-family: var(--f-display); text-transform: uppercase; letter-spacing: .045em; font-weight: 500; font-size: 14px; }
.nav-item .ico { margin-left: auto; opacity: .5; }
.nav-item.active .ico { opacity: 1; }
.nav-item svg { width: 17px; height: 17px; stroke-width: 1.7; }

.side-foot { padding: 16px 10px 6px; border-top: 1px solid var(--stroke); margin-top: 10px; }
.side-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-dim); }
.side-user .av { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; color: #fff; font-size: 13px; }
.side-user .who b { display: block; color: var(--text); font-size: 13px; }
.side-user .who small { font-family: var(--f-mono); font-size: 10px; color: var(--text-faint); }
.logout { margin-top: 12px; width: 100%; padding: 9px; background: transparent; border: 1px solid var(--stroke-2); border-radius: var(--radius-s); color: var(--text-dim); font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; transition: .15s; }
.logout:hover { border-color: var(--brand-line); color: var(--brand-3); }

/* ---------- area de conteudo ---------- */
.content { min-height: 100vh; }
.section { display: none; animation: fade .35s ease; }
.section.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* cabecalho de secao */
.sec-head { padding: 46px 56px 24px; border-bottom: 1px solid var(--stroke); position: relative; }
.sec-head .sec-idx { font-family: var(--f-mono); font-size: 12px; color: var(--brand); letter-spacing: .2em; }
.sec-head h1 { font-family: var(--f-display); text-transform: uppercase; font-weight: 600; font-size: 42px; line-height: 1.02; margin: 8px 0 10px; letter-spacing: .005em; }
.sec-head h1 em { font-style: normal; color: var(--brand); }
.sec-head .sub { color: var(--text-dim); font-size: 15px; max-width: 680px; }
.sec-body { padding: 34px 56px 80px; }

/* utilitarios de layout */
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.sep { color: var(--brand); margin: 0 8px; }

/* cards genericos escuros */
.card { background: var(--bg-3); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 22px; transition: border-color .15s, background .15s, transform .15s; }
.card:hover { border-color: var(--brand-line); background: var(--bg-4); }
.card h3 { font-family: var(--f-display); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; font-size: 18px; margin: 0 0 8px; }
.card p { color: var(--text-dim); font-size: 14px; margin: 0; }
.card .ico-wrap { width: 42px; height: 42px; border-radius: 11px; background: var(--brand-soft); border: 1px solid var(--brand-line); display: grid; place-items: center; color: var(--brand-3); margin-bottom: 14px; }
.card .ico-wrap svg { width: 20px; height: 20px; }

/* stat / numero grande */
.stat { }
.stat .num { font-family: var(--f-mono); font-weight: 700; font-size: 34px; color: var(--brand-3); line-height: 1; }
.stat .lbl { font-size: 12.5px; color: var(--text-dim); margin-top: 6px; }

/* figura com legenda */
figure.fig { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--stroke); background: var(--bg-2); }
figure.fig img { width: 100%; height: auto; display: block; }
figure.fig figcaption { padding: 12px 16px; font-size: 12.5px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--stroke); }
figure.fig figcaption .tag { font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }

/* chip / badge */
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); border: 1px solid var(--brand-line); font-size: 12px; color: var(--brand-3); font-family: var(--f-mono); letter-spacing: .04em; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }

/* bloco bege (partido claro) */
.cream-block { background: var(--cream); color: var(--ink); border-radius: var(--radius); padding: 34px 36px; }
.cream-block h3 { font-family: var(--f-display); text-transform: uppercase; color: var(--ink); font-weight: 700; }
.cream-block p { color: #4a4150; }
.cream-block .script { color: var(--brand-2); }

/* lista de ambientes */
.amb { display: flex; gap: 18px; padding: 20px; border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--bg-3); transition: .15s; }
.amb:hover { border-color: var(--brand-line); }
.amb .badge { flex-shrink: 0; width: 54px; height: 54px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); border: 1px solid var(--brand-line); color: var(--brand-3); }
.amb .badge svg { width: 24px; height: 24px; }
.amb h4 { margin: 0 0 4px; font-family: var(--f-display); text-transform: uppercase; letter-spacing: .04em; font-size: 16px; }
.amb .area { font-family: var(--f-mono); font-size: 12px; color: var(--brand); }
.amb p { margin: 6px 0 0; font-size: 13.5px; color: var(--text-dim); }

/* setor colorido */
.setor { border-radius: var(--radius); padding: 18px 20px; border: 1px solid var(--stroke); position: relative; overflow: hidden; }
.setor::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--sc, var(--brand)); }
.setor h4 { margin: 0 0 4px; font-family: var(--f-display); text-transform: uppercase; font-size: 15px; letter-spacing: .05em; }
.setor .m2 { font-family: var(--f-mono); font-size: 11px; color: var(--sc, var(--brand)); }
.setor p { margin: 6px 0 0; font-size: 13px; color: var(--text-dim); }

/* fluxograma */
.flux { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 24px; background: var(--bg-2); border: 1px solid var(--stroke); border-radius: var(--radius); }
.flux .node { padding: 12px 18px; border-radius: 10px; background: var(--brand-soft); border: 1px solid var(--brand-line); font-family: var(--f-display); text-transform: uppercase; font-size: 13px; letter-spacing: .05em; color: var(--brand-3); }
.flux .arw { color: var(--text-faint); font-size: 18px; }

/* material swatch */
.mat { border-radius: var(--radius-s); overflow: hidden; border: 1px solid var(--stroke); background: var(--bg-3); }
.mat .sw { height: 70px; }
.mat .nm { padding: 10px 12px; font-size: 12px; color: var(--text); font-family: var(--f-mono); letter-spacing: .02em; }
.mat .nm small { display: block; color: var(--text-faint); font-size: 10px; margin-top: 2px; letter-spacing: .04em; }

/* galeria */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.shot { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--stroke); cursor: zoom-in; background: var(--bg-2); }
.shot img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16/10; transition: transform .5s; }
.shot:hover img { transform: scale(1.04); }
.shot .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px; background: linear-gradient(transparent, rgba(8,6,12,.92)); }
.shot .cap b { font-family: var(--f-display); text-transform: uppercase; letter-spacing: .05em; font-size: 16px; display: block; }
.shot .cap small { font-size: 12px; color: var(--text-dim); }

/* pranchas tecnicas */
.tec-list { display: flex; flex-direction: column; gap: 14px; }
.tec-row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--bg-3); cursor: pointer; transition: .15s; }
.tec-row:hover { border-color: var(--brand-line); background: var(--bg-4); }
.tec-row .fol { font-family: var(--f-mono); font-size: 12px; color: var(--brand); min-width: 46px; }
.tec-row .tt { font-family: var(--f-display); text-transform: uppercase; letter-spacing: .04em; font-size: 15px; flex: 1; }
.tec-row .esc { font-family: var(--f-mono); font-size: 11px; color: var(--text-faint); }
.tec-row .go { color: var(--text-faint); }
.tec-row:hover .go { color: var(--brand-3); }

/* painel A2 */
.painel-wrap { border: 1px solid var(--stroke); border-radius: var(--radius); overflow: hidden; background: #08060c; cursor: zoom-in; }
.painel-wrap img { width: 100%; height: auto; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(6,4,10,.94); display: none; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; backdrop-filter: blur(4px); }
.lightbox.show { display: flex; }
.lightbox img { max-width: 96vw; max-height: 92vh; object-fit: contain; border-radius: 8px; box-shadow: var(--shadow); cursor: default; }
.lightbox .lb-close { position: absolute; top: 22px; right: 26px; width: 42px; height: 42px; border-radius: 50%; background: var(--bg-3); border: 1px solid var(--stroke-2); color: var(--text); display: grid; place-items: center; cursor: pointer; font-size: 20px; }
.lightbox .lb-close:hover { border-color: var(--brand-line); color: var(--brand-3); }
.lightbox .lb-cap { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); font-family: var(--f-mono); font-size: 12px; color: var(--text-dim); letter-spacing: .06em; }

/* hero home */
.hero { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--stroke); margin-bottom: 30px; }
.hero img { width: 100%; height: 460px; object-fit: cover; }
.hero .veil { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,7,15,.92) 0%, rgba(10,7,15,.55) 45%, rgba(10,7,15,.15) 100%); }
.hero .hc { position: absolute; left: 44px; bottom: 40px; right: 44px; }
.hero .hc .slogan { font-family: var(--f-script); font-size: 40px; color: var(--brand-3); line-height: 1; }
.hero .hc h2 { font-family: var(--f-display); text-transform: uppercase; font-weight: 600; font-size: 46px; margin: 6px 0 10px; line-height: 1; max-width: 660px; }
.hero .hc h2 em { font-style: normal; color: var(--brand); }
.hero .hc p { max-width: 560px; color: var(--text-dim); font-size: 15px; }

/* faixa de metricas */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--stroke); border: 1px solid var(--stroke); border-radius: var(--radius); overflow: hidden; margin: 26px 0; }
.metrics .m { background: var(--bg-2); padding: 22px; }
.metrics .m .num { font-family: var(--f-mono); font-weight: 700; font-size: 30px; color: var(--brand-3); }
.metrics .m .lbl { font-size: 12px; color: var(--text-dim); margin-top: 5px; }

/* prose */
.prose p { color: var(--text-dim); font-size: 15px; max-width: 760px; margin: 0 0 16px; }
.prose h3 { font-family: var(--f-display); text-transform: uppercase; letter-spacing: .04em; font-size: 20px; margin: 30px 0 12px; }
.prose strong { color: var(--text); }

.block-title { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; }
.block-title .ln { flex: 1; height: 1px; background: var(--stroke); }
.block-title h2 { font-family: var(--f-display); text-transform: uppercase; letter-spacing: .05em; font-size: 15px; color: var(--text-dim); margin: 0; }

/* responsivo */
@media (max-width: 1080px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; width: 84vw; max-width: 320px; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .mobile-bar { display: flex !important; }
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: repeat(2, 1fr); }
  .auth { grid-template-columns: 1fr; }
  .auth-cover { display: none; }
}
@media (max-width: 680px) {
  .sec-head, .sec-body { padding-left: 22px; padding-right: 22px; }
  .g2, .g3, .g4, .gallery { grid-template-columns: 1fr; }
  .sec-head h1 { font-size: 32px; }
  .hero img { height: 340px; }
  .hero .hc h2 { font-size: 32px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}
.mobile-bar { display: none; position: sticky; top: 0; z-index: 40; align-items: center; gap: 12px; padding: 14px 18px; background: var(--bg-2); border-bottom: 1px solid var(--stroke); }
.mobile-bar button { background: var(--bg-3); border: 1px solid var(--stroke-2); color: var(--text); border-radius: 9px; padding: 8px 11px; cursor: pointer; }
.mobile-bar .mb-brand { font-family: var(--f-display); text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }
.mobile-bar .mb-brand span { color: var(--brand); }
.scrim { display: none; position: fixed; inset: 0; background: rgba(4,3,8,.6); z-index: 55; }
.scrim.show { display: block; }
