/* ===== HEADER ===== */
#header {
    display: flex; align-items: center; gap: 16px;
    padding: 10px 16px; background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
}
#header h1 { font-size: 18px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
#search-filters { display: flex; gap: 10px; font-size: 12px; color: var(--text-secondary); }
#search-filters label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
#search-box { position: relative; display: flex; align-items: center; gap: 6px; flex: 1; max-width: 480px; }
#search-box input {
    flex: 1; padding: 7px 12px; border: 1px solid var(--border);
    border-radius: 6px; background: var(--bg); color: var(--text-primary);
    font-size: 13px; outline: none;
}
#search-box input:focus { border-color: var(--accent); }
#search-box button {
    padding: 7px 16px; border: none; border-radius: 6px;
    background: var(--accent); color: #fff; font-size: 13px; cursor: pointer;
}
#search-box button:hover { background: var(--accent-hover); }
#search-box button.btn-secundario {
    background: transparent; color: var(--accent);
    border: 1px solid var(--accent);
}
#search-box button.btn-secundario:hover {
    background: var(--accent); color: #fff;
}
#cpf-info { cursor: help; color: var(--text-muted); font-size: 14px; }
#cpf-tooltip {
    display: none; position: absolute; top: 100%; left: 0; z-index: 50;
    background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: 8px; padding: 12px; font-size: 12px; line-height: 1.5;
    color: var(--text-secondary); box-shadow: var(--shadow); width: 300px;
}
#cpf-info:hover + #cpf-tooltip { display: block; }
#search-results {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 40;
    background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: 8px; box-shadow: var(--shadow); display: none;
    max-height: 320px; overflow-y: auto;
}
#search-results div { padding: 8px 12px; cursor: pointer; font-size: 13px; }
#search-results div:hover { background: var(--bg-hover); }
#search-results .search-result-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: default; }
#search-results .search-result-row:hover { background: var(--bg-hover); }
#search-results .result-label { flex: 1; cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#search-results .result-actions { display: flex; gap: 4px; flex-shrink: 0; }
#search-results .result-btn { border: 1px solid var(--border); background: var(--bg-panel); border-radius: 4px; cursor: pointer; font-size: 12px; padding: 2px 6px; line-height: 1.4; }
#search-results .result-btn:hover { border-color: var(--accent); }
#source-info { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
#layout-select {
    padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg-panel); color: var(--text-secondary);
    font-size: 12px; outline: none; cursor: pointer;
}
#layout-select:hover { border-color: var(--accent); }
/* ===== MAIN / GRAFO ===== */
#main-container { position: relative; flex: 1; height: calc(100vh - 120px); }
#cy { width: 100%; height: 100%; }
#loading {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: var(--bg-panel); padding: 12px 24px; border-radius: 8px;
    border: 1px solid var(--border); font-size: 14px; color: var(--text-secondary);
    box-shadow: var(--shadow); display: none; z-index: 10;
}
#mobile-hint {
    position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.7); color: #fff; padding: 8px 14px;
    border-radius: 20px; font-size: 12px; display: none; z-index: 10;
}
#toast {
    position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%);
    background: var(--bg-panel); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 8px; padding: 10px 20px;
    font-size: 13px; box-shadow: var(--shadow); display: none; z-index: 3000;
}
/* ===== FOOTER ===== */
#footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 16px; background: var(--bg-panel); border-top: 1px solid var(--border);
    font-size: 11px; color: var(--text-muted);
}
#footer-brand { display: flex; align-items: center; gap: 8px; }
#footer-brand img { height: 16px; width: auto; opacity: 0.7; }
#footer-brand span { font-size: 9px; color: var(--text-muted); }
/* ===== BRAND HEADER ===== */
#brand { display: flex; align-items: center; gap: 6px; margin-left: auto; opacity: var(--logo-opacity); transition: opacity 0.3s; }
#brand:hover { opacity: 1; }
#brand img { height: 22px; width: auto; }
#brand .brand-label { font-size: 10px; color: var(--text-muted); font-weight: 400; letter-spacing: 0.3px; }
#theme-toggle {
    background: none; border: 1px solid var(--border); border-radius: 6px;
    cursor: pointer; font-size: 14px; padding: 3px 7px; color: var(--text-secondary);
    transition: all 0.3s; display: flex; align-items: center; line-height: 1;
}
#theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
/* ===== RESPONSIVO ===== */
@media (max-width: 600px) {
    #header { flex-wrap: wrap; gap: 8px; }
    #search-filters { order: 3; width: 100%; }
    #search-box { max-width: 100%; order: 2; }
    #source-info { display: none; }
    #ficha-panel { width: 100%; }
    #brand .brand-label { display: none; }
    #brand img { height: 18px; }
    #theme-toggle { font-size: 12px; padding: 2px 5px; }
}