/* OSINT Gov — tema dark */
:root {
    --bg: #0a0e14;
    --bg2: #0d1117;
    --panel: #11161d;
    --border: #1f2733;
    --fg: #d5dde8;
    --muted: #7d8a9c;
    --accent: #ff2d55;
    --green: #2ea86e;
    --blue: #3b82f6;
}
* { box-sizing: border-box; }
body { font-family: system-ui, "Segoe UI", sans-serif; margin: 0; background: var(--bg); color: var(--fg); }
h1 { font-size: 1.35rem; letter-spacing: .5px; }
h2 { font-size: 1.05rem; margin-top: 2rem; color: #aeb9c8; text-transform: uppercase; letter-spacing: 1px; }
h3 { font-size: .9rem; color: var(--muted); }
a { color: #6ea8fe; }

nav {
    background: linear-gradient(90deg, #0d1420, #11161d);
    border-bottom: 1px solid var(--border);
    display: flex; gap: 1.1rem; align-items: center;
    padding: .7rem 1.4rem; position: sticky; top: 0; z-index: 10;
}
nav strong { color: var(--accent); letter-spacing: 1.5px; text-transform: uppercase; font-size: .95rem; }
nav strong::after { content: " //"; color: var(--muted); }
nav a { color: var(--muted); text-decoration: none; font-size: .85rem; text-transform: uppercase; letter-spacing: 1px; }
nav a:hover { color: var(--fg); }
nav .spacer { flex: 1; }

main { max-width: 1250px; margin: 1.4rem auto; padding: 0 1rem; }

/* --- Layout sidebar --- */
body.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 215px; flex-shrink: 0; display: flex; flex-direction: column;
    background: #0b0f16; border-right: 1px solid var(--border);
    padding: 1rem .7rem; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; gap: .7rem; align-items: center; padding: .3rem .5rem 1.1rem; }
.sidebar .logo {
    width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
    background: var(--accent); color: #fff; font-size: 1.1rem;
}
.sidebar .brand b { color: var(--fg); font-size: .95rem; }
.sidebar .brand small { color: var(--muted); font-size: .68rem; }
.menu-label { font-size: .62rem; color: #4d596b; letter-spacing: 2px; padding: .6rem .7rem .4rem; }
.sidebar .mi {
    display: flex; align-items: center; gap: .65rem;
    color: var(--muted); text-decoration: none; font-size: .85rem;
    padding: .55rem .7rem; border-radius: 7px; margin-bottom: 2px;
}
.sidebar .mi:hover { background: #151c26; color: var(--fg); }
.sidebar .mi.on { background: #1a2230; color: var(--fg); border-left: 3px solid var(--accent); }
.sidebar .mi .ic { width: 18px; text-align: center; opacity: .8; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: .5rem; }
.content { flex: 1; min-width: 0; }
.content main { max-width: 1200px; }

table { width: 100%; border-collapse: collapse; background: var(--panel); font-size: .85rem; }
th, td { padding: .45rem .7rem; border-bottom: 1px solid var(--border); text-align: left; }
th { background: #151c26; color: var(--muted); text-transform: uppercase; font-size: .68rem; letter-spacing: 1px; }
tr:hover td { background: #151c26; }

.cards { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1rem 0; }
.card {
    background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
    padding: .8rem 1.2rem; min-width: 135px; border-top: 3px solid var(--muted);
}
.card .n { font-size: 1.7rem; font-weight: 700; font-family: "Consolas", monospace; }
.card .lbl { text-transform: uppercase; font-size: .68rem; color: var(--muted); letter-spacing: 1px; }
.card .regs { font-size: .72rem; color: #566274; }
.st-pendente { border-top-color: #8b949e; }
.st-baixando, .st-importando { border-top-color: var(--blue); }
.st-concluido { border-top-color: var(--green); }
.st-erro { border-top-color: var(--accent); }
tr.st-erro td.erro { color: #f0716f; }

.acoes { margin: .9rem 0; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.btn, button {
    background: #1a2230; color: var(--fg); border: 1px solid var(--border); border-radius: 6px;
    padding: .5rem 1rem; cursor: pointer; text-decoration: none; font-size: .85rem;
}
.btn:hover, button:hover { border-color: var(--blue); color: #fff; }
.btn-go { background: #0d3325 !important; border-color: #14532d !important; color: #4ade80 !important; }
.btn-go:hover { border-color: #4ade80 !important; }
.btn-stop { background: #3d1518 !important; border-color: #7f1d1d !important; color: #f87171 !important; }
.btn-stop:hover { border-color: #f87171 !important; }

.alert { background: #3d1518; border: 1px solid #7f1d1d; color: #f87171; padding: .6rem .9rem; border-radius: 6px; margin-bottom: 1rem; font-size: .85rem; }
.alert.ok { background: #0d3325; border-color: #14532d; color: #4ade80; }
.small { font-size: .75rem; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: var(--panel); border: 1px solid var(--border); padding: 2rem; border-radius: 10px; width: 340px; box-shadow: 0 8px 40px rgba(0,0,0,.6); }
.login-box h1 { margin: 0 0 .2rem; color: var(--accent); letter-spacing: 2px; }
.login-box .sub { color: var(--muted); font-size: .8rem; margin-bottom: 1.2rem; }
.login-box label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .9rem; }
.login-box input { width: 100%; padding: .55rem; border: 1px solid var(--border); border-radius: 6px; margin-top: .25rem; background: var(--bg2); color: var(--fg); }
.login-box input:focus { outline: none; border-color: var(--blue); }
.login-box button { width: 100%; background: var(--accent); border: 0; color: #fff; font-weight: 600; }
.login-box button:hover { filter: brightness(1.15); }

/* Busca / grafo */
.busca { display: flex; gap: .6rem; margin-bottom: .2rem; }
.busca input { flex: 1; padding: .65rem .9rem; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--fg); font-size: .95rem; }
.busca input:focus { outline: none; border-color: var(--accent); }
.busca button { background: var(--accent); color: #fff; border: 0; font-weight: 600; padding: .65rem 1.4rem; }

.tabs { display:flex; align-items:center; gap:0; background:var(--bg2); border:1px solid var(--border); border-radius:8px 8px 0 0; overflow:hidden; margin-top:1rem; }
.tab { background:transparent; color:var(--muted); border:0; border-radius:0; padding:.7rem 1.4rem; font-size:.82rem; }
.tab.active { color:#fff; box-shadow:inset 0 -2px 0 var(--accent); }
.tabs .spacer { flex:1; }
.conexoes { color:var(--green); font-size:.78rem; padding-right:1rem; }
.tabpane { background:var(--bg2); border:1px solid var(--border); border-top:0; border-radius:0 0 8px 8px; padding:1rem; }
.tabpane.hidden { display:none; }
#graph { height:560px; background:#05070a; border-radius:6px; }
.chips { display:flex; flex-wrap:wrap; gap:.5rem; padding:.8rem 0 0; }
.chip { --chip:#8b949e; display:inline-block; min-width:12px; min-height:12px; padding:.25rem .7rem; border-radius:99px; border:1px solid var(--chip); color:var(--chip); font-size:.72rem; }
.tabpane h2 { color:#aeb9c8; }

.scroll { overflow-x: auto; }
#autoStatus, #bgStatus { font-size: .82rem; color: var(--muted); font-family: Consolas, monospace; }

/* Perfil */
.perfil-head { display:flex; align-items:baseline; gap:1rem; flex-wrap:wrap; }
.perfil-head h1 { font-family: Consolas, monospace; }
.meta .tag { display:inline-block; padding:.3rem .8rem; border-radius:99px; background:#1a2230; border:1px solid var(--border); font-size:.78rem; margin-right:.4rem; font-family:Consolas,monospace; }
.tag.warn { background:#332701; color:#ffda6a; border-color:#664d03; }
.tag.total { background:#0d3325; color:#4ade80; border-color:#14532d; font-weight:600; }
.timeline { display:flex; align-items:flex-end; gap:3px; height:140px; padding:.8rem; background:var(--panel); border:1px solid var(--border); border-radius:8px; overflow-x:auto; }
.timeline .bar { display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; min-width:26px; }
.timeline .fill { width:100%; background:var(--blue); border-radius:2px 2px 0 0; }
.timeline span { font-size:.6rem; color:var(--muted); transform:rotate(-45deg); margin-top:.3rem; white-space:nowrap; }
.pessoa-card { display:flex; justify-content:space-between; align-items:center; background:var(--panel); border:1px solid var(--border); border-radius:8px; padding:.7rem 1rem; margin:.5rem 0; }
.pessoa-card a { color:#6ea8fe; font-weight:600; }
.dup { background:#3d1518; color:#f87171; font-size:.7rem; padding:.1rem .4rem; border-radius:99px; }
details.raw { background:var(--panel); border:1px solid var(--border); border-radius:6px; margin:.4rem 0; }
details.raw summary { padding:.5rem .8rem; cursor:pointer; font-size:.85rem; }
details.raw table { font-size:.78rem; }
details.raw th { width:220px; text-align:left; }
