/* Portal Método Torque — app shell */
:root {
  --bg: #121016;
  --panel: #1b1822;
  --panel-2: #221e2b;
  --line: #2e2a38;
  --text: #e8e5f0;
  --muted: #a09aae;
  --muted-2: #6e6a78;
  --accent: #7c3aed;
  --accent-2: #a78bfa;
  --ok: #22c55e;
  --sidebar-w: 300px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Archivo", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.brand-dash { display: inline-block; width: 28px; height: 3px; background: var(--accent); vertical-align: middle; }

/* ---------- cadastro / código de acesso ---------- */
#gate {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow-y: auto;
}
body.gated .layout, body.gated .topbar { filter: blur(3px); pointer-events: none; user-select: none; }
.gate-card {
  width: 100%; max-width: 420px;
  background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--accent);
  padding: 34px 32px; text-align: center;
}
.gate-logo { width: 210px; max-width: 80%; margin-bottom: 18px; }
.gate-card h1 { margin: 0; font-size: 26px; font-weight: 800; color: #fff; }
.gate-card > p { margin: 12px 0 22px; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.gate-card form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.campo-gate label { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; color: var(--muted); margin-bottom: 5px; }
.campo-gate input {
  width: 100%; padding: 12px 14px; box-sizing: border-box;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); font-family: inherit; font-size: 15px;
}
.campo-gate input:focus { outline: none; border-color: var(--accent); }
.gate-erro { margin: 0; font-size: 13.5px; color: #f87171; background: rgba(220,38,38,.1); border: 1px solid rgba(220,38,38,.35); padding: 10px 12px; }
.gate-abas { display: flex; margin: 16px 0 4px; border: 1px solid var(--line); }
.gate-abas button {
  flex: 1; padding: 11px; font-family: inherit; font-size: 14px; font-weight: 700;
  background: none; border: none; color: var(--muted); cursor: pointer;
}
.gate-abas button.ativa { background: var(--accent); color: #fff; }
.gate-link { background: none; border: none; color: var(--accent-2); font-family: inherit; font-size: 12.5px; cursor: pointer; text-decoration: underline; padding: 4px; }
.gate-ok { margin: 0; font-size: 13.5px; color: #4ade80; background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.35); padding: 10px 12px; }
.sync-chip { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: #4ade80; }

/* painel equipe da academia */
#dlgEquipeAcad { border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 0; max-width: min(560px, 94vw); }
#dlgEquipeAcad::backdrop { background: rgba(18, 16, 22, .7); }
.equipe-card { padding: 26px 28px; }
.equipe-card h2 { margin: 0 0 6px; font-size: 20px; color: #fff; }
.eqa-intro { margin: 0 0 14px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.eqa-codigo {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bg); border: 1px dashed var(--accent);
  padding: 14px 18px; margin-bottom: 18px;
}
.eqa-codigo strong { font-size: 26px; letter-spacing: .35em; color: var(--accent-2); }
.btn-eqa {
  padding: 8px 14px; font-family: inherit; font-size: 12px; font-weight: 700;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
}
.eqa-tabela { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.eqa-tabela th { text-align: left; font-size: 11px; letter-spacing: .1em; color: var(--muted-2); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.eqa-tabela td { padding: 8px; border-bottom: 1px solid var(--line); color: var(--muted); }
.eqa-tabela td:first-child { color: var(--text); font-weight: 600; }
.eqa-remover { background: none; border: 1px solid rgba(220,38,38,.5); color: #f87171; font-size: 11px; padding: 4px 8px; cursor: pointer; font-family: inherit; }
.gate-card small { display: block; margin-top: 18px; font-size: 12px; color: var(--muted-2); line-height: 1.5; }

.side-perfil {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 12px; font-size: 12.5px; color: var(--muted);
}
.side-perfil span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-perfil button {
  flex: none; padding: 5px 10px; font-family: inherit; font-size: 11px; font-weight: 600;
  background: none; border: 1px solid var(--line); color: var(--muted); cursor: pointer;
}
.side-perfil button:hover { border-color: var(--accent); color: var(--text); }

/* ---------- top bar (mobile) ---------- */
.topbar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  height: var(--topbar-h);
  align-items: center; gap: 12px;
  padding: 0 14px;
  background: rgba(18, 16, 22, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.topbar-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .18em; color: var(--accent-2);
  text-decoration: none; white-space: nowrap;
}
.topbar-doc {
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: none;
  background: none; border: 1px solid var(--line); color: var(--text);
  cursor: pointer;
}

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.side-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 18px 14px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.side-brand strong { display: block; font-size: 13px; letter-spacing: .16em; color: #fff; }
.side-brand small { display: block; font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }

.side-search { padding: 12px 14px 4px; }
.side-search input {
  width: 100%; padding: 9px 12px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 0;
  font-family: inherit; font-size: 13.5px;
}
.side-search input:focus { outline: none; border-color: var(--accent); }

.side-scroll { flex: 1; overflow-y: auto; padding: 8px 10px 12px; scrollbar-width: thin; }

.nav-group { margin-top: 14px; }
.nav-group-label {
  display: block; padding: 0 8px 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .18em; color: var(--muted-2);
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px; margin: 1px 0;
  font-size: 13.5px; color: var(--muted);
  text-decoration: none; border-left: 2px solid transparent;
}
.nav-item:hover { color: var(--text); background: var(--panel-2); }
.nav-item.active { color: #fff; background: var(--panel-2); border-left-color: var(--accent); }
.nav-item .n {
  flex: none; width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: var(--accent-2);
  background: rgba(124, 58, 237, .14); border: 1px solid rgba(124, 58, 237, .35);
}
.nav-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .check { flex: none; font-size: 12px; color: var(--ok); visibility: hidden; }
.nav-item.done .check { visibility: visible; }
.nav-item .tag {
  flex: none; font-size: 9.5px; font-weight: 700; letter-spacing: .08em;
  color: var(--accent-2); border: 1px solid rgba(124, 58, 237, .4);
  padding: 1px 5px;
}
.nav-empty { padding: 12px 8px; font-size: 13px; color: var(--muted-2); }

.side-foot { border-top: 1px solid var(--line); padding: 14px 16px; }
.side-progress-label {
  display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--muted);
  margin-bottom: 8px;
}
.bar { height: 6px; background: var(--bg); border: 1px solid var(--line); }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s; }

.scrim {
  display: none;
  position: fixed; inset: 0; z-index: 45;
  background: rgba(0, 0, 0, .55);
}

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

/* ---------- home ---------- */
.hero { text-align: center; padding: 88px 32px 72px; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 14px;
  font-size: 13px; font-weight: 700; letter-spacing: .22em; color: var(--accent-2);
}
.hero h1 {
  margin: 26px auto 0; max-width: 820px;
  font-size: clamp(34px, 5vw, 58px); line-height: 1.08; font-weight: 800; letter-spacing: -.015em; color: #fff;
}
.hero p { margin: 22px auto 0; max-width: 680px; font-size: 18px; line-height: 1.6; color: #c9c5d4; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 38px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 15px 32px;
  font-family: inherit; font-size: 16px; font-weight: 700; letter-spacing: .02em;
  text-decoration: none; cursor: pointer; border: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #6d28d9; }
.btn-ghost { background: none; border: 1.5px solid #3a3644; color: var(--text); font-weight: 600; }
.btn-ghost:hover { border-color: var(--accent); color: #fff; }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-done { background: none; border: 1.5px solid var(--ok); color: var(--ok); font-weight: 600; }
.btn-done:hover { background: rgba(34, 197, 94, .12); }
.btn-done.is-done { background: var(--ok); color: #0b1409; }

.home-body { max-width: 1120px; width: 100%; margin: 0 auto; padding: 0 28px 60px; }

.resume-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  padding: 18px 22px; margin-bottom: 8px;
}
.resume-kicker { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .18em; color: var(--accent-2); margin-bottom: 4px; }
.resume-card strong { font-size: 16px; color: #fff; }

.home-sec { margin-top: 56px; }
.sec-kicker { font-size: 12px; font-weight: 700; letter-spacing: .2em; color: var(--accent-2); }
.home-sec h2 { margin: 10px 0 26px; font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.01em; color: #fff; }

.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.mod-card {
  background: var(--panel); border: 1px solid var(--line);
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.mod-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mod-card-top .num { font-size: 24px; font-weight: 800; color: var(--accent-2); }
.mod-card-top .st { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted-2); }
.mod-card-top .st.done { color: var(--ok); }
.mod-card h3 { margin: 0; font-size: 16.5px; font-weight: 700; color: #fff; line-height: 1.35; }
.mod-mats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.mat-chip {
  font-size: 12px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line); background: var(--bg);
  padding: 5px 10px; text-decoration: none;
}
.mat-chip:hover { border-color: var(--accent); color: #fff; }
.mat-chip.primary { color: var(--accent-2); border-color: rgba(124, 58, 237, .45); }
.mat-chip.done-chip { color: var(--ok); border-color: rgba(34, 197, 94, .4); }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tool-card {
  background: var(--panel); border: 1px solid var(--line);
  padding: 20px 22px; text-decoration: none;
  display: flex; flex-direction: column; gap: 8px;
}
.tool-card:hover { border-color: var(--accent); }
.tool-card .tk { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; color: var(--accent-2); }
.tool-card h3 { margin: 0; font-size: 16px; font-weight: 700; color: #fff; }
.tool-card p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); }

.app-card { border-left: 3px solid var(--accent); }
.app-ico { font-size: 26px; line-height: 1; }

.side-backup { display: flex; gap: 8px; margin-top: 12px; }
.side-backup button {
  flex: 1; padding: 7px 6px; font-family: inherit; font-size: 11.5px; font-weight: 600;
  background: none; border: 1px solid var(--line); color: var(--muted); cursor: pointer;
}
.side-backup button:hover { border-color: var(--accent); color: var(--text); }

.home-foot {
  margin-top: 72px; padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted-2); text-align: center;
}

/* ---------- viewer ---------- */
.viewer { flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.viewer-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 12px 18px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.viewer-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.viewer-badge {
  flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  color: var(--accent-2); border: 1px solid rgba(124, 58, 237, .45);
  padding: 3px 8px; white-space: nowrap;
}
.viewer-title { font-size: 15px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#docFrame { flex: 1; width: 100%; border: 0; background: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .topbar { display: flex; }
  .sidebar { transform: translateX(-102%); transition: transform .25s ease; box-shadow: 8px 0 30px rgba(0, 0, 0, .5); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { display: block; }
  .main { margin-left: 0; padding-top: var(--topbar-h); }
  .viewer { min-height: calc(100vh - var(--topbar-h)); }
  .hero { padding: 56px 22px 48px; }
  .home-body { padding: 0 18px 48px; }
  .viewer-bar { padding: 10px 12px; }
}
